Implement text analysis solutions 4.1 Apply language model text analysis
Analysts need redacted support chats in which each removed value is replaced by a…
Study guide skill: Configure detection of sentiment, tone, safety issues, and sensitive content
Question B5-012
Analysts need redacted support chats in which each removed value is replaced by a numbered placeholder that names its entity type, such as [PERSON_1] or [PHONENUMBER_1], so they can still see what kind of data was removed. You call Azure Language text PII detection with the redactionPolicies parameter (introduced in a preview API version). Which policy kind should you use?
Select one answer.
Answer: B
The entityMask policy replaces each detected PII value with its entity type, for example [PERSON_1] and [PHONENUMBER_1]. characterMask replaces the value with a chosen character while preserving the original length and offset, so the type isn't visible, and noMask returns the response without a redactedText field at all. syntheticReplacement (preview) replaces each value with a substitute, such as a different name or phone number picked from a predefined set, rather than an entity-type placeholder.
Deep dive
How it works
Azure Language text PII detection identifies, classifies and redacts sensitive data and returns structured output, including redacted text, based on your API configuration. Newer preview API versions add a redactionPolicies parameter that controls how each detected value is masked. You can include more than one policy in a request: one acts as the defaultRedactionPolicy, and the others override it for specific entity types.
The policy field accepts four types:
- entityMask: replaces the detected text with its entity type, for example "[PERSON_1] received a call from [PHONENUMBER_1]". Analysts can still see what kind of data was removed.
- characterMask (the default): masks the text with a chosen character while keeping the original length and offset. An optional
redactionCharactersets the character. - noMask: returns the response without a
redactedTextfield. - syntheticReplacement (preview): replaces each value with a substitute, such as a different name or phone number, picked at random from a predefined set.
The other options, and when you'd use them
- syntheticReplacement: Use it when you want realistic-looking text without the real values. The output reads naturally, so the entity type isn't visible.
- noMask: Use it when you only need the detected entities and categories, not redacted text.
- characterMask: Use it when downstream systems rely on the original length and character offsets. Asterisks hide the value, but they don't say which entity type was there.
Exam tip
Match the output to the policy. "[PERSON_1]" is entityMask, "*****" is characterMask, a fake but realistic value is syntheticReplacement, and no redacted text at all is noMask.
References
Last reviewed: