Dismiss Notice

Register now to be one of the first members of this SharePoint Community! Click here it just takes seconds!

Dismiss Notice
Welcome Guest from Country Flag

Microsoft QnA Maker–Creating a Bot for answering frequently asked questions

Discussion in 'Official Microsoft News' started by Lee Stott, Mar 28, 2017.

Thread Status:
Not open for further replies.
  1. Lee Stott

    Lee Stott Guest

    Blog Posts:
    Microsoft QnA Maker Overview

    One of the basic requirements in writing your own Bot service is to seed it with questions and answers. In many cases, the questions and answers already exist in content like FAQ URLs/documents, etc.
    Microsoft QnA Maker is a free, easy-to-use, REST API and web-based service that trains AI to respond to user’s questions in a more natural, conversational way. Compatible across development platforms, hosting services, and channels, QnA Maker is the only question and answer service with a graphical user interface—meaning you don’t need to be a developer to train, manage, and use it for a wide range of solutions.
    With optimized machine learning logic and the ability to integrate industry-leading language processing with ease, QnA Maker distills masses of information into distinct, helpful answers.

    The QnA Maker cognitive service has fast become the backbone for many customer service bot scenarios. Once you have created your QnA service and published it, it’s time to incorporate it into your bot framework bot. To date, there are a couple of ways to implement it from C#.

    Watch the following short intro to developing using the QnAMaker

    Getting Started Option 1 – use the Microsoft.Bot.Builder.CognitiveServices nuget package

    You’ll then need to create a class that uses the QnAMakerDialog eg:

    public class FAQDialog : QnAMakerDialog
    public FAQDialog() : base(new QnAMakerService
    (new QnAMakerAttribute(ConfigurationManager.AppSettings["QnASubscriptionKey"],
    "Sorry I don't understand, please rephrase your question.",
    { }


    Then ensure you’ve set the following keys within your web.config:

    <add key="QnASubscriptionKey" value="QnASubscriptionKey" />
    <add key="QnAKnowledgebaseId" value="QnAKnowledgebaseId" />

    Full sample here: https://github.com/Microsoft/BotBuilder-CognitiveServices/tree/master/CSharp/Samples/QnAMaker

    Option 2 – use the QnAMakerDialog nuget package by Gary Pretty (MVP)


    This has a couple of nice features, such as being able to attribute methods with the QnA confidence score and being able to add attachments to responses. More of which can be discovered here:

    [QnAMakerService("QnASubscriptionKey", "QnAKnowledgebaseId")]
    public class FAQDialogGP: QnAMakerDialog<object>
    public override async Task NoMatchHandler(IDialogContext context, string originalQueryText)
    await context.PostAsync($"Sorry, I couldn't find an answer for '{originalQueryText}'.");

    Full sample here: https://github.com/garypretty/botframework/tree/master/QnAMakerDialog/QnAMakerDialog.Sample

    Interested in learning more about Microsoft Bot Framework

    see http://dev.botframework.com

    Learn More

    Hands on Labs for Building a Microsoft Bot https://github.com/MSFTImagine/comp...kshop/15. Bots/Microsoft Bot Framework HOL.md

    Continue reading...
Thread Status:
Not open for further replies.

Share This Page

LiveZilla Live Chat Software