简体   繁体   中英

How can I properly get my Luis chatbot working?

I have to connect Luis to node.js and create my first chatbot that, as a first stage should handle simple requests.

I have checked the following links : https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-recognize-intent-luis

https://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/intelligence-LUIS

but getting started has proven to be difficult, what I've done as a first stage is:

var restify = require('restify');
var builder = require('botbuilder');
var http = require('http');
var recognizer = require ('recognizer');


// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
   console.log('%s listening to %s', server.name, server.url); 
});

// Create chat connector for communicating with the Bot Framework Service
var connector = new builder.ChatConnector({
    appId: MY_APP_ID,
    appPassword:MY_PASSWORD
});

var bot = new builder.UniversalBot(connector, function (session,args) {
}
});
    var recognizer = new builder.LuisRecognizer(LUIS_ENDPOINT_URL);
    bot.recognizer(recognizer);

and not sure how to move forward from here.

What I have in a Luis intent is: calendar.add what I have as entities is: calendar.location and calendar.subject

what I want the user to say in the bot framework channel emulator:

add a business meeting schedule in Paris.

What the bot should say: Understood the location is Paris and subject is business meeting.

It seems that the utterance add a business meeting schedule in Paris. doesn't match the Calendar.Add intent. So you can try to manually add this utterance in the intent in your LUIS application.

  1. Go to your LUIS application, click Intents list, click Calendar.Add into the edit page.
  2. Type the utterance add a business meeting schedule in Paris. in the box, type enter add the utterance into the list. 在此处输入图片说明
  3. Click the business and meeting letters into a big square brackets, select Calendar.Subject in dropdown list, the same click Paris and select Calendar.Location . Finishing the actions, it should looks like: 在此处输入图片说明
  4. Click Save to save the edition. Then Train and publish your LUIS application.

Then your bot should match the utterance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM