无法匹配“无"意图与触发动作 [英] Unable to match "None" intent with triggeractions

查看:65
本文介绍了无法匹配“无"意图与触发动作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个利用LUIS并利用触发操作的机器人.所有的意图都可以正常工作,但是当无"意图被击中时,我再也无法获得任何结果.

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.

我从在线研究中了解到,我可能不得不添加onDefault动作,但是我找不到任何能证明这一点的好的文档.有人知道如何使用triggerAction()来完成这项工作吗?

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()?

当前代码如下:

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.

推荐答案

注意:使用IntentDialog时,应避免为LUIS的"None"意图添加match()处理函数.改为添加onDefault()处理程序(或使用全局识别器时的默认对话框).这样做的原因是,如果LUIS模型不了解用户的话语,则通常会以无"意图返回很高的分数.在为IntentDialog配置了多个识别器的情况下,该识别器可能导致None意图胜过得分略低的其他模型的Non-None意图.因此,LuisRecognizer类一起抑制了None意图.如果您为无"明确注册处理程序,则将永远不会匹配该处理程序.但是,onDefault()处理函数(或bot的默认对话框)可以实现相同的效果,因为当所有模型报告的最高意图为无"时,它实际上会被触发.

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".

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

这篇关于无法匹配“无"意图与触发动作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆