BrainyBeeBrainyBee
ExploreBlogStart Studying
HomeDeveloping AI Apps and Agents on Azure (AI-103)Configure detection of sentiment, tone, safety issues, and sensitive content
Lesson2,727 words

Configure detection of sentiment, tone, safety issues, and sensitive content

AI-103 › Unit 4: Implement text analysis solutions › Apply language model text analysis › Configure detection of sentiment, tone, safety issues, and sensitive content

Configure detection of sentiment, tone, safety issues, and sensitive content

Four detection needs that sound like one capability are served by three different services with three different statuses. Sentiment is an Azure Language feature — and a legacy one. Sensitive content means PII detection, which is core. Safety issues means Content Safety's harm categories. Getting the mapping right, and knowing which is legacy, is most of this objective.

Why This Matters

Sentiment and PII sit on opposite sides of the split. PII detection is core, "recommended for new development"; sentiment analysis and opinion mining is legacy, "supported for existing implementations".

"Safety" is a different service. Harm categories live in Content Safety with severity levels and thresholds, not in Azure Language.

PII has three surfaces and a preview. Text, conversation, and document PII — with anonymization (synthetic replacement) currently in preview.

Four needs, three services

Sentiment and opinion → Azure Language sentiment analysis and opinion mining (legacy). Sensitive content → Azure Language PII detection (core), across text, conversation, and document. Harmful content → Content Safety harm categories with severity thresholds. Tone beyond positive/negative → a generative approach with a defined schema, since no preconfigured feature covers it.

Prerequisites

  • The core/legacy split in Azure Language.
  • The four harm categories and the safe/low/medium/high levels.
  • That Content Understanding can classify against an enum.
  • Container availability for on-premises deployment.

Learning Objectives

By the end of this lesson you will be able to:

  1. Map each detection need to the correct service.
  2. Configure PII detection across its three surfaces.
  3. Apply sentiment analysis and opinion mining, with its legacy status.
  4. Detect tone where no preconfigured feature exists.
  5. Choose containers where data cannot leave the environment.

Building Blocks

PII detection — core. It "identifies entities in text and conversations (chat or transcripts) that are associated with individuals", across three surfaces:

SurfaceCovers
Text PIIUnstructured text
Conversation PIIChat and transcripts
Document PIINative documents (.pdf, .docx, .txt)

The Document PII playground in Foundry is generally available, ships with "curated sample documents and expected outputs" for evaluating detection "without uploading your own data", and "uses the same Document PII model and policies as the production API, so results align with production behavior". Note the caveat: the "anonymization feature (synthetic replacement) is currently available in preview".

The documented use: "Detect and redact sensitive information such as PII and PHI" across "unstructured text, transcribed conversations, native documents".

Sentiment analysis and opinion mining — legacy. "Preconfigured features that help you understand public perception of your brand or topic. These features analyze text to identify positive or negative sentiments and can link them to specific elements within the text." Preconfigured means "the AI models it uses can't be changed".

Text analytics for health — core. "Extracts and labels relevant health information from unstructured text."

Content Safety. Four harm categories — Hate and Fairness, Sexual, Violence, Self-Harm — with "classification can be multi-labeled", four severity levels safe/low/medium/high, and a medium default threshold on both prompts and completions. Text supports the full 0–7 scale.

Containers exist for sentiment analysis, language detection, key phrase extraction, custom NER, text analytics for health, and summarization.

Three detection services

Attribute
Status

Core

Legacy

Separate service

Finds

Entities associated with individuals

Positive/negative sentiment, linked to elements

Harmful content by category and severity

Customizable

Preconfigured

Preconfigured

Thresholds configurable

Surfaces

Text, conversation, document

Text

Text, image, multimodal

Container

Not on the list

Yes

—

Deep Dive

Mapping the requirement to the service

Four phrasings recur, and each names one service.

"Identify customer sentiment in reviews." — sentiment analysis and opinion mining, which identifies "positive or negative sentiments" and can "link them to specific elements within the text". Opinion mining is the second half worth remembering: it attaches sentiment to a specific aspect, so a review can be positive about delivery and negative about packaging in one result.

"Redact personal information before storage." — PII detection, a core capability covering "PII and PHI" across text, conversations, and native documents.

"Block harmful content." — Content Safety, whose four harm categories and severity thresholds are a different service with different mechanics.

"Detect the tone of the message — frustrated, urgent, formal." — none of the above. Sentiment is positive or negative, not a tone taxonomy. A tone requirement means a generative approach: a Content Understanding classify field with an enum of your tone labels, or a prompt with a defined structure.

That last case is the reliable trap: a scenario asking for a nuanced emotional or stylistic label, with sentiment analysis among the options.

Configuring detection

  1. 1

    Separate the four needs

    Sentiment, sensitive content (PII), harmful content (Content Safety), and tone are different problems.

PII detection in depth

This is the core capability of the four, and the detail is examinable.

Three surfaces. Text PII for unstructured text. Conversation PII for "chat or transcripts" — relevant because conversational text carries identifiers across turns. Document PII for native formats (.pdf, .docx, .txt), which preserves the fact that documents have structure rather than being flattened first.

The playground is a genuine evaluation tool. It is generally available, ships with "curated sample documents and expected outputs", lets you "compare detection results across entity types before you transition to uploading real documents", and — the important part — "uses the same Document PII model and policies as the production API, so results align with production behavior". So evaluation there is predictive, not indicative.

Detection and anonymization are different maturities. Detection is generally available; the "anonymization feature (synthetic replacement)" is "currently available in preview". A compliance workflow that must replace identifiers with realistic substitutes is depending on a preview feature — which matters under a production-only constraint. Detect-and-redact is the GA path.

PHI is in scope. The documented use covers "PII and PHI", so health identifiers are handled here. That sits alongside text analytics for health, which extracts clinical information rather than identifying individuals — two different jobs on the same documents.

Sentiment, opinion mining, and their limits

Sentiment analysis identifies "positive or negative sentiments". Opinion mining links those sentiments "to specific elements within the text" — the aspect-level refinement.

Three limits shape design.

It is preconfigured. "The AI models it uses can't be changed", so there is no training your own sentiment categories. A domain where "expensive" is neutral rather than negative cannot be taught.

It is legacy. Supported for existing implementations; a new build should weigh a generative alternative, particularly since a schema-driven approach can produce sentiment and tone and a rationale in one pass with confidence scores.

The taxonomy is fixed to polarity. Positive, negative, neutral, mixed — not urgency, formality, frustration, or intent. Those need a vocabulary you define.

Where sentiment analysis remains strongly indicated: an existing implementation, a need for consistent polarity scoring at scale with no setup, and — notably — an on-premises requirement, since sentiment analysis has a container and a generative approach generally does not offer that.

Sentiment is polarity, not emotion

"Positive or negative sentiments" is the documented scope. A requirement for frustration, urgency, confusion, politeness, or formality is asking for a tone taxonomy that no preconfigured feature provides. Define the labels yourself in a Content Understanding classify field with an enum, or a prompt with a specified structure — and pair it with a generate field for the rationale.

Composing the checks

Real pipelines run several of these together, and order matters.

Detect and redact PII first where downstream processing is generative, so identifiers do not enter a model's context unnecessarily. That is a data-minimisation argument as much as a compliance one.

Run safety checks at the boundary. Content Safety's filters apply at the model deployment, defaulting to medium on prompts and completions, and they classify harmful content — not sentiment, not tone, and not sensitive information. A negative review is not harmful content, and a document full of national identifiers is not either.

Run analytical detection on the redacted text. Sentiment, tone, and topic work fine on text with identifiers removed, and keeping that order limits exposure.

Route on confidence. Where a schema-driven approach is used, confidence scores from 0 to 1 allow the uncertain cases to reach a human rather than reviewing everything.

The framing to carry: PII is about individuals, harm categories are about content, sentiment is about polarity, and tone is about a vocabulary you define. Four questions, four answers.

Worked Examples

Example 1 — redacting call transcripts. A contact centre must remove personal information from transcripts before analysis, replacing identifiers with realistic substitutes.

Conversation PII, which covers "chat or transcripts" and is a core capability spanning "PII and PHI". The realistic-substitute requirement is anonymization (synthetic replacement), which is "currently available in preview" — so under a production-only constraint, detect-and-redact is the GA path and synthetic replacement is not yet available for reliance.

Example 2 — detecting frustration. A team wants to flag messages where the customer sounds frustrated or the request is urgent.

Not sentiment analysis — that identifies "positive or negative sentiments", a polarity scale, and is preconfigured so it cannot be taught new labels. Define the vocabulary yourself: a Content Understanding classify field with an enum such as , plus a generate field for the rationale and confidence for routing.

Example 3 — sentiment on-premises. A bank must score review sentiment without data leaving its environment.

Sentiment analysis has a container, alongside language detection, key phrase extraction, custom NER, text analytics for health, and summarization — used to "bring the service closer to your data for compliance, security, or other operational reasons". Its legacy status is acceptable here because the container requirement is decisive; a generative alternative does not offer the same on-premises path.

Visual Explanations

Need to service:

Loading Diagram...
Figure 1 — Mermaid diagram

Pipeline order:

Loading Diagram...
Figure 2 — Mermaid diagram

Common Mistakes

Using sentiment analysis for tone. It is polarity, not emotion.

Trying to train sentiment categories. It is preconfigured.

Assuming sentiment is core. It is legacy; PII detection is core.

Treating harm categories as sentiment. A negative review is not harmful content.

Relying on synthetic replacement in production. Anonymization is preview.

Flattening documents before PII detection. Document PII handles native formats.

Confusing PII detection with text analytics for health. Individuals against clinical content.

Assuming any feature can run in a container. The list is specific.

Running analysis before redaction and exposing identifiers unnecessarily.

Practice Exercises

  1. Map each to a service: frustration; a national insurance number; graphic violence; a negative product review.
  2. Name PII detection's three surfaces and say which part is preview.
  3. What does opinion mining add to sentiment analysis, and what can neither do?
  4. Why might a legacy feature still be the right answer?
  5. Give a sensible order for PII, safety, and analytical checks, with the reason.
▶Answers
  1. Frustration → no preconfigured feature; define an enum in a classify field. National insurance number → PII detection (core). Graphic violence → Content Safety harm categories. Negative product review → sentiment analysis and opinion mining (legacy).
  2. Text PII, Conversation PII (chat or transcripts), and Document PII (.pdf, .docx, .txt). The anonymization feature (synthetic replacement) is "currently available in preview"; detection itself is generally available.
  3. Opinion mining links sentiments "to specific elements within the text", giving aspect-level results rather than one document-level polarity. Neither can produce a tone taxonomy — both are limited to positive/negative polarity and are preconfigured, so the models "can't be changed".
  4. Because a specific requirement makes it decisive — most commonly an on-premises container, since sentiment analysis, language detection, key phrase extraction, custom NER, text analytics for health, and summarization have containers. Legacy means "supported for existing implementations", not deprecated.
  5. Redact PII first, so identifiers do not enter a model's context — data minimisation as well as compliance. Then safety checks at the boundary, since filters apply at the deployment. Then analytical detection on the redacted text, which works fine without identifiers, limiting exposure throughout.

Summary & Concept Map

Four detection needs resolve to three services. PII detection is core, covers "PII and PHI" across text, conversation, and document surfaces, has a GA playground that mirrors production behaviour, and offers detection as GA while anonymization by synthetic replacement is preview. Sentiment analysis and opinion mining is legacy and preconfigured — polarity, with opinion mining linking sentiment to specific elements — so it cannot be taught new categories, though its container can make it decisive under residency constraints. Content Safety handles harmful content through four categories at safe/low/medium/high, defaulting to medium on prompts and completions. And tone — frustration, urgency, formality — has no preconfigured feature at all, so it needs a classify field with your own enum plus a rationale and confidence-based routing.

Loading Diagram...
Figure 3 — Mermaid diagram
Loading flashcards…

Sources and freshness

Written against current Microsoft Learn documentation for the AI-103 skills measured (16 April 2026), reviewed 2026-08-20. Microsoft Learn controls every changing product contract — availability, preview status, quotas, limits, regional support, naming, and retirement dates all move independently of this lesson. Where a scenario turns on a specific number or a GA/preview boundary, confirm it against the product's own page before relying on it.

All Developing AI Apps and Agents on Azure (AI-103) Study Resources

Related Notes

  • Choose an appropriate method for retrieval and indexing2,778 words
  • Quick Note — Choose an appropriate method for retrieval and indexing888 words
  • Choose an appropriate model for each task, including LLMs, small language models, multimodal models, and Foundry Tools3,097 words
  • Quick Note — Choose an appropriate model for each task, including LLMs, small language models, multimodal models, and Foundry Tools1,041 words
  • Choose appropriate memory, tool, and knowledge integration services for agent solutions2,815 words
  • Quick Note — Choose appropriate memory, tool, and knowledge integration services for agent solutions949 words
  • Choose the appropriate Foundry services for generative tasks, grounding, vector search, agent workflows, or multimodal processing2,733 words
  • Quick Note — Choose the appropriate Foundry services for generative tasks, grounding, vector search, agent workflows, or multimodal processing901 words
  • Apply responsible AI instrumentation, including evaluators, safety evaluations, and explanation tooling2,891 words
  • Configure safety filters, guardrails, risk detection, and content moderation2,795 words
  • Govern agent behavior with oversight modes, constraints, and tool-access controls2,863 words
  • Implement auditing through trace logging, provenance metadata, and approval workflows2,624 words

Ready to study Developing AI Apps and Agents on Azure (AI-103)?

Practice tests, flashcards, and all study notes — free, no sign-up.

Start Studying

Ready to study Developing AI Apps and Agents on Azure (AI-103)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free
Developing AI Apps and Agents on Azure (AI-103) ResourcesExplore All HivesBlogHome

© 2026 BrainyBee. Free AI-powered exam prep.

Loading Diagram...
Flowchart, top to bottom. Detection need connects to What is being detected?. A connects to PII detection - CORE<br/>text / conversation / document<br/>PII and PHI (An individual's information). A connects to Sentiment + opinion mining - LEGACY<br/>positive/negative, linked to elements (Polarity of opinion). A connects to Content Safety harm categories<br/>safe/low/medium/high, default medium (Harmful content). A connects to NO preconfigured feature -<br/>classify field with YOUR enum (Tone: frustrated, urgent, formal). A connects to Text analytics for health - CORE (Clinical information).
Loading Diagram...
Flowchart, left to right. Incoming text connects to 1. Detect + redact PII<br/>minimise what enters a model. PII connects to 2. Safety checks at the boundary<br/>harm categories, threshold medium. SAFE connects to 3. Analytical detection<br/>sentiment / tone / topic. ANA connects to 4. Route on confidence 0-1. CONF connects to Low confidence to review.
Loading Diagram...
Flowchart, top to bottom. Detection connects to PII - CORE. Detection] --> PII[PII - CORE connects to Sentiment - LEGACY. Detection] --> PII[PII - CORE connects to Content Safety. Detection] --> PII[PII - CORE connects to Tone. PII connects to Text / conversation / document. PII connects to PII and PHI. PII connects to Playground GA, mirrors production. PII connects to Anonymization = PREVIEW. 10 more statements.

Detection — retrieval

Card 1 of 6

Front of flashcard 1 of 6

Which side of the split are sentiment and PII on?

hard

PII detection is CORE — "recommended for new development". Sentiment analysis and opinion mining is LEGACY — "supported for existing implementations". They are frequently offered together as distractors.

core-legacy

Detection — retrieval

Card 1

Front

Which side of the split are sentiment and PII on?

Back

PII detection is CORE — "recommended for new development". Sentiment analysis and opinion mining is LEGACY — "supported for existing implementations". They are frequently offered together as distractors.

Card 2

Front

PII detection surfaces

Back

Text PII (unstructured text), Conversation PII (chat or transcripts), and Document PII (native .pdf, .docx, .txt). Covers "PII and PHI". Detection is GA; anonymization (synthetic replacement) is preview.

Card 3

Front

What opinion mining adds

Back

It links positive/negative sentiment to specific elements within the text — aspect-level rather than document-level. So one review can be positive about delivery and negative about packaging in a single result.

Card 4

Front

Why sentiment cannot detect tone

Back

Its documented scope is "positive or negative sentiments" — polarity — and it is preconfigured, so "the AI models it uses can't be changed". Frustration, urgency, formality need a vocabulary you define in a classify field with an enum.

Card 5

Front

The Document PII playground

Back

Generally available, with "curated sample documents and expected outputs" so you can evaluate "without uploading your own data" — and it "uses the same Document PII model and policies as the production API, so results align with production behavior".

Card 6

Front

When legacy is still the right answer

Back

When a specific constraint makes it decisive — most often an on-premises container, available for sentiment analysis, language detection, key phrase extraction, custom NER, text analytics for health, and summarization. Legacy means supported for existing implementations, not deprecated.

Detection — retrieval

Card 1

Front

Which side of the split are sentiment and PII on?

Back

PII detection is CORE — "recommended for new development". Sentiment analysis and opinion mining is LEGACY — "supported for existing implementations". They are frequently offered together as distractors.

Card 2

Front

PII detection surfaces

Back

Text PII (unstructured text), Conversation PII (chat or transcripts), and Document PII (native .pdf, .docx, .txt). Covers "PII and PHI". Detection is GA; anonymization (synthetic replacement) is preview.

Card 3

Front

What opinion mining adds

Back

It links positive/negative sentiment to specific elements within the text — aspect-level rather than document-level. So one review can be positive about delivery and negative about packaging in a single result.

Card 4

Front

Why sentiment cannot detect tone

Back

Its documented scope is "positive or negative sentiments" — polarity — and it is preconfigured, so "the AI models it uses can't be changed". Frustration, urgency, formality need a vocabulary you define in a classify field with an enum.

Card 5

Front

The Document PII playground

Back

Generally available, with "curated sample documents and expected outputs" so you can evaluate "without uploading your own data" — and it "uses the same Document PII model and policies as the production API, so results align with production behavior".

Card 6

Front

When legacy is still the right answer

Back

When a specific constraint makes it decisive — most often an on-premises container, available for sentiment analysis, language detection, key phrase extraction, custom NER, text analytics for health, and summarization. Legacy means supported for existing implementations, not deprecated.