问题
I have a bot that leverages LUIS and makes use of trigger actions. All intents work fine, but I am no longer able to get any results when the "None" intent is hit.
I understand from researching online that I might have to add an onDefault action instead, but I am unable to find any good documentation demonstrating this. Does anyone know how to make this work with triggerAction()?
The current code looks like this:
bot.dialog('None', [
function (session, results, args, next) {
session.send("NONE INTENT TRIGGERED", session);
};
]).triggerAction({
matches: 'None'
});
Would much appreciate any pointers in the right direction.
回答1:
NOTE: When using an IntentDialog, you should avoid adding a matches() handler for LUIS’s “None” intent. Add a onDefault() handler instead (or a default dialog when using global recognizers). The reason for this is that a LUIS model will often return a very high score for the None intent if it doesn’t understand the users utterance. In the scenario where you’ve configured the IntentDialog with multiple recognizers that could cause the None intent to win out over a non-None intent from a different model that had a slightly lower score. Because of this the LuisRecognizer class suppresses the None intent all together. If you explicitly register a handler for “None” it will never be matched. The onDefault() handler (or the bot's default dialog) however can achieve the same effect because it essentially gets triggered when all of the models reported a top intent of “None”.
source: https://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/intelligence-LUIS
回答2:
The dialog
has a method onDefault
which handles None
. Like:
dialog.onDefault (function (session) {
session.send ('I did not understand your request!');
});
来源:https://stackoverflow.com/questions/43749505/unable-to-match-none-intent-with-triggeractions