提取实体
命名实体识别标识文本中提到的实体。 实体分为类别和子类别,例如:
- 人
 - 位置
 - 日期/时间
 - 组织
 - 地址
 - URL
 
注意
有关类别的完整列表,请参阅 文档。
实体识别的输入类似于其他 Azure AI 语言 API 函数的输入:
{
  "kind": "EntityRecognition",
  "parameters": {
    "modelVersion": "latest"
  },
  "analysisInput": {
    "documents": [
      {
        "id": "1",
        "language": "en",
        "text": "Joe went to London on Saturday"
      }
    ]
  }
}
响应包括在每个文档中找到的分类实体的列表:
{
    "kind": "EntityRecognitionResults",
     "results": {
          "documents":[
              {
                  "entities":[
                  {
                    "text":"Joe",
                    "category":"Person",
                    "offset":0,
                    "length":3,
                    "confidenceScore":0.62
                  },
                  {
                    "text":"London",
                    "category":"Location",
                    "subcategory":"GPE",
                    "offset":12,
                    "length":6,
                    "confidenceScore":0.88
                  },
                  {
                    "text":"Saturday",
                    "category":"DateTime",
                    "subcategory":"Date",
                    "offset":22,
                    "length":8,
                    "confidenceScore":0.8
                  }
                ],
                "id":"1",
                "warnings":[]
              }
          ],
          "errors":[],
          "modelVersion":"2021-01-15"
    }
}
若要了解有关实体的详细信息,请参阅生成对话语言理解模型模块。