hiexam
microsoft · AI-102 · Q655 · code_completion · azure_ai, document_analysis, python

HOTSPOT - You have an Azure subscription that contains an Azure AI Document Intelligence resource named DI1. You buil…

HOTSPOT - You have an Azure subscription that contains an Azure AI Document Intelligence resource named DI1. You build an app named App1 that analyzes PDF files for handwritten content by using DI1. You need to ensure that App1 will recognize the handwritten content. How should you complete the code? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point. //IMG//
document_analysis_client = DocumentAnalysisClient(
    endpoint=endpoint, credential=AzureKeyCredential(key)
)

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

result = poller.result()

for style in result.styles:
    if style.is_handwritten and style.confidence > {{slot2}}:

        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