擷取實體
具名實體辨識會識別文字中提及的實體。 實體會分組為類別和子類別,例如:
- 個人
- Location
- Datetime
- Organization
- 位址
- 電子郵件
- 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"
}
}
若要深入瞭解實體,請參閱 建置對話式語言理解模型 模組。