AI-901 practice question: Text analysis and speech apps (2 of 5)
Implement AI solutions by using Microsoft Foundry A free question from our original AI-901 practice exam. Try it, then open the answer to see why each option is right or wrong.
A grocery chain stores its customer support chat transcripts. Before analysts read them, the developer must print each transcript with card and phone numbers masked.
from azure.ai.textanalytics import TextAnalyticsClient
from azure.core.credentials import AzureKeyCredential
client = TextAnalyticsClient(endpoint=ENDPOINT, credential=AzureKeyCredential(KEY))
result = client.recognize_pii_entities(documents, language="en")
for doc in result:
print(doc.________)
Which attribute of each result should replace the blank?
Choose one answer.
AA. the entities attribute
BB. the redacted_text attribute
CC. the is_error attribute
DD. the confidence_score attribute
Show the answer and explanation
Answer: B
A. Wrong: entities lists each personal item found, with its category and position. It shows what was detected, but the masked text is a separate attribute.
B. Right: Correct. redacted_text holds the document's text with the detected personal information masked. It is the value the team needs to print before analysts read the transcripts. Learn more: What is Azure Language? (opens in a new tab)
C. Wrong: is_error reports whether processing failed for a document. It is a status flag, so printing it would not show a masked transcript.
D. Wrong: confidence_score gives how sure the service is about one detected item. It is a number attached to each entity, not the masked transcript.
Explanation
recognize_pii_entities returns a result for each document. Each result exposes redacted_text with the personal details masked, while entities, error status and confidence values serve other purposes.
Want more on Text analysis and speech apps? The 5 full-length practice sets have 25 more Text analysis and speech apps questions, 225 in all, none of them in the free exam. One payment of $9.99 $6.99, no subscription. Get the practice sets →
✓ Every exam starts with free questions. No account needed.
Can we use Google Analytics cookies to see which pages help people? No ads, and we never sell data. Privacy