问题
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.
回答1:
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.
- Go to your LUIS application, click
Intents
list, clickCalendar.Add
into the edit page. - Type the utterance
add a business meeting schedule in Paris.
in the box, type enter add the utterance into the list. - Click the
business
andmeeting
letters into a big square brackets, selectCalendar.Subject
in dropdown list, the same clickParis
and selectCalendar.Location
. Finishing the actions, it should looks like: - Click
Save
to save the edition. Then Train and publish your LUIS application.
Then your bot should match the utterance.
来源:https://stackoverflow.com/questions/47671071/how-can-i-properly-get-my-luis-chatbot-working