Creating a NSW COVID rules chatbot
Chatbots are becoming increasingly common (or even the norm) across many industry verticals. Imagine having an on-demand communication channel that is capable of servicing your customers 24/7. The ability to delegate away repetitive low value tasks like communicating store locations and hours or checking on the status of an order allows organisations to alleviate pressure from frontline staff and enables them to be refocused to higher value activities like problem solving and business process improvement. In fact, Chatbots are so popular that over 67% of global consumers have had an interaction with a chatbot within the last 12 months and over 80% of organisations have signalled plans to implement some sort of chatbot functionality by 2022
Despite the tremendous value proposition chatbots can bring to external customers, the use of chatbots can also act as an enabler and help shape the workplace for employees as part of a modern workplace. How many times have you had to contact your IT Service Desk for even the most basic of problems only to get the usual 'have you plugged it in' response? Have you spent countless hours trying to locate the latest version of a specific document or FAQ? How cool would it be if you could just ask a chatbot to find you the document or better yet, ask it specific questions about the contents of the document and have it provide the answers for you. Well, with QnA Maker, that dream is a reality.
QnA Maker is a cloud based service within Azure that allows you create a conversational question and answer layer over semi structured data like documents or webpages. Put simply, it allows you to create a knowledge base and then use natural language to ask questions and find answers from your data without having to find and read it yourself.
One of the greatest frustrations I have heard with chatbots is the inability for chatbots to learn and improve from it's previous interactions in the past. The great thing about QnA Maker is that this is no longer the case. With active learning, QnA Maker will continually learn and suggest new question variations based on implicit and explicit feedback which will result in a more accurate and engaging user experience.
Another frustration I hear is that interactions with chatbots are usually cold and unengaging. I guess this is to be expected because at the end of the day, it is a computer program. With that said, QnA maker has a chat-chat feature that allows you to align your chatbot with one of several personalities including professional, witty, friendly, caring and enthusiastic. So if you are ever working from home and feeling a bit lonely, you can now also turn to your chatbot for a bit of a conversation to brighten your mood.
So if you are like me in New South Wales, Australia and about to come out of lockdown, trying to find answers to what you can or can't do is quite challenging and at times, confusing. Looking at the NSW Government website here, there are pages and pages of information with rules for small businesses, workers, travel and transport. Wouldn't it be great if I could build a chatbot to ask it a simple question like whether or not I can take my dog to a vet and have it return the answer for me.
Let's look at how this can be done in 4 steps:
Before we begin though, let's see the finished product.
Create a QnA Maker Service in Azure
The first step is to provision a QnA Maker service in Azure. Log into your Azure Portal https://portal.azure.com and do a search for QnA Maker.
Once you are in the QnA Maker blade, click on Create + to being provisioning your service.
There are a few details required here:
Once you are ready, click Create.
Once your service is created, we are ready to create our knowledge base.
Create a knowledge base in QnA Maker portal
So once our QnA Maker service has been provisioned, let's create our first knowledge base. To do this, we need to go to https://www.qnamaker.ai/ which is a no code visual designer for building, training and publishing your chatbot. Click on Create a knowledge base to get started.
Next, you will be asked a series of questions.
In Step 1, you can create a QnA Service if you haven't already. We can skip this step as we have already provisioned our service in Azure but if you haven't, you can specify whether you want to use the Stable or Preview features. At the time of writing, Preview contains the Custom Answer functionality which is used to extract answers from a passage of text.
In Step 2, specify your Azure tenant, subscription and the service we provisioned earlier. You can also choose a language. QnA Maker currently supports over 50 languages
In Step 3, give your knowledge base a name
In Step 4, we will provide the locations or source of our data. QnA maker supports a variety of sources from HTML, PDF, Word, Excel and Text. You can read up more on supported data sources here.
Here I am going to specify two URLs which points to specific FAQ pages from the NSW Health and NSW state government websites. I've also enabled multi-turn extraction which allows your chatbots to use follow up prompts and ask the user for additional information to provide an answer. Remember how I mentioned you could give your chatbot a personality? Well, you can do that here too so let's go with caring.
The last step is to Create your KB which can take a couple of minutes depending on the data sources you have selected
Train, test and publish your bot
So once our knowledge base has been created, we get to the fun part of seeing how our bot behaves. We start on the knowledge base screen where we see our question answer pairs. This is pretty much the relationship between the questions someone can ask and the answers the chatbot will provide. At the top of our list, we can see some default question answer pairs which may change depending on your personality type.
If we do a search for specific keywords, we can also see the question answer pairs related to our data sources.
From here, you can add any new question value pairs manually or edit an existing one. Once you are happy, click on Save and train which will save your changes and train the model for your chatbot.
To test it out, click on Test which will open up a chat window. This is a pretty useful tool as this means you can continually tweak and test the behaviour of your chatbot before publishing it into production.
So, let's test it out. First, we will ask it some general conversational questions
领英推荐
Let's now ask it some specific questions from the knowledge base.
And another one.
There's obviously room for improvement by adding additional data sources to our knowledge base but glad to see the caring side of our chatbot.
Once you are happy with your chatbot, click on Publish which will make the endpoint available to use in your app.
Deploying your bot to a Teams channel
The first step is to create an App Service in Azure. This is pretty much the web application that will host your bot. I will choose the standard options here and will provision it in the same App Service Plan as my QnA Maker runtime.
Once deployed, click on Channels which is a connection between your application and the bot.
By default, we get a web application which we can open in any browser.
To deploy it to Teams, click on the Teams icon to create a channel to MS Teams. Follow the prompt and click Save.
Once it is saved, you can either create a Team package or deploy it into your tenants app catalog. Once it is deployed, users within your organisation will be able to access the chatbot.
And that's it. We have been able to create a chatbot in less than 10 minutes without writing a single line of code. Using QnA Maker, we are able to extract insights from semi structured data and surface that up to our end users. We can also give our chatbots a personality to make the experience a little more fun.