Information and Document Chatbot
Learn more about information and document chatbots.
Join the DZone community and get the full member experience.
Join For FreeA bot is an app or some software that does a task automatically. Users interact in a conversational way using text or speech. It may be a simple question-and-answer bot or a complex bot that allows people to interact with services in an intelligent manner using pattern matching and artificial intelligence techniques.
For developing a bot, we can use Azure Bot Service or the Bot Framework SDK for .NET. Bot Framework SDK is a powerful framework for constructing bots that can handle both free-form interactions and more guided conversations. It is easy to use and leverages C# to provide a familiar way for .NET developers to write bots.
Information and document chatbots could answer different questions defined in QNA maker and provide different types of documents stored in data sources such as azure blob storage required by the user.
For developing an intelligent bot, our first step is to make our bot intelligent enough to understand the user text or speech. For this purpose, Language Understanding (LUIS) is used. LUIS understands the user speech and extracts the intents and entities from it. Intents are how LUIS determines what a user wants to do. Put simply, it finds out the intention of the user.
An entity is used like a variable in algebra; it is used to capture and pass important information.
Results from LUIS and QNA maker comes in the JSON format; we need to extract reliable information from it. For this purpose, we need to write a program in C# code, which extracts that information.
The following is the sample C# code to retrieve intents and entities from JSON.
Note: We need to write C# code according to our JSON format, different JSON formats generate different C# code.
In this bot, we use intents and entities to fetch information and required documents from QNA maker and blob storage (you can use any other data sources such as cosmos DB).
Azure Blob storage is Microsoft's object storage solution for the cloud. Blob storage is used for storing huge amounts of unstructured data. Unstructured data is data that does not adhere to a particular data model or definition, such as text or binary data.
For searching documents, we are using Azure Search (it is a component of the Microsoft Azure Cloud Platform providing indexing and querying capabilities for data uploaded to and download from Microsoft servers). Intents and entities are passed to Azure Search, and it will start searching documents in the provided data sources (in this case Azure blob storage). Azure Search builds a great enterprise search solution that reduces complexity with a fully-managed service and gets up and running quickly.
Note: Azure Search is not used to fetch information from QNA maker; we need to write separate C# code to fetch information from QNA maker.
The following is an example of an information and document chatbot.
As we can see, the user asked for some projects in MVC, so the bot returned some information about MVC architecture style stored in QNA maker and documents from Azure blob storage using Azure Search.
Opinions expressed by DZone contributors are their own.
Comments