列表实体List entity

列表实体表示一组固定、封闭的相关单词及其同义词。List entities represent a fixed, closed set of related words along with their synonyms. LUIS 不会为列表实体发现更多值。LUIS does not discover additional values for list entities. 使用“建议”功能根据当前列表查看有关新词的建议。Use the Recommend feature to see suggestions for new words based on the current list. 如果存在多个具有相同值的列表实体,则终结点查询中会返回其中每个实体。If there is more than one list entity with the same value, each entity is returned in the endpoint query.

列表实体不进行机器学习。A list entity isn't machine-learned. 它是确切的文本匹配。It is an exact text match. LUIS 将任何列表中某个项的任何匹配项标记为响应中的实体。LUIS marks any match to an item in any list as an entity in the response.

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

  • 是已知的集。Are a known set.
  • 不经常更改。Doesn't change often. 如果需要经常更改列表或希望列表自行扩展,则使用短语列表提升的简单实体是更好的选择。If you need to change the list often or want the list to self-expand, a simple entity boosted with a phrase list is a better choice.
  • 此集不超出此实体类型的最大 LUIS 边界The set doesn't exceed the maximum LUIS boundaries for this entity type.
  • 言语中的文本是同义项或规范名称的不区分大小写的匹配。The text in the utterance is a case-insensitive match with a synonym or the canonical name. LUIS 不会在不匹配的情况下使用该列表。LUIS doesn't use the list beyond the match. 使用列表实体无法解析模糊匹配、词干提取、复数形式和其他变体。Fuzzy matching, stemming, plurals, and other variations are not resolved with a list entity. 若要管理变体,请考虑使用带有可选文本语法的模式To manage variations, consider using a pattern with the optional text syntax.

列表实体

用于导入到列表实体的示例 .jsonExample .json to import into list entity

可使用以下 .json 格式将值导入现有列表实体:You can import values into an existing list entity using the following .json format:

[
    {
        "canonicalForm": "Blue",
        "list": [
            "navy",
            "royal",
            "baby"
        ]
    },
    {
        "canonicalForm": "Green",
        "list": [
            "kelly",
            "forest",
            "avacado"
        ]
    }
]

示例 JSON 响应Example JSON response

假设应用有一个名为 Cities 的列表,允许城市名称的变体,包括机场城市 (Sea-tac)、机场代码 (SEA)、邮政编码 (98101) 和电话区号 (206)。Suppose the app has a list, named Cities, allowing for variations of city names including city of airport (Sea-tac), airport code (SEA), postal zip code (98101), and phone area code (206).

列表项List item 项同义词Item synonyms
Seattle sea-tacsea98101206+1sea-tac, sea, 98101, 206, +1
Paris cdgroissyory750011+33cdg, roissy, ory, 75001, 1, +33

book 2 tickets to paris

在之前的陈述中,单词 paris 映射至属于 Cities 列表实体一部分的“巴黎”项。In the previous utterance, the word paris is mapped to the paris item as part of the Cities list entity. 列表实体同时匹配项的规范化名称及其同义词。The list entity matches both the item's normalized name as well as the item synonyms.

  "entities": [
    {
      "entity": "paris",
      "type": "Cities",
      "startIndex": 18,
      "endIndex": 22,
      "resolution": {
        "values": [
          "Paris"
        ]
      }
    }
  ]
数据对象Data object 实体名称Entity name ValueValue
列表实体List Entity Cities paris

后续步骤Next steps

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