Create AI Chatbot using Microsoft Bot Framework
Gartner Summits projects that more than 85% of customer interactions will be managed without a human by 2020. Chatbots are expected to be the number one consumer application of AI over the next five years according to TechEmergence. There are well-known platforms for building chatbot, such as IBM Watson, Microsoft Bot Framework, LUIS, Wit.ai, Api.ai, Chatfuel, and others.
Microsoft Bot Framework has its own Bot Builder SDK that includes .NET SDK and Node.js SDK. The entire system consists of three parts: Bot Connector, Developer Portal, and Bot Directory. The framework provides the Direct Line REST API, which can be used to host a bot in an application or website. It is open source and available to all on Github, and it supports automatic translation to more than 30 languages.
Microsoft Bot Framework understands users’ intents. It is possible to incorporate LUIS for natural language understanding, Cortana for voice, and the Bing APIs for search.
We are going to use Azure Bot Service which provides an integrated environment that is purpose-built for bot development, enabling us to build, connect, test, deploy, and manage bots, all from one place. It is powered by Microsoft Bot Framework and Azure Functions, which means that bot will run in a server-less environment on Azure that will scale based upon demand.
Following is what we are going to do :
- Create Q&A knowledge base.
- Create Azure service bot.
- Enable Web chat channel on the bot.
- Embed the web chat on the website.
For creating Q&A knowledge base,we are going to use Microsoft QnA Maker ,it s a free, easy-to-use, REST API and web-based service that trains AI to respond to user’s questions in a more natural, conversational way. Compatible across development platforms, hosting services, and channels.
QnA Maker is primarily meant to provide a FAQ data source which can be queried from either Bot/Application. QnA Maker is offered as one of several templates in Azure Bot Service which enables rapid intelligent bot development powered by Microsoft Bot Framework, and run in a server less environment, scales based on demand.Also note currently there is a limit of a 20MB knowledge base.
- Microsoft Account for generating AppID for your bot.
- Microsoft Azure subscription to use Azure Bot service
We will head over to Microsoft QnA Maker to create Q&A knowledge base.
- Once you login,click ‘Create new service’ to create new knowledge base.
- Enter Service Name,URL where Q & A pairs are available.If you don’t have ready made Q&A pairs,there is also option to upload files.Supported formats are .tsv, .pdf, .doc, .docx, .xlsx, each under 2MB.
- For now,I have used one of the sample URL’s https://support.microsoft.com/en-us/help/17133/windows-8-bitlocker-recovery-keys-frequently-asked-questions
- On the Next page, check if the questions,answers are proper.If you want to edit answers / questions,you can do it in this step.
- Click on ‘Test’ section on the left to test/train the Q&A model you’ve created.Check if the service is able to retrieve the correct answer for particular question.If its not able to retrieve,choose the correct answer from the alternatives given.If you want to provide alternative phrasing for the same question,there is an option on the right.Once you’re done with testing,choose ‘Save and retrain’.
- Visit the ‘Settings’ tab to check if all of them are proper.
- Once verified,click on ‘Publish’ button
Now that we have published service,next step is to create bot which we will see in the next post.
If you’ve any questions,please post it in the comments section.
Like this post? Don’t forget to share it!