Bitzu

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.

Source: https://learn.microsoft.com/en-us/azure/ai-services/language-service/sentiment-opinion-mining/quickstart?pivots=programming-language-python

Practice questions

Single choice

Which Python class is the client for sending documents to Azure Language for sentiment analysis?

  1. SpeechRecognizer
  2. TextAnalyticsClient
  3. AIProjectClient
  4. 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.

Select all that apply

Which tasks can you do by sending text to the Azure Language capabilities?

  1. Detect whether a review is positive or negative
  2. Pull out the main talking points of an article
  3. Find company and city names in a paragraph
  4. Read an article aloud in a chosen voice
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More AI-901 topics in this module