Lesson 8 of 26 · see all lessons
  1. Start here: the exam, Python basics and responsible AI (skill area 1, 40-45%)

    1. 1. Start here: the AI-901 exam, the plan and what you already know
    2. 2. The Python and Azure basics AI-901 expects
    3. 3. Responsible AI: the six principles in practice
  2. AI models: how they work, choosing and deploying (skill area 1)

    1. 4. How generative AI models work
    2. 5. Choosing the right AI model for the job
    3. 6. Deploying a model: deployment options and configuration parameters
  3. AI workloads: text, speech, vision and extraction (skill area 1)

    1. 7. Common AI workloads: from chat and agents to vision and extraction
    2. 8. Text analysis: key phrases, entities, sentiment and summaries
    3. 9. Speech: recognition and synthesis
    4. 10. Computer vision and image generation
    5. 11. Extracting information from documents, images, audio and video
  4. Generative AI apps and agents in Foundry (skill area 2, 55-60%)

    1. 12. Writing system and user prompts
    2. 13. Deploying a model and chatting with it in the Foundry portal
    3. 14. Building a lightweight chat client with the Foundry SDK
    4. 15. Creating and testing a single agent in the Foundry portal
    5. 16. Building a lightweight client app for an agent
  5. Text, speech, vision and extraction apps in Foundry (skill area 2)

    1. 17. Building a text analysis app
    2. 18. Building speech apps: spoken prompts and Azure Speech
    3. 19. Building vision apps: images in prompts and generated images
    4. 20. Extracting information with Content Understanding: documents and forms
    5. 21. Content Understanding for images, audio and video, and a small extraction app
  6. Final review and four mock exams

    1. 22. Final review and exam day: every decision on one page
    2. 23. Mock exam 1
    3. 24. Mock exam 2
    4. 25. Mock exam 3
    5. 26. Mock exam 4
See the leaderboard

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.

[2]

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".

[55][57][64]

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.

FeatureReturns
Named entity recognition (NER)Each entity with a type, such as Person or City.
PII detectionPersonal data with a type, plus redacted text.
Entity linkingEach 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.

[65][66][67][68]

[67][68]

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.

[68]

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.

[16][69]

Rendering diagram…
One positive and one negative sentence make the whole review mixed. Scores here are illustrative.

[16]

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.

Sentiment analysis: "mixed". Opinion mining: "you loved the pool and hated the breakfast." Picture: Three-panel comic strip, bold flat colours, thick outlines.

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.

[70][71][73]

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.

[70]

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.

[72][73]

Step through

From a review to useful tokens

  1. The0
  2. guides1
  3. were2
  4. amazing3
  5. and4
  6. the5
  7. boats6
  8. amazed7
  9. us8

Step 1: split the sentence into tokens, one per word.

Step 1 of 5

[72]

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 LanguagePrompting a generative model
OutputFixed JSON shape with scores.Whatever the prompt asks for.
ResultsPredictable, same input gives same output.Can vary between runs.
EffortCall a feature, no prompt work.Write and test prompts.
FlexibilityOnly 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.

[55][57][68][69]

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.

[55]

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.

[16][64][66][67][70]

Match

Match each output to the feature that returns it

Pick an item on the left, then its match on the right.

[57]

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.

[16]

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.

[70]

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.

[71]

FlashcardsIndex cardsFlashcards ⚡

Card 1 of 17

Worth keeping

  1. Key phrases: topics. NER: typed entities. PII: personal data to mask. Entity linking: which thing, with a link.
  2. Sentiment gives positive, neutral or negative per sentence; a document can also be mixed.
  3. Opinion mining ties each target to its assessment, such as pool and cold.
  4. Extractive summaries copy original sentences; abstractive summaries write new ones.
  5. 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.

  1. [2]Microsoft Learn: Study guide for Exam AI-901: Microsoft Azure AI Fundamentals
  2. [16]Microsoft Learn: How to: Use Sentiment analysis and Opinion Mining
  3. [32]Microsoft Learn: Generative AI and agents (Introduction to AI concepts)
  4. [55]Microsoft Learn: Text and natural language (training unit)
  5. [57]Microsoft Learn: What is Azure Language in Foundry Tools?
  6. [63]Microsoft Learn: What is Azure Translator in Foundry Tools?
  7. [64]Microsoft Learn: What is key phrase extraction in Azure Language in Foundry Tools?
  8. [65]Microsoft Learn: What is the named entity recognition (NER) feature in Azure Language?
  9. [66]Microsoft Learn: Entity categories recognized by Named Entity Recognition in Azure Language in Foundry Tools
  10. [67]Microsoft Learn: What is the Personally Identifiable Information (PII) detection feature in Azure Language?
  11. [68]Microsoft Learn: What is entity linking in Azure Language in Foundry Tools?
  12. [69]Microsoft Learn: What is sentiment analysis and opinion mining in Azure Language service?
  13. [70]Microsoft Learn: What is summarization?
  14. [71]Microsoft Learn: What is language detection in Azure Language?
  15. [72]Microsoft Learn: Tokenization (training unit)
  16. [73]Microsoft Learn: Statistical text analysis (training unit)