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
> * This quickstart is only for version `3.0-preview` of the Text Analytics client library, which includes a public preview for improved [Sentiment Analysis](../../how-tos/text-analytics-how-to-sentiment-analysis.md#sentiment-analysis-versions-and-features) and [Named Entity Recognition (NER)](../../how-tos/text-analytics-how-to-entity-linking.md#named-entity-recognition-versions-and-features).
20
-
> * The code in this article uses synchronous methods and un-secured credentials storage for simplicity reasons. For production scenarios, we recommend using the batched asynchronous methods for performance and scalability. For example, calling `SentimentBatchAsync()` instead of `Sentiment()`.
21
-
22
18
## Prerequisites
23
19
24
20
* Azure subscription - [Create one for free](https://azure.microsoft.com/free/)
@@ -67,7 +67,7 @@ When batch processing text is sent to the API as a list of `documents`, which ar
67
67
68
68
The response object is a list containing the analysis information for each document.
69
69
70
-
#### [Version 2](#tab/version-2)
70
+
#### [Version 2.1](#tab/version-2)
71
71
72
72
The Text Analytics client is a [TextAnalyticsClient](https://docs.microsoft.com/python/api/azure-cognitiveservices-language-textanalytics/azure.cognitiveservices.language.textanalytics.textanalyticsclient?view=azure-python) object that authenticates to Azure using your key. The client provides several methods for analyzing text, as a single string, or a batch.
73
73
@@ -140,7 +140,7 @@ neutral=0.771
140
140
negative=0.017
141
141
```
142
142
143
-
#### [Version 2](#tab/version-2)
143
+
#### [Version 2.1](#tab/version-2)
144
144
145
145
Authenticate a client object, and call the [sentiment()](https://docs.microsoft.com/python/api/azure-cognitiveservices-language-textanalytics/azure.cognitiveservices.language.textanalytics.textanalyticsclient?view=azure-python#sentiment-show-stats-none--documents-none--custom-headers-none--raw-false----operation-config-) function. Iterate through the results, and print each document's ID, and sentiment score. A score closer to 0 indicates a negative sentiment, while a score closer to 1 indicates a positive sentiment.
Using the client created earlier, call [detect_language()](https://docs.microsoft.com/python/api/azure-cognitiveservices-language-textanalytics/azure.cognitiveservices.language.textanalytics.textanalyticsclient?view=azure-python#detect-language-show-stats-none--documents-none--custom-headers-none--raw-false----operation-config-) and get the result. Then iterate through the results, and print each document's ID, and the first returned language.
193
193
@@ -358,7 +358,7 @@ Linked Entities:
358
358
Score: 0.281 Offset: 89 Length: 5
359
359
```
360
360
361
-
#### [Version 2](#tab/version-2)
361
+
#### [Version 2.1](#tab/version-2)
362
362
363
363
> [!NOTE]
364
364
> In version 2.1, entity linking is included in the NER response.
Using the client created earlier, call the [key_phrases()](https://docs.microsoft.com/python/api/azure-cognitiveservices-language-textanalytics/azure.cognitiveservices.language.textanalytics.textanalyticsclient?view=azure-python#key-phrases-show-stats-none--documents-none--custom-headers-none--raw-false----operation-config-) function and get the result. Then iterate through the results, and print each document's ID, and the key phrases contained in it.
Copy file name to clipboardExpand all lines: articles/cognitive-services/text-analytics/quickstarts/text-analytics-sdk.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ Use the Text Analytics client library to perform:
49
49
::: zone pivot="programming-language-java"
50
50
51
51
> [!IMPORTANT]
52
-
> *The latest preview version of the Text Analytics API is `3.0-preview`, which includes a public preview for improved [Sentiment Analysis](../how-tos/text-analytics-how-to-sentiment-analysis.md#sentiment-analysis-versions-and-features) and [Named Entity Recognition (NER)](../how-tos/text-analytics-how-to-entity-linking.md#named-entity-recognition-versions-and-features). The latest stable version is `2.1`.
52
+
> *This quickstart is only for version `3.0-preview`of the Text Analytics client library, which includes a public preview for improved [Sentiment Analysis](../../how-tos/text-analytics-how-to-sentiment-analysis.md#sentiment-analysis-versions-and-features) and [Named Entity Recognition (NER)](../../how-tos/text-analytics-how-to-entity-linking.md#named-entity-recognition-versions-and-features).
53
53
> * Be sure to only follow the instructions for the version you are using.
54
54
> * The code in this article uses synchronous methods and un-secured credentials storage for simplicity reasons. For production scenarios, we recommend using the batched asynchronous methods for performance and scalability. See the reference documentation below.
0 commit comments