Unable to match “None” intent with triggeractions

你说的曾经没有我的故事 提交于 2019-12-08 12:41:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!