Skip to content

Commit 37c7062

Browse files
Merge pull request #272230 from laujan/245406-check-python-code
update python code
2 parents fd4c7c5 + a18dcc2 commit 37c7062

File tree

1 file changed

+14
-14
lines changed
  • articles/ai-services/document-intelligence/how-to-guides/includes/v4-0

1 file changed

+14
-14
lines changed

articles/ai-services/document-intelligence/how-to-guides/includes/v4-0/python-sdk.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ def analyze_read():
9898
# sample document
9999
formUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/read.png"
100100

101-
document_intelligence_client = DocumentIntelligenceClient(
101+
client = DocumentIntelligenceClient(
102102
endpoint=endpoint, credential=AzureKeyCredential(key)
103103
)
104104

105-
poller = document_intelligence_client.begin_analyze_document(
105+
poller = client.begin_analyze_document(
106106
"prebuilt-read", formUrl
107107
)
108108
result = poller.result()
@@ -174,11 +174,11 @@ def analyze_layout():
174174
# sample document
175175
formUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/layout.png"
176176

177-
document_intelligence_client = DocumentIntelligenceClient(
177+
client = DocumentIntelligenceClient(
178178
endpoint=endpoint, credential=AzureKeyCredential(key)
179179
)
180180

181-
poller = document_intelligence_client.begin_analyze_document(
181+
poller = client.begin_analyze_document(
182182
"prebuilt-layout", formUrl
183183
)
184184
result = poller.result()
@@ -295,9 +295,9 @@ def analyze_general_documents():
295295
docUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/sample-layout.pdf"
296296

297297
# create your `DocumentIntelligenceClient` instance and `AzureKeyCredential` variable
298-
document_intelligence_client = DocumentIntelligenceClient(endpoint=endpoint, credential=AzureKeyCredential(key))
298+
client = DocumentIntelligenceClient(endpoint=endpoint, credential=AzureKeyCredential(key))
299299

300-
poller = document_intelligence_client.begin_analyze_document(
300+
poller = client.begin_analyze_document(
301301
"prebuilt-document", docUrl)
302302
result = poller.result()
303303

@@ -416,11 +416,11 @@ def analyze_tax_us_w2():
416416
# sample document
417417
formUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/w2.png"
418418

419-
document_intelligence_client = DocumentIntelligenceClient(
419+
client = DocumentIntelligenceClient(
420420
endpoint=endpoint, credential=AzureKeyCredential(key)
421421
)
422422

423-
poller = document_intelligence_client.begin_analyze_document(
423+
poller = client.begin_analyze_document(
424424
"prebuilt-tax.us.w2", formUrl
425425
)
426426
w2s = poller.result()
@@ -747,11 +747,11 @@ def analyze_invoice():
747747

748748
invoiceUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/sample-invoice.pdf"
749749

750-
document_intelligence_client = DocumentIntelligenceClient(
750+
client = DocumentIntelligenceClient(
751751
endpoint=endpoint, credential=AzureKeyCredential(key)
752752
)
753753

754-
poller = document_intelligence_client.begin_analyze_document(
754+
poller = client.begin_analyze_document(
755755
"prebuilt-invoice", invoiceUrl)
756756
invoices = poller.result()
757757

@@ -1027,10 +1027,10 @@ def analyze_receipts():
10271027
# sample document
10281028
receiptUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/receipt.png"
10291029

1030-
document_intelligence_client = DocumentIntelligenceClient(
1030+
client = DocumentIntelligenceClient(
10311031
endpoint=endpoint, credential=AzureKeyCredential(key)
10321032
)
1033-
poller = document_intelligence_client.begin_analyze_document(
1033+
poller = client.begin_analyze_document(
10341034
"prebuilt-receipt", receiptUrl, locale="en-US"
10351035
)
10361036
receipts = poller.result()
@@ -1125,11 +1125,11 @@ def analyze_identity_documents():
11251125
# sample document
11261126
identityUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/identity_documents.png"
11271127

1128-
document_intelligence_client = DocumentIntelligenceClient(
1128+
client = DocumentIntelligenceClient(
11291129
endpoint=endpoint, credential=AzureKeyCredential(key)
11301130
)
11311131

1132-
poller = document_intelligence_client.begin_analyze_document(
1132+
poller =client.begin_analyze_document(
11331133
"prebuilt-idDocument", identityUrl
11341134
)
11351135
id_documents = poller.result()

0 commit comments

Comments
 (0)