Extract Entities, Summaries and Structured JSON
30-second answer
Use Azure Language in Foundry Tools when you want fixed, predictable output: named entity recognition (people, places, dates, with confidence scores), PII redaction and summaries. Use a model deployment when you need your own fields. Ask for JSON mode and you only get valid JSON. Ask with structured outputs (a JSON schema with strict: true, every field required) and the reply follows your shape every time. For domain summaries such as compliance, don't train anything first: give the model a role, a checklist, a glossary and one example at temperature 0. For your own entity types at high volume, train custom NER.
Simulate it » No Azure account neededExam objective: 4.1.1 Extract entities, topics, summaries and structured JSON outputs by using generative prompting and Foundry Tools. 4.1.4 Customize language model outputs for domain tasks, such as compliance summarization and domain extraction. (Skills measured as of April 16, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
In your Foundry project open <strong>Discover → Foundry Tools</strong> and pick <strong>Azure Language</strong>. It runs on the same Foundry resource as your models.
👆 Click the glowing item in the portal to continue
Read the steps as text
- In your Foundry project open Discover → Foundry Tools and pick Azure Language. It runs on the same Foundry resource as your models.
- Pick Extract named entities and paste a support ticket. These capabilities are fixed: same input, same output shape, every time.
- Each entity has a category and a confidence score. Look at the order number: that's the limit of prebuilt NER.
- Now try a model. In Build → Playgrounds, pick your gpt-4.1-mini deployment and tell it to extract fields. Temperature 0 keeps extraction steady.
- Write the shape you need as a JSON schema: every property listed in required, and additionalProperties: false. Strict mode needs both.
- In code, structured outputs go in text.format (Responses API) or response_format (Chat Completions). The reply now matches your schema every time.
- For domain tasks like compliance summaries, the instructions carry the domain: the role, a checklist, a glossary and a couple of worked examples. Fine-tune only if that still can't hold the format.
🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.
🖱️ Drag to rotate · scroll or pinch to zoom
Entities and strict JSON
A support ticket goes to Azure Language for named entities (fixed categories, confidence scores) or to a model deployment that can return any shape you ask for. A model needs a JSON schema with strict: true before code can trust the fields. JSON mode only promises valid JSON.
🤔 What happens if…
Read this tour as text
- Entities and strict JSON. A support ticket goes to Azure Language for named entities (fixed categories, confidence scores) or to a model deployment that can return any shape you ask for. A model needs a JSON schema with strict: true before code can trust the fields. JSON mode only promises valid JSON.
- Domain summaries and custom extraction. A plain summary drops what an auditor needs. A domain prompt (role, checklist, glossary, one worked example, temperature 0) fixes that without training. For the same fields at high volume, custom named entity recognition in Azure Language learns your own entity types from labelled examples.
- Sentiment and tone. Sentiment analysis returns positive, neutral, negative or mixed with confidence scores, and opinion mining ties each opinion to its target. It is cheap and steady, but it reads “Oh great, another hour on hold” as positive. For tone, ask a model for a label from an enum.
- Safety, PII and Prompt Shields. Content Safety scores Hate, Sexual, Violence and Self-harm at severity 0, 2, 4 or 6 and you choose the block threshold. PII detection can redact only the categories your policy lists. Prompt Shields checks the user prompt and any document for hidden instructions.
- Translator or an LLM. Azure Translator returns many target languages in one fast call, per character. A dynamic dictionary or Custom Translator protects brand names. An LLM translation flow follows tone and formatting rules written in plain words, but it costs more and can vary, so evaluate it first.
- A voice for the agent. Speech to text turns the caller into words, the agent answers, and text to speech with a neural voice speaks the reply. SSML controls pauses and rate. A phrase list boosts a few words; custom speech is for many terms, accents or noise. Voice Live runs the loop over one low-latency connection.
- Translate speech and reason over audio. Speech translation recognises one spoken language and returns text in several in one pass, and can speak the result. When the question is about how something was said, send the audio to an audio-capable model such as gpt-4o-audio-preview. A text-only deployment rejects input_audio.
Fabrikam's support tickets arrive as free text. Your app must pull out who, what and when, mask personal data, summarise each ticket, and hand the ticketing system JSON it can trust. Try Azure Language first, then a model with structured outputs, then a compliance summary tuned to the domain.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
Support tickets are free text, and the ticketing system needs clean fields it can trust.
😊 THE SOLUTION
Use Azure Language for fixed entity categories, and a model with a strict JSON schema for your own fields.
- People, places and dates buried in text✓ Azure Language named entity recognition
- The model invents its own JSON keys✓ A JSON schema with strict: true
- Summaries that miss amounts and control IDs✓ A domain prompt with a checklist and an example
Start with a question
What if the ticket says 'order 48213' and your system wants an order_id field?
Priya from Fabrikam Retail writes in: “Order 48213 arrived on 12 November with a cracked screen.” A person sees the name, the company, the date and the order straight away. Your ticketing system doesn’t read sentences. It wants fields, and it throws an error if one is missing.
You have two tools. Azure Language is a trained reader with fixed categories. A model is a flexible reader that can return any shape you describe. The skill is knowing which one to use, and how to make the model’s answer something code can trust.
Explain it like I’m 10
The technical explanation
Azure Language: entities, PII and summaries
Azure Language in Foundry Tools (the service formerly called Azure AI Language) runs on your Foundry resource. The calls are the same across features: send documents, get a result per document.
| Feature | Returns | Good for |
|---|---|---|
| Named entity recognition | Entities with a category (Person, Organization, Location, DateTime, Quantity and more) and a confidence score | Standard facts in tickets, emails, contracts |
| PII detection | Entities plus redacted text | Masking personal data before storage or before an agent reads it |
| Abstractive summarization | A short summary written in new sentences | Long documents and conversations |
| Custom NER | Your own entity types | Repeated extraction of business fields |
Prebuilt categories are fixed. An order number often comes back as a Quantity, because the service doesn’t know your business.
from azure.identity import DefaultAzureCredential
from azure.ai.textanalytics import TextAnalyticsClient
client = TextAnalyticsClient(endpoint=ENDPOINT, credential=DefaultAzureCredential())
result = client.recognize_entities([ticket_text])[0]
for e in result.entities:
print(e.text, e.category, round(e.confidence_score, 2))
pii = client.recognize_pii_entities([ticket_text], categories_filter=["PhoneNumber", "Email"])[0]
print(pii.redacted_text)
Strict JSON from a model
A model can return your own fields. Three levels of control:
- Plain text prompt: “Return JSON.” It usually works until it doesn’t. Don’t parse this in production.
- JSON mode (
response_format={"type": "json_object"}): the reply is valid JSON. The keys are still the model’s idea. - Structured outputs (
response_formatof typejson_schemawithstrict: true): the reply matches your schema.
schema = {
"name": "ticket",
"strict": True,
"schema": {
"type": "object",
"properties": {
"customer": {"type": "string"},
"order_id": {"type": "string"},
"priority": {"type": "string", "enum": ["low", "normal", "high"]},
"churn_risk": {"type": "boolean"}
},
"required": ["customer", "order_id", "priority", "churn_risk"],
"additionalProperties": False
}
}
resp = openai_client.chat.completions.create(
model="gpt-4.1-mini",
messages=[{"role": "user", "content": ticket_text}],
response_format={"type": "json_schema", "json_schema": schema},
)
For strict mode, list every property in required and set additionalProperties to false. An enum keeps a field to values your code understands.
Domain tasks: compliance summaries and domain extraction
A plain request such as “summarise this policy update” gives a nice paragraph that an auditor can’t use. Fix the prompt before you think about training.
- Role: “You are a compliance analyst writing for the audit team.”
- Checklist: WHAT changed, WHO is responsible, DEADLINE, CONTROL ID, RISK.
- Glossary: what “PCI-07” or “four-eyes check” mean in your company.
- Example: one policy update and the summary you’d accept, including “Not stated” for something missing.
- Temperature 0, so the layout doesn’t wander.
If prompting still can’t hold the format, consider fine-tuning. If the job is pulling the same fields from huge volumes, custom NER in Azure Language is usually cheaper and steadier than prompting a large model every time.
Architect level Check what's changing in Azure Language
Microsoft has announced retirement dates for some Azure Language features, with Foundry models as the suggested path. As announced on Microsoft Learn (checked 25 November 2026), entity recognition, PII detection and language detection continue, while features such as sentiment analysis, key phrase extraction and summarization are listed for retirement on 31 March 2029. For a new, long-lived project, read the current retirement notice before you build on a feature, and plan a prompt-based version of anything on that list.
Real-world business scenario
Fabrikam Retail (fictional)
- The problem
- Support agents retyped customer name, order ID and priority from emails into the ticketing system, and the quarterly compliance summaries left out deadlines and control IDs.
- What they used
- Azure Language PII detection to mask card and phone numbers, a gpt-4.1-mini deployment with a strict JSON schema for the ticket fields, and a domain prompt with a checklist and an example for compliance summaries.
- Why that choice
- Redaction came from a fixed, predictable service. The schema meant the ticketing API never received a missing field, and the checklist made every summary list the same five items.
- The result
- Ticket entry time dropped from about four minutes to seconds, and the audit team stopped sending summaries back for missing deadlines.
When to use it and when not to
✓ Use it when…
- The categories are standard and you want the same output every time (Azure Language).
- Code downstream needs exact fields (a model with structured outputs).
- Summaries must include a fixed list of items (a domain prompt with an example).
✕ Think twice when…
- You rely on JSON mode and assume every field will be there.
- You fine-tune before trying a better prompt and a few examples.
- You expect prebuilt entities to know your order IDs or policy numbers.
↔ Alternatives to consider
- Custom NER for your own entity types at high volume.
- Content Understanding when the source is a scanned form or invoice rather than text.
- A reasoning model for judgments that need several steps.
Test yourself with exercises
5 original practice questions in the AI-103 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.
Interview preparation
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What's the difference between JSON mode and structured outputs?
Model answer
JSON mode makes sure the reply parses as JSON, nothing more. The keys can be anything, and some can be missing. Structured outputs take a JSON schema and make the reply match it. With strict true, every field is required and extra fields aren't allowed, so my code can rely on the shape.
Intermediate When would you pick Azure Language over a model for extraction?
Model answer
When the categories are standard and I want the same output for the same input, at volume and a low price. Named entities, PII and summaries come back with a fixed shape and confidence scores. I'd pick a model when I need my own fields or a free-form judgment.
Experienced developer A compliance summary keeps leaving out the deadline and control ID. How do you fix it?
Model answer
I'd write a developer message with the reader's role, a checklist of required items, a short glossary, and one worked example that shows "Not stated" for missing items. Then temperature 0 and an evaluation on a few dozen real documents. Only if that can't hold the format would I look at fine-tuning.
Scenario Three teams want the same four fields from 100,000 contracts a month. What do you build?
Model answer
I'd label a few hundred contracts and train a custom NER model in Azure Language, because the fields repeat and the volume is high. It's cheaper and steadier than prompting a large model every time. For the odd contract with unusual wording I'd keep a model with a strict schema as a fallback.
Quick revision
Key points
- Azure Language gives fixed categories, confidence scores and the same output for the same input.
- Prebuilt NER can't know your own fields. Use custom NER or a model for those.
- JSON mode means valid JSON only. Structured outputs with strict true means your schema.
- Strict schemas need every property listed in required and additionalProperties set to false.
- Domain summaries come from role, checklist, glossary, example and temperature 0.
Important terminology
- Named entity recognition (NER)
- An Azure Language feature that finds people, organizations, locations, dates and other categories in text and returns a category and a confidence score for each.
- PII detection
- An Azure Language feature that finds personal data and returns a redacted copy of the text. It can be limited to the categories you list.
- JSON mode
- A model setting that makes the reply valid JSON. It doesn't guarantee which keys are present.
- Structured outputs
- A model setting that makes the reply match a JSON schema you supply. With strict set to true, every field is required and no extra fields are allowed.
- Domain prompt
- Instructions that give a model a role, a checklist, a glossary and an example so its output suits one field, such as compliance.
- Custom NER
- A model you train in Azure Language on labelled examples so it extracts your own entity types, such as PolicyId or ApprovalRole.
Common mistakes
- Thinking JSON mode guarantees the fields you asked for.
- Fine-tuning before trying a better prompt.
- Expecting prebuilt NER to return order numbers or policy IDs as their own category.
Exam tips
- "Reply must match a schema" = structured outputs, not JSON mode.
- "Same fields, huge volume, your own types" = custom NER.
- "Mask personal data" = PII detection, with a categories filter when policy lists some.
Five quick revision questions
-
1.Which Azure Language feature returns a redacted copy of text?Show
PII detection.
-
2.What does strict true add to a JSON schema?Show
Every field is required and the reply can't contain extra fields.
-
3.What is the first thing to try when a summary lacks required items?Show
A domain prompt with a checklist and an example.
-
4.Which feature learns your own entity types?Show
Custom NER.
-
5.Which Azure Language feature finds people, places and dates?Show
Named entity recognition.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: Sentiment, Tone and Sensitive Content Detection
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.