GithubHelp home page GithubHelp logo

imfing / bot-luis-qna Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 1.0 21 KB

:space_invader: An integrated bot template using Microsoft Bot Framework and LUIS and QnA Maker.

C# 97.43% ASP 0.49% HTML 2.08%
bot microsoft natural-language-processing bot-framework

bot-luis-qna's Introduction

Build bot with LUIS and QnA Maker

A template for you to build with both LUIS and QnA Maker.

Sometimes LUIS or QnA Maker is not enough for you handle all the type of messages. Now you can call QnA Maker after LUIS fail to respond.

What's more, you can add question-answer pairs to QnA Maker database through chatting. You don't have to add, retrain and publish manually.

LuisDialog.cs

This contains the LUIS dialog.

QnADialog.cs

This contains the QnADialog class. Examples:

Query QnA when LUIS found no matching intent

string message = $"Sorry, I do not know'{result.Query}'";

// No intent found, then try asking QnA Knowlegebase

Dialogs.QnADialog qna = new Dialogs.QnADialog();
if (!qna.TryQuery(result.Query, out message))
    message = $"Sorry, I do not know'{result.Query}'";
await context.PostAsync(message);

Add QA pairs and publish it with your code.

Dialogs.QnADialog qna = new Dialogs.QnADialog();
await context.PostAsync("Learning...");
qna.AddPairs(question, answer);
qna.Publish();
await context.PostAsync($"Done! Try asking'{question}'");

LogHelper.cs

A log class for you to write logs.

Usage:

static LogHelper loghelper = new LogHelper(AppDomain.CurrentDomain.BaseDirectory + @"/log/Log.txt");


loghelper.log("Your information here");

Your can find your logs at /log/Log.txt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.