Skip to content

Commit 42e7132

Browse files
committed
Added NER output sample and attributes
1 parent d11a68f commit 42e7132

File tree

2 files changed

+82
-8
lines changed

2 files changed

+82
-8
lines changed

articles/ai-services/language-service/named-entity-recognition/how-to-call.md

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ The API attempts to detect the [defined entity categories](concepts/named-entity
3939

4040
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.
4141

42-
## Select which entities to be returned (Preview API only)
42+
## Select which entities to be returned
4343

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:
4545

4646
**Input:**
4747

@@ -108,6 +108,80 @@ This method returns all `Location` entities only falling under the `GPE` tag and
108108

109109
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.
110110

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:
114+
115+
|Name of the attribute|Type |Definition |
116+
|---------------------|------------|-----------------------------------------|
117+
|`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+
111185
## Specify the NER model
112186
113187
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).

articles/ai-services/language-service/toc.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,8 @@ items:
693693
href: text-analytics-for-health/concepts/relation-extraction.md
694694
- name: Assertion detection
695695
href: text-analytics-for-health/concepts/assertion-detection.md
696+
- name: Fast Healthcare Interoperability Resources (FHIR) structuring
697+
href: text-analytics-for-health/concepts/fhir.md
696698
- name: Custom (preview)
697699
items:
698700
- name: Custom text analytics for health overview
@@ -727,8 +729,6 @@ items:
727729
href: custom-text-analytics-for-health/concepts/entity-components.md
728730
- name: Evaluation metrics
729731
href: custom-text-analytics-for-health/concepts/evaluation-metrics.md
730-
- name: Fast Healthcare Interoperability Resources (FHIR) structuring
731-
href: custom-text-analytics-for-health/concepts/fhir.md
732732
- name: Reference
733733
items:
734734
- name: Service limits
@@ -813,13 +813,13 @@ items:
813813
href: tutorials/power-automate.md
814814
- name: Use language in prompt flow
815815
href: tutorials/prompt-flow.md
816-
- name: 🆕 Native document support
816+
- name: Native document support
817817
items:
818-
- name: 🆕 Use native documents for language processing
818+
- name: Use native documents for language processing
819819
href: native-document-support/use-native-documents.md
820-
- name: 🆕 Create SAS tokens for storage containers
820+
- name: Create SAS tokens for storage containers
821821
href: native-document-support/shared-access-signatures.md
822-
- name: 🆕 Create a managed identity for storage containers
822+
- name: Create a managed identity for storage containers
823823
href: native-document-support/managed-identities.md
824824
- name: Scenario deep-dives
825825
items:

0 commit comments

Comments
 (0)