@@ -79,7 +79,7 @@ def sentiment_analysis_example(endpoint, key):
79
79
80
80
document = " I had the best day of my life. I wish you were there with me."
81
81
82
- response = single_analyze_sentiment(endpoint = endpoint, key = key, input_text = document)
82
+ response = single_analyze_sentiment(endpoint = endpoint, credential = key, input_text = document)
83
83
print (" Document Sentiment: {} " .format(response.sentiment))
84
84
print (" Overall scores: positive={0:.3f } ; neutral={1:.3f } ; negative={2:.3f } \n " .format(
85
85
response.document_scores.positive,
@@ -133,7 +133,7 @@ from azure.ai.textanalytics import single_detect_language
133
133
def language_detection_example (endpoint , key ):
134
134
try :
135
135
document = " Ce document est rédigé en Français."
136
- response = single_detect_language(endpoint = endpoint, key = key, input_text = document)
136
+ response = single_detect_language(endpoint = endpoint, credential = key, input_text = document)
137
137
print (" Language: " , response.primary_language.name)
138
138
139
139
except Exception as err:
@@ -162,7 +162,7 @@ def entity_recognition_example(endpoint, key):
162
162
163
163
try :
164
164
document = " I had a wonderful trip to Seattle last week."
165
- result = single_recognize_entities(endpoint = endpoint, key = key, input_text = document)
165
+ result = single_recognize_entities(endpoint = endpoint, credential = key, input_text = document)
166
166
167
167
print (" Named Entities:\n " )
168
168
for entity in result.entities:
@@ -202,7 +202,7 @@ def entity_pii_example(endpoint, key):
202
202
document = " Insurance policy for SSN on file 123-12-1234 is here by approved."
203
203
204
204
205
- result = single_recognize_pii_entities(endpoint = endpoint, key = key, input_text = document)
205
+ result = single_recognize_pii_entities(endpoint = endpoint, credential = key, input_text = document)
206
206
207
207
print (" Personally Identifiable Information Entities: " )
208
208
for entity in result.entities:
@@ -235,7 +235,7 @@ def entity_linking_example(endpoint, key):
235
235
During his career at Microsoft, Gates held the positions of chairman,
236
236
chief executive officer, president and chief software architect,
237
237
while also being the largest individual shareholder until May 2014."""
238
- result = single_recognize_linked_entities(endpoint = endpoint, key = key, input_text = document)
238
+ result = single_recognize_linked_entities(endpoint = endpoint, credential = key, input_text = document)
239
239
240
240
print (" Linked Entities:\n " )
241
241
for entity in result.entities:
@@ -312,7 +312,7 @@ def key_phrase_extraction_example(endpoint, key):
312
312
try :
313
313
document = " My cat might need to see a veterinarian."
314
314
315
- response = single_extract_key_phrases(endpoint = endpoint, key = key, input_text = document)
315
+ response = single_extract_key_phrases(endpoint = endpoint, credential = key, input_text = document)
316
316
317
317
if not response.is_error:
318
318
print (" \t Key Phrases:" )
0 commit comments