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
You must have JSON documents in this format: ID, text, language.
116
117
117
-
Each document must must be under 5,120 characters, and you can have up to 1,000 items (IDs) per collection. The collection is submitted in the body of the request.
118
+
Each document must be under 5,120 characters, and you can have up to 1,000 items (IDs) per collection. The collection is submitted in the body of the request.
118
119
119
120
### Structure the request
120
121
121
122
Create a POST request. You can [use Postman](text-analytics-how-to-call-api.md) or the **API testing console** in the following links to quickly structure and send one.
> You can find your key and endpoint for your Text Analytics resource on the azure portal. They will be located on the resource's **Quick start** page, under **resource management**.
Set a request header to include your Text Analytics API key. In the request body, provide the JSON documents you prepared.
@@ -176,44 +178,8 @@ All POST requests return a JSON formatted response with the IDs and detected ent
176
178
177
179
Output is returned immediately. You can stream the results to an application that accepts JSON or save the output to a file on the local system, and then import it into an application that allows you to sort, search, and manipulate the data.
Copy file name to clipboardExpand all lines: articles/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis.md
+41-39Lines changed: 41 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ manager: nitinme
8
8
ms.service: cognitive-services
9
9
ms.subservice: text-analytics
10
10
ms.topic: sample
11
-
ms.date: 12/17/2019
11
+
ms.date: 02/10/2020
12
12
ms.author: aahi
13
13
---
14
14
@@ -45,14 +45,7 @@ The Text Analytics API offers two versions of Sentiment Analysis - v2 and v3. Se
45
45
| Sentiment labeling || X |
46
46
| Model versioning || X |
47
47
48
-
#### [Version 2](#tab/version-2)
49
-
50
-
### Sentiment scoring
51
-
52
-
The sentiment analyzer classifies text as predominantly positive or negative. It assigns a score in the range of 0 to 1. Values close to 0.5 are neutral or indeterminate. A score of 0.5 indicates neutrality. When a string can't be analyzed for sentiment or has no sentiment, the score is always 0.5 exactly. For example, if you pass in a Spanish string with an English language code, the score is 0.5.
53
-
54
-
55
-
#### [Version 3 (Public preview)](#tab/version-3)
48
+
#### [Version 3.0-preview](#tab/version-3)
56
49
57
50
### Sentiment scoring
58
51
@@ -80,6 +73,13 @@ Sentiment Analysis v3 can return scores and labels at a sentence and document le
80
73
81
74
You can find an example C# application that calls this version of Sentiment Analysis on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/tree/master/dotnet/Language/SentimentV3.cs).
82
75
76
+
77
+
#### [Version 2.1](#tab/version-2)
78
+
79
+
### Sentiment scoring
80
+
81
+
The sentiment analyzer classifies text as predominantly positive or negative. It assigns a score in the range of 0 to 1. Values close to 0.5 are neutral or indeterminate. A score of 0.5 indicates neutrality. When a string can't be analyzed for sentiment or has no sentiment, the score is always 0.5 exactly. For example, if you pass in a Spanish string with an English language code, the score is 0.5.
82
+
83
83
---
84
84
85
85
## Sending a REST API request
@@ -96,28 +96,29 @@ Document size must be under 5,120 characters per document. You can have up to 1,
96
96
97
97
Create a POST request. You can [use Postman](text-analytics-how-to-call-api.md) or the **API testing console** in the following reference links to quickly structure and send one.
Set the HTTPS endpoint for sentiment analysis by using either a Text Analytics resource on Azure or an instantiated [Text Analytics container](text-analytics-how-to-install-containers.md). You must include the correct URL for the version you want to use. For example:
> You can find your key and endpoint for your Text Analytics resource on the azure portal. They will be located on the resource's **Quick start** page, under **resource management**.
Set a request header to include your Text Analytics API key. In the request body, provide the JSON documents collection you prepared for this analysis.
@@ -156,26 +157,7 @@ The sentiment analyzer classifies text as predominantly positive or negative. It
156
157
157
158
Output is returned immediately. You can stream the results to an application that accepts JSON or save the output to a file on the local system. Then, import the output into an application that you can use to sort, search, and manipulate the data.
158
159
159
-
#### [Version 2](#tab/version-2)
160
-
161
-
### Sentiment Analysis v2 example response
162
-
163
-
Responses from Sentiment Analysis v2 contain sentiment scores for each sent document.
164
-
165
-
```json
166
-
{
167
-
"documents": [{
168
-
"id": "1",
169
-
"score": 0.98690706491470337
170
-
}, {
171
-
"id": "2",
172
-
"score": 0.95202046632766724
173
-
}],
174
-
"errors": []
175
-
}
176
-
```
177
-
178
-
#### [Version 3 (Public preview)](#tab/version-3)
160
+
#### [Version 3.0-preview](#tab/version-3)
179
161
180
162
### Sentiment Analysis v3 example response
181
163
@@ -250,6 +232,26 @@ Responses from Sentiment Analysis v3 contain sentiment labels and scores for eac
250
232
"errors": []
251
233
}
252
234
```
235
+
236
+
#### [Version 2.1](#tab/version-2)
237
+
238
+
### Sentiment Analysis v2 example response
239
+
240
+
Responses from Sentiment Analysis v2 contain sentiment scores for each sent document.
0 commit comments