|
| 1 | +--- |
| 2 | +title: Migration guide for v2 of the Text Analytics API |
| 3 | +titleSuffix: Azure Cognitive Services |
| 4 | +description: Learn how to move your applications to use version 3 of the Text Analytics API. |
| 5 | +services: cognitive-services |
| 6 | +author: aahill |
| 7 | +manager: nitinme |
| 8 | +ms.service: cognitive-services |
| 9 | +ms.subservice: text-analytics |
| 10 | +ms.topic: article |
| 11 | +ms.date: 07/06/2021 |
| 12 | +ms.author: aahi |
| 13 | +--- |
| 14 | + |
| 15 | +# Migrate from version 2 of the Text Analytics API |
| 16 | + |
| 17 | +If your applications are using version 2.1 of the Text Analytics API, this article will help you upgrade your applications to use the latest version of the features, which are now a part of [Azure Cognitive Service for language](../overview.md). |
| 18 | + |
| 19 | +## Features |
| 20 | + |
| 21 | +Select one of the features below to see information you can use to update your application. |
| 22 | + |
| 23 | +## [Sentiment analysis](#tab/sentiment-analysis) |
| 24 | + |
| 25 | +> [!TIP] |
| 26 | +> Want to use the latest version of the API in your application? See the [sentiment analysis](../sentiment-opinion-mining/how-to/call-api.md) how-to article and [quickstart](../sentiment-opinion-mining/quickstart.md) for information on the current version of the API. |
| 27 | +
|
| 28 | +## Feature changes |
| 29 | + |
| 30 | +Sentiment Analysis in version 2.1 returns sentiment scores between 0 and 1 for each document sent to the API, with scores closer to 1 indicating more positive sentiment. The current version of this feature returns sentiment labels (such as "positive" or "negative") for both the sentences and the document as a whole, and their associated confidence scores. |
| 31 | + |
| 32 | +## Steps to migrate |
| 33 | + |
| 34 | +### REST API |
| 35 | + |
| 36 | +If your application uses the REST API, update its request endpoint to use the [current endpoint](../sentiment-opinion-mining/quickstart.md?pivots=rest-api) for sentiment analysis. For example:`https://<your-custom-subdomain>.cognitiveservices.azure.com/text/analytics/v3.1/sentiment`. You will also need to update the application to use the sentiment labels returned in the [API's response](../sentiment-opinion-mining/how-to/call-api.md). |
| 37 | + |
| 38 | +See the reference documentation for examples of the JSON response. |
| 39 | +* [Version 2.1](https://westcentralus.dev.cognitive.microsoft.com/docs/services/TextAnalytics-v2-1/operations/56f30ceeeda5650db055a3c9) |
| 40 | +* [Version 3.0](https://westus.dev.cognitive.microsoft.com/docs/services/TextAnalytics-v3-0/operations/Sentiment) |
| 41 | +* [Version 3.1](https://westcentralus.dev.cognitive.microsoft.com/docs/services/TextAnalytics-v3-1/operations/Sentiment) |
| 42 | + |
| 43 | +### Client libraries |
| 44 | + |
| 45 | +To use the latest version of the sentiment analysis client library, you will need to download the latest software package in the `Azure.AI.TextAnalytics` namespace. The [quickstart article](../sentiment-opinion-mining/quickstart.md) lists the commands you can use for your preferred language, with example code. |
| 46 | + |
| 47 | +## [NER and entity linking](#tab/named-entity-recognition) |
| 48 | + |
| 49 | +> [!TIP] |
| 50 | +> Want to use the latest version of the API in your application? See the following articles for information on the current version of the APIs: |
| 51 | +> NER: |
| 52 | +> * [Quickstart](../named-entity-recognition/quickstart.md) |
| 53 | +> * [how to call the API](../named-entity-recognition/how-to-call.md) |
| 54 | +> Entity linking |
| 55 | +> * [Quickstart](../entity-linking/quickstart.md) |
| 56 | +> * [how to call the API](../entity-linking/how-to/call-api.md) |
| 57 | +
|
| 58 | +## Feature changes |
| 59 | + |
| 60 | +In version 2.1, the Text Analytics API uses one endpoint for Named Entity Recognition (NER) and entity linking. The current version of this feature provides expanded named entity detection, and uses separate endpoints for NER and entity linking requests. Additionally, you can use another feature offered in the Language service that lets you detect [detect personal (pii) and health (phi) information](../personally-identifiable-information/overview.md). |
| 61 | + |
| 62 | +## Steps to migrate |
| 63 | + |
| 64 | +### REST API |
| 65 | + |
| 66 | +If your application uses the REST API, update its request endpoint to the [current endpoints](../named-entity-recognition/quickstart.md?pivots=rest-api) for NER and/or entity linking. For example: |
| 67 | + |
| 68 | +Entity Linking |
| 69 | +* `https://<your-custom-subdomain>.cognitiveservices.azure.com/text/analytics/v3.1/entities/linking` |
| 70 | + |
| 71 | +NER |
| 72 | +* `https://<your-custom-subdomain>.cognitiveservices.azure.com/text/analytics/v3.1/entities/recognition/general` |
| 73 | + |
| 74 | +You will also need to update your application to use the [entity categories](../named-entity-recognition/concepts/named-entity-categories.md) returned in the [API's response](../named-entity-recognition/how-to-call.md). |
| 75 | + |
| 76 | +See the reference documentation for examples of the JSON response. |
| 77 | +* [Version 2.1](https://westcentralus.dev.cognitive.microsoft.com/docs/services/TextAnalytics-v2-1/operations/5ac4251d5b4ccd1554da7634) |
| 78 | +* [Version 3.0](https://westus.dev.cognitive.microsoft.com/docs/services/TextAnalytics-v3-0/operations/EntitiesRecognitionGeneral) |
| 79 | +* [Version 3.1](https://westcentralus.dev.cognitive.microsoft.com/docs/services/TextAnalytics-v3-1/operations/EntitiesRecognitionGeneral) |
| 80 | + |
| 81 | +### Client libraries |
| 82 | + |
| 83 | +To use the latest version of the NER and entity linking client libraries, you will need to download the latest software package in the `Azure.AI.TextAnalytics` namespace. The quickstart article for [Named Entity Recognition](../named-entity-recognition/quickstart.md) and [entity linking](../entity-linking/quickstart.md) lists the commands you can use for your preferred language, with example code. |
| 84 | + |
| 85 | +#### Version 2.1 entity categories |
| 86 | + |
| 87 | +The following table lists the entity categories returned for NER v2.1. |
| 88 | + |
| 89 | +| Category | Description | |
| 90 | +|------------|--------------------------------------| |
| 91 | +| Person | Names of people. | |
| 92 | +|Location | Natural and human-made landmarks, structures, geographical features, and geopolitical entities | |
| 93 | +|Organization | Companies, political groups, musical bands, sport clubs, government bodies, and public organizations. Nationalities and religions are not included in this entity type. | |
| 94 | +| PhoneNumber | Phone numbers (US and EU phone numbers only). | |
| 95 | +| Email | Email addresses. | |
| 96 | +| URL | URLs to websites. | |
| 97 | +| IP | Network IP addresses. | |
| 98 | +| DateTime | Dates and times of day.| |
| 99 | +| Date | Calender dates. | |
| 100 | +| Time | Times of day | |
| 101 | +| DateRange | Date ranges. | |
| 102 | +| TimeRange | Time ranges. | |
| 103 | +| Duration | Durations. | |
| 104 | +| Set | Set, repeated times. | |
| 105 | +| Quantity | Numbers and numeric quantities. | |
| 106 | +| Number | Numbers. | |
| 107 | +| Percentage | Percentages.| |
| 108 | +| Ordinal | Ordinal numbers. | |
| 109 | +| Age | Ages. | |
| 110 | +| Currency | Currencies. | |
| 111 | +| Dimension | Dimensions and measurements. | |
| 112 | +| Temperature | Temperatures. | |
| 113 | + |
| 114 | +## [Language detection](#tab/language-detection) |
| 115 | + |
| 116 | +> [!TIP] |
| 117 | +> Want to use the latest version of the API in your application? See the [language detection](../language-detection/how-to/call-api.md) how-to article and [quickstart](../language-detection/quickstart.md) for information on the current version of the API. |
| 118 | +
|
| 119 | +## Feature changes |
| 120 | + |
| 121 | +The language detection feature output has changed in the current version. The JSON response will contain `ConfidenceScore` instead of `score`. The current version also only returns one language in a `detectedLanguage` attribute for each document. |
| 122 | + |
| 123 | +## Steps to migrate |
| 124 | + |
| 125 | +### REST API |
| 126 | + |
| 127 | +If your application uses the REST API, update its request endpoint to the [current endpoint](../language-detection/quickstart.md?pivots=rest-api) for language detection. For example:`https://<your-custom-subdomain>.cognitiveservices.azure.com/text/analytics/v3.1/languages`. You will also need to update the application to use `ConfidenceScore` instead of `score` in the [API's response](../language-detection/how-to/call-api.md). |
| 128 | + |
| 129 | +See the reference documentation for examples of the JSON response. |
| 130 | +* [Version 2.1](https://westcentralus.dev.cognitive.microsoft.com/docs/services/TextAnalytics-v2-1/operations/56f30ceeeda5650db055a3c7) |
| 131 | +* [Version 3.0](https://westus.dev.cognitive.microsoft.com/docs/services/TextAnalytics-v3-0/operations/Languages) |
| 132 | +* [Version 3.1](https://westcentralus.dev.cognitive.microsoft.com/docs/services/TextAnalytics-v3-1/operations/Languages) |
| 133 | + |
| 134 | +#### Client libraries |
| 135 | + |
| 136 | +To use the latest version of the sentiment analysis client library, you will need to download the latest software package in the `Azure.AI.TextAnalytics` namespace. The [quickstart article](../language-detection/quickstart.md) lists the commands you can use for your preferred language, with example code. |
| 137 | + |
| 138 | +## [Key phrase extraction](#tab/key-phrase-extraction) |
| 139 | + |
| 140 | +> [!TIP] |
| 141 | +> Want to use the latest version of the API in your application? See the [key phrase extraction](../key-phrase-extraction/how-to/call-api.md) how-to article and [quickstart](../key-phrase-extraction/quickstart.md) for information on the current version of the API. |
| 142 | +
|
| 143 | +## Feature changes |
| 144 | + |
| 145 | +The key phrase extraction feature currently has not changed outside of the endpoint version. |
| 146 | + |
| 147 | +## Steps to migrate |
| 148 | + |
| 149 | +### REST API |
| 150 | + |
| 151 | +If your application uses the REST API, update its request endpoint to the [current endpoint](../key-phrase-extraction/quickstart.md?pivots=rest-api) for key phrase extraction. For example: `https://<your-custom-subdomain>.api.cognitiveservices.azure.com/text/analytics/v3.1/keyPhrases` |
| 152 | + |
| 153 | +See the reference documentation for examples of the JSON response. |
| 154 | +* [Version 2.1](https://westcentralus.dev.cognitive.microsoft.com/docs/services/TextAnalytics-v2-1/operations/56f30ceeeda5650db055a3c6) |
| 155 | +* [Version 3.0](https://westus.dev.cognitive.microsoft.com/docs/services/TextAnalytics-v3-0/operations/KeyPhrases) |
| 156 | +* [Version 3.1](https://westcentralus.dev.cognitive.microsoft.com/docs/services/TextAnalytics-v3-1/operations/KeyPhrases) |
| 157 | + |
| 158 | +### Client libraries |
| 159 | + |
| 160 | +To use the latest version of the sentiment analysis client library, you will need to download the latest software package in the `Azure.AI.TextAnalytics` namespace. The [quickstart article](../key-phrase-extraction/quickstart.md) lists the commands you can use for your preferred language, with example code. |
| 161 | + |
| 162 | +--- |
| 163 | + |
| 164 | +## See also |
| 165 | + |
| 166 | +* [What is Azure Cognitive Service for language?](../overview.md) |
0 commit comments