Text analysis with Azure Language

The prebuilt NLP features, what each one returns, and when a generative model is the better tool instead.

  • Text & speech
  • 18 minutes
  • High priority

After this lesson you can

  • Match a required output to the right text analysis technique
  • Tell extractive from abstractive summarization, and sentiment from opinion mining
  • Know which Language features need training data and which do not

The techniques, by output shape

Every one of these questions is really asking: what shape of output does the requirement need? Learn the outputs and the routing is automatic.

TechniqueOutputGive it to me when…
Key phrase extractionAn unordered list of topic phrases"What is this about?" / recurring themes
Named entity recognitionTyped entities: Person, Location, Organization, DateTime, Quantity"Find the people and places"
PII detectionSensitive identifiers located, and a redacted copy"Mask national IDs, cards, emails"
Sentiment analysisPositive / neutral / negative + confidence scores, per document and per sentence"Is this review good or bad?"
Opinion miningTarget → assessment → sentiment triples"Which aspect did they dislike?"
SummarizationA shorter version - extractive or abstractive"Condense this"
Language detectionISO language code + confidence"What language is this?"
Entity linkingEntity disambiguated and linked to a knowledge base entry"Which Mars is this?"
Text analytics for healthMedical entities, relations and assertionsClinical notes

Check your understanding

AI workloads

Which technique returns "Seattle data center", "cloud latency" and "system reliability" from a paragraph - an unordered list of the main talking points?

Changed: Eight of these features retire on 31 March 2029

Microsoft has announced end of support for key phrase extraction, sentiment analysis and opinion mining, summarization (extractive and abstractive), entity linking, custom text classification, conversational language understanding (CLU), custom question answering (CQA) and orchestration workflow. New projects are directed to Foundry models instead. Still fully supported: language detection, PII detection, text analytics for health, prebuilt NER and custom NER. The techniques themselves are still examinable - the skills-measured list names keyword extraction, entity detection, sentiment analysis and summarization - but a scenario that asks what to build on today increasingly answers "a generative model in Foundry".

The two distinctions that get tested

Exam trap: Extractive vs. abstractive summarization

Extractive selects the most important sentences verbatim from the source. Abstractive generates new wording that captures the meaning. Legal, medical or compliance, where fidelity matters ⇒ extractive. Meeting notes, call recaps, readability ⇒ abstractive.

Exam trap: Sentiment vs. opinion mining

Sentiment gives a label for the document or sentence. Opinion mining links each target (the wifi, the room) to its assessment (unusable, spotless) and a sentiment. If the question says "which specific aspect", it is opinion mining.

Check your understanding

AI workloads

A legal team needs summaries of contracts where every sentence appears verbatim in the original document, for evidentiary reasons. Which approach fits?

Check your understanding

AI workloads

A hotel chain wants to know, for each review, not just the overall mood but which aspect drove it: "the room was spotless but the wifi was unusable".

Which capability produces target-and-assessment pairs like this?

Prebuilt vs. custom

Know this: The dividing line

Prebuilt features work immediately - send text, get a result, no training data. Custom features need you to label examples and train. If a scenario mentions categories or entities specific to that business, it is custom.

Prebuilt (no training)Custom (needs labelled data)
Sentiment analysis & opinion miningCustom text classification
Key phrase extractionCustom named entity recognition
Named entity recognition, PII detectionConversational language understanding (CLU)
Language detectionQuestion answering
Summarization (extractive & abstractive)Orchestration workflow
Text analytics for health, entity linking-

Check your understanding

AI workloads Hard

Which two capabilities of Azure Language in Foundry Tools require you to supply labelled training data? (Choose two.)

Choose 2. Each correct answer is part of the solution. Each correct selection is worth one point.

Choose 2, then check.

Check your understanding

Text & speech

An app must route incoming messages into the company's own five support categories, which no prebuilt model knows about.

Prebuilt feature or generative model?

Reach for a prebuilt Language feature when…Reach for a generative model when…
Output must be a predictable, typed structureOutput is free-form or the format varies
Volume is high and per-document cost mattersVolume is modest
The task is exactly one of the standard onesThe task is bespoke or combines several steps
You want no prompt engineering to maintainYou want flexibility and can iterate on a prompt

Check your understanding

Text & speech

A team must decide between calling a prebuilt sentiment API and prompting a deployed generative model to classify sentiment.

Which consideration most favours the prebuilt API?

A lightweight text analysis client

The pattern is the same for every feature: authenticate, send documents, read the typed result.

Sentiment, key phrases and entities from the same document
import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.textanalytics import TextAnalyticsClient

# A key keeps the sample short; prefer DefaultAzureCredential in real apps.
client = TextAnalyticsClient(
    endpoint=os.environ["LANGUAGE_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["LANGUAGE_KEY"]),
)

docs = ["Response times improved by 40%, but the documentation is still incomplete."]

sentiment = client.analyze_sentiment(documents=docs)[0]
print(sentiment.sentiment, sentiment.confidence_scores)

phrases = client.extract_key_phrases(documents=docs)[0]
print(phrases.key_phrases)

entities = client.recognize_entities(documents=docs)[0]
for e in entities.entities:
    print(e.text, "->", e.category)

Azure Language is also reachable from Foundry as a tool, through the Azure Language MCP server (preview) - which is how an agent can call these capabilities as tools rather than your code calling them directly.

Check your understanding

Text & speech

A retailer receives 20,000 product reviews per week and wants an overall mood label per review plus the recurring themes across all of them.

Which combination of Azure Language features should the app call?