Episode 2 : This Week in Cognitive: Build a Bot with QnA Maker

Noelle Russell builds a QnA Maker chatbot in Azure from scratch, importing FAQ content and adding a chitchat personality to customize the bot's tone. She covers training the model, testing answers, and improving matching with alternative utterances.
Chapters
Hello and welcome to another episode of This Week in Cognitive. I'm your host Noelle Russell, and it is my pleasure to bring to you the latest and greatest applications and demos and samples that we are building inside of Cognitive Services. So, I always like to remind you of all the amazing incredible things that you can do with the pre-built models in Cognitive Services and in Applied AI. Everything from vision to language, speech, and actually today we are going to focus on knowledge. So, we're going to go dive into QnA Maker. We recently announced a brand new feature, the ability to add personality to your frequently asked questions chatbot. It's the way to build a chatbot in just a few minutes, but now it even has personality. So, let's jump right in. So, here you can see the QnA Maker page, right? You could just go on out. You do need a subscription, so you'd go into the Azure portal, create a subscription. In order to be able to use this. I am going to just show you kind of the page that you'll start on, then you'll have to sign in. That takes a couple seconds. So I've already signed in just to show you a little bit about how this works. Now again, almost every company has this challenge, right? How do I solve the problem of people in the organization having to answer the exact same question over and over and over again? The people who are answering those questions I don't like answering them. The people who can build something, or as a developer, I'm excited to be able to offer something that someone might value within the company and that would be great for the business. So, here's a really quick and easy opportunity to do that. So, here I've gone into QnA Maker. You'll notice there's a nice menu at the top. You can see existing knowledge bases that you have, but I'm going to actually create one from scratch. So, we'll go in, create a new knowledge base. Right here is where you would go in and create the Azure subscription. QnA service today is about $10 a month, right? So really, and that's in production. There's definitely a free tier so you can get started right away and playing around with this. Now, I'm going to go in and create using my existing account. I'm going to go in and select a subscription account. I went in and created a couple of these, and now I'm going to name, Name my knowledge base. Now, in this case, I could actually go to any FAQ site, but I'm going to choose one, well, that's applicable. In this case, I'm going to choose QnA Maker since we're learning about it. I also found one really interesting design practice is that you could go in and instead of using the word bot in your name, you might want to try the word assist or helper or something different than bot. For whatever, any reason or the most important reason you would want to do that is because you want to show value that this thing is going to help you out, and bot doesn't intuitively say that. So, QnA Maker Assist, assistant, calling your bot James, though awesome, probably doesn't indicate its usefulness. So, definitely go in, choose a name, and choose some describing words in the name of your bot to identify what it's going to do for the user. The next thing I need to do is find out where my content is going to come from. So, I actually went and pulled up the site for QnA Maker. It turns out that QnA Maker has an FAQ, lucky me. I'm going to then copy it and paste it. Now, notice here I can actually add multiple URLs. Let's say I had FAQs across my organization that I wanted to pull into a single bot, Let's say I had other services that provided this content, I could load them all here. I could also load TSV files. I recently worked on a project where a hospital wanted to create an assistant, and they handed me an Excel spreadsheet of every question and every answer that they had collected so far, hundreds and hundreds of them. So, you can also load that content as well. Now, here is the new feature, the chitchat feature. So, now you can add a personality. This is extremely unique. It gives you the ability to not just create a bot with language understanding, but now add a whole bunch of personality features that you can customize. The reason this is important is because one of the things that will determine your bot success is how well it communicates to the user. Does it communicate your brand? You're going to have a different personality for your bot if you are a record label versus if you are a legal office, right, versus a doctor's office or a school, right? There are different ways that you'd want to sound to your user. So, in my case, I like the friend because I'm a friendly person. So, I'm going to pick that one. But you can pick any of them to play around with. I honestly would pick all three so you could see the different options. Then I say, "Create your knowledge base." Okay. So, what was happening there is that It went to the site, it pulled out all the questions and answers into a dialogue. This is a tough thing to be able to do, right? Technically, be able to build a language understanding model from a web page. It did that for you in just a couple, maybe a minute, right? It then allows you to go in and edit it. So, one of the common questions I have with developers that are building bots using this technology is, Well, what happens when I ask it a question and it doesn't come back with the answer I thought? Well, the good news is this is a model you can edit. So, let's just take a look. You can actually see right here there's the ability to test it. So, I can click "Test" and it'll allow me to go through and test it. Before I do that though, I'm going to actually save and train the model based on what was built, and then you'll notice this is AI, right? It's a research and experiment project. So, what you're going to do is every time you start to make changes to tune and improve your language model that's supporting this bot, you're going to go in and save and train that model in order to be able to test against it. So, I'm going to go ahead and right now be able to type in, like let's say over here it says, "What is the roadmap?" So, what you'll see here, what happened was, is that I was able to type in, "What's the roadmap?" Notice that's not actually what's in the FAQ. What's in the FAQ is what is the roadmap of the QnA Maker, right? But I don't want to have to type that in, I want to accommodate my users using the language my users would use. So, this allows me to not have to do any of that work. As a developer, all I have to do is point it to an FAQ, right? Pull in the FAQ and then be able to ask it questions. Now, your job is to test, test, test, test. I usually have, right? User experience is a huge part of bot creation. So now, you need to have users who would typically use this bot start using it, collect all the different ways they might say something, and make sure, you'll notice over here, I'm going to go ahead and close this out. Over here, there's a little plus sign. You can add additional utterances that will render the same response. So, this is your ability to fine-tune and create a better model that will accommodate your users and how they talk. Now, let's take a look at the chitchat feature because that's pretty fun. So, if I just say something like, "Hello," you can see if someone says, "Testing, can you hear me?" or "Hiya, good morning," or "Hello Google, Siri, Cortana," no matter what they say, you can see the answer provided here. Now, if you have a personality of your bot, what you're going to want to do is change these answers. If you have a quirky fun bot, maybe you'd make a funny answer. If you have a more cartoon kids bot, maybe you say, "Have a magical day," or something like that. This gives you the ability to change the responses, which then changes the personality and how users interact with your bot. Other ones I think I remember seeing in here was something about ice cream, maybe not. Sneeze, let's try that one. What if somebody asks your bot, "Do you dream? Do you smell? Can you sneeze?" You should have an answer for these things. This is what makes a bot fun and personable, and the reality is when people test out your bot, especially in the beginning, they're going to test it with all sorts of quirky personality type questions. So, be ready for them, and now you can do it with a click of a button to select that radio button when you're building your QnA Maker instance. So, as you can see here, within just a couple of seconds, I'm able to build a bot, point it to an FAQ, create a language model, and even add personality. So thanks for joining us on This Week in Cognitive, and I look forward to seeing you next time.
More from Noelle

Take the Unlocking AI Challenge and Get the Keys to Unlocking Time and Revenue for Your Business

Don't Get Left Behind: The AI Executive Challenge #ai #business #fearofmissingout








