Lesson 8 of 26 · see all lessons
Start here: the exam, Python basics and responsible AI (skill area 1, 40-45%)
AI models: how they work, choosing and deploying (skill area 1)
AI workloads: text, speech, vision and extraction (skill area 1)
Generative AI apps and agents in Foundry (skill area 2, 55-60%)
Text, speech, vision and extraction apps in Foundry (skill area 2)
- 17. Building a text analysis app
- 18. Building speech apps: spoken prompts and Azure Speech
- 19. Building vision apps: images in prompts and generated images
- 20. Extracting information with Content Understanding: documents and forms
- 21. Content Understanding for images, audio and video, and a small extraction app
Final review and four mock exams
17 min
Text analysis: key phrases, entities, sentiment and summaries
Learn the text analysis techniques the exam names and what each returns.
By the end of this lesson you can
- Say what key phrase extraction, entity detection, sentiment analysis and summarization each return
- Tell named entity recognition, PII detection and entity linking apart
- Read a sentiment result at document and sentence level
- Choose between Azure Language and prompting a generative model
From earlier lessons · 1 of 2
A hotel group wants software that reads a guest's complaint, looks up the booking and issues a room upgrade. Which part of an agent lets it issue the upgrade?
Pick one answer.
From earlier lessons · 2 of 2
A museum wants its printed exhibit labels translated from Dutch into five languages. Which Foundry Tool should it use?
Pick one answer.
Fernhill Travel exports 4,000 customer reviews into a spreadsheet. Nobody has time to read them. The manager asks three questions. What do people talk about most? Which hotels and cities come up? Are customers happy or angry? Azure Language can answer each one, and each answer comes from a different feature.
Key phrase extraction: what is the text about?
Exam depth: know it cold.
Key phrase extraction returns a list of the main concepts in a text. The exam also calls it keyword extraction or key-term extraction.
Microsoft's own example: from "The food was delicious and the staff were wonderful." it returns "food" and "wonderful staff".
You get phrases only. There are no types, no scores and no opinions. Use it to tag documents, spot trending topics, or build a word cloud of what customers mention.
Deciding words: "main topics", "talking points", "what is it about".
Entity detection: NER, PII detection and entity linking
Exam depth: know it cold.
An entity is a real thing named in text, such as a person, place or date. Three features find entities.
| Feature | Returns |
|---|---|
| Named entity recognition (NER) | Each entity with a type, such as Person or City. |
| PII detection | Personal data with a type, plus redacted text. |
| Entity linking | Each entity with a link to Wikipedia. |
NER uses a fixed list of types. It includes Person, Organization, Location, City, Date, DateTime, Quantity-style types such as Number and Currency, Email and PhoneNumber.
PII detection finds personally identifiable information, data that identifies a person, such as names, addresses and phone numbers. It can return the text with those values masked.
Entity linking decides which thing a word means. "Seattle" gets a link to the Seattle page on Wikipedia.
A news site finds articles that mention "Jordan". It must know whether each one means the country or a basketball player, and link to a reference page. Which feature should you use?
Pick one answer.
Sentiment analysis and opinion mining
Exam depth: know it cold.
Sentiment analysis labels text as positive, neutral or negative. It works at two levels: each sentence, and the whole document.
Each level also gets three confidence scores, one per label, each between 0 and 1. The label is the one with the highest score.
The document can get a fourth label, mixed. That happens when it has at least one positive and at least one negative sentence.
Opinion mining goes finer. It finds each target (the thing discussed, such as "room") and its assessment (the opinion word, such as "great"), each with its own sentiment. Microsoft also calls this aspect-based sentiment analysis.
Deciding words: "happy or unhappy" picks sentiment; "which feature of the product" picks opinion mining.
A review has three sentences. Two are neutral and one is negative. Which label does sentiment analysis return for the whole document?
Pick one answer.
Summarization and language detection
Exam depth: know it cold.
Summarization shortens text and keeps the main points. There are two approaches.
- Extractive summarization picks the most important sentences from the original and returns them word for word. Each one comes with a rank score.
- Abstractive summarization writes new sentences that capture the main ideas. The words don't have to appear in the source.
Deciding words: "exact sentences from the source" means extractive; "new" or "in its own words" means abstractive.
Exam depth: recognize it. Language detection returns the main language of a text, its ISO code and a confidence score. It identifies more than 100 languages. It's often the first step before other analysis.
For this statement, select Yes if it is true. Otherwise, select No. "Extractive summarization can return a sentence that never appeared in the original text."
Pick one answer.
Under the hood: tokens, counts and TextRank
Exam depth: recognize it.
Classic text analysis starts by splitting text into tokens, usually words. Clean-up steps follow: stop word removal drops words like "the", and stemming or lemmatization reduces words to a base form.
- Frequency analysis counts tokens. Common words hint at the topic.
- TF-IDF (term frequency, inverse document frequency) scores a word high when it's frequent in one document but rare across the others. It helps find each document's own keywords.
- Bag-of-words turns text into word counts for a classifier. A classifier trained on labeled examples can predict sentiment this way.
- TextRank ranks sentences by how similar they are to other sentences. The top ones form an extractive summary. Run on words, it finds keywords.
Step through
From a review to useful tokens
- The0
- guides1
- were2
- amazing3
- and4
- the5
- boats6
- amazed7
- us8
Step 1: split the sentence into tokens, one per word.
Two ways to analyze text: Azure Language or a generative model
Exam depth: know it cold.
You can do every technique here in two ways.
| Azure Language | Prompting a generative model | |
|---|---|---|
| Output | Fixed JSON shape with scores. | Whatever the prompt asks for. |
| Results | Predictable, same input gives same output. | Can vary between runs. |
| Effort | Call a feature, no prompt work. | Write and test prompts. |
| Flexibility | Only the built-in features. | Any question about the text. |
Decision rule: "predictable", "consistent" or "confidence score" picks Azure Language; "explain why" or "answer in our tone" picks a model.
Microsoft now splits Azure Language into core features (PII detection, language detection, NER) and legacy ones. Key phrase extraction, sentiment analysis and summarization retire on March 31, 2029; entity linking on September 1, 2028. Microsoft points new projects for those to Foundry models. The exam still tests the techniques.
A bank must flag account numbers and names in support chats before staff can read them. Auditors require the same input to give the same result every time. What should you use?
Pick one answer.
Worked example: one Fernhill Travel review
Predict, then reveal
Review: "The hotel in Porto was lovely. The airport transfer from Fernhill Travel was two hours late. Maria at the desk fixed it fast, call her on 555-0142." Predict what each feature returns before you reveal.
Match
Match each output to the feature that returns it
Pick an item on the left, then its match on the right.
Exam-style practice
A phone maker wants to know which parts of its product customers praise or criticize, such as battery, camera or screen. Which feature fits best?
Pick one answer.
A legal team needs short summaries of contracts. Every summary sentence must appear word for word in the contract, so nothing is reworded. Which approach should you use?
Pick one answer.
A support inbox receives emails in many languages. Each email must go to a team that speaks its language before anyone reads it. Which feature should run first?
Pick one answer.
FlashcardsIndex cardsFlashcards ⚡
Card 1 of 17Worth keeping
- Key phrases: topics. NER: typed entities. PII: personal data to mask. Entity linking: which thing, with a link.
- Sentiment gives positive, neutral or negative per sentence; a document can also be mixed.
- Opinion mining ties each target to its assessment, such as pool and cold.
- Extractive summaries copy original sentences; abstractive summaries write new ones.
- Azure Language is predictable and scored; a prompted model is flexible but can vary.
The blind customer who asked for spoken itineraries is still waiting. Next lesson: how Azure Speech turns text into a natural voice, and calls into searchable text.
Leaderboard
Loading…
50 XP for each lesson you finish, 10 for each right answer. Names show only for learners who turn on Show me on leaderboards.
Embed this practice on your site
Free for classrooms, blogs and study groups. Paste this into any page that accepts HTML.
Report a copyright problem with this lesson
Sources for this lesson (16)
Each fact in the lesson is marked with the number of the page it comes from.
- [2]Microsoft Learn: Study guide for Exam AI-901: Microsoft Azure AI Fundamentals
- [16]Microsoft Learn: How to: Use Sentiment analysis and Opinion Mining
- [32]Microsoft Learn: Generative AI and agents (Introduction to AI concepts)
- [55]Microsoft Learn: Text and natural language (training unit)
- [57]Microsoft Learn: What is Azure Language in Foundry Tools?
- [63]Microsoft Learn: What is Azure Translator in Foundry Tools?
- [64]Microsoft Learn: What is key phrase extraction in Azure Language in Foundry Tools?
- [65]Microsoft Learn: What is the named entity recognition (NER) feature in Azure Language?
- [66]Microsoft Learn: Entity categories recognized by Named Entity Recognition in Azure Language in Foundry Tools
- [67]Microsoft Learn: What is the Personally Identifiable Information (PII) detection feature in Azure Language?
- [68]Microsoft Learn: What is entity linking in Azure Language in Foundry Tools?
- [69]Microsoft Learn: What is sentiment analysis and opinion mining in Azure Language service?
- [70]Microsoft Learn: What is summarization?
- [71]Microsoft Learn: What is language detection in Azure Language?
- [72]Microsoft Learn: Tokenization (training unit)
- [73]Microsoft Learn: Statistical text analysis (training unit)