Implement Text Analysis Solutions · Topic 1 of 2
Language Model Text Analysis and Translation
AI-103 text analysis: extracting entities, topics, summaries and JSON, sentiment and PII detection, translation and customizing outputs for domains.
- 3 min
- Use a prompted model for flexible, custom outputs; a Foundry Tool for standard tasks at scale.
- Tasks: entities, topics, summaries, sentiment, tone and safety, PII, language detection.
- Structured outputs make a model return JSON matching a schema.
What it is
Text analysis turns unstructured text, such as emails, chats, reviews or contracts, into useful information. AI-103 covers two approaches: generative prompting with a language model, and Foundry Tools such as Azure Language and Azure Translator that provide prebuilt analysis.
How it works
Two approaches
| Language model prompting | Prebuilt Foundry Tool | |
|---|---|---|
| Strength | Flexible: any fields, any format, domain-specific reasoning | Consistent, purpose-built, often cheaper at scale |
| Output | Whatever you ask for; use structured outputs for reliable JSON | Fixed response format per feature |
| Best for | Custom extraction, domain summaries, mixed tasks | Standard tasks such as PII detection, sentiment, language detection |
Common analysis tasks
| Task | What it returns |
|---|---|
| Entity extraction | People, organizations, places, dates, products and other named items |
| Topic and key phrase extraction | The main subjects of the text |
| Summarization | A short version, extractive (key sentences) or abstractive (rewritten) |
| Sentiment and opinion | Positive, negative, neutral or mixed, sometimes per aspect |
| Tone and safety | Abusive, harmful or sensitive language |
| PII detection and redaction | Finds personal data such as names, phone numbers and card numbers, and can mask it |
| Language detection | Which language the text is in |
Structured JSON outputs
To feed results into code, ask a model for structured outputs that follow a JSON schema, for example:
{"customer_name": "string", "product": "string", "issue_category": "billing | delivery | quality", "sentiment": "positive | neutral | negative"}
A schema stops the model returning extra text or missing fields.
Translation
| Option | When to use |
|---|---|
| Azure Translator in Foundry Tools | High-volume text or document translation, consistent terminology with glossaries (document translation) or Custom Translator dictionaries |
| LLM-powered translation | Translation that also adapts tone, simplifies, or combines translation with another task |
Customizing for a domain
Domain tasks, such as compliance summaries or extracting clauses from contracts, often need:
- clear instructions with the domain's terms and rules,
- few-shot examples of correct output,
- a schema for the result,
- and evaluation against a labeled sample to confirm accuracy.
A worked example: support chats must have card numbers masked before they are stored, then be summarized for a supervisor. Azure Language PII detection masks the numbers at scale; a language model then writes a three-line summary and returns the issue category in JSON.
When a question needs personal data removed from text before it reaches a model or storage, the answer is PII detection and redaction, not a prompt asking the model to "ignore" the data.
How the exam asks about this
- "Mask phone and card numbers in call transcripts out of the box." Azure Language PII detection.
- "Return customer, product and category in a fixed JSON shape." A model with structured outputs.
- "Translate millions of product descriptions with a company glossary." Azure Translator, with a glossary or a Custom Translator model.
What to remember for the exam
- Use a prompted model for flexible, custom outputs; a Foundry Tool for standard tasks at scale.
- Tasks: entities, topics, summaries, sentiment, tone and safety, PII, language detection.
- Structured outputs make a model return JSON matching a schema.
- Translator suits high-volume, glossary-controlled translation; an LLM suits translation plus rewriting.
- Domain tasks need instructions, examples, schemas and evaluation.
Sending raw personal data to a model and asking it not to use it is not data protection. Redact first.
Common mistakes
Parsing free text when JSON is required. Use structured outputs.
Using an LLM for every simple task. Prebuilt tools can be cheaper and more consistent.
Skipping evaluation for domain extraction. Check accuracy on labeled examples.
Check yourself
When is a prebuilt Foundry Tool better than prompting a language model?
For narrow, standard tasks such as PII detection or sentiment, where consistency and cost at scale matter.
What does structured output guarantee?
That the model's response follows the JSON schema you provide.
Which tool fits high-volume translation with consistent terminology?
Azure Translator in Foundry Tools, with a glossary or a Custom Translator model.
Topic 1 of 2 in Implement Text Analysis Solutions
Test yourself on Implement Text Analysis 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.