Create BOT from FAQ page with no coding — QnA Maker as new member of Cognitive Services


New comer of Cognitive Services — QnA Maker

Now new service of Microsoft Cognitive Services is available, which named QnA Maker.

We can make Q&A bot service without any coding from Q and A lists or web (such as FAQ pages). It works as web services and accessible thru web APIs, or you can develop your own bot quickly using it as AI engine — no coding either on Azure Bot Service (which works as Azure Functions).

You can even add some varieties to both of Qs and As manually from its GUI interface.

bluesky_20161222_01

* Please be noticed this is available in English so far and other language may not work correctly.

How to develop Q&A bot from your FAQ pages and/or list

Create New Q&A Service

Go to QnA Maker page, and select [Create New Service] from top bar.

Input FAQ website URL. (let’s see if we use Azure support FAQ page.)

You can add some custom list, using *.tsv files (encoded by Unicode, UTF-16) which contains only pairs of Q&A listed delimiting by tabs. Or, just type Q&A pairs at next page.

bluesky_20161222_02

At [Knowledge Base] page, see FAQ page or your list converted as Q&A knowledge base, which you can add and/or customize at this page.  Click [Test] at left bar and go to bot testing page.

bluesky_20161222_03

Test & train your Q&A Bot

At [Test] page, you can directly check how it works. Type question which user suppose to input, and see how your bot answers. It answers and suggests some alternate choices at left panel, you can edit it as a pair to your input. You can edit questions as well as at right panel which to have same answer. Click [Save and retrain] at upper bar, to let Q&A Bot trained.

bluesky_20161222_04

Publish your bot

Once you publish your bot, it works as web service, which accessible via web API binding keys, shown at “knowledgebases” and “Subscription-Key”.

bluesky_20161222_05

How to create Q&A bot on Azure Bot Service

Go to Azure Portal, create new Bot Service from menu. Once Bot Service created, set up Microsoft App ID and password to your bot. (Please see Azure Bot Service tutorial for detail.)

Now Choose “QnA Maker” at [Choose a template] section. Now you can either create new QnA Maker app or use existing one.

bluesky_20161222_06 bluesky_20161222_07

Comments (26)

  1. Sachin Pandey says:

    HI,
    I really want to use the QandA bot, but I want to use it for the enterprise and not publically. Is it possible to deploy the created bot inside the firewall only??
    Thanks,
    Sachin

    1. a y a k o says:

      Sachin, thank you for your comment, and I’m sorry I haven’t noticed for while 🙁
      QnA Maker works on Azure, and strict access is on request as below.
      https://cognitive.uservoice.com/forums/578689-qna-maker/suggestions/18165322-restrict-access-to-authenticated-user

  2. Vishal Goyal says:

    Excellent. I just tried this and works fine.

    1. a y a k o says:

      Vishal, thank you for your comment and using QnA Maker!

  3. simon says:

    hi, thanks for the article. I have create my FAQ bot, and i try to use javascript query the json, but and the sample code, 2 parameters confused me, one is params and the second one is {body}. What is the diff between params and body?

    if i post a message to bot, just like “hi”
    is that {body} will be:
    {“question”: “hi”};
    and what is the params input values?

    var params = {
    // Request parameters
    };

    1. simon says:

      the fully sample code is here

      JSSample

      $(function() {
      var params = {
      // Request parameters
      };

      $.ajax({
      url: “https://westus.api.cognitive.microsoft.com/qnamaker/v2.0/knowledgebases/create?” + $.param(params),
      beforeSend: function(xhrObj){
      // Request headers
      xhrObj.setRequestHeader(“Content-Type”,”application/json”);
      xhrObj.setRequestHeader(“Ocp-Apim-Subscription-Key”,”{subscription key}”);
      },
      type: “POST”,
      // Request body
      data: “{body}”,
      })
      .done(function(data) {
      alert(“success”);
      })
      .fail(function() {
      alert(“error”);
      });
      });

    2. simon says:

      sorry, i post the wrong code, here is the real one

      POST – Generate answer
      var params = {
      // Request parameters
      };

      $.ajax({
      url: “https://westus.api.cognitive.microsoft.com/qnamaker/v2.0/knowledgebases/{knowledgeBaseID}/generateAnswer?” + $.param(params),
      beforeSend: function(xhrObj){
      // Request headers
      xhrObj.setRequestHeader(“Content-Type”,”application/json”);
      xhrObj.setRequestHeader(“Ocp-Apim-Subscription-Key”,”{subscription key}”);
      },
      type: “POST”,
      // Request body
      data: “{body}”,
      })
      .done(function(data) {
      alert(“success”);
      })
      .fail(function() {
      alert(“error”);
      });
      });

    3. a y a k o says:

      Simon, sorry for late reply. I hope your issue cleared…
      Please try StackOverflow, since here is too small spaces for codes.
      https://stackoverflow.com/questions/tagged/microsoft-cognitive

  4. Nikhil Mehta says:

    Currently we are creating a chat bot and we are using both LUIS and QnA in the chat-bot with azure chat-bot framework to respond to user inputted question. is there any way to identify which API to hit (QnA or LUIS) after we get the question on our server? We are currently facing ambiguity in the API as we have two different endpoints one for LUIS and one for QnA.

    1. a y a k o says:

      Nikhil,
      What about using “scores” for reliability check? e.g. call QnA Maker first and LUIS later.

  5. Vineet Jaiswal says:

    Excellent work, you people save a lot of time to learn Machine Learning algorithm and do classification and scoring, I was trying to make same kind of product and fixed my problem, thanks

    1. a y a k o says:

      Thanks Vineet!

  6. Asher Bain says:

    Hi, couple of questions: 1) if I have a huge knowledge base in question and answer format, should I use qnamaker only vs using LUIS and intent/ entity. I am finding Qnamaker to be very easy for mass FAQs for users… 2) if Qnamaker is the way to go, when to use LUIS? 3) can Qnamaker and LUIS integrate? Thanks

    1. a y a k o says:

      Hi Asher,
      1)It depends volume and complications of Qs. It maybe better to use Azure Search.
      2)LUIS is natural language sentence classifier and entity extractor. QnA Maker is rather search engine that define closest Q&A on list.
      3)No function to connect QnA Maker & LUIS direct. But you can integrate LUIS when you build a bot using QnA Maker (at app level).

  7. ceekay says:

    I tried a sample and created a Q&A bot and used that template in Azure. I see the training done as alternative words is not getting in the azure search. I get results in Q&A test page. But the same is missing in Azure Web Bot. Can you guide if i am missing something?

    1. a y a k o says:

      Hi ceekay,
      Please create QnA Maker app first and create Bot Service from Azure Portal, choosing QnA Maker option (you need to use same account for both).

  8. Rick says:

    HI, I have deployed Q and A Maker and think it is great. However, I would like to know how I can format the actual text in the questions and answers. In other words, is there a list of options for applying styles or syntax to the text?
    TIA Rick

    1. a y a k o says:

      Hi Rick,
      You can get sample file from QnA Maker “Create New Service” page, or download from https://qnamaker.ai/Content/examples/ExampleFile.tsv
      Save your Q&A list as tab-separated format option (using Excel or appropriate tool).

      1. Rick says:

        Hi
        When I click on “Download Chat Logs” in the Test window, nothing happens. Does anyone have an idea how to find the chat logs.
        Thanks in advance
        Rick

      2. Rick says:

        Thanks for the response.

  9. For a non-programmer that successfully setup QnAMaker (very nice interface!), would it be easier to use Azure or Bot Framework to connect to Facebook Manager? Thanks!

    1. Doug Henningsen says:

      Best to go with Azure. Skip Bot Framework. Problem solved.

      1. a y a k o says:

        Doug, thank you for update!

    2. a y a k o says:

      Doug, Bot Framework has Facebook Messenger connector.
      Create chatbot base with QnA Maker and deploy Azure Bot Services using it with no coding. You can find connector from Bot Services setting page.

  10. Rick says:

    Hi I have QnA Maker working well, but need to be able to interpret the chat logs, Is there a way to get the user name of anyone in a channel asking a question?
    TIA

    Rick

Skip to main content