Skip to content

Commit 35456c8

Browse files
author
Chris Tufts
committed
changed document to documents
1 parent 0fd195d commit 35456c8

File tree

1 file changed

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

1 file changed

+10
-10
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ Create a new function called `sentiment_analysis_example()` that takes the clien
132132
```python
133133
def sentiment_analysis_example(client):
134134

135-
document = ["I had the best day of my life. I wish you were there with me."]
136-
response = client.analyze_sentiment(documents = document)[0]
135+
documents = ["I had the best day of my life. I wish you were there with me."]
136+
response = client.analyze_sentiment(documents = documents)[0]
137137
print("Document Sentiment: {}".format(response.sentiment))
138138
print("Overall scores: positive={0:.2f}; neutral={1:.2f}; negative={2:.2f} \n".format(
139139
response.confidence_scores.positive,
@@ -202,8 +202,8 @@ Create a new function called `language_detection_example()` that takes the clien
202202
```python
203203
def language_detection_example(client):
204204
try:
205-
document = ["Ce document est rédigé en Français."]
206-
response = client.detect_language(documents = document, country_hint = 'us')[0]
205+
documents = ["Ce document est rédigé en Français."]
206+
response = client.detect_language(documents = documents, country_hint = 'us')[0]
207207
print("Language: ", response.primary_language.name)
208208

209209
except Exception as err:
@@ -249,8 +249,8 @@ Create a new function called `entity_recognition_example` that takes the client
249249
def entity_recognition_example(client):
250250

251251
try:
252-
document = ["I had a wonderful trip to Seattle last week."]
253-
result = client.recognize_entities(documents = document)[0]
252+
documents = ["I had a wonderful trip to Seattle last week."]
253+
result = client.recognize_entities(documents = documents)[0]
254254

255255
print("Named Entities:\n")
256256
for entity in result.entities:
@@ -282,12 +282,12 @@ Create a new function called `entity_linking_example()` that takes the client as
282282
def entity_linking_example(client):
283283

284284
try:
285-
document = ["""Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975,
285+
documents = ["""Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975,
286286
to develop and sell BASIC interpreters for the Altair 8800.
287287
During his career at Microsoft, Gates held the positions of chairman,
288288
chief executive officer, president and chief software architect,
289289
while also being the largest individual shareholder until May 2014."""]
290-
result = client.recognize_linked_entities(documents = document)[0]
290+
result = client.recognize_linked_entities(documents = documents)[0]
291291

292292
print("Linked Entities:\n")
293293
for entity in result.entities:
@@ -412,9 +412,9 @@ Create a new function called `key_phrase_extraction_example()` that takes the cl
412412
def key_phrase_extraction_example(client):
413413

414414
try:
415-
document = ["My cat might need to see a veterinarian."]
415+
documents = ["My cat might need to see a veterinarian."]
416416

417-
response = client.extract_key_phrases(documents = document)[0]
417+
response = client.extract_key_phrases(documents = documents)[0]
418418

419419
if not response.is_error:
420420
print("\tKey Phrases:")

0 commit comments

Comments
 (0)