| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | namespace Azure.AI.TextAnalytics |
| | 5 | | { |
| | 6 | | /// <summary> |
| | 7 | | /// A word or phrase identified as an entity that can be categorized |
| | 8 | | /// as known type in a given taxonomy. The set of categories recognized by the |
| | 9 | | /// Text Analytics service is described at |
| | 10 | | /// <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/Text-Analytics/named-entity-types"/>. |
| | 11 | | /// </summary> |
| | 12 | | public readonly struct CategorizedEntity |
| | 13 | | { |
| | 14 | | internal CategorizedEntity(string text, string category, string subCategory, double score) |
| | 15 | | { |
| 196 | 16 | | Text = text; |
| 196 | 17 | | Category = category; |
| 196 | 18 | | SubCategory = subCategory; |
| 196 | 19 | | ConfidenceScore = score; |
| 196 | 20 | | } |
| | 21 | |
|
| | 22 | | /// <summary> |
| | 23 | | /// Gets the entity text as it appears in the input document. |
| | 24 | | /// </summary> |
| 56 | 25 | | public string Text { get; } |
| | 26 | |
|
| | 27 | | /// <summary> |
| | 28 | | /// Gets the entity category inferred by the Text Analytics service's |
| | 29 | | /// named entity recognition model. The list of available categories is |
| | 30 | | /// described at |
| | 31 | | /// <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/Text-Analytics/named-entity-types"/>. |
| | 32 | | /// </summary> |
| 32 | 33 | | public EntityCategory Category { get; } |
| | 34 | |
|
| | 35 | | /// <summary> |
| | 36 | | /// Gets the sub category of the entity inferred by the Text Analytics service's |
| | 37 | | /// named entity recognition model. This property may not have a value if |
| | 38 | | /// a sub category doesn't exist for this entity. The list of available categories and |
| | 39 | | /// subcategories is described at |
| | 40 | | /// <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/Text-Analytics/named-entity-types"/>. |
| | 41 | | /// </summary> |
| 36 | 42 | | public string SubCategory { get; } |
| | 43 | |
|
| | 44 | | /// <summary> |
| | 45 | | /// Gets a score between 0 and 1, indicating the confidence that the |
| | 46 | | /// text substring matches this inferred entity. |
| | 47 | | /// </summary> |
| 44 | 48 | | public double ConfidenceScore { get; } |
| | 49 | | } |
| | 50 | | } |