Skip to content

Commit 803e9e4

Browse files
[textanalytics] correct cspell errors (Azure#23035)
* correct cspell errors for TA * rerecord tests where the input was changed due to spelling
1 parent e510962 commit 803e9e4

16 files changed

+299
-161
lines changed

.vscode/cspell.json

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
"sdk/translation/azure-ai-translation-document/samples/assets/**",
106106
"sdk/translation/azure-ai-translation-document/tests/glossaries-valid.csv",
107107
"sdk/tables/azure-data-tables/**",
108-
"sdk/textanalytics/azure-ai-textanalytics/**",
109108
"sdk/storage/azure-storage-blob/**",
110109
"eng/**/*.json",
111110
"eng/*.txt",
@@ -209,11 +208,13 @@
209208
"pschema",
210209
"PSECRET",
211210
"pygobject",
211+
"parameterizing",
212212
"pytz",
213213
"pywin",
214214
"rdbms",
215215
"reauthenticated",
216216
"reimage",
217+
"revascularization",
217218
"rollup",
218219
"rtsp",
219220
"rtype",
@@ -239,6 +240,7 @@
239240
"urandom",
240241
"urlsafeb",
241242
"urlunparse",
243+
"usgov",
242244
"usdodcentral",
243245
"usdodeast",
244246
"usgovarizona",
@@ -276,6 +278,51 @@
276278
"words": [
277279
"essai"
278280
]
281+
},
282+
{
283+
"filename": "sdk/textanalytics/azure-ai-textanalytics/**",
284+
"words": [
285+
"Forndexter",
286+
"ESDNI",
287+
"dinero",
288+
"IOHTTP",
289+
"Zocor",
290+
"dann",
291+
"dont",
292+
"UMLS",
293+
"nach",
294+
"año",
295+
"BRCPF",
296+
"abril",
297+
"zalgo",
298+
"n'était",
299+
"tengo",
300+
"IDRG",
301+
"était",
302+
"gegründet",
303+
"L'hôtel",
304+
"Hola",
305+
"hola",
306+
"escrito",
307+
"Coumadin",
308+
"EUGPS",
309+
"dokument",
310+
"wurde",
311+
"Detta",
312+
"IFIC",
313+
"Fahrt",
314+
"documento",
315+
"scritto",
316+
"USUK",
317+
"Sprache",
318+
"PLREGON",
319+
"Fusce",
320+
"Inigo",
321+
"italiano",
322+
"skrivet",
323+
"verfasst",
324+
"engelska"
325+
]
279326
}
280327
],
281328
"allowCompoundWords": true

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ This version uses a next-generation code generator that *might* introduce breaki
350350
At a glance:
351351

352352
- "is" should not be used at all.
353-
- "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered.
353+
- "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be preferred.
354354

355355
**Bugfixes**
356356

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ class HealthcareRelationRole(DictMixin):
588588
589589
For example, in "The subject took 100 mg of ibuprofen",
590590
"100 mg" is a dosage entity fulfilling the role "Dosage"
591-
in the extracted relation "DosageofMedication".
591+
in the extracted relation "DosageOfMedication".
592592
593593
:ivar name: The role of the entity in the relationship. I.e., in the relation
594594
"The subject took 100 mg of ibuprofen", the dosage entity "100 mg" has role
@@ -606,10 +606,10 @@ def __init__(self, **kwargs):
606606

607607
@staticmethod
608608
def _get_entity(healthcare_role_result, entities):
609-
nums = _get_indices(healthcare_role_result.ref)
610-
entity_index = nums[
609+
numbers = _get_indices(healthcare_role_result.ref)
610+
entity_index = numbers[
611611
1
612-
] # first num parsed from index is document #, second is entity index
612+
] # first number parsed from index is document #, second is entity index
613613
return entities[entity_index]
614614

615615
@classmethod
@@ -1559,9 +1559,9 @@ def _get_assessments(
15591559
]
15601560
assessments = []
15611561
for assessment_relation in assessment_relations:
1562-
nums = _get_indices(assessment_relation)
1563-
sentence_index = nums[1]
1564-
assessment_index = nums[2]
1562+
numbers = _get_indices(assessment_relation)
1563+
sentence_index = numbers[1]
1564+
assessment_index = numbers[2]
15651565
assessments.append(
15661566
sentiment.sentences[sentence_index].assessments[assessment_index]
15671567
)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async def sample_extract_key_phrases_async():
4141
articles = [
4242
"""
4343
Washington, D.C. Autumn in DC is a uniquely beautiful season. The leaves fall from the trees
44-
in a city chockful of forrests, leaving yellow leaves on the ground and a clearer view of the
44+
in a city chock-full of forests, leaving yellow leaves on the ground and a clearer view of the
4545
blue sky above...
4646
""",
4747
"""

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async def sample_recognize_linked_entities_async():
4747
Microsoft was founded by Bill Gates with some friends he met at Harvard. One of his friends,
4848
Steve Ballmer, eventually became CEO after Bill Gates as well. Steve Ballmer eventually stepped
4949
down as CEO of Microsoft, and was succeeded by Satya Nadella.
50-
Microsoft originally moved its headquarters to Bellevue, Wahsington in Januaray 1979, but is now
50+
Microsoft originally moved its headquarters to Bellevue, Washington in January 1979, but is now
5151
headquartered in Redmond.
5252
"""
5353
]

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
async def sample_recognize_pii_entities_async():
3030
print(
3131
"In this sample we will be going through our customer's loan payment information and redacting "
32-
"all PII (personally identifable information) before storing this information on our public website. "
32+
"all PII (personally identifiable information) before storing this information on our public website. "
3333
"I'm also looking to explicitly extract the SSN information, so I can update my database with SSNs for "
3434
"our customers"
3535
)
@@ -73,14 +73,14 @@ async def sample_recognize_pii_entities_async():
7373
"I also want to be fairly confident that what I'm storing is an SSN, so let's also "
7474
"ensure that we're > 60% positive the entity is a SSN"
7575
)
76-
ssns = []
76+
social_security_numbers = []
7777
for doc in docs:
7878
for entity in doc.entities:
7979
if entity.category == 'USSocialSecurityNumber' and entity.confidence_score >= 0.6:
80-
ssns.append(entity.text)
80+
social_security_numbers.append(entity.text)
8181

8282
print("We have extracted the following SSNs as well: '{}'".format(
83-
"', '".join(ssns)
83+
"', '".join(social_security_numbers)
8484
))
8585

8686

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def sample_extract_key_phrases():
4040
articles = [
4141
"""
4242
Washington, D.C. Autumn in DC is a uniquely beautiful season. The leaves fall from the trees
43-
in a city chockful of forrests, leaving yellow leaves on the ground and a clearer view of the
43+
in a city chock-full of forests, leaving yellow leaves on the ground and a clearer view of the
4444
blue sky above...
4545
""",
4646
"""

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def sample_recognize_linked_entities():
4747
Microsoft was founded by Bill Gates with some friends he met at Harvard. One of his friends,
4848
Steve Ballmer, eventually became CEO after Bill Gates as well. Steve Ballmer eventually stepped
4949
down as CEO of Microsoft, and was succeeded by Satya Nadella.
50-
Microsoft originally moved its headquarters to Bellevue, Wahsington in Januaray 1979, but is now
50+
Microsoft originally moved its headquarters to Bellevue, Washington in January 1979, but is now
5151
headquartered in Redmond.
5252
"""
5353
]

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
def sample_recognize_pii_entities():
2929
print(
3030
"In this sample we will be going through our customer's loan payment information and redacting "
31-
"all PII (personally identifable information) before storing this information on our public website. "
31+
"all PII (personally identifiable information) before storing this information on our public website. "
3232
"I'm also looking to explicitly extract the SSN information, so I can update my database with SSNs for "
3333
"our customers"
3434
)
@@ -71,14 +71,14 @@ def sample_recognize_pii_entities():
7171
"I also want to be fairly confident that what I'm storing is an SSN, so let's also "
7272
"ensure that we're > 60% positive the entity is a SSN"
7373
)
74-
ssns = []
74+
social_security_numbers = []
7575
for doc in docs:
7676
for entity in doc.entities:
7777
if entity.category == 'USSocialSecurityNumber' and entity.confidence_score >= 0.6:
78-
ssns.append(entity.text)
78+
social_security_numbers.append(entity.text)
7979

8080
print("We have extracted the following SSNs as well: '{}'".format(
81-
"', '".join(ssns)
81+
"', '".join(social_security_numbers)
8282
))
8383

8484

sdk/textanalytics/azure-ai-textanalytics/tests/recordings/test_analyze.pyTestAnalyzetest_all_successful_passing_dict_extract_summary_action.json

Lines changed: 54 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,83 @@
77
"Accept": "application/json, text/json",
88
"Accept-Encoding": "gzip, deflate",
99
"Connection": "keep-alive",
10-
"Content-Length": "2177",
10+
"Content-Length": "2179",
1111
"Content-Type": "application/json",
1212
"User-Agent": "azsdk-python-ai-textanalytics/5.2.0b3 Python/3.10.0 (Windows-10-10.0.22000-SP0)",
13-
"x-ms-client-request-id": "25293ed1-5d0f-11ec-aac3-b831b58100e8"
13+
"x-ms-client-request-id": "6e622223-8b89-11ec-91fe-b831b58100e8"
14+
},
15+
"RequestBody": {
16+
"tasks": {
17+
"entityRecognitionTasks": [],
18+
"entityRecognitionPiiTasks": [],
19+
"keyPhraseExtractionTasks": [],
20+
"entityLinkingTasks": [],
21+
"sentimentAnalysisTasks": [],
22+
"extractiveSummarizationTasks": [
23+
{
24+
"parameters": {
25+
"stringIndexType": "UnicodeCodePoint"
26+
},
27+
"taskName": "0"
28+
}
29+
],
30+
"customEntityRecognitionTasks": [],
31+
"customSingleClassificationTasks": [],
32+
"customMultiClassificationTasks": []
33+
},
34+
"analysisInput": {
35+
"documents": [
36+
{
37+
"id": "1",
38+
"text": "The government of British Prime Minster Theresa May has been plunged into turmoil with the resignation of two senior Cabinet ministers in a deep split over her Brexit strategy. The Foreign Secretary Boris Johnson, quit on Monday, hours after the resignation late on Sunday night of the minister in charge of Brexit negotiations, David Davis. Their decision to leave the government came three days after May appeared to have agreed a deal with her fractured Cabinet on the UK\u0027s post Brexit relationship with the EU. That plan is now in tatters and her political future appears uncertain. May appeared in Parliament on Monday afternoon to defend her plan, minutes after Downing Street confirmed the departure of Johnson. May acknowledged the splits in her statement to MPs, saying of the ministers who quit: We do not agree about the best way of delivering our shared commitment to honoring the result of the referendum. The Prime Minister\u0027s latest political drama began late on Sunday night when Davis quit, declaring he could not support May\u0027s Brexit plan. He said it involved too close a relationship with the EU and gave only an illusion of control being returned to the UK after it left the EU. It seems to me we\u0027re giving too much away, too easily, and that\u0027s a dangerous strategy at this time, Davis said in a BBC radio interview Monday morning. Johnson\u0027s resignation came Monday afternoon local time, just before the Prime Minister was due to make a scheduled statement in Parliament. This afternoon, the Prime Minister accepted the resignation of Boris Johnson as Foreign Secretary, a statement from Downing Street said.",
39+
"language": "en"
40+
},
41+
{
42+
"id": "2",
43+
"text": "Microsoft fue fundado por Bill Gates y Paul Allen",
44+
"language": "es"
45+
}
46+
]
47+
}
1448
},
15-
"RequestBody": "{\u0022tasks\u0022: {\u0022entityRecognitionTasks\u0022: [], \u0022entityRecognitionPiiTasks\u0022: [], \u0022keyPhraseExtractionTasks\u0022: [], \u0022entityLinkingTasks\u0022: [], \u0022sentimentAnalysisTasks\u0022: [], \u0022extractiveSummarizationTasks\u0022: [{\u0022parameters\u0022: {\u0022stringIndexType\u0022: \u0022UnicodeCodePoint\u0022}, \u0022taskName\u0022: \u00220\u0022}], \u0022customEntityRecognitionTasks\u0022: [], \u0022customSingleClassificationTasks\u0022: [], \u0022customMultiClassificationTasks\u0022: []}, \u0022analysisInput\u0022: {\u0022documents\u0022: [{\u0022id\u0022: \u00221\u0022, \u0022text\u0022: \u0022The government of British Prime Minster Theresa May has been plunged into turmoil with the resignation of two senior Cabinet ministers in a deep split over her Brexit strategy. The Foreign Secretary Boris Johnson, quit on Monday, hours after the resignation late on Sunday night of the minister in charge of Brexit negotiations, David Davis. Their decision to leave the government came three days after May appeared to have agreed a deal with herfractured Cabinet on the UK\u0027s post Brexit relationship with the EU. That plan is now in tatters and her political future appears uncertain. May appeared in Parliament on Monday afternoon to defend her plan, minutes after Downing Street confirmed the departure of Johnson. May acknowledged the splits in her statement to MPs, saying of the ministers who quit: We do not agree about the best way of delivering our shared commitment to honoring the result of the referendum. The Prime Minister\u0027s latest plitical drama began late on Sunday night when Davis quit, declaring he could not support May\u0027s Brexit plan. He said it involved too close a relationship with the EU and gave only an illusion of control being returned to the UK after it left the EU. It seems to me we\u0027re giving too much away, too easily, and that\u0027s a dangerous strategy at this time, Davis said in a BBC radio interview Monday morning. Johnson\u0027s resignation came Monday afternoon local time, just before the Prime Minister was due to make a scheduled statement in Parliament. This afternoon, the Prime Minister accepted the resignation of Boris Johnson as Foreign Secretary, a statement from Downing Street said.\u0022, \u0022language\u0022: \u0022en\u0022}, {\u0022id\u0022: \u00222\u0022, \u0022text\u0022: \u0022Microsoft fue fundado por Bill Gates y Paul Allen\u0022, \u0022language\u0022: \u0022es\u0022}]}}",
1649
"StatusCode": 202,
1750
"ResponseHeaders": {
18-
"apim-request-id": "a03b6b25-f013-4368-bd31-ad425c9179ac",
19-
"Date": "Tue, 14 Dec 2021 18:53:37 GMT",
20-
"operation-location": "https://fakeendpoint.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/0a0d1391-60f6-4b43-8d4f-41abe9f6f861",
51+
"apim-request-id": "45d67f8b-1922-42c0-a6d6-7190deabb9e7",
52+
"Date": "Fri, 11 Feb 2022 22:24:52 GMT",
53+
"operation-location": "https://fakeendpoint.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/ffafe0bd-e704-47e3-806d-cdcbdcf27232",
2154
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
2255
"Transfer-Encoding": "chunked",
2356
"X-Content-Type-Options": "nosniff",
24-
"x-envoy-upstream-service-time": "217"
57+
"x-envoy-upstream-service-time": "149"
2558
},
2659
"ResponseBody": null
2760
},
2861
{
29-
"RequestUri": "https://fakeendpoint.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/0a0d1391-60f6-4b43-8d4f-41abe9f6f861?showStats=True",
62+
"RequestUri": "https://fakeendpoint.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/ffafe0bd-e704-47e3-806d-cdcbdcf27232?showStats=True",
3063
"RequestMethod": "GET",
3164
"RequestHeaders": {
3265
"Accept": "*/*",
3366
"Accept-Encoding": "gzip, deflate",
3467
"Connection": "keep-alive",
3568
"User-Agent": "azsdk-python-ai-textanalytics/5.2.0b3 Python/3.10.0 (Windows-10-10.0.22000-SP0)",
36-
"x-ms-client-request-id": "25293ed1-5d0f-11ec-aac3-b831b58100e8"
69+
"x-ms-client-request-id": "6e622223-8b89-11ec-91fe-b831b58100e8"
3770
},
3871
"RequestBody": null,
3972
"StatusCode": 200,
4073
"ResponseHeaders": {
41-
"apim-request-id": "3fa18449-f763-4f73-b925-eae5942bf462",
74+
"apim-request-id": "107fe20e-9cdf-4723-8766-128bad85a9b3",
4275
"Content-Type": "application/json; charset=utf-8",
43-
"Date": "Tue, 14 Dec 2021 18:53:42 GMT",
76+
"Date": "Fri, 11 Feb 2022 22:24:57 GMT",
4477
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
4578
"Transfer-Encoding": "chunked",
4679
"X-Content-Type-Options": "nosniff",
47-
"x-envoy-upstream-service-time": "114"
80+
"x-envoy-upstream-service-time": "86"
4881
},
4982
"ResponseBody": {
50-
"jobId": "0a0d1391-60f6-4b43-8d4f-41abe9f6f861",
51-
"lastUpdateDateTime": "2021-12-14T18:53:41Z",
52-
"createdDateTime": "2021-12-14T18:53:37Z",
53-
"expirationDateTime": "2021-12-15T18:53:37Z",
83+
"jobId": "ffafe0bd-e704-47e3-806d-cdcbdcf27232",
84+
"lastUpdateDateTime": "2022-02-11T22:24:55Z",
85+
"createdDateTime": "2022-02-11T22:24:52Z",
86+
"expirationDateTime": "2022-02-12T22:24:52Z",
5487
"status": "succeeded",
5588
"errors": [],
5689
"tasks": {
@@ -60,7 +93,7 @@
6093
"total": 1,
6194
"extractiveSummarizationTasks": [
6295
{
63-
"lastUpdateDateTime": "2021-12-14T18:53:41.3509318Z",
96+
"lastUpdateDateTime": "2022-02-11T22:24:55.9540887Z",
6497
"taskName": "0",
6598
"state": "succeeded",
6699
"results": {
@@ -74,7 +107,7 @@
74107
{
75108
"id": "1",
76109
"statistics": {
77-
"charactersCount": 1625,
110+
"charactersCount": 1627,
78111
"transactionsCount": 2
79112
},
80113
"sentences": [
@@ -91,10 +124,10 @@
91124
"length": 164
92125
},
93126
{
94-
"text": "Their decision to leave the government came three days after May appeared to have agreed a deal with herfractured Cabinet on the UK\u0027s post Brexit relationship with the EU.",
95-
"rankScore": 0.47,
127+
"text": "Their decision to leave the government came three days after May appeared to have agreed a deal with her fractured Cabinet on the UK\u0027s post Brexit relationship with the EU.",
128+
"rankScore": 0.56,
96129
"offset": 342,
97-
"length": 171
130+
"length": 172
98131
}
99132
],
100133
"warnings": []

0 commit comments

Comments
 (0)