Skip to content

Commit f5217fa

Browse files
authored
[text analytics] default to API v4 (Azure#16886)
1 parent cafa7c6 commit f5217fa

File tree

586 files changed

+9011
-103698
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

586 files changed

+9011
-103698
lines changed

sdk/textanalytics/azure-ai-textanalytics/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ This table shows the relationship between SDK versions and supported API version
8181
| SDK version | Supported API version of service |
8282
| ------------------------------------------------------------------------- | --------------------------------- |
8383
| 5.0.0 - Latest GA release (can be installed by removing the `--pre` flag) | 3.0 |
84-
| 5.1.0b5 - Latest release (beta) | 3.0, 3.1-preview.2, 3.1-preview.3 |
84+
| 5.1.0b6 - Latest release (beta) | 3.0, 3.1-preview.4 |
8585

8686
### Authenticate the client
8787

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_base_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
class TextAnalyticsApiVersion(str, Enum):
1414
"""Text Analytics API versions supported by this package"""
1515

16-
V3_1_PREVIEW_4 = "v3.1-preview.4"
1716
#: this is the default version
18-
V3_1_PREVIEW = "v3.1-preview.3"
17+
V3_1_PREVIEW = "v3.1-preview.4"
18+
V3_1_PREVIEW_3 = "v3.1-preview.3"
1919
V3_0 = "v3.0"
2020

2121
def _authentication_policy(credential):

sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_pii_entities_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async def recognize_pii_entities_async(self):
8080
ssns = []
8181
for doc in docs:
8282
for entity in doc.entities:
83-
if entity.category == 'U.S. Social Security Number (SSN)' and entity.confidence_score >= 0.6:
83+
if entity.category == 'USSocialSecurityNumber' and entity.confidence_score >= 0.6:
8484
ssns.append(entity.text)
8585

8686
print("We have extracted the following SSNs as well: '{}'".format(

sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_pii_entities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def recognize_pii_entities(self):
7878
ssns = []
7979
for doc in docs:
8080
for entity in doc.entities:
81-
if entity.category == 'U.S. Social Security Number (SSN)' and entity.confidence_score >= 0.6:
81+
if entity.category == 'USSocialSecurityNumber' and entity.confidence_score >= 0.6:
8282
ssns.append(entity.text)
8383

8484
print("We have extracted the following SSNs as well: '{}'".format(

sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.test_all_successful_passing_dict_key_phrase_task.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,27 @@ interactions:
1717
Content-Type:
1818
- application/json
1919
User-Agent:
20-
- azsdk-python-ai-textanalytics/5.1.0b5 Python/3.8.5 (macOS-10.13.6-x86_64-i386-64bit)
20+
- azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit)
2121
method: POST
22-
uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze
22+
uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/analyze
2323
response:
2424
body:
2525
string: ''
2626
headers:
2727
apim-request-id:
28-
- 30e8a61d-806b-4600-b2b2-9ca08c6ed132
28+
- 5b776c71-84ed-4c81-a0a2-8fc8562e1c9a
2929
date:
30-
- Tue, 02 Feb 2021 03:17:41 GMT
30+
- Tue, 23 Feb 2021 17:04:20 GMT
3131
operation-location:
32-
- https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze/jobs/57e367bd-077c-4bdd-a6b2-921d7c886084_637478208000000000
32+
- https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/analyze/jobs/29e71533-7e8f-4e52-b450-3405040c5f49
3333
strict-transport-security:
3434
- max-age=31536000; includeSubDomains; preload
3535
transfer-encoding:
3636
- chunked
3737
x-content-type-options:
3838
- nosniff
3939
x-envoy-upstream-service-time:
40-
- '67'
40+
- '416'
4141
status:
4242
code: 202
4343
message: Accepted
@@ -51,29 +51,29 @@ interactions:
5151
Connection:
5252
- keep-alive
5353
User-Agent:
54-
- azsdk-python-ai-textanalytics/5.1.0b5 Python/3.8.5 (macOS-10.13.6-x86_64-i386-64bit)
54+
- azsdk-python-ai-textanalytics/5.1.0b6 Python/3.9.1 (macOS-10.13.6-x86_64-i386-64bit)
5555
method: GET
56-
uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.3/analyze/jobs/57e367bd-077c-4bdd-a6b2-921d7c886084_637478208000000000?showStats=True
56+
uri: https://westus2.api.cognitive.microsoft.com/text/analytics/v3.1-preview.4/analyze/jobs/29e71533-7e8f-4e52-b450-3405040c5f49?showStats=True
5757
response:
5858
body:
59-
string: '{"jobId":"57e367bd-077c-4bdd-a6b2-921d7c886084_637478208000000000","lastUpdateDateTime":"2021-02-02T03:17:42Z","createdDateTime":"2021-02-02T03:17:42Z","expirationDateTime":"2021-02-03T03:17:42Z","status":"succeeded","errors":[],"tasks":{"details":{"lastUpdateDateTime":"2021-02-02T03:17:42Z"},"completed":1,"failed":0,"inProgress":0,"total":1,"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-02-02T03:17:42.582121Z","results":{"statistics":{"documentsCount":2,"validDocumentsCount":2,"erroneousDocumentsCount":0,"transactionsCount":2},"documents":[{"id":"1","keyPhrases":["Bill
59+
string: '{"jobId":"29e71533-7e8f-4e52-b450-3405040c5f49","lastUpdateDateTime":"2021-02-23T17:04:21Z","createdDateTime":"2021-02-23T17:04:20Z","expirationDateTime":"2021-02-24T17:04:20Z","status":"succeeded","errors":[],"tasks":{"details":{"lastUpdateDateTime":"2021-02-23T17:04:21Z"},"completed":1,"failed":0,"inProgress":0,"total":1,"keyPhraseExtractionTasks":[{"lastUpdateDateTime":"2021-02-23T17:04:21.9303839Z","state":"succeeded","results":{"statistics":{"documentsCount":2,"validDocumentsCount":2,"erroneousDocumentsCount":0,"transactionsCount":2},"documents":[{"id":"1","keyPhrases":["Bill
6060
Gates","Paul Allen","Microsoft"],"statistics":{"charactersCount":50,"transactionsCount":1},"warnings":[]},{"id":"2","keyPhrases":["Bill
6161
Gates","Paul Allen","Microsoft"],"statistics":{"charactersCount":49,"transactionsCount":1},"warnings":[]}],"errors":[],"modelVersion":"2020-07-01"}}]}}'
6262
headers:
6363
apim-request-id:
64-
- 36d9908d-9a6e-4830-895d-20694c26c777
64+
- 7bb0726f-e8c9-41fe-baf8-ae8abcce68ce
6565
content-type:
6666
- application/json; charset=utf-8
6767
date:
68-
- Tue, 02 Feb 2021 03:17:46 GMT
68+
- Tue, 23 Feb 2021 17:04:25 GMT
6969
strict-transport-security:
7070
- max-age=31536000; includeSubDomains; preload
7171
transfer-encoding:
7272
- chunked
7373
x-content-type-options:
7474
- nosniff
7575
x-envoy-upstream-service-time:
76-
- '73'
76+
- '160'
7777
status:
7878
code: 200
7979
message: OK

0 commit comments

Comments
 (0)