Building A QnA Maker Bot

What is Bot?

 
Bot is the renamed version of an earlier concept called Remote Procedure Call. In those days, for an interaction between a server and a client, we needed human interference. Since we are evolving with digital, we adapt to the same technique with an enhanced feature. We can simply term it as an updated version of RPC.
 
Bot is nothing but an autonomous program which is used to interact with the humans or machines in a predictable way.
 

Type of Bot

  1. Language – Applies the Machine Learning techniques for conversation.
  2. QnA Maker - FAQ
  3. Speech – Converts the voice to text, like Alexa devices.
  4. Search – Search Engine
  5. Vision – Analysis and identification of the data present in the multimedia files.

Life Cycle

 
 
Building A QnA Maker Bot
  • Design - We must design the bot which provides great usability experience. This is our primary focus.
  • Develop - We can develop a bot using the C# /Node /Cognitive Services
  • Test - The developed bot must be tested to ensure that it meets the requirement. In order to facilitate this, we can test the bot in Bot Emulator.
  • Publish - The developed application needs to be shipped to the target platform.
  • Connect - Integrate the bot with the various application.
  • Evaluate - Evaluating bot services data.
In this article, we are going to see how a QnA Bot can be created and how it can be connected to some other application.
 
Step 1
 
Create a QnA Maker Service.
 
Link: https://www.qnamaker.ai/
 
Building A QnA Maker Bot 
 
Click on "Create a QnA Service". It will launch the Azure portal.
 
Enter the Name & Subscription and relevant details. The important thing to note here is the pricing tier. It should be F0 (which is free).
 
Building A QnA Maker Bot
 
Building A QnA Maker Bot 
 
For demo purposes, we won’t be dealing with the insights. So, I have disabled the App Insights option. Once all the details have been filled, click on "Create". After the Azure deployment operation, the selected resource will be created.
 
Step 2
 
Building A QnA Maker Bot
 
Building A QnA Maker Bot
 
Step 3
 
Enter the name of your knowledge base.
 
Building A QnA Maker Bot
 
Building A QnA Maker Bot
 
Multi-turn extraction
 
The term defines that in some cases, the response can be defined in a single shot. It would require some follow-up questions and provide the final answer.
 
Step 4 - Create the KB
 
Building A QnA Maker Bot
 
Once we have created the KB, we have to provide the list of QnA Pairs for the KB.
 
Building A QnA Maker Bot
 
Publish the FAQ KBA which we created earlier.
 
Building A QnA Maker Bot
 
Step 5 - Integrate QnA With Bot
 
Login to Azure Portal, create a resource, and in the market place, search for Web App Bot.
 
Building A QnA Maker Bot
 
Provide the details for the bot - enter the subscription, Resource Group, and other details. Click on "Create".
 
Building A QnA Maker Bot
 
Building A QnA Maker Bot
 

QnA Auth Key

 
QnA Maker Service deals with two kinds of keys - subscription keys and endpoint keys.
 
Subscription Keys
 
Used to access the QnA Maker management service APIs. It helps us to perform edit operation of the knowledge base.
 
Endpoint Keys
 
Used to access the knowledge base endpoint to get a response for a user query.
 

How to Get the QnA Auth Key?

 
Link
 
https://www.qnamaker.ai/UserSettings
 
In the QnA Maker Portal, go to User Account - Service Settings.
 
Building A QnA Maker Bot
 
Bot Template Selection
 
Here, we want to develop a FAQ bot, so we must select "Question and Answer" as a template and click on "Create".
 
Building A QnA Maker Bot
 
App ID Creation
 
Before we create a bot, finally, we need to create an App ID and Password if the auto-creation of app id and password doesn’t work. Just click on "Create App ID" in the App Registration Portal. It will launch the application registration pool. Generate the App ID & Password for your application.
 
Building A QnA Maker Bot
 
Step 6
 
While testing the bot, once the bot is created under the resource group, you can see many entries.
 
Building A QnA Maker Bot
 
Click on the SaiFAQ Web App Bot. It will navigate to another window. Select the "Test your bot in online web chat" option.
 
Building A QnA Maker Bot
 

Integrate with SharePoint

 
Using the "Connect" option, select the bot to channel (SharePoint).
 
Building A QnA Maker Bot
 
Building A QnA Maker Bot
 
Connect to your SharePoint site by embedding the code to the iframe and publish the page.
 
Building A QnA Maker Bot
 
Building A QnA Maker Bot
 
In this article, we have had the basic idea of FAQ bot and bot principles and concepts. In the upcoming article, we will discuss LUIS and Cognitive Services.


Similar Articles