Implement text analysis solutions 4.1 Apply language model text analysis
A hotel chain is starting a new project to learn that a review is positive about…
Study guide skill: Configure detection of sentiment, tone, safety issues, and sensitive content
Question B1-038
A hotel chain is starting a new project to learn that a review is positive about 'breakfast' but negative about 'parking', not just an overall score for the review, and the results must be stored as consistent JSON. Following Microsoft's current guidance for new text analysis projects, what should you use?
Select one answer.
Answer: D
Sentiment analysis and opinion mining (aspect-based sentiment) retire from Azure Language on March 31, 2029, and Microsoft directs all new projects to Microsoft Foundry models. A Foundry model can be prompted to return the overall sentiment and the sentiment for each aspect, and structured outputs make it follow a JSON schema so the results parse reliably. Document-level sentiment gives only one overall label (and is also retiring), key phrase extraction (also retiring) doesn't assign sentiment, and language detection only identifies the language.
Deep dive
How it works
Two requirements drive this design: aspect-level sentiment (breakfast positive, parking negative) and consistent JSON you can store. And because this is a new project, the platform choice matters too. The Azure Language pages for sentiment analysis, opinion mining and key phrase extraction all carry the same guidance: direct all new projects to Microsoft Foundry.
What you build in Foundry:
- Prompt a Foundry model to return the overall sentiment for the review plus a list of aspects, each with its own sentiment. This is the aspect-based analysis that Azure Language called opinion mining: sentiment linked to specific aspects of the text, such as the attributes of products or services.
- Use structured outputs with a JSON schema. Structured outputs make the model follow a JSON Schema definition that you provide in the call, in response_format for Chat Completions or text.format for Responses. That's stronger than the older JSON mode, which guaranteed valid JSON but couldn't ensure the output followed your schema.
A schema with fields like overallSentiment and an aspects array (name, sentiment) gives you rows you can store and query without fragile parsing.
The other options, and when you'd use them
- Key phrase extraction: It identifies the main concepts in text, such as "food" and "wonderful staff". It doesn't assign sentiment to them, and its page also directs new projects to Foundry.
- Language detection: It returns the main language of each document with a confidence score. Useful for routing multilingual reviews, but it says nothing about sentiment.
- Document-level sentiment analysis: Sentiment labels at the document level answer "how was this review overall", not "how did the guest feel about parking". The aspect-level detail lives in opinion mining, and new projects are directed to Foundry either way.
Exam tip
New text-analysis project + per-aspect opinions + reliable JSON = Foundry model + structured outputs (JSON schema). Overall label only = document-level sentiment, which isn't enough.
References
Microsoft Learn references
Last reviewed: