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:

  1. Create a QnA Maker Service in Azure
  2. Create a knowledge base in QnA Maker portal
  3. Train, test and publish your bot
  4. Deploying your bot to a Teams channel

Before we begin though, let's see the finished product.

No alt text provided for this image

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.

No alt text provided for this image

Once you are in the QnA Maker blade, click on Create + to being provisioning your service.

No alt text provided for this image

There are a few details required here:

  1. Subscription and resource group - the account and container you want to provision the resources in
  2. Pricing tier - there are 2 pricing tiers available (Free and Standard) which can affect the throughput and performance of your service. For testing, the Free tier is more than enough but for anything production, I would recommend the Standard tier. Read here for more info.
  3. App Search Details - when you create your Knowledge Base, you will upload documents or specify URLs to index, extract insights and then search. There are 7 pricing tiers available here and each offers differing levels of storage, number of indexes, scale out limits and private endpoints. Again, for testing, the Free tier is more than enough. Read here for more info.
  4. App Service - the compute required to host your QnA service. By default, it will provision a S1 App Service Plan. You can look for this App Service Plan and change plan to Free as this will incur a cost. Read more here.
  5. App Insights - you can also store app telemetry and chat logs in Azure App Insights, Azure's Application Performance Monitoring service. This is very useful for production deployments to gain insights into your user base as well as alerting for any errors. For testing, we will disable this.

Once you are ready, click Create.

No alt text provided for this image

Once your service is created, we are ready to create our knowledge base.

No alt text provided for this image

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.

No alt text provided for this image

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.

No alt text provided for this image

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

No alt text provided for this image

In Step 3, give your knowledge base a name

No alt text provided for this image

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.

No alt text provided for this image

The last step is to Create your KB which can take a couple of minutes depending on the data sources you have selected

No alt text provided for this image

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.

No alt text provided for this image

If we do a search for specific keywords, we can also see the question answer pairs related to our data sources.

No alt text provided for this image

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.

No alt text provided for this image

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.

No alt text provided for this image

So, let's test it out. First, we will ask it some general conversational questions

No alt text provided for this image

Let's now ask it some specific questions from the knowledge base.

No alt text provided for this image

And another one.

No alt text provided for this image

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.

No alt text provided for this image

Once you are happy with your chatbot, click on Publish which will make the endpoint available to use in your app.

No alt text provided for this image

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.

No alt text provided for this image

Once deployed, click on Channels which is a connection between your application and the bot.

No alt text provided for this image

By default, we get a web application which we can open in any browser.

No alt text provided for this image

To deploy it to Teams, click on the Teams icon to create a channel to MS Teams. Follow the prompt and click Save.

No alt text provided for this image

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.

No alt text provided for this image

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.

























要查看或添加评论,请登录

Eric Cheng的更多文章

  • Unleashing the Power of LLM: The Art of Prompt Design and Fine Tuning

    Unleashing the Power of LLM: The Art of Prompt Design and Fine Tuning

    Recently, I came across a requirement whereby I needed to implement Named Entity Recognition (NER) to extract the model…

    1 条评论
  • Building an AI Technical Assistant: Leveraging ChatGPT and Embeddings

    Building an AI Technical Assistant: Leveraging ChatGPT and Embeddings

    Without saying, there has been a great deal of activity and buzz surrounding OpenAI and more specifically ChatGPT. This…

  • The importance of APIM

    The importance of APIM

    Many organisations, regardless of industry and size, will have data spread across a number of disparate systems and…

    2 条评论
  • Cloud Defender for DevOps

    Cloud Defender for DevOps

    Microsoft Defender for Cloud is Microsoft's integrated security solution for cloud security posture management (CSPM)…

  • GitHub Copilot - a pair programming match made in heaven?

    GitHub Copilot - a pair programming match made in heaven?

    If you are in the tech space, you may have read about the splash AI is making when it comes to software development and…

  • Partitioning your Cosmos DB

    Partitioning your Cosmos DB

    One of the exciting announcements from last year's Microsoft Build was that the Cosmos DB serverless tier was becoming…

  • PowerApps Wrap

    PowerApps Wrap

    Unless you have been living under a rock, you would have heard about PowerApps. PowerApps is Microsoft's low code…

    4 条评论
  • Pokémon, Custom connectors and the Power Platform

    Pokémon, Custom connectors and the Power Platform

    I guess it's comes to no surprise that the Power Platform comes loaded with connectors. I'm not even going to list the…

  • Overview of D365 Customer Voice

    Overview of D365 Customer Voice

    If you have been involved in managing customer feedback within the Microsoft ecosystem, chances are you have probably…

  • A glimpse into Azure Digital Twin

    A glimpse into Azure Digital Twin

    So far, I have only been using a single AZ3166 to send telemetry data back to an IoT Central application. In the real…

社区洞察

其他会员也浏览了