Implement Information Extraction Solutions · Topic 2 of 2

Extracting Content from Documents

AI-103 document extraction: OCR, layout and field extraction pipelines, Azure Content Understanding analyzers, and markdown output for agents and RAG.

  • 3 min
In a nutshell
  • Pipeline: OCR, layout analysis, field extraction, structured or markdown output.
  • Content Understanding uses analyzers; custom analyzers use a field schema.
  • Markdown output preserves structure and suits RAG and agents.

What it is

Many documents, such as invoices, forms, contracts and reports, mix text, tables and layout. Document extraction turns them into clean, structured content: plain text, tables, key fields and markdown that apps, agents and RAG pipelines can use. In Foundry, Azure Content Understanding is the main service for this, and Azure Document Intelligence provides prebuilt and custom document models.

DocumentPDF, scan, imageOCRread textLayouttables, headingsField extractionanalyzerMarkdown or JSONfor agents and RAG

How it works

The extraction pipeline

StepWhat it does
OCRReads printed and handwritten text from scans and images
Layout analysisFinds paragraphs, headings, tables, selection marks and reading order
Field extractionPulls named values, such as invoice number, total and due date
OutputReturns structured JSON fields, or markdown that keeps headings and tables

Azure Content Understanding

Content Understanding processes documents, images, audio and video with analyzers:

  • Prebuilt analyzers cover common needs such as reading document content.
  • Custom analyzers define a field schema: the fields you want, their types and descriptions. The service extracts them using generative models and returns them in a consistent structure.
  • Outputs can include markdown with headings and tables preserved, which is well suited to chunking for RAG and to passing to agents.
  • Results can include grounding, such as where in the document a value was found, and confidence information, so you can review uncertain values.

Document Intelligence

Model typeUse
ReadExtract text (OCR)
LayoutExtract text, tables and structure
Prebuilt modelsCommon documents such as invoices, receipts and ID documents
Custom modelsYour own forms, trained on labeled samples

Choosing outputs for downstream use

Downstream useBest output
RAG over long reportsMarkdown with headings and tables kept, then chunked
Business process, such as paying invoicesStructured fields in JSON
Agent answering about a documentClean markdown plus key fields
Audit and reviewFields with source location and confidence

A worked example: an accounts team receives invoices as scanned PDFs. A Content Understanding custom analyzer defines vendor name, invoice number, line items and total. Low-confidence values go to a person for review; the rest flow into the finance system. The same documents are also converted to markdown and indexed so an agent can answer questions about them.

Exam tip

Markdown output keeps a table as a table. Plain OCR text can scramble rows and columns, which confuses both search and the model.

How the exam asks about this

  • "Extract the same fields from many different invoice layouts." Content Understanding custom analyzer, or a Document Intelligence prebuilt invoice model.
  • "Prepare long reports with tables for RAG." Extract to markdown, then chunk and index.
  • "Read handwriting on scanned forms." OCR in the extraction pipeline.

What to remember for the exam

  • Pipeline: OCR, layout analysis, field extraction, structured or markdown output.
  • Content Understanding uses analyzers; custom analyzers use a field schema.
  • Markdown output preserves structure and suits RAG and agents.
  • Document Intelligence offers read, layout, prebuilt and custom models.
  • Use source locations and confidence to route uncertain values to review.
Watch out

Plain text extraction alone loses table structure. Use layout-aware extraction when documents contain tables.

Common mistakes

Indexing raw OCR text for table-heavy documents. Use layout-aware markdown.

Hard-coding positions for varied layouts. Use analyzers or models that understand fields.

Trusting every extracted value. Check confidence and review low-confidence fields.

Check yourself

  • What does a Content Understanding custom analyzer need you to define?

    A field schema: the fields to extract, with their types and descriptions.

  • Why is markdown output useful for RAG?

    It keeps headings and tables, so chunks keep their structure and meaning.

  • What are the main steps of document extraction?

    OCR, layout analysis, field extraction and structured or markdown output.

Topic 2 of 2 in Implement Information Extraction Solutions

Test yourself on Implement Information Extraction Solutions

The full Microsoft AI-103 question bank has 648 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Microsoft. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.