【问题标题】:bot framework default dialog is not triggering outbot 框架默认对话框未触发
【发布时间】:2018-07-18 10:36:54
【问题描述】:

我正在使用 node.js 创建一个带有 Microsoft bot 框架的多对话框聊天机器人 bot 正在连接用于 NLP 的 LUIS。当意图匹配时,对话框触发没有任何问题。但是当涉及到一个不匹配的对话框时,我想触发这个Sorry, I don't know. :( this is the default dialog 消息。我的代码如下,对于没有匹配的意图,它没有按预期工作。

我注意到,每次我输入一个与任何意图都不匹配的词组时,它都会触发先前匹配的意图对话。

我不知道这段代码有什么问题。 我遵循了以下解决方案,但没有一个对我有用

solution 01

solution 02

solution 03

const bot = new builder.UniversalBot(new builder.ChatConnector({
        appId: process.env.MicrosoftAppId,
        appPassword: process.env.MicrosoftAppPassword
    }));

 bot.dialog(vacanciesDialog1.id, vacanciesDialog1.waterfall).triggerAction({ matches: vacanciesDialog1.name });
    bot.dialog(gratuityDialog.id, gratuityDialog.waterfall).triggerAction({ matches: gratuityDialog.name });
    bot.dialog(slipsDialog.id, slipsDialog.waterfall).triggerAction({ matches: slipsDialog.name });

如果任何对话框不匹配,则默认对话框如下

bot.dialog('/', [
        (session, args, next) => {
            session.send(`Sorry, I don't know. :( this is the default dialog`);
        }
    ])

【问题讨论】:

标签: node.js botframework chatbot azure-language-understanding


【解决方案1】:

你可能需要训练你的 None 意图。

我创建了一个简单的 LUIS 应用,试图重现您的问题。当我第一次部署我的机器人时,我的大部分意图都是“取消”,而不是“无”。在我添加了一些“无”语句后,这个问题就解决了。

请看this related StackOverflow question

[编辑] 我想进一步详细说明。通过像这样格式化我的代码,我得到了 None 的工作意图:

bot.dialog('/', function (session, args) {
    session.send(`Sorry, I don't know. :( this is the default dialog.`, session.message.text);
}).triggerAction({
    matches: 'None'
});

然后,一旦我在 LUIS 上添加了一些“无”话语,我又进行了一次发布以确保更改通过。希望这会有所帮助。

【讨论】:

猜你喜欢
  • 2018-08-08
  • 1970-01-01
  • 2016-10-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多