LUIS Bot 无法在用户话语中找到实体

LUIS Bot not able to find entity in the user utterance

我正在使用 EntityRecognizer 查找用户话语中出现的 entities。我正在遵循官方 NotesApp 示例,您可以找到 here。 当我在 LUIS 意图中发送一个话语时,我在控制台中得到 null 值。例如:create a note of name Note.Title 其中 Note.titleEntity(笔记的标题)。

我不确定这里的问题是什么,因为它在匹配的话语上调用 dialog 但找不到 EntitiesEntity.

下面的代码应该在控制台中打印标题。

    .matches('Note.Create', [(session, args, next) => {

        //Resolve and store any Note.Title entity passed from LUIS.
        var intent = args.intent;
        var title = builder.EntityRecognizer.findEntity(intent.entities, 'Note.Title');
        console.log("Title---"+title);

        //extra code ahead...
     }])

首先,正如 Ezequiel Jadib 在评论中提到的,请检查您是否 train your LUIS app 并发布它。

其次,如果您的 LUIS 应用仍然无法正确识别实体(或意图),您可以标记更多话语或use Phrase lists feature以提高 LUIS 应用的性能。

此外,LUIS不可能在所有场景下都是100%智能的,对于一些特定的场景,我们可以在代码逻辑中进行处理,在“Handle the Note.Create intent” section下的代码片段中可以看到,它会提示如果它没有检测到从 LUIS 传递的任何 Note.Title 实体,这为我们提供了另一种在 LUIS 应用程序无法识别或检测到来自用户 [=21] 的 Note.Title 实体时获取笔记标题的方法=].

您在这里遇到的主要问题是您使用的笔记标题未被 LUIS 识别为 Note.Title 实体。要解决此问题,您将必须针对其中一些值训练 LUIS

如下图所示,在添加 Note 域后的普通 LUIS 应用中,您的话语符合当前意图,但标题未被识别

因此转到 Note.Create 意图,添加您的话语并将您的新标题注释标记为 Note.Title 实体。

训练应用程序,瞧!