I was intrigued by one of the new Ux paradigms talked about in Build 2017. Microsoft is providing several technologies to build a bot.
Bots can communicate with a user in a variety of ways including text, card, and speech. Microsoft Bot framework lets you build the bots using C# and Node.js. Azure Bot Services can host the bots and scale them up as necessary. Bot connectors can let a bot connect with a variety of channels including Skype, Slack, Facebook messenger, Cortana and much more. Effectively user can chat with your bot using those tools. A bot can also be connected to Cognitive Services to make it smarter.
One of the common use cases for Bot would be to answer FAQs. If you have a compilation of FAQ and answers, Microsoft provides AI service to extract Q and A from your document(s) and/or URL(s). It creates a knowledge base from the information and builds a REST API endpoint for you. A subject matter expert (SME) is able to further train this knowledge base and customize it with no programming knowledge. This infrastructure lets SME and developer work independently.
A developer can create Bot/API that will be able to communicate with the REST endpoint created for the knowledge base. If you want to skip writing the code, Azure Bot Service will automatically generate and host code to communicate with this endpoint. Once a bot is created by Azure Bot Service, it is automatically registered with the Skype channel and you have Web Chat control available for consumption. You can connect it to the other channels available in the portal.
Here are the steps to create a Q and A bot in 15 minutes 🙂 based on my experience.
I get several questions about my Secure Storage Xamarin Plugin. So I thought of building a bot to answer those questions. So here is how to build an easy Q and A bot.
- Prepare FAQs
Write an FAQ document or use your FAQ URL. You can also use multiple documents or combination of URLs and documents.
- Go to https://qnamaker.ai
- Sign In and accept the terms
- Click on Create New Service
- Provide a name to the service. This name will be same as the name of your chat bot
- In the URLs section, you can refer to the relevant URLs or your FAQ site.
- You can alternatively/additionally upload an FAQ document file. It intelligently extracts questions and answers from the document and URLs
- This will build your knowledge base. It will have questions answers ready for you (or SME) to review.
- Click Test on the left side and test your bot. You/SME may need to retrain it for additional questions or correction.
- Once you are satisfied with it, publish the bot. This will give you URL endpoint, knowledge base ID and subscription key to create a bot.
- It has effectively built a knowledge base and you can use like REST API with JSON format.
- Go to portal.azure.com
- Click on Add new -> Choose Bot Service (Preview)
- Provide an App name. This will be the name of your service. It will take a few minutes to create the deployment.
- After the service is created, click on the notification. It will take you to Create a Microsoft App ID screen
- Complete the steps in Generate Password section. Eventually, it will give you a password and returns back to the earlier screen.
- After returning, it will ask you to choose a language. C# or Node.js
- In the templates, select Question and Answer template
- When you click Create Bot, It will redirect you to login in the Q and A maker service.
- It will then ask you to create new knowledge base or use an existing one.
- Choose the one you created in the Q and A Maker. It takes a while to provision the bot.
- Once it is ready, you can test it from the Test button.
- Now is the time to integrate with channels. Click on the Channels tab.
- Skype and Web Chat channels are preselected. Bot in the Skype channel is not available publicly. Click on the channel and go through various tabs to configure and publish it. You may need additional information there such as publisher name, email etc.
- You can add your bot to the other channel(s) of your choice. Each channel may need more info pertaining to that channel.
- If you add it to the Bing channel, users will be able to chat with it.
You can ask questions like:
- What is Secure Storage Plugin?
- Is it open source?
FYI, it answers general questions asked by a developer and does not have extensive knowledge base . Hope you enjoy it.