@@ -99,7 +99,7 @@ def sentiment_analysis_example(endpoint, key):
99
99
100
100
document = " I had the best day of my life. I wish you were there with me."
101
101
102
- response = single_analyze_sentiment(endpoint = endpoint, key = key, input_text = document)
102
+ response = single_analyze_sentiment(endpoint = endpoint, credential = key, input_text = document)
103
103
print (" Document Sentiment: {} " .format(response.sentiment))
104
104
print (" Overall scores: positive={0:.3f } ; neutral={1:.3f } ; negative={2:.3f } \n " .format(
105
105
response.document_scores.positive,
@@ -172,7 +172,7 @@ from azure.ai.textanalytics import single_detect_language
172
172
def language_detection_example (endpoint , key ):
173
173
try :
174
174
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)
176
176
print (" Language: " , response.primary_language.name)
177
177
178
178
except Exception as err:
@@ -222,7 +222,7 @@ def entity_recognition_example(endpoint, key):
222
222
223
223
try :
224
224
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)
226
226
227
227
print (" Named Entities:\n " )
228
228
for entity in result.entities:
@@ -259,7 +259,7 @@ def entity_pii_example(endpoint, key):
259
259
document = " Insurance policy for SSN on file 123-12-1234 is here by approved."
260
260
261
261
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)
263
263
264
264
print (" Personally Identifiable Information Entities: " )
265
265
for entity in result.entities:
@@ -293,7 +293,7 @@ def entity_linking_example(endpoint, key):
293
293
During his career at Microsoft, Gates held the positions of chairman,
294
294
chief executive officer, president and chief software architect,
295
295
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)
297
297
298
298
print (" Linked Entities:\n " )
299
299
for entity in result.entities:
@@ -423,7 +423,7 @@ def key_phrase_extraction_example(endpoint, key):
423
423
try :
424
424
document = " My cat might need to see a veterinarian."
425
425
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)
427
427
428
428
if not response.is_error:
429
429
print (" \t Key Phrases:" )
0 commit comments