![](https://www.azureaction.com/wp-content/uploads/2020/11/chatbot.jpg)
ChatBot on Azure as an Artificial Intelligence (AI) Teacher
ChatBot is an Artificial Intelligence (AI) program that can understand and communicate voice and text like human.
The ChatBot Blog is divided into two parts:
In Part 1 of this blog, we are going to build a ChatBot which can be used as an Artificial Intelligence Teacher.
In Part 2 of this blog, we will explore the common methods to embed the ChatBot into a website and the recommended secured approach.
The main steps involved to create ChatBot are the following:
- Prepare a Question and Answer document
- Create a QnA maker service (Azure cognitive service)
- Create a Knowledge Base (KB)
- Connect QnA maker service to KB
- Populate KB
- Save and Train KB
- Publish KB
- Create a Web App Bot Service
- Test Bot
Prepare a Question and Answer document
The first step is to create a Question and Answer document. It can be a simple document which can follow some structure. For demonstration purpose, a sample set of question and answers regarding Azure services has been prepared in Microsoft Word like the below:
![](https://azureaction.com/wp-content/uploads/2020/12/Picture1-1.png)
Create a QnA maker service
QnA Maker is a cloud-based API service that lets us create a conversational question-and-answer layer over our existing data. We have to use a QnA maker service to build a knowledge base by extracting questions and answers from our semi-structured document.
Create a QnA Maker service as shown below:
![](https://azureaction.com/wp-content/uploads/2020/12/Picture2-1.png)
![](https://azureaction.com/wp-content/uploads/2020/12/Picture3-1.png)
Once the Provisioning is complete, you will see the below resources created in your Azure Resource Group:
![](https://azureaction.com/wp-content/uploads/2020/12/Picture4-1.png)
Create a Knowledge Base
Now its time to create the knowledge base for your Bot.
For that you must go to a website: www.qnamaker.ai and login with your Azure account.
![](https://azureaction.com/wp-content/uploads/2020/12/Picture5-2.png)
Once you login with your account, you should see a similar screen like the below:
![](https://azureaction.com/wp-content/uploads/2020/12/Picture6-1.png)
Here if you notice, Step 1 is already done as you have already completed the creation of the QnA Service.
For Step 2, you must select your Azure AD, Subscription Name, the QnA Service and Language.
![](https://azureaction.com/wp-content/uploads/2020/12/Picture7-1.png)
In Step 3, Give a meaningful name to your KB like the below
![](https://azureaction.com/wp-content/uploads/2020/12/Picture8-1.png)
In Step 4, you have to populate your KB with the Q&A document that you have already created in the beginning. You can also add the frequently asked questions to your KB.
![](https://azureaction.com/wp-content/uploads/2020/12/Picture9-1.png)
In Step 5, Click the Create your KB button
![](https://azureaction.com/wp-content/uploads/2020/12/Picture10-1.png)
![](https://azureaction.com/wp-content/uploads/2020/12/Picture11-1.png)
Save and Train KB
Once the KB is created, you must Save and Train the KB to save your edits and train QnA Maker
![](https://azureaction.com/wp-content/uploads/2020/12/Picture12.png)
You can also Test the knowledge base by performing Test feature which is available on the QnA make portal.
![](https://azureaction.com/wp-content/uploads/2020/12/Picture13-1.png)
Publish KB
Once you are happy with the Training and Testing, you are ready to publish the KB
![](https://azureaction.com/wp-content/uploads/2020/12/Picture14-2.png)
Create a Web App Bot Service
Now you can create the Azure Web App Bot Service like the below:
![](https://azureaction.com/wp-content/uploads/2020/12/Picture15-1.png)
Once the Bot is provisioned, you should see the below resources in your Resource Group
![](https://azureaction.com/wp-content/uploads/2020/12/Picture16-1.png)
Test Bot
Once the Web App Bot is provisioned, you can perform Bot test like the below:
![](https://azureaction.com/wp-content/uploads/2020/12/Picture17-1.png)