Language: Sentiment, Summarization, CLU and Question Answering

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

See the section bibliography for the reference material consulted while preparing these pages.

This page targets Azure CLI 2.90.0, the Language text REST API 2024-11-01, the conversations REST API 2024-11-01, and the client libraries azure-ai-textanalytics 5.4.0, Azure.AI.TextAnalytics 5.3.0 and com.azure:azure-ai-textanalytics 5.5.15, checked on 2026-10-06.

End of support on 2029-03-31. Sentiment analysis and opinion mining, key phrase extraction, summarization, conversational language understanding (CLU), orchestration workflow, custom question answering and custom text classification are legacy Azure Language features. They keep working until 2029-03-31. Microsoft recommends moving them to Foundry Models (an LLM with a prompt or structured output). Start new work on an LLM, and plan the migration of existing work. See the official notice: What’s new in Azure Language.

Language’s core features (PII, NER, language detection, Text Analytics for health) are not affected. They are on Language: PII, Entities, Language Detection and Health.

Each section below gives the use case, a working call, and the LLM alternative: a short prompt you can send to a Foundry Model with structured output instead.

Sentiment analysis and opinion mining

Sentiment returns positive, neutral, negative or mixed per document and per sentence, with scores. Opinion mining links each opinion to its target ("the ending was rushed").

from azure.ai.textanalytics import TextAnalyticsClient
from azure.identity import DefaultAzureCredential

client = TextAnalyticsClient(
    endpoint="https://foundry-bookshelf.cognitiveservices.azure.com/",
    credential=DefaultAzureCredential(),
)
review = "Beautiful prose, but the ending felt rushed and the print quality was poor."
doc = client.analyze_sentiment([review], show_opinion_mining=True)[0]
print(doc.sentiment)
for sentence in doc.sentences:
    for opinion in sentence.mined_opinions:
        print(opinion.target.text, opinion.target.sentiment)
using Azure.AI.TextAnalytics;
using Azure.Identity;

var client = new TextAnalyticsClient(
    new Uri("https://foundry-bookshelf.cognitiveservices.azure.com/"), new DefaultAzureCredential());

DocumentSentiment sentiment = client.AnalyzeSentiment(
    "Beautiful prose, but the ending felt rushed.",
    options: new AnalyzeSentimentOptions { IncludeOpinionMining = true }).Value;
Console.WriteLine(sentiment.Sentiment);
import com.azure.ai.textanalytics.TextAnalyticsClient;
import com.azure.ai.textanalytics.TextAnalyticsClientBuilder;
import com.azure.ai.textanalytics.models.DocumentSentiment;
import com.azure.identity.DefaultAzureCredentialBuilder;

TextAnalyticsClient client = new TextAnalyticsClientBuilder()
    .endpoint("https://foundry-bookshelf.cognitiveservices.azure.com/")
    .credential(new DefaultAzureCredentialBuilder().build())
    .buildClient();

DocumentSentiment sentiment = client.analyzeSentiment("Beautiful prose, but the ending felt rushed.");
System.out.println(sentiment.getSentiment());

LLM alternative. Prompt: "Classify the overall sentiment of this book review as positive, neutral, negative or mixed. List each aspect mentioned (story, ending, characters, print quality, delivery) with its sentiment. Answer as JSON with fields sentiment and aspects." Use structured outputs with a JSON schema so the result is always parseable.

Key phrase extraction

Returns the main talking points of a text. Use it to tag reviews or tickets.

curl -s -X POST "https://$FOUNDRY.cognitiveservices.azure.com/language/:analyze-text?api-version=2024-11-01" \
  -H "Authorization: Bearer $(az account get-access-token --resource https://cognitiveservices.azure.com --query accessToken -o tsv)" \
  -H "Content-Type: application/json" \
  -d '{"kind":"KeyPhraseExtraction","analysisInput":{"documents":[{"id":"1","language":"en",
       "text":"The paperback arrived with a torn cover and the delivery took two weeks."}]}}'

LLM alternative. Prompt: "Return up to five short tags (two or three words each) that describe the main topics of this text, as a JSON array of strings."

Summarization

  • Text summarization: extractive (key sentences) or abstractive (a generated summary).

  • Conversation summarization: call-center recaps with issue and resolution aspects, chapter titles and narrative summaries.

  • Document summarization: native PDF/DOCX input.

poller = client.begin_abstract_summary([long_text], sentence_count=3)
for result in poller.result():
    print(result.summaries[0].text)

LLM alternative. Prompt: "Summarize this support call in three bullet points, then give the customer’s issue and the agent’s resolution as separate fields." An LLM handles long context and custom formats better, which is why Microsoft points summarization to Foundry Models.

Entity linking

Entity linking reaches end of support on 2028-09-01, earlier than the other legacy features. Use Language NER (Language: PII, Entities, Language Detection and Health) or a Foundry Model instead. See What’s new in Azure Language.

Entity linking disambiguates an entity and links it to a Wikipedia entry ("Mercury" the planet vs the element).

LLM alternative. Prompt: "For each named entity in this text, give its type and a one-line description that disambiguates it, as JSON." Or keep NER and look entities up in your own catalog.

Custom text classification

Train a model to put documents into your own categories (single-label or multi-label), for example ticket types.

LLM alternative. Prompt: "Classify this ticket into exactly one of: Shipping, Returns, Payment, Account, Other. Answer with the label only." For hundreds of labels or very high volume, a small fine-tuned model may beat both.

Conversational language understanding (CLU)

CLU predicts the intent of an utterance and extracts entities, from examples you label. It replaced LUIS. Recent versions add LLM quick deploy, which builds a working CLU model from intent descriptions without labeled data.

TOKEN=$(az account get-access-token --resource https://cognitiveservices.azure.com --query accessToken -o tsv)

curl -s -X POST \
  "https://$FOUNDRY.cognitiveservices.azure.com/language/:analyze-conversations?api-version=2024-11-01" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{
    "kind": "Conversation",
    "analysisInput": {"conversationItem": {"id": "1", "participantId": "user",
      "text": "I want to return the hardback I ordered last week"}},
    "parameters": {"projectName": "bookshelf-support", "deploymentName": "production"}
  }' | jq '.result.prediction.topIntent'

Source: CLU quickstart

LLM alternative. Prompt with function calling: declare one function per intent (start_return, track_order, ask_faq) with typed parameters, and let the model choose. This is how the Intent Routing agent template on Using Foundry Tools from Agents (MCP and Toolbox) works.

Orchestration workflow

Orchestration routes an utterance to the right CLU project or question answering project. It is the multi-bot dispatcher.

LLM alternative. A router prompt or an agent with tools, one per downstream project.

Custom question answering (CQA)

CQA builds a knowledge base from FAQ pages, manuals and editorial question-answer pairs, and returns the best answer with a confidence score. It supports multi-turn prompts and synonyms.

from azure.ai.language.questionanswering import QuestionAnsweringClient
from azure.identity import DefaultAzureCredential

qa = QuestionAnsweringClient(
    "https://foundry-bookshelf.cognitiveservices.azure.com/", DefaultAzureCredential()
)
output = qa.get_answers(
    question="How long do I have to return a book?",
    project_name="bookshelf-faq", deployment_name="production",
)
print(output.answers[0].answer, output.answers[0].confidence)

LLM alternative. Retrieval-augmented generation: index the FAQ in Azure AI Search and let a model answer from the retrieved passages with citations (Azure AI Search with Foundry Tools). Keep exact, approved answers where wording matters (returns policy, legal text): the Exact Question Answering agent template returns them verbatim.

Migrations from retired services

LUIS was fully retired on 2026-03-31. Existing LUIS applications can be imported into CLU in the Foundry portal (Import → LUIS JSON). Intents, entities and utterances carry over; prebuilt entities and patterns need review. See Migrate from LUIS.

QnA Maker was retired on 2025-03-31. Its knowledge bases migrate to custom question answering projects with the migration tool, keeping question-answer pairs, metadata and multi-turn prompts. See Migrate from QnA Maker.

Language Studio moves to the Foundry portal

Language Studio retires on 2027-03-20. Projects for custom NER, custom text classification, CLU, orchestration and CQA move to the Foundry portal (https://ai.azure.com). Use the migration steps in Migrate from Language Studio to the Foundry portal.

Provisioning

In the Azure portal

  1. Use the Foundry resource foundry-bookshelf.

  2. In the Foundry portal, open Fine-tuning → AI Service fine-tuning and create a Conversational language understanding or Custom question answering project. CQA needs an Azure AI Search resource for its index.

  3. Deploy the project, then call it with the project and deployment names.

With the Azure CLI

az role assignment create \
  --assignee "$(az ad signed-in-user show --query id -o tsv)" \
  --role "Cognitive Services Language Owner" \
  --scope "$(az cognitiveservices account show --name "$FOUNDRY" --resource-group "$RG" --query id -o tsv)"

Use cases

Scenario Feature (or LLM alternative) Why this feature Example input → output

Bookshelf: sentiment of book reviews

Opinion mining today; LLM with structured output for new work

Per-aspect sentiment feeds the review dashboard.

"Great story, poor binding" → positive story, negative print quality

Bookshelf: FAQ bot for shipping and returns

CQA, or AI Search RAG plus exact answers

Policy answers must be exact; other questions can be generated.

"How long do returns take?" → approved policy text

Review dashboards

Sentiment, key phrases

Trends across thousands of reviews.

Reviews → weekly sentiment by aspect

Support-ticket triage

Custom text classification or an LLM classifier

Route tickets automatically.

Ticket → Returns queue

Chatbot intent routing

CLU or LLM function calling

Map an utterance to an action.

"Cancel my order" → cancel_order(order_id)

Call-center recap

Conversation summarization

Issue and resolution for the CRM.

Transcript → issue, resolution, follow-up

When not to use it

  • For new projects, start with a Foundry Model; these features reach end of support on 2029-03-31.

  • For PII, NER, language detection and health, use the core features page; they are not legacy.

  • See Choosing a Foundry Tool (or a Foundry Model) for the trade-offs between prebuilt tools and LLMs.