-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[text analytics] return None for offset and length for v3.0 (#13382)
- Loading branch information
1 parent
077e344
commit d25ce0e
Showing
20 changed files
with
681 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
.../tests/recordings/test_analyze_sentiment.test_no_offset_length_v3_sentence_sentiment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
interactions: | ||
- request: | ||
body: '{"documents": [{"id": "0", "text": "I like nature. I do not like being | ||
inside", "language": "en"}]}' | ||
headers: | ||
Accept: | ||
- application/json, text/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '99' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- azsdk-python-ai-textanalytics/5.0.1 Python/3.8.5 (macOS-10.13.6-x86_64-i386-64bit) | ||
method: POST | ||
uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false | ||
response: | ||
body: | ||
string: '{"documents":[{"id":"0","sentiment":"mixed","confidenceScores":{"positive":0.44,"neutral":0.27,"negative":0.29},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.88,"neutral":0.11,"negative":0.01},"offset":0,"length":14,"text":"I | ||
like nature."},{"sentiment":"negative","confidenceScores":{"positive":0.01,"neutral":0.43,"negative":0.56},"offset":15,"length":26,"text":"I | ||
do not like being inside"}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}' | ||
headers: | ||
apim-request-id: | ||
- 94e0a047-a7be-4d12-a4ec-81ef3f496950 | ||
content-type: | ||
- application/json; charset=utf-8 | ||
csp-billing-usage: | ||
- CognitiveServices.TextAnalytics.BatchScoring=1 | ||
date: | ||
- Thu, 27 Aug 2020 20:56:20 GMT | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains; preload | ||
transfer-encoding: | ||
- chunked | ||
x-content-type-options: | ||
- nosniff | ||
x-envoy-upstream-service-time: | ||
- '78' | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
45 changes: 45 additions & 0 deletions
45
...cs/azure-ai-textanalytics/tests/recordings/test_analyze_sentiment.test_offset_length.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
interactions: | ||
- request: | ||
body: '{"documents": [{"id": "0", "text": "I like nature. I do not like being | ||
inside", "language": "en"}]}' | ||
headers: | ||
Accept: | ||
- application/json, text/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '99' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- azsdk-python-ai-textanalytics/5.0.1 Python/3.8.5 (macOS-10.13.6-x86_64-i386-64bit) | ||
method: POST | ||
uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false&stringIndexType=UnicodeCodePoint | ||
response: | ||
body: | ||
string: '{"documents":[{"id":"0","sentiment":"mixed","confidenceScores":{"positive":0.44,"neutral":0.27,"negative":0.29},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.88,"neutral":0.11,"negative":0.01},"offset":0,"length":14,"text":"I | ||
like nature."},{"sentiment":"negative","confidenceScores":{"positive":0.01,"neutral":0.43,"negative":0.56},"offset":15,"length":26,"text":"I | ||
do not like being inside"}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}' | ||
headers: | ||
apim-request-id: | ||
- c1dc9d16-85c8-420d-95a1-76b21edbb06f | ||
content-type: | ||
- application/json; charset=utf-8 | ||
csp-billing-usage: | ||
- CognitiveServices.TextAnalytics.BatchScoring=1 | ||
date: | ||
- Fri, 28 Aug 2020 18:31:18 GMT | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains; preload | ||
transfer-encoding: | ||
- chunked | ||
x-content-type-options: | ||
- nosniff | ||
x-envoy-upstream-service-time: | ||
- '81' | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
34 changes: 34 additions & 0 deletions
34
.../recordings/test_analyze_sentiment_async.test_no_offset_length_v3_sentence_sentiment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
interactions: | ||
- request: | ||
body: '{"documents": [{"id": "0", "text": "I like nature. I do not like being | ||
inside", "language": "en"}]}' | ||
headers: | ||
Accept: | ||
- application/json, text/json | ||
Content-Length: | ||
- '99' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- azsdk-python-ai-textanalytics/5.0.1 Python/3.8.5 (macOS-10.13.6-x86_64-i386-64bit) | ||
method: POST | ||
uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/sentiment?showStats=false | ||
response: | ||
body: | ||
string: '{"documents":[{"id":"0","sentiment":"mixed","confidenceScores":{"positive":0.44,"neutral":0.27,"negative":0.29},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.88,"neutral":0.11,"negative":0.01},"offset":0,"length":14,"text":"I | ||
like nature."},{"sentiment":"negative","confidenceScores":{"positive":0.01,"neutral":0.43,"negative":0.56},"offset":15,"length":26,"text":"I | ||
do not like being inside"}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}' | ||
headers: | ||
apim-request-id: 0577ce48-c371-418e-b478-cc085c7ecaf8 | ||
content-type: application/json; charset=utf-8 | ||
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1 | ||
date: Thu, 27 Aug 2020 20:56:21 GMT | ||
strict-transport-security: max-age=31536000; includeSubDomains; preload | ||
transfer-encoding: chunked | ||
x-content-type-options: nosniff | ||
x-envoy-upstream-service-time: '79' | ||
status: | ||
code: 200 | ||
message: OK | ||
url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.0/sentiment?showStats=false | ||
version: 1 |
34 changes: 34 additions & 0 deletions
34
...re-ai-textanalytics/tests/recordings/test_analyze_sentiment_async.test_offset_length.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
interactions: | ||
- request: | ||
body: '{"documents": [{"id": "0", "text": "I like nature. I do not like being | ||
inside", "language": "en"}]}' | ||
headers: | ||
Accept: | ||
- application/json, text/json | ||
Content-Length: | ||
- '99' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- azsdk-python-ai-textanalytics/5.0.1 Python/3.8.5 (macOS-10.13.6-x86_64-i386-64bit) | ||
method: POST | ||
uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/sentiment?showStats=false&stringIndexType=UnicodeCodePoint | ||
response: | ||
body: | ||
string: '{"documents":[{"id":"0","sentiment":"mixed","confidenceScores":{"positive":0.44,"neutral":0.27,"negative":0.29},"sentences":[{"sentiment":"positive","confidenceScores":{"positive":0.88,"neutral":0.11,"negative":0.01},"offset":0,"length":14,"text":"I | ||
like nature."},{"sentiment":"negative","confidenceScores":{"positive":0.01,"neutral":0.43,"negative":0.56},"offset":15,"length":26,"text":"I | ||
do not like being inside"}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}' | ||
headers: | ||
apim-request-id: 22d88cc1-51fb-48e0-a335-d14b72e1d125 | ||
content-type: application/json; charset=utf-8 | ||
csp-billing-usage: CognitiveServices.TextAnalytics.BatchScoring=1 | ||
date: Fri, 28 Aug 2020 18:31:18 GMT | ||
strict-transport-security: max-age=31536000; includeSubDomains; preload | ||
transfer-encoding: chunked | ||
x-content-type-options: nosniff | ||
x-envoy-upstream-service-time: '92' | ||
status: | ||
code: 200 | ||
message: OK | ||
url: https://westus2.api.cognitive.microsoft.com//text/analytics/v3.1-preview.1/sentiment?showStats=false&stringIndexType=UnicodeCodePoint | ||
version: 1 |
45 changes: 45 additions & 0 deletions
45
...sts/recordings/test_recognize_entities.test_no_offset_length_v3_categorized_entities.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
interactions: | ||
- request: | ||
body: '{"documents": [{"id": "0", "text": "Microsoft was founded by Bill Gates | ||
and Paul Allen", "language": "en"}]}' | ||
headers: | ||
Accept: | ||
- application/json, text/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '108' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- azsdk-python-ai-textanalytics/5.0.1 Python/3.8.5 (macOS-10.13.6-x86_64-i386-64bit) | ||
method: POST | ||
uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0/entities/recognition/general?showStats=false | ||
response: | ||
body: | ||
string: '{"documents":[{"id":"0","entities":[{"text":"Microsoft","category":"Organization","offset":0,"length":9,"confidenceScore":0.82},{"text":"Bill | ||
Gates","category":"Person","offset":25,"length":10,"confidenceScore":0.84},{"text":"Paul | ||
Allen","category":"Person","offset":40,"length":10,"confidenceScore":0.89}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}' | ||
headers: | ||
apim-request-id: | ||
- 8ebab42d-0090-4d36-8e52-721f4c4b87d7 | ||
content-type: | ||
- application/json; charset=utf-8 | ||
csp-billing-usage: | ||
- CognitiveServices.TextAnalytics.BatchScoring=1 | ||
date: | ||
- Thu, 27 Aug 2020 20:56:21 GMT | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains; preload | ||
transfer-encoding: | ||
- chunked | ||
x-content-type-options: | ||
- nosniff | ||
x-envoy-upstream-service-time: | ||
- '82' | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
45 changes: 45 additions & 0 deletions
45
...s/azure-ai-textanalytics/tests/recordings/test_recognize_entities.test_offset_length.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
interactions: | ||
- request: | ||
body: '{"documents": [{"id": "0", "text": "Microsoft was founded by Bill Gates | ||
and Paul Allen", "language": "en"}]}' | ||
headers: | ||
Accept: | ||
- application/json, text/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '108' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- azsdk-python-ai-textanalytics/5.0.1 Python/3.8.5 (macOS-10.13.6-x86_64-i386-64bit) | ||
method: POST | ||
uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.1/entities/recognition/general?showStats=false&stringIndexType=UnicodeCodePoint | ||
response: | ||
body: | ||
string: '{"documents":[{"id":"0","entities":[{"text":"Microsoft","category":"Organization","offset":0,"length":9,"confidenceScore":0.82},{"text":"Bill | ||
Gates","category":"Person","offset":25,"length":10,"confidenceScore":0.84},{"text":"Paul | ||
Allen","category":"Person","offset":40,"length":10,"confidenceScore":0.89}],"warnings":[]}],"errors":[],"modelVersion":"2020-04-01"}' | ||
headers: | ||
apim-request-id: | ||
- c588af7e-ff6c-4bca-9be0-bc50b81df611 | ||
content-type: | ||
- application/json; charset=utf-8 | ||
csp-billing-usage: | ||
- CognitiveServices.TextAnalytics.BatchScoring=1 | ||
date: | ||
- Fri, 28 Aug 2020 18:31:19 GMT | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains; preload | ||
transfer-encoding: | ||
- chunked | ||
x-content-type-options: | ||
- nosniff | ||
x-envoy-upstream-service-time: | ||
- '80' | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
Oops, something went wrong.