【问题标题】:LUIS: recognizing more than one of the same composite entity in one utteranceLUIS:在一个话语中识别多个相同的复合实体
【发布时间】:2018-04-06 14:20:53
【问题描述】:

我是 LUIS 新手,但我仍在努力解决问题,我似乎无法弄清楚的一件事是如何让我的 LUIS 应用识别哪些实体属于同一个复合实体时有更多比一个话语中的一个实例。我知道这很令人困惑,让我尝试更好地解释:

我的测试应用是关于订购东西的。

我有这样的话语:

请为我购买 2 个红辣椒albuns 和一个惊人的蜘蛛侠形象

返回的 JSON 是这样的:

{
  "query": "purchase for me 2 red hot chilli pepper albuns and an amazing spiderman figure please",
  "topScoringIntent": {
    "intent": "Order",
    "score": 0.9981847
  },
  "intents": [
    {
      "intent": "Order",
      "score": 0.9981847
    },
    {
      "intent": "Read",
      "score": 0.0023417694
    },
    {
      "intent": "None",
      "score": 0.00118408469
    }
  ],
  "entities": [
    {
      "entity": "red hot chilli pepper albuns",
      "type": "Item.Description",
      "startIndex": 18,
      "endIndex": 45,
      "score": 0.8821352
    },
    {
      "entity": "amazing spiderman figure",
      "type": "Item.Description",
      "startIndex": 54,
      "endIndex": 77,
      "score": 0.9167113
    },
    {
      "entity": "2",
      "type": "Item.Quantity",
      "startIndex": 16,
      "endIndex": 16,
      "score": 0.9843564
    },
    {
      "entity": "an",
      "type": "Item.Quantity",
      "startIndex": 51,
      "endIndex": 52,
      "score": 0.948889554
    }
  ]
}

它正确识别了实体,但它不知道“2”对应于“red hot chili pepper albuns”,“an”对应于“the Amazing spiderman figure”

我的实体是:

Item.Quantity - simple entity
Item.Description - simple entity 
Item.Number - simple entity
Item - composite entity with the above as children

这有可能吗?

【问题讨论】:

    标签: json botframework azure-language-understanding


    【解决方案1】:

    是的,完全有可能。并且您在使用复合实体的正确轨道上,只是需要更改复合实体的训练。首先对于复合实体,应添加和训练子实体(您已完成)。

    接下来是标记复合实体。转到订单意图,对于任何话语,让我们说:

    给我买2个红辣椒albuns

    选择 Item.Quantity 实体,然后从列表中选择 Wrap in Composite entity。在文字下方会出现一条绿线,现在将光标向右移动直到红辣椒albuns(或直到您要包装的任何实体),您会注意到绿线跟随指示一个复合实体。从出现的列表中选择复合名称 Item

    对于同一话语中的多个复合实体,例如

    请为我购买 2 个红辣椒albuns 和一个惊人的蜘蛛侠形象

    重复相同的过程,除了第一个复合实体将针对2 red hot chilli pepper albuns 进行包装和训练,而下一个复合实体将针对an amazing spiderman figure 进行包装和训练

    不要忘记训练和发布 LUIS 应用。

    要更深入地了解复合实体,请查看Luis tutorial - composite entity

    【讨论】:

    • 既然你解释了它看起来很明显,我应该自己弄清楚。谢谢,这正是我所需要的。
    • 在为最左边的实体选择复合后,我可以将光标移动到某些实体下方的任何位置。绿线只会出现在第一个实体下方。是的,第二个实体也是同一复合实体定义的一部分。自您发表评论以来的 1.5 年里,他们是否发生了一些变化?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多