复合实体Composite entity

复合实体由其他实体构成,例如预生成实体、简单实体、正则表达式实体和列表实体。A composite entity is made up of other entities, such as prebuilt entities, simple, regular expression, and list entities. 各种单独的实体构成整个实体。The separate entities form a whole entity.

注意

此实体已弃用。This entity is deprecated. 请迁移到机器学习实体Please migrate to the machine-learning entity.

如果数据具有以下特征,则非常适合使用此实体:This entity is a good fit when the data:

  • 彼此相关。Are related to each other.
  • 在使用陈述的情况下彼此相关。Are related to each other in the context of the utterance.
  • 使用各种实体类型。Use a variety of entity types.
  • 需要由客户端应用程序作为一个信息单元进行分组和处理。Need to be grouped and processed by the client application as a unit of information.
  • 包含需要机器学习的各种用户话语。Have a variety of user utterances that require machine-learning.

复合实体

示例 JSONExample JSON

考虑一个预生成的 numberLocation::ToLocation 的复合实体,它包含以下话语:Consider a composite entity of prebuilt number and Location::ToLocation with the following utterance:

book 2 tickets to cairo

注意数字 2 和 ToLocation cairo 之间有单词,这些单词不属于任何实体。Notice that 2, the number, and cairo, the ToLocation have words between them that are not part of any of the entities. LUIS 网站中的已标记陈述中使用的绿色下划线指示复合实体。The green underline, used in a labeled utterance in the LUIS website, indicates a composite entity.

复合实体

复合实体返回在 compositeEntities 数组中,且该复合中的所有实体也都返回在 entities 数组中:Composite entities are returned in a compositeEntities array and all entities within the composite are also returned in the entities array:

  "entities": [
    {
      "entity": "2 tickets to cairo",
      "type": "ticketinfo",
      "startIndex": 5,
      "endIndex": 22,
      "score": 0.9214487
    },
    {
      "entity": "cairo",
      "type": "builtin.geographyV2.city",
      "startIndex": 18,
      "endIndex": 22
    },
    {
      "entity": "2",
      "type": "builtin.number",
      "startIndex": 5,
      "endIndex": 5,
      "resolution": {
        "subtype": "integer",
        "value": "2"
      }
    }
  ],
  "compositeEntities": [
    {
      "parentType": "ticketinfo",
      "value": "2 tickets to cairo",
      "children": [
        {
          "type": "builtin.number",
          "value": "2"
        },
        {
          "type": "builtin.geographyV2.city",
          "value": "cairo"
        }
      ]
    }
  ]
数据对象Data object 实体名称Entity name ValueValue
预构建实体 - 数量Prebuilt Entity - number "builtin.number""builtin.number" "2""2"
预生成实体 - GeographyV2Prebuilt Entity - GeographyV2 "Location::ToLocation""Location::ToLocation" "cairo""cairo"

后续步骤Next steps

详细了解实体:Learn more about entities: