AIFondry-ContentUnderstanding

🎓 Demo Scripts - Content Understanding Walkthrough

Overview

This folder contains a progressive 3-step walkthrough for Azure AI Foundry Content Understanding:

  1. Prebuilt analyzers for zero-configuration extraction from standard business documents
  2. Custom extraction for domain-specific entities, summaries, and document classification
  3. A multi-document pipeline that classifies, routes, and consolidates results across mixed inputs

Together, the demos move from simple document analysis to a production-style routing pipeline.

Prerequisites

Your repo root .env must include:

CONTENTUNDERSTANDING_ENDPOINT=https://<your-resource>.cognitiveservices.azure.com/
CONTENTUNDERSTANDING_KEY=<your-key>

Setup

From the repository root:

python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r demos\requirements.txt

Then make sure .env exists in the repo root. If needed, copy the template first:

Copy-Item .env.template .env

Update .env with:

Script Descriptions

01_prebuilt_analyzer.py

What it does

Key concepts demonstrated

How to run it

python demos\01_prebuilt_analyzer.py

Expected output

02_custom_entity_extractor.py

What it does

Key concepts demonstrated

How to run it

python demos\02_custom_entity_extractor.py

Expected output

03_multi_document_pipeline.py

What it does

Key concepts demonstrated

How to run it

python demos\03_multi_document_pipeline.py

Expected output

Key Concepts

Method Purpose Example in demos
extract Pull literal values directly from the document content People, organizations, dates, monetary amounts, and locations in 02_custom_entity_extractor.py
generate Produce AI-generated content derived from the source document summary and key_terms in 02_custom_entity_extractor.py, plus summary in 03_multi_document_pipeline.py
classify Assign the document to a category for routing or labeling document_type in 02_custom_entity_extractor.py, and category-based routing in 03_multi_document_pipeline.py

Confidence Scores

Use confidence scores as a lightweight decision policy:

Confidence Suggested action
> 0.85 Auto-approve
0.5 - 0.85 Send for human review
< 0.5 Reject or reprocess

This matches the color-coded thresholds used in the prebuilt analyzer demo.

Troubleshooting

Resources

See Also