AI-901 ยท Text and speech solutions
Text analysis app with Azure Language (Python)
Reading Python that sends documents to a language capability for sentiment, key phrases, entities or summarization, and choosing the right call for the task.
Key points
- pip install azure-ai-textanalytics.
- Build TextAnalyticsClient(endpoint=<Language endpoint>, credential=AzureKeyCredential(<key>)), pass a list of strings, and call the method that matches the task: analyze_sentiment (tone), extract_key_phrases (main points), recognize_entities (people, places, organizations), detect_language (language code).
- Each call returns one result per document.
Practice questions
Which Python class is the client for sending documents to Azure Language for sentiment analysis?
- SpeechRecognizer
- TextAnalyticsClient
- AIProjectClient
- SpeechSynthesizer
Show answer
Answer: B. TextAnalyticsClient
TextAnalyticsClient from azure.ai.textanalytics is the Language client. SpeechRecognizer belongs to the Speech SDK, and AIProjectClient is for Foundry projects.
Which tasks can you do by sending text to the Azure Language capabilities?
- Detect whether a review is positive or negative
- Pull out the main talking points of an article
- Find company and city names in a paragraph
- Read an article aloud in a chosen voice
- Transcribe a recorded phone call
Show answer
Answer: A. Detect whether a review is positive or negative, B. Pull out the main talking points of an article, C. Find company and city names in a paragraph
Sentiment, key phrases and entity recognition are text analysis features. Turning text into audio is Speech synthesis, and transcribing a recording is Speech recognition.
Before you can run sentiment analysis, you must train a custom model on your own labeled data.
Show answer
Answer: False
False. Sentiment analysis uses a prebuilt model as-is, with no training step. You only need a Language resource endpoint and key.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
