Skip to content

Commit 6884556

Browse files
authored
Merge pull request #103419 from aahill/ta-var-fix
fixing variable
2 parents 3be13c4 + 8b0c60b commit 6884556

File tree

1 file changed

+6
-6
lines changed
  • articles/cognitive-services/text-analytics/includes/quickstarts

1 file changed

+6
-6
lines changed

articles/cognitive-services/text-analytics/includes/quickstarts/python-sdk.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def sentiment_analysis_example(endpoint, key):
9999

100100
document = "I had the best day of my life. I wish you were there with me."
101101

102-
response = single_analyze_sentiment(endpoint=endpoint, key=key, input_text=document)
102+
response = single_analyze_sentiment(endpoint=endpoint, credential=key, input_text=document)
103103
print("Document Sentiment: {}".format(response.sentiment))
104104
print("Overall scores: positive={0:.3f}; neutral={1:.3f}; negative={2:.3f} \n".format(
105105
response.document_scores.positive,
@@ -172,7 +172,7 @@ from azure.ai.textanalytics import single_detect_language
172172
def language_detection_example(endpoint, key):
173173
try:
174174
document = "Ce document est rédigé en Français."
175-
response = single_detect_language(endpoint=endpoint, key=key, input_text= document)
175+
response = single_detect_language(endpoint=endpoint, credential=key, input_text= document)
176176
print("Language: ", response.primary_language.name)
177177

178178
except Exception as err:
@@ -222,7 +222,7 @@ def entity_recognition_example(endpoint, key):
222222

223223
try:
224224
document = "I had a wonderful trip to Seattle last week."
225-
result = single_recognize_entities(endpoint=endpoint, key=key, input_text= document)
225+
result = single_recognize_entities(endpoint=endpoint, credential=key, input_text= document)
226226

227227
print("Named Entities:\n")
228228
for entity in result.entities:
@@ -259,7 +259,7 @@ def entity_pii_example(endpoint, key):
259259
document = "Insurance policy for SSN on file 123-12-1234 is here by approved."
260260

261261

262-
result = single_recognize_pii_entities(endpoint=endpoint, key=key, input_text= document)
262+
result = single_recognize_pii_entities(endpoint=endpoint, credential=key, input_text= document)
263263

264264
print("Personally Identifiable Information Entities: ")
265265
for entity in result.entities:
@@ -293,7 +293,7 @@ def entity_linking_example(endpoint, key):
293293
During his career at Microsoft, Gates held the positions of chairman,
294294
chief executive officer, president and chief software architect,
295295
while also being the largest individual shareholder until May 2014."""
296-
result = single_recognize_linked_entities(endpoint=endpoint, key=key, input_text= document)
296+
result = single_recognize_linked_entities(endpoint=endpoint, credential=key, input_text= document)
297297

298298
print("Linked Entities:\n")
299299
for entity in result.entities:
@@ -423,7 +423,7 @@ def key_phrase_extraction_example(endpoint, key):
423423
try:
424424
document = "My cat might need to see a veterinarian."
425425

426-
response = single_extract_key_phrases(endpoint=endpoint, key=key, input_text= document)
426+
response = single_extract_key_phrases(endpoint=endpoint, credential=key, input_text= document)
427427

428428
if not response.is_error:
429429
print("\tKey Phrases:")

0 commit comments

Comments
 (0)