Introduction

Recently I have attended Azure Tech Day event in Mumbai, where in Cortana session I came to know about QnA maker provided by Microsoft Bot Framework using Microsoft Cognitive Services. Playing with it for few hours, really found it fantastic to work with.

In this tutorial, will work with Botframework’s QnA maker to create our own QnA Bot.

Pre-requisite

Create your first QnA bot

Go to https://qnamaker.ai/ OR qnamaker.botframework.com; both lead to the same web portal.

Click on ‘Create new service’.


If you are not logged in, it will ask to log in with Microsoft Live account.

After successful login, QnA Maker will require some basic permissions to get started. Read those permission details carefully and click on Yes to proceed.


Now, QnA Maker will ask to agree with Microsoft Cognitive Terms and privacy statement, as QnA maker is provided under Cognitive Services terms. Check the ‘I agree.’ checkbox and hit on continue to proceed with.


Now, you will landed over to main page where in you can start with creating your own QnA Bot.


Let’s name the service

The first item is naming your service (mandatory). This name will appear as Bot response.


Feeding data

For feeding the data to QnA bot, there are three methods or ways available. We can use any one method or combinations of all three methods as per the requirement.

Testing the service

Once done with adding question set with any available method or combination of the same, lets test it how it will respond to given questions.

Go to tab ‘Test’

It provides a cool chat interface, where in you can enter the questions as request and it responds with desired seeded response.

At Left block it will list you all possible response, with highest score on top followed by lowest possible response. You can reorder or select the required response from this block and hit on ‘Save and Train ‘button to train the Bot.

At Right block it will allow us to add additional phrase or question set for the same response. Once added hit on ‘Save and Train ‘button to train the Bot.

This all changes will be reflected at Knowledgebase tab.


Now, let’s ask the first question from the doc uploaded. Refer to the above posted image with sample doc format for entered question and answer.

As seen, we have asked the question and got the exact response as seeded to Bot, outlined with blue. Also, as mentioned earlier, notice the area outlined with Yellow, where all the responses are listed with highest score at top.

And, the area outlined with green is where we can add additional phrase or question for the same response. Here, I have added as ” Why Modi did this to us? “


Once done with adding phrase, click on ‘Save and train’ button to get it seeded.

Now, go to "Knowledge base" tab. Here, you can see the added question with same response.


Will test the same. Going to tab, Test, and entering the newly added phrase.


Cool! Isn’t it.

Now, once done with adding and modifying the knowledgebase, let's publish the same. Click on ‘Publish’ at top. This will lead to a summarize page where it will list total number of QnA added.

Again, click on ‘Publish‘.


Success message with deployment will be displayed along with sample HTTP request URL, which you can use in your Bot application to communicate.

At any given time, you can edit service by clicking ‘Edit Service ‘. These details along with deployment details will be available at ‘Setting’ tab.


You can also view the list of all services created at ‘My Service’ tab. Wherein you can edit, delete or view the sample HTTP request code for the service along with last modified and published details.


Summary

Microsoft Bot Framework has provided this super intelligent QnA Maker to make developers' life easier, for building such intelligent Bot with few clicks. Do read the Documentation for learning how to build your Bot using the above service.

Will deep dive more in Microsoft Bot Framework and Cognitive services in coming articles. Would encourage to try it out once. You can have your own FAQ bot up and live in just a few minutes.

Hope, you found this useful.

Happy Azure Coding!