Building an Information Extraction Application
This lesson explains how a lightweight extraction application submits content to an analyzer, waits for the asynchronous result and processes the fields, using the Python client library or the REST pattern.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the one-time setup that Content Understanding requires.
- Analyze content with the Python SDK.
- Describe the asynchronous REST pattern.
- Read fields and confidence values from a result.
One-time setup
Content Understanding runs on a Foundry resource. Before the first analysis, the resource needs deployments of a supported chat completion model (such as a GPT-5 series model) and an embedding model (text-embedding-3-large), registered as the resource's default deployments. Content Understanding Studio can configure the defaults, and deploy the models automatically, when you connect a resource; in code, a PATCH request to the defaults endpoint maps model names and aliases to deployment names.
Analyzing with the Python SDK
The client library is azure-ai-contentunderstanding. A ContentUnderstandingClient takes the resource endpoint, https://<resource>.services.ai.azure.com/, and a credential such as DefaultAzureCredential. begin_analyze() takes the analyzer ID and a list of inputs and returns a poller, because analysis is a long-running operation; poller.result() waits until it completes.
import os
from azure.identity import DefaultAzureCredential
from azure.ai.contentunderstanding import ContentUnderstandingClient
client = ContentUnderstandingClient(endpoint=os.environ["FOUNDRY_ENDPOINT"], credential=DefaultAzureCredential())
poller = client.begin_analyze(analyzer_id="prebuilt-invoice",
inputs=[{"url": "https://example.com/invoices/inv-1042.pdf"}])
result = poller.result() # waits for the asynchronous analysis
for content in result.contents:
print(content.markdown[:500])
print(content.fields)The REST pattern
With the REST API, the application sends POST /contentunderstanding/analyzers/{analyzerId}:analyze with the inputs. The response is 202 Accepted with an Operation-Location header. The application polls that URL until the status is Succeeded (or Failed) and then reads the result. Custom analyzers are created with PUT /contentunderstanding/analyzers/{analyzerId} and a definition that contains the base analyzer and field schema.
The following diagram shows the requests an application makes.

Analyze with REST
Reading results
The result's contents list has one entry per analyzed item (or per segment for video). Each entry has markdown and fields. Each field has a type, a type-specific value such as valueString, valueNumber, valueDate, valueArray or valueObject, a confidence score and source information. The application stores high-confidence values and routes low-confidence ones to a review queue.
Typed field values
A script that returns too early
A developer calls the analyze REST operation for a 40-page PDF and immediately reads the response body, which contains no fields.
Analysis is asynchronous: the first response only acknowledges the request. The script must read the Operation-Location header and poll it until the status is Succeeded, or use the SDK's begin_analyze() and call result() on the poller, which handles the polling.
What must be configured on the Foundry resource before Content Understanding can analyze content?
Show answer
Default chat and embedding model deployments, which Content Understanding uses.
Exam Tips
Remember for the exam
- Configure default chat and embedding model deployments on the resource first.
- begin_analyze() returns a poller; result() waits for completion.
- REST: POST :analyze, then poll Operation-Location until Succeeded.
- Fields carry type-specific values and confidence scores.