LUIS Intent不返回带空格的实体的整个值 [英] LUIS Intent not returning the entire value of the entity with space

查看:84
本文介绍了LUIS Intent不返回带空格的实体的整个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用一个简单的实体创建了这样的LUIS话语: 客户abc的订单处理中

I have created a LUIS Utterance like this with a simple entity included: orders in process for customer abc

其中abc替换为简单实体vf_NARCName

Where abc is replaced with the simple entity vf_NARCName

在bot中,当我输入类似问题时: 客户动物皮肤病医院的订单正在处理

In the bot when I type the question like: Orders in process for customer Animal Dermatology Hospital

这里的客户名称是动物皮肤病医院,之间用空格隔开,那么当我通过LUIS Rest API提取数据时,我得到的是Animal作为实体值而不是Animal Dermatology Hospital,有时也没有实体值返回

Here the customer name is Animal Dermatology Hospital which is separated by space then when I am fetching the data through LUIS Rest API I am getting Animal as the entity value instead of Animal Dermatology Hospital and some times also no entity value returning

 {
      "query": " orders in process for customer Animal Dermatology Service",
      "topScoringIntent": {
        "intent": "OrderDetails_2a598c9b-7cb5-4113-9aca-435b55bbe19e",
        "score": 0.7547371
      },

返回数据

{
  "query": "how many orders are currently in process for customer Animal Dermatology Service",
  "topScoringIntent": {
    "intent": "OrderDetails_2a598c9b-7cb5-4113-9aca-435b55bbe19e",
    "score": 0.6452578
  },
  "entities": []
}

但是,如果我仅用动物查询,则返回正确的数据

But if I query it with only Animal then proper data is returning

返回数据

{
      "query": "how many orders are currently in process for customer Animal",
      "topScoringIntent": {
        "intent": "OrderDetails_2a598c9b-7cb5-4113-9aca-435b55bbe19e",
        "score": 0.8928922
      },
      "entities": [
        {
          "entity": "animal",
          "type": "vf_NARCName",
          "startIndex": 54,
          "endIndex": 59,
          "score": 0.500023663
        }
      ]
    }

推荐答案

您的LUIS应用本质上需要更多关于实体发生方式的说明.

Your LUIS app essentially needs more utterances of how that entity can occur.

我想说"stategy 1.)可能是最有用的,但是请列出您可能还包括的其他选项,以帮助您进行实体检测.

I would say stategy 1.) is probably the most useful, but list other options you may include as well to help with your entity detection.

  1. 使用vf_NARCName实体的重要变体添加更多语音

,请确保您包括以下内容:

As stated in the First Tutorial in the documentation under "Build App" section, make sure that you include:

  • 每个意图至少 15个言语,其中包括实体显示方式的不同方式
  • At least 15 utterances per intent, and within that include different ways of how the entity can appear

和您应该意识到的变体是:

  • differences in word order (where the entity can occur within an utterance)
  • tense (like "was", "is", "will be", as shown in this tutorial)
  • grammatical correctness
  • length of both the utterance and of the entity itself (word count)

最后一点可能是您应该包括更多示例的地方.因此,请检查您包含vf_NARCName实体的语音,这些实体的长度不仅是1个字,而且可能是2或3个甚至更长,如果在您的应用中是这样的话.

The last bit is probably one that you should include more examples of. So check your utterances that contain vf_NARCName entities that are of not just 1 word in length, but 2 or 3 or maybe even longer if that's a possibility in your app.

  1. 添加词组列表

作为描述短语列表是什么的文档状态,

短语列表包括一组值(单词或短语),它们 属于同一个类别,必须得到类似的对待

A phrase list includes a group of values (words or phrases) that belong to the same class and must be treated similarly

这是您可以帮助向LUIS发送另一个信号以帮助检测您的vf_NARCName实体的另一种方式.

This is another way you could help send another signal to LUIS to help detect your vf_NARCName entity.

有关如何添加短语列表的教程

Tutorial on how to add Phrase List here.

  1. 最后,您可能想使用使用Pattern.any

作为 Pattern.any文档在这里声明,

使用pattern.any实体从话语中提取数据,其中 话语格式正确,数据的结尾可能在哪里 容易与话语中的其余单词混淆

use the pattern.any entity to extract data from utterances where the utterances are well-formatted and where the end of the data may be easily confused with the remaining words of the utterance

因此,如果您知道您可能拥有潜在的vf_NARCName实体,而该实体本身的字数非常长,那么您可以从使用Pattern.any实体中受益.

So if you know that you may have potential vf_NARCName entities that are extremely long in word count for the entity itself, you may benefit from using Pattern.any entity.

例如,也许您将"The Department of People Who like Really Long Names, But Hate Novels"作为vf_NARCName实体. LUIS可能很难确定该实体的确切位置,但是可以通过使用Pattern.any来做到这一点.

For example maybe you had "The Department of People Who like Really Long Names, But Hate Novels" as a vf_NARCName entity. LUIS may have a hard time determining where exactly that entity ends, but can do so with the use of Pattern.any.

这篇关于LUIS Intent不返回带空格的实体的整个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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