Course menuAI-901

Exams / AI-901 / Study guide / Text analysis and speech apps

Text analysis and speech apps: AI-901 study notes and practice questions

What to know about Text analysis and speech apps for the AI-901 exam, from the Implement AI solutions by using Microsoft Foundry domain (58% of the exam guide), then 5 free questions to test it. Part of the AI-901 study guide.

Last verified against current Microsoft Learn ·How we write our questions

What to know for the exam

Domain 1 asks what text analysis and speech can do. This topic asks how an app uses them. You find the services in the Foundry portal under Build, then Services, and each service page has a Code tab with a sample.

Text analysis in code

Install the azure-ai-textanalytics and azure-core packages. Create a TextAnalyticsClient with the resource endpoint (it looks like https://<resource>.cognitiveservices.azure.com/) and a credential, usually AzureKeyCredential(key). Storing the endpoint and key in environment variables, not in code, is the safe habit.

In the course lab, the app calls recognize_pii_entities(documents, language="en"). Each result item reports whether it is an error (is_error), the redacted_text, and a list of entities, each with its text, category, confidence score, offset and length. The pattern is the same for other features: send a list of documents, get back one result per document, and check for an error before using it.

Speech in apps

  • In the portal, an agent with Voice mode enabled can listen and speak using Azure Speech Voice Live. You pick a voice in the configuration pane, allow the microphone, and watch the status change between Listening and Speaking. A captions button shows the transcript, and Call agent shows client code.
  • Other ways to use Azure Speech are the Speech SDK, the Speech CLI, REST APIs (for example batch transcription) and containers.

How to choose

Scenario Tool
Redact personal data in text Azure Language PII detection
Spoken conversation with an agent Voice mode and Voice Live
Transcribe many audio files Batch transcription
Read text aloud Text to speech

Common traps

  • Wrong credential. Language and Speech samples use a resource key. The agent client uses Microsoft Entra ID.
  • Ignoring errors. A document in the batch can fail while others succeed, which is why is_error exists.
  • Mixing up endpoints. The Language endpoint is not the Foundry project endpoint.

Try the 5 practice questions

A dental clinic network collects written feedback from patients in Spanish, Vietnamese and Arabic.

Its quality team reads only English, and it wants each comment converted into English text before review.

Which Foundry Tool should the team use?

Choose one answer.

  1. A. Azure Language language detection, which reports the language each comment is written in
  2. B. Azure Speech speech translation, which translates spoken audio into another language
  3. C. Azure Translator, which translates written text from one language into another
  4. D. Azure Language PII detection, which masks names and phone numbers in each comment
Show the answer and explanation

Answer: C

  • A. Wrong: Language detection tells the team which language a comment uses. It does not convert the comment, so the team still could not read it.
  • B. Wrong: Speech translation starts from spoken audio. The feedback is already written, so the text-based Translator is the better fit.
  • C. Right: Correct. Azure Translator converts written text between languages, so each comment can be returned in English. It works directly on the typed feedback. Learn more: What are Foundry Tools? (opens in a new tab)
  • D. Wrong: PII detection finds and masks personal details in text. It leaves the comment in its original language, so the team could not read it.

Explanation

The input is written text and the output must be the same text in English, which is Azure Translator. Language detection only identifies the language, and speech translation works on audio. PII detection protects personal details but does not translate.

Study

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.

  1. A. the entities attribute
  2. B. the redacted_text attribute
  3. C. the is_error attribute
  4. D. 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.

Study

A seaside resort receives guest voicemails at its front desk. The manager wants each message converted to text, so staff can search and read the messages during the day.

The voicemails are audio recordings, not typed text. Which Foundry Tool should the resort use to create the text?

Choose one answer.

  1. A. Azure Translator, which converts written text from one language into another
  2. B. Azure Speech text-to-speech, which turns written text into spoken audio
  3. C. Azure Speech speech-to-text, which turns recorded audio into written text
  4. D. Azure Language sentiment analysis, which rates whether written text is positive, negative or mixed
Show the answer and explanation

Answer: C

  • A. Wrong: Translator works on text that already exists, so it cannot create text from recordings. It would change the language of messages but not transcribe them.
  • B. Wrong: Text-to-speech runs in the opposite direction, from text to audio. It would make spoken replies, not written transcripts of guest messages.
  • C. Right: Correct. Speech-to-text transcribes audio recordings into text, which lets staff search the messages. It fits the audio input the resort has. Learn more: What is the Speech service? (opens in a new tab)
  • D. Wrong: Sentiment analysis needs written text as input and scores its tone. The resort does not yet have the words, so this cannot create the transcripts.

Explanation

The resort has audio and needs text, so speech-to-text is the Foundry Tool to use. Text-to-speech, translation and sentiment analysis each start from written text, which the voicemails are not.

Study

Question 4

Harder · choose 2 ·Link to this question (question 4)

A primary-school reading app is being built on Foundry Tools. It must read each lesson aloud in a natural, child-friendly voice. It must also score how accurately a pupil pronounces each spoken word, so teachers can track progress.

Which two Azure Speech capabilities meet these requirements? (Choose two.)

Choose two answers.

  1. A. Speech-to-text real-time transcription, which writes down the words a pupil says
  2. B. Text-to-speech with a neural voice, which reads lesson text aloud naturally
  3. C. Azure Language key phrase extraction, which lists the main terms in each lesson
  4. D. Speech translation, which converts a pupil's spoken words into another language
  5. E. Pronunciation assessment, which scores how accurately each spoken word is said
Show the answer and explanation

Answers: B, E

  • A. Wrong: Real-time transcription writes down what a pupil says, but it does not judge how well each word is pronounced. Teachers would still lack the score they need.
  • B. Right: Correct. Text-to-speech with a neural voice reads each lesson aloud in natural-sounding audio. This covers the reading requirement. Learn more: What is the Speech service? (opens in a new tab)
  • C. Wrong: Key phrase extraction is a text analysis feature for written text. It does not read lessons aloud or score pronunciation.
  • D. Wrong: Speech translation changes spoken language into another language. The app needs pronunciation feedback in the same language, so this does not fit.
  • E. Right: Correct. Pronunciation assessment compares a pupil's spoken words with the expected pronunciation and returns scores. This covers the scoring requirement.

Explanation

Neural text-to-speech handles the reading requirement, and pronunciation assessment handles the scoring requirement. Transcription, translation and key phrase extraction each address a different need.

Study

A concert ticketing company is adding voice and text features to its customer app. Its architects are matching each feature to a Foundry Tool.

Which of these statements about Azure Speech and Azure Language are true?

For each statement, choose Yes if the statement is true. Otherwise, choose No.

  1. A. Azure Language detects which language a typed customer message is written in.
  2. B. Azure Language analyzes the sound of a recorded call directly, without converting it to text first.
  3. C. Azure Speech can identify the language being spoken in a recorded customer call.
Show the answer and explanation
  • A. Yes. Yes. Language detection is an Azure Language feature that works on text, so it fits typed messages in any language the service supports.
  • B. No. No. Azure Language works on text. A recorded call must first be converted to text with Azure Speech before Azure Language can analyze its words.
  • C. Yes. Yes. Language identification is an Azure Speech capability that works on audio, so it can tell which language a caller speaks.

Explanation

Speech handles audio, and Language handles text. Language detection in Azure Language works on typed text, while language identification in Azure Speech works on spoken audio.

Study

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

Study Text analysis and speech apps

More Implement AI solutions by using Microsoft Foundry topics

Every exam starts with free questions. No account needed.