hiexam
microsoft · AI-102 · Q282 · code_completion · azure_sdk, python, document_analysis

Complete the Python snippet to configure the DocumentAnalysisClient and process handwritten content with confidence abo…

Complete the Python snippet to configure the DocumentAnalysisClient and process handwritten content with confidence above a threshold.
document_analysis_client = DocumentAnalysisClient(
    endpoint=endpoint, credential=AzureKeyCredential(key)
)

with open("<filePath>", "rb") as f:
    poller = document_analysis_client.begin_analyze_document(
        document=f,
        model="{{model}}"
    )

result = poller.result()
for style in result.styles:
    if style.is_handwritten and style.confidence > {{confidence_threshold}}:
        print("Document contains handwritten content:")
        print("".join(result.content[span.offset : span.offset + span.length] for span in style.spans))
Correct slot values

Answer hidden

Unlock AI-102

First 5 questions of every exam are free. Unlock the rest.

Includes
  • · All — questions
  • · Verified answers + AI explanations
  • · Spaced-repetition mistake notebook
  • · Phone, tablet, laptop sync

One-time payment. Doesn't auto-renew. · Already paid? Sign in