How to create a chatbot for your classroom

Koen Timmers

Educator - Author - Keynote speaker - Global Teacher Prize 2017 and 2018 finalist

How to create a chatbot for your classroom

A chatbot is a computer program or an artificial intelligence which conducts a conversation via auditory or textual methods. Such programs are often designed to convincingly simulate how a human would behave as a conversational partner. But how about using a chatbot for educational purposes? I decided to set up a chatbot and use a bot in my own classroom. This way my students can ask standard questions so there is more time for the teacher to guide students having issues on their computer. The chatbot is also available 24/7. Questions not answered by the bot can be answered at another moment by email or face to face. 

In this tutorial I'd like to explain how I was able to create a chat bot. 

There are many services offering chatbots and most of them aren't cheap at all. I decided to use Azure which implies your school needs to be in a Microsoft environment. 

Navigate to http://qnamaker.ai. Hit "Create a knowledge base".

 

Creating your own chatbot

Click on Create a QnA service. You will be referred to https://portal.azure.com/#create/Microsoft.CognitiveServicesQnAMaker. Possibly you will need to activate your service and will be offered a $175USD voucher.

Search for "chat bot" and find the QnQ Maker service.

Create a new resource. Chouse the F0 pricing tier (3 calls per second) and the F pricing tier (3 indexes = free).

This still may cost some money. Make sure you check after one day!

Back in the QnAmaker, you need to select your Directory ID, Azure subscription name and Azure QnA service. 

It may take some minutes before you're able to select your service and you probably need to refresh your webpage. 

Now it becomes interesting! You are able to populate your knowledge base (KB) by adding URLs and files. 

A URL can be a website with a FAQ. A file can be a Word or TXT file having a question and answer. Even one sentence and a new paragraph with the answer will be recognized. Since you choose the F price tier you are only allowed to add 3 resources like for example 2 files and 1 URL. 

For all chitchat questions like Hi, how are you, haha, bye there will be the Chit-Chat for which you can choose tthe Professional, the Friend or the Comic. 

Hit Create your KB. 

 

Notice your menu. EDIT allow you to edit your knowledge base. You can add more questions to Answers and can add new pairs. 

At the bottom you will find the navigation. When you go to the last pages you will find the chitchat.

Hit Test to try out your chatbot. 

By hitting Test a second time it will disappear. 

By hitting Inspect at your bot's answers, you can edit the question and answer. 

Going back to Edit, you can manually add QnA pairs with questions and answers. 

Hit Save and train each time you edited questions or answers. 

Hit Settings when you'd like to add more or alternative knowledge bases (URLs or files). Don't delete the chitchat file or you'd loose the answers to random questions.

All set? Hit Publish!

You'll be offered Postman and Curl code which can be used in apps. You can also integrate your chatbot in Facebook, Messenger, Skype, etc. 

I decided to integrate the chatbot in my website. By using Vue.JS I was able to add my own layout and slightly adjust the chatbot (default answers, direction of the answers, etc). 

Integrating the chatbot in your website

By using HTML, JS and CSS I was able to integrate the chatbot in my website. This would be the final result: 

 

Good luck!

 

by PLN Education