Lesson 20 of 26 · see all lessons
Start here: the exam, Python basics and responsible AI (skill area 1, 40-45%)
AI models: how they work, choosing and deploying (skill area 1)
AI workloads: text, speech, vision and extraction (skill area 1)
Generative AI apps and agents in Foundry (skill area 2, 55-60%)
Text, speech, vision and extraction apps in Foundry (skill area 2)
- 17. Building a text analysis app
- 18. Building speech apps: spoken prompts and Azure Speech
- 19. Building vision apps: images in prompts and generated images
- 20. Extracting information with Content Understanding: documents and forms
- 21. Content Understanding for images, audio and video, and a small extraction app
Final review and four mock exams
18 min
Extracting information with Content Understanding: documents and forms
Use Azure Content Understanding analyzers and field schemas to pull fields from documents and forms.
By the end of this lesson you can
- Explain what Azure Content Understanding and an analyzer are
- Choose a prebuilt analyzer or define a field schema for a custom one
- Read Python that creates an analyzer, analyzes a form and reads fields with confidence
- Choose between Content Understanding and Document Intelligence
From earlier lessons · 1 of 2
Your vision app must send a local photo to a vision-capable model with the Responses API. How do you pass the photo?
Pick one answer.
From earlier lessons · 2 of 2
What is the difference between OCR and field extraction?
Pick one answer.
Every morning, two Fernhill Travel staff retype paper booking forms and supplier invoices into the booking system. They make typos, and the busy season is coming. The operations lead asks whether a tool can read the forms and hand over clean fields, with a flag when it isn't sure. That tool is Azure Content Understanding.
What Content Understanding is
Exam depth: know it cold.
Azure Content Understanding is a Foundry Tool that uses generative AI to turn documents, images, audio and video into a structured output you define. You need a Microsoft Foundry resource and deployed models it can use, such as a GPT model and an embedding model.
It returns two kinds of output:
- Content: the text and layout as Markdown, including tables and paragraphs.
- Fields: named values, such as a total or a customer name, with confidence scores from 0 to 1 and grounding, the spot in the file each value came from.
The current GA API version is 2025-11-01. Newer features arrive in a preview version first.
Analyzers: prebuilt or custom
Exam depth: know it cold.
An analyzer is a reusable configuration that says what content to process, what to extract and how to shape the output. You call it by its analyzer ID.
| Kind | Examples | Use it when |
|---|---|---|
| Content extraction | prebuilt-read, prebuilt-layout | You need only text, or text with tables and structure. |
| Domain-specific | prebuilt-invoice, prebuilt-receipt, prebuilt-idDocument | A common document type already has a model. |
| RAG | prebuilt-documentSearch | You feed content into search or a chat assistant. |
| Base | prebuilt-document, -image, -audio, -video | You build your own analyzer on top of one. |
| Custom | fernhill_booking | Your own form, with fields you define. |
Decision rule: a standard document type means a prebuilt analyzer. Your own form or fields means a custom analyzer built on prebuilt-document.
Fernhill Travel receives supplier invoices in many layouts. The team needs vendor name, invoice total and line items, with the least setup. Which analyzer should you use?
Pick one answer.
Field schemas: extract, generate, classify
Exam depth: know it cold.
A field schema lists the fields a custom analyzer returns. Each field has:
- A name, such as
total_price. - A type: string, number, boolean, date, object or array.
- A description, which works as a mini-prompt telling the model what to look for.
- A method:
- extract: copy the value as it appears, such as a date on a receipt. Documents only.
- generate: write a value from the content, such as a summary.
- classify: pick one value from a fixed list, set with
enum.
Extract fields need source and confidence turned on, so you get grounding and a confidence score for them.
from azure.ai.contentunderstanding.models import (ContentFieldSchema, ContentFieldDefinition, ContentFieldType, GenerationMethod,)field_schema = ContentFieldSchema(name="booking_form_schema",description="Fields from a Fernhill Travel booking form",fields={"lead_traveler": ContentFieldDefinition(type=ContentFieldType.STRING, method=GenerationMethod.EXTRACT,description="Full name of the lead traveler",estimate_source_and_confidence=True),"total_price": ContentFieldDefinition(type=ContentFieldType.NUMBER, method=GenerationMethod.EXTRACT,description="Total price of the booking",estimate_source_and_confidence=True),"trip_type": ContentFieldDefinition(type=ContentFieldType.STRING, method=GenerationMethod.CLASSIFY,description="Kind of trip booked", enum=["tour", "cruise", "other"]),"special_requests": ContentFieldDefinition(type=ContentFieldType.STRING, method=GenerationMethod.GENERATE,description="One-sentence summary of any special requests"),},)
Match
Match each booking-form field to the method it should use.
Pick an item on the left, then its match on the right.
A field must hold one of four values: "refund", "change", "complaint" or "other". Which method should the field use?
Pick one answer.
Read the code: create an analyzer and analyze a form
import osfrom azure.ai.contentunderstanding import ContentUnderstandingClientfrom azure.ai.contentunderstanding.models import ContentAnalyzer, ContentAnalyzerConfigfrom azure.core.credentials import AzureKeyCredentialclient = ContentUnderstandingClient(endpoint=os.environ["CONTENTUNDERSTANDING_ENDPOINT"],credential=AzureKeyCredential(os.environ["CONTENTUNDERSTANDING_KEY"]),)analyzer = ContentAnalyzer(base_analyzer_id="prebuilt-document",description="Fernhill Travel booking forms",config=ContentAnalyzerConfig(return_details=True),field_schema=field_schema,models={"completion": "gpt-5.2", "embedding": "text-embedding-3-large"},)client.begin_create_analyzer(analyzer_id="fernhill_booking", resource=analyzer).result()with open("booking_form.pdf", "rb") as f:poller = client.begin_analyze_binary(analyzer_id="fernhill_booking", binary_input=f.read())result = poller.result()for name, field in result.contents[0].fields.items():print(name, field.value, field.confidence)
Exam depth: know it cold.
- Line 2 imports
ContentUnderstandingClientfromazure-ai-contentunderstanding, installed with pip. - Lines 6-9 create the client from the endpoint and key.
DefaultAzureCredential()also works. - Lines 10-16 define the analyzer: base
prebuilt-document, a description, the schema from the last snippet, and the model names it uses. - Line 17 creates it under the ID
fernhill_bookingand waits with.result(). - Lines 19-21 send the PDF's bytes with
begin_analyze_binary. For a file online, usebegin_analyzewithinputs=[AnalysisInput(url=...)]. - Analysis is a long-running operation: the
begin_call returns a poller, and.result()waits until the analysis finishes. - Lines 23-24 read
result.contents[0].fields. Each field has.value,.confidenceand.source.
In the analyzer app, which line waits for the analysis to finish before you read fields?
Pick one answer.
Try it in the Foundry portal
Exam depth: recognize it.
- Go to Microsoft Foundry and open or create a project.
- Select Build, then Models on the left.
- Select the AI Services tab, then the Content Understanding playground.
- Select the gear icon and pick or deploy the models the analyzers need.
- Run an analyzer on the sample data, or upload a booking form.
- Examine the results formatted or as raw JSON.
- Delete the resource group when you finish, to stop charges.
Foundry shows Read, Layout and a subset of prebuilt analyzers. To build a custom analyzer with a schema and labeled samples, use Content Understanding Studio, its companion portal.
Content Understanding or Document Intelligence?
Exam depth: recognize it.
Azure Document Intelligence uses models trained for document parsing. It returns fields deterministically, fast, with no generative AI. Microsoft now presents it as part of the Content Understanding family.
| Document Intelligence | Content Understanding analyzers | |
|---|---|---|
| Best for | Standard, structured forms in high volume. | Varied layouts, unstructured text, inferred fields. |
| Input | Documents only. | Documents, images, audio and video. |
| Custom fields | Train a custom model with labeled samples. | Describe fields in plain words; no labels to start. |
| Generative AI | No. | Yes. |
Decision rule: standard form at scale, Document Intelligence. Varied content, generated fields or audio and video, Content Understanding.
Fernhill Travel receives free-form letters from partner hotels in many layouts. It needs each letter's hotel name and a generated one-line summary of what changed, without labeling samples first. What should you use?
Pick one answer.
Exam-style practice
Fernhill Travel wants forms with low-certainty totals sent to a person for review, and the reviewer must see where on the page each total came from. What should the analyzer return?
Pick one answer.
For each statement, select Yes if it is true. Statement: a Content Understanding analyzer that only needs the text and tables of scanned forms requires a field schema.
Pick one answer.
You build a custom analyzer for cruise brochures (PDF). Which value should base_analyzer_id have?
Pick one answer.
Worth keeping
- Content Understanding turns content into Markdown plus fields with confidence and grounding.
- Standard document type: prebuilt analyzer. Your own fields: custom analyzer on a base analyzer.
- Field methods: extract copies, generate writes, classify picks from an enum.
- In code: create the client, begin_analyze or begin_analyze_binary, poller.result(), read fields.
- Standard forms at scale: Document Intelligence. Varied or multimodal content: Content Understanding.
On the job
Write each field description like an instruction to a new colleague: where the value sits and what it looks like. Start with a prebuilt analyzer when one exists. Set a confidence threshold, such as 0.8, below which a person checks the form. Keep the grounding visible in your review screen, so checking takes seconds.
Booking forms now fill themselves in. Then the helpline manager has 400 call recordings from last week. She wants to know why people called. Next lesson, Content Understanding takes on images, audio and video.
Leaderboard
Loading…
50 XP for each lesson you finish, 10 for each right answer. Names show only for learners who turn on Show me on leaderboards.
Embed this practice on your site
Free for classrooms, blogs and study groups. Paste this into any page that accepts HTML.
Report a copyright problem with this lesson
Sources for this lesson (10)
Each fact in the lesson is marked with the number of the page it comes from.
- [2]Microsoft Learn: Study guide for Exam AI-901: Microsoft Azure AI Fundamentals
- [60]Microsoft Learn: What is Azure Content Understanding in Foundry Tools?
- [61]Microsoft Learn: Choose the right Azure AI tool for document processing
- [95]Microsoft Learn: Azure Content Understanding in Foundry Tools prebuilt analyzers
- [122]Microsoft Learn: Azure Content Understanding in Foundry Tools - What is an analyzer? Configuration and reference
- [123]Microsoft Learn: Azure AI Content Understanding client library for Python
- [124]Microsoft Learn: Quickstart: Azure Content Understanding in Foundry Tools
- [125]Microsoft Learn: Create a custom analyzer with Azure Content Understanding in Foundry Tools
- [126]Microsoft Learn: Quickstart: Try Content Understanding Studio or Microsoft Foundry
- [127]Microsoft Learn: Which model should I choose? (Document Intelligence)