You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/language-service/named-entity-recognition/how-to-call.md
+76-2Lines changed: 76 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,9 +39,9 @@ The API attempts to detect the [defined entity categories](concepts/named-entity
39
39
40
40
When you get results from NER, you can stream the results to an application or save the output to a file on the local system. The API response will include [recognized entities](concepts/named-entity-categories.md), including their categories and subcategories, and confidence scores.
41
41
42
-
## Select which entities to be returned (Preview API only)
42
+
## Select which entities to be returned
43
43
44
-
Starting with **API version 2023-04-15-preview**, the API attempts to detect the [defined entity types and tags](concepts/named-entity-categories.md) for a given document language. The entity types and tags replace the categories and subcategories structure the older models use to define entities for more flexibility. You can also specify which entities are detected and returned, use the optional `includeList` and `excludeList` parameters with the appropriate entity types. The following example would detect only `Location`. You can specify one or more [entity types](concepts/named-entity-categories.md) to be returned. Given the types and tags hierarchy introduced for this version, you have the flexibility to filter on different granularity levels as so:
44
+
The API attempts to detect the [defined entity types and tags](concepts/named-entity-categories.md) for a given document language. The entity types and tags replace the categories and subcategories structure the older models use to define entities for more flexibility. You can also specify which entities are detected and returned, use the optional `includeList` and `excludeList` parameters with the appropriate entity types. The following example would detect only `Location`. You can specify one or more [entity types](concepts/named-entity-categories.md) to be returned. Given the types and tags hierarchy introduced for this version, you have the flexibility to filter on different granularity levels as so:
45
45
46
46
**Input:**
47
47
@@ -108,6 +108,80 @@ This method returns all `Location` entities only falling under the `GPE` tag and
108
108
109
109
Using these parameters we can successfully filter on only `Location` entity types, since the `GPE` entity tag included in the `includeList` parameter, falls under the `Location` type. We then filter on only Geopolitical entities and exclude any entities tagged with `Continent` or `CountryRegion` tags.
110
110
111
+
## Additional output attributes
112
+
113
+
In order to provide users with more insight into an entity's types and provide increased usability, NER supports these additional attributes in the output:
|`type`|String |The most specific type of detected entity.<br><br>For example, “Seattle” is a City, a GPE (Geo Political Entity) and a “Location”. The most granular classification for “Seattle” is that it is a “City”. The type would be “City” for the text “Seattle".|
118
+
|`tags` |List (tags) |A list of tag objects which expresses the affinity of the detected entity to a hierarchy or any other grouping.<br><br>A tag contains two fields:<br>1. `name`: A unique name for the tag.<br>2. `confidenceScore`: The associated confidence score for a tag ranging from <br><br>This unique tagName will be used to filter in the `inclusionList` and `exclusionList` parameters
119
+
|`metadata` |Object |Metadata is an object containing additional data about the entity type detected. It changes based on the field `metadataKind`.
120
+
121
+
## Sample output
122
+
123
+
This sample output includes an example of the additional output attributes.
124
+
125
+
```bash
126
+
{
127
+
"kind": "EntityRecognitionResults",
128
+
"results": {
129
+
"documents": [
130
+
{
131
+
"id": "1",
132
+
"entities": [
133
+
{
134
+
"text": "Microsoft",
135
+
"category": "Organization",
136
+
"type": "Organization",
137
+
"offset": 0,
138
+
"length": 9,
139
+
"confidenceScore": 0.97,
140
+
"tags": [
141
+
{
142
+
"name": "Organization",
143
+
"confidenceScore": 0.97
144
+
}
145
+
]
146
+
},
147
+
{
148
+
"text": "One",
149
+
"category": "Quantity",
150
+
"type": "Number",
151
+
"subcategory": "Number",
152
+
"offset": 21,
153
+
"length": 3,
154
+
"confidenceScore": 0.9,
155
+
"tags": [
156
+
{
157
+
"name": "Number",
158
+
"confidenceScore": 0.8
159
+
},
160
+
{
161
+
"name": "Quantity",
162
+
"confidenceScore": 0.8
163
+
},
164
+
{
165
+
"name": "Numeric",
166
+
"confidenceScore": 0.8
167
+
}
168
+
],
169
+
"metadata": {
170
+
"metadataKind": "NumberMetadata",
171
+
"numberKind": "Integer",
172
+
"value": 1.0
173
+
}
174
+
}
175
+
],
176
+
"warnings": []
177
+
}
178
+
],
179
+
"errors": [],
180
+
"modelVersion": "2023-09-01"
181
+
}
182
+
}
183
+
```
184
+
111
185
## Specify the NER model
112
186
113
187
By default, this feature uses the latest available AI model on your text. You can also configure your API requests to use a specific [model version](../concepts/model-lifecycle.md).
0 commit comments