Skip to content

Commit 8b051ee

Browse files
committed
updating rest api
1 parent 12c6045 commit 8b051ee

File tree

1 file changed

+64
-16
lines changed
  • articles/cognitive-services/language-service/sentiment-opinion-mining/includes/quickstarts

1 file changed

+64
-16
lines changed

articles/cognitive-services/language-service/sentiment-opinion-mining/includes/quickstarts/rest-api.md

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ curl -i -X POST <your-language-resource-endpoint>/language/:analyze-text?api-ver
6666
{
6767
"id":"1",
6868
"language":"en",
69-
"text": "The customer service here is really good."
69+
"text": "The food and service were unacceptable. The concierge was nice, however."
7070
}
7171
]
7272
}
@@ -82,34 +82,82 @@ curl -i -X POST <your-language-resource-endpoint>/language/:analyze-text?api-ver
8282
"results": {
8383
"documents": [{
8484
"id": "1",
85-
"sentiment": "positive",
85+
"sentiment": "mixed",
8686
"confidenceScores": {
87-
"positive": 1.0,
87+
"positive": 0.47,
8888
"neutral": 0.0,
89-
"negative": 0.0
89+
"negative": 0.52
9090
},
9191
"sentences": [{
92-
"sentiment": "positive",
92+
"sentiment": "negative",
9393
"confidenceScores": {
94-
"positive": 1.0,
94+
"positive": 0.0,
9595
"neutral": 0.0,
96-
"negative": 0.0
96+
"negative": 0.99
9797
},
9898
"offset": 0,
99-
"length": 41,
100-
"text": "The customer service here is really good.",
99+
"length": 40,
100+
"text": "The food and service were unacceptable. ",
101+
"targets": [{
102+
"sentiment": "negative",
103+
"confidenceScores": {
104+
"positive": 0.0,
105+
"negative": 1.0
106+
},
107+
"offset": 4,
108+
"length": 4,
109+
"text": "food",
110+
"relations": [{
111+
"relationType": "assessment",
112+
"ref": "#/documents/0/sentences/0/assessments/0"
113+
}]
114+
}, {
115+
"sentiment": "negative",
116+
"confidenceScores": {
117+
"positive": 0.0,
118+
"negative": 1.0
119+
},
120+
"offset": 13,
121+
"length": 7,
122+
"text": "service",
123+
"relations": [{
124+
"relationType": "assessment",
125+
"ref": "#/documents/0/sentences/0/assessments/0"
126+
}]
127+
}],
128+
"assessments": [{
129+
"sentiment": "negative",
130+
"confidenceScores": {
131+
"positive": 0.0,
132+
"negative": 1.0
133+
},
134+
"offset": 26,
135+
"length": 12,
136+
"text": "unacceptable",
137+
"isNegated": false
138+
}]
139+
}, {
140+
"sentiment": "positive",
141+
"confidenceScores": {
142+
"positive": 0.94,
143+
"neutral": 0.01,
144+
"negative": 0.05
145+
},
146+
"offset": 40,
147+
"length": 32,
148+
"text": "The concierge was nice, however.",
101149
"targets": [{
102150
"sentiment": "positive",
103151
"confidenceScores": {
104152
"positive": 1.0,
105153
"negative": 0.0
106154
},
107-
"offset": 4,
108-
"length": 16,
109-
"text": "customer service",
155+
"offset": 44,
156+
"length": 9,
157+
"text": "concierge",
110158
"relations": [{
111159
"relationType": "assessment",
112-
"ref": "#/documents/0/sentences/0/assessments/0"
160+
"ref": "#/documents/0/sentences/1/assessments/0"
113161
}]
114162
}],
115163
"assessments": [{
@@ -118,16 +166,16 @@ curl -i -X POST <your-language-resource-endpoint>/language/:analyze-text?api-ver
118166
"positive": 1.0,
119167
"negative": 0.0
120168
},
121-
"offset": 36,
169+
"offset": 58,
122170
"length": 4,
123-
"text": "good",
171+
"text": "nice",
124172
"isNegated": false
125173
}]
126174
}],
127175
"warnings": []
128176
}],
129177
"errors": [],
130-
"modelVersion": "2021-10-01"
178+
"modelVersion": "2022-06-01"
131179
}
132180
}
133181
```

0 commit comments

Comments
 (0)