gpt4 book ai didi

node.js - 机器人无法识别 LUIS 意图

转载 作者:太空宇宙 更新时间:2023-11-04 00:12:38 27 4
gpt4 key购买 nike

编辑

很抱歉大家,这只是由于意图名称后面缺少逗号。非常抱歉x:

<小时/>

我最近使用 Microsoft Bot Framework (botbuilder v3.14.0)、Node.js (v8.9.4) 和 LUIS 创建一个聊天机器人。

我能够成功“识别”机器人中的某些意图,并返回所需的结果,但对于某些意图,机器人似乎无法识别意图,即使 LUIS 的结果是指向正确的方向。

我尝试使用 LUIS 测试 Blade 进行测试,并在 Chrome 中直接在端点 URL 之后输入查询。两种方法都会返回相同且正确的意图。端点 URL 方法的示例结果如下:

{
"query": "why do you exist",
"topScoringIntent": {
"intent": "bot-existence",
"score": 0.597947
},
"intents": [
{
"intent": "bot-existence",
"score": 0.597947
},
{
"intent": "bot-joke",
"score": 0.04189388
},
{
"intent": "Exit",
"score": 0.0182088781
},
{
"intent": "None",
"score": 0.0164906159
},
{
"intent": "Cancel",
"score": 0.009767669
},
{
"intent": "Stop",
"score": 0.009608646
},
{
"intent": "bot-age",
"score": 0.009238302
},
{
"intent": "Greeting",
"score": 0.008374314
},
{
"intent": "bot-name",
"score": 0.00683666952
},
{
"intent": "Help",
"score": 0.00357789616
},
{
"intent": "StartOver",
"score": 0.00262053218
},
{
"intent": "checkDBStatus",
"score": 0.002412489
},
{
"intent": "refreshSchema",
"score": 1.35339326E-06
},
{
"intent": "checkDutyPerson",
"score": 5.41015623E-08
}
],
"entities": []
}

在这种情况下,机器人应该能够识别出bot-existence意图并执行以下代码:

intents.matches('bot-existence' [
function (session) {
console.log('bot-existence Intent');

session.beginDialog('bot-existDialog');
}
]);

但事实并非如此。不过,它适用于其他意图,例如 bot-agebot-jokecheckDBStatus。这些意图的代码与上面的 bot-existence 代码相同,只是进行了编辑以适本地适应意图。我还多次发布了 LUIS 应用程序,以防万一,但无济于事。

知道为什么吗?

最佳答案

很抱歉,大家,我所缺少的只是代码中的一个逗号,位于意图名称(“bot-existence”)旁边。编辑后的代码段如下!

intents.matches('bot-existence', [
function (session) {
console.log('bot-existence Intent');

session.beginDialog('bot-existDialog');
}
]);

关于node.js - 机器人无法识别 LUIS 意图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48799301/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com