I like big bots and I cannot lie …

… You other users can’t deny
That when a bot loads up with a big knowledgebase
and throw questions in its face
You get answers …

OK, enough of that. I saw a tweet by James Marshall (@jamesbmarshall) which he followed up with a blog post where he spoke about building a bot using in less than an hour with zero code.  His jamesbmarshallbot (a chat bot to handle out of office queries) piqued my interest and I wanted to have a go myself to see if the claims were true.

I used the QNAMaker website which is heavily wizard based and will either take a FAQ from a page, allow you to upload questions and answers in a tab separated text file or you can manually enter the questions and answers on the page.  Following the instructions on James’ blog page I quite quickly was able to create StuartRidoutBot which, similarly to James’ bot, would answer queries if I was out of the office.  You can interact with StuartRidoutBot in the following ways:

Next Steps

I was happy with the bot but not the standard welcome (Welcome You!) or the response if it couldn’t find an answer (the rather abrupt No match found!)

With some help from Gary Pretty’s blog I found that you could change these standard greeting and response.   I had to slightly modify the approach as I had deployed using the Azure Bot Service.

Customising the welcome message

  1. In the Azure Bot Service, go to your bot and ensure you’re in the Develop tab.
  2. Select the run.csx file
  3. Find the code highlighted below and edit the message to suit

Edit the error message

In the Azure Bot Service select the BasicQnAMakerDialog.csx file and find the code highlighted below.

public BasicQnAMakerDialog() : base(new QnAMakerService(new QnAMakerAttribute(Utils.GetAppSetting("QnASubscriptionKey"), Utils.GetAppSetting("QnAKnowledgebaseId"),"Sorry but I can't find an answer.  Could you please rephrase your question?")))

The code highlighted above should be added in (including the comma) as an extra parameter to the QnAMaker definition.

Summary

The Microsoft Bot Framework, QNAMaker service and Azure Bot Service make it really easy to get started.   Hope this helps! Let me know how you get on with your bot.

Other useful resources

James Mann’s YouTube video – Creating an intelligent FAQ bot with QnAMakerDialog

Leave a Reply

Your email address will not be published. Required fields are marked *