Official agent skill

Azure AI Textanalytics Py

by microsoft in microsoft/skills

Azure AI Text Analytics SDK for sentiment analysis, entity recognition, key phrases, language detection, PII, and healthcare NLP.

OfficialMITAuto-check passedSales & Support

Install Azure AI Textanalytics Py

skills CLI
$ npx skills add microsoft/skills --skill azure-ai-textanalytics-py -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/skills azure-ai-textanalytics-py --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/plugins/azure-sdk-python/skills/azure-ai-textanalytics-py .claude/skills/azure-ai-textanalytics-py && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
azure-ai-textanalytics-py
GitHub stars
3.1k
Used in
6 other repos
Token cost
~2.4k tokens
SKILL.md length
389 words
Files
3 (incl. references)
Skills in repo
150
Repo updated
First seen
Licence
MIT

At a glance

Azure AI Text Analytics SDK for sentiment analysis, entity recognition, key phrases, language detection, PII, and healthcare NLP.

  • Works in 7 steps: Pick sync OR async and stay consistent.… → Always use context managers for clients… → Use batch operations for multiple… → …
  • Natural language processing on text
  • SKILL.md covers Installation, Environment Variables, Authentication & Lifecycle and Sentiment Analysis, plus 11 more sections
  • Calls pip; reaches learn.microsoft.com; needs AZURE_TOKEN_CREDENTIALS and AZURE_LANGUAGE_KEY

What it does

Azure AI Textanalytics Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Azure AI Text Analytics SDK for sentiment analysis, entity recognition, key phrases, language detection, PII, and healthcare NLP. Use for natural language processing on text. Triggers: "text analytics", "sentiment analysis", "entity recognition", "key phrase", "PII detection", "TextAnalyticsClient".

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/capabilities.md` and `references/non-hero-scenarios.md`).

It sits in Sales & Support, covering Customer feedback analysis and Natural language processing. It works with Microsoft Azure and Visual Studio Code. The repository describes itself as: Skills, MCP servers, Custom Agents, Agents.md for SDKs to ground Coding Agents. The licence is MIT.

When your agent uses it

  • Natural language processing on text
  • Tasks that involve Customer feedback analysis
  • Tasks that involve Natural language processing

Example prompts

  • “text analytics”
  • “sentiment analysis”
  • “entity recognition”
  • “/azure-ai-textanalytics-py”

Requirements

  • Python 3
  • A credential in AZURE_LANGUAGE_KEY

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Pick sync OR async and stay consistent. Do not mix azure.ai.textanalytics sync clients with azure.ai.textanalytics.aio async clients in…
  2. Always use context managers for clients and async credentials. Wrap every client in with TextAnalyticsClient(...) as client: (sync) or…
  3. Use batch operations for multiple documents (up to 10 per request)
  4. Enable opinion mining for detailed aspect-based sentiment
  5. Use async client for high-throughput scenarios
  6. Handle document errors — results list may contain errors for some docs
  7. Specify language when known to improve accuracy

What it can do on your machine

Read from SKILL.md and the folder at commit 354361d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • learn.microsoft.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • AZURE_TOKEN_CREDENTIALS
    • AZURE_LANGUAGE_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Azure AI Textanalytics Py loads about 2.4k tokens when it runs, and up to ~3.7k if it reads all its reference files. Until then it costs about 82 tokens; SKILL.md has 389 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~82
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/skills at commit 354361d, republished under its MIT licence (© microsoft). 389 words, ~2,391 tokens.

Download SKILL.mdSave it as .claude/skills/azure-ai-textanalytics-py/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
azure-ai-textanalytics-py
description
Azure AI Text Analytics SDK for sentiment analysis, entity recognition, key phrases, language detection, PII, and healthcare NLP. Use for natural language processing on text. Triggers: "text analytics", "sentiment analysis", "entity recognition", "key phrase", "PII detection", "TextAnalyticsClient".
license
MIT
metadata.author
Microsoft
metadata.version
1.0.0
metadata.package
azure-ai-textanalytics

Azure AI Text Analytics SDK for Python

Client library for Azure AI Language service NLP capabilities including sentiment, entities, key phrases, and more.

Installation

bash
pip install azure-ai-textanalytics

Environment Variables

bash
AZURE_LANGUAGE_ENDPOINT=https://<resource>.cognitiveservices.azure.com  # Required for all auth methods
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production
AZURE_LANGUAGE_KEY=<your-api-key>  # Only required for the legacy API-key auth path below

Authentication & Lifecycle

🔑 Two rules apply to every code sample below:

  1. Prefer DefaultAzureCredential. It works locally (Azure CLI / VS Code / Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account/API keys — they bypass Entra audit and rotation.
    • Local dev: DefaultAzureCredential works as-is.
    • Production: set AZURE_TOKEN_CREDENTIALS=prod (or AZURE_TOKEN_CREDENTIALS=<specific_credential>) to constrain the credential chain to production-safe credentials.
  2. Wrap every client in a context manager so HTTP transports, sockets, and token caches are released deterministically:
    • Sync: with <Client>(...) as client:
    • Async: async with <Client>(...) as client: and async with DefaultAzureCredential() as credential: (from azure.identity.aio)

Snippets may abbreviate this setup, but production code should always follow both rules.

python
import os
from azure.identity import DefaultAzureCredential, ManagedIdentityCredential
from azure.ai.textanalytics import TextAnalyticsClient

# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
credential = DefaultAzureCredential(require_envvar=True)
# Or use a specific credential directly in production:
# See https://learn.microsoft.com/python/api/overview/azure/identity-readme?view=azure-python#credential-classes
# credential = ManagedIdentityCredential()

with TextAnalyticsClient(
    endpoint=os.environ["AZURE_LANGUAGE_ENDPOINT"],
    credential=credential,
) as client:
    languages = client.detect_language(["Hello, world!"])
Legacy: API Key (existing keyed deployments)

New code should use DefaultAzureCredential above. Use AzureKeyCredential only if you have an existing keyed deployment that hasn't been migrated to Entra ID yet — for example, regulated environments still completing their Entra rollout.

python
import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.textanalytics import TextAnalyticsClient

with TextAnalyticsClient(
    endpoint=os.environ["AZURE_LANGUAGE_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["AZURE_LANGUAGE_KEY"]),
) as client:
    languages = client.detect_language(["Hello, world!"])

Sentiment Analysis

python
documents = [
    "I had a wonderful trip to Seattle last week!",
    "The food was terrible and the service was slow."
]

result = client.analyze_sentiment(documents, show_opinion_mining=True)

for doc in result:
    if not doc.is_error:
        print(f"Sentiment: {doc.sentiment}")
        print(f"Scores: pos={doc.confidence_scores.positive:.2f}, "
              f"neg={doc.confidence_scores.negative:.2f}, "
              f"neu={doc.confidence_scores.neutral:.2f}")
        
        # Opinion mining (aspect-based sentiment)
        for sentence in doc.sentences:
            for opinion in sentence.mined_opinions:
                target = opinion.target
                print(f"  Target: '{target.text}' - {target.sentiment}")
                for assessment in opinion.assessments:
                    print(f"    Assessment: '{assessment.text}' - {assessment.sentiment}")

Entity Recognition

python
documents = ["Microsoft was founded by Bill Gates and Paul Allen in Albuquerque."]

result = client.recognize_entities(documents)

for doc in result:
    if not doc.is_error:
        for entity in doc.entities:
            print(f"Entity: {entity.text}")
            print(f"  Category: {entity.category}")
            print(f"  Subcategory: {entity.subcategory}")
            print(f"  Confidence: {entity.confidence_score:.2f}")

PII Detection

python
documents = ["My SSN is 123-45-6789 and my email is john@example.com"]

result = client.recognize_pii_entities(documents)

for doc in result:
    if not doc.is_error:
        print(f"Redacted: {doc.redacted_text}")
        for entity in doc.entities:
            print(f"PII: {entity.text} ({entity.category})")

Key Phrase Extraction

python
documents = ["Azure AI provides powerful machine learning capabilities for developers."]

result = client.extract_key_phrases(documents)

for doc in result:
    if not doc.is_error:
        print(f"Key phrases: {doc.key_phrases}")

Language Detection

python
documents = ["Ce document est en francais.", "This is written in English."]

result = client.detect_language(documents)

for doc in result:
    if not doc.is_error:
        print(f"Language: {doc.primary_language.name} ({doc.primary_language.iso6391_name})")
        print(f"Confidence: {doc.primary_language.confidence_score:.2f}")

Healthcare Text Analytics

python
documents = ["Patient has diabetes and was prescribed metformin 500mg twice daily."]

poller = client.begin_analyze_healthcare_entities(documents)
result = poller.result()

for doc in result:
    if not doc.is_error:
        for entity in doc.entities:
            print(f"Entity: {entity.text}")
            print(f"  Category: {entity.category}")
            print(f"  Normalized: {entity.normalized_text}")
            
            # Entity links (UMLS, etc.)
            for link in entity.data_sources:
                print(f"  Link: {link.name} - {link.entity_id}")

Multiple Analysis (Batch)

python
from azure.ai.textanalytics import (
    RecognizeEntitiesAction,
    ExtractKeyPhrasesAction,
    AnalyzeSentimentAction
)

documents = ["Microsoft announced new Azure AI features at Build conference."]

poller = client.begin_analyze_actions(
    documents,
    actions=[
        RecognizeEntitiesAction(),
        ExtractKeyPhrasesAction(),
        AnalyzeSentimentAction()
    ]
)

results = poller.result()
for doc_results in results:
    for result in doc_results:
        if result.kind == "EntityRecognition":
            print(f"Entities: {[e.text for e in result.entities]}")
        elif result.kind == "KeyPhraseExtraction":
            print(f"Key phrases: {result.key_phrases}")
        elif result.kind == "SentimentAnalysis":
            print(f"Sentiment: {result.sentiment}")

Async Client

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

async def analyze():
    async with DefaultAzureCredential() as credential:
        async with TextAnalyticsClient(
            endpoint=endpoint,
            credential=credential
        ) as client:
            result = await client.analyze_sentiment(documents)
            # Process results...

Client Types

ClientPurpose
TextAnalyticsClientAll text analytics operations
TextAnalyticsClient (aio)Async version

Available Operations

MethodDescription
analyze_sentimentSentiment analysis with opinion mining
recognize_entitiesNamed entity recognition
recognize_pii_entitiesPII detection and redaction
recognize_linked_entitiesEntity linking to Wikipedia
extract_key_phrasesKey phrase extraction
detect_languageLanguage detection
begin_analyze_healthcare_entitiesHealthcare NLP (long-running)
begin_analyze_actionsMultiple analyses in batch
Show full SKILL.md (140 more words)Show less

Best Practices

  1. Pick sync OR async and stay consistent. Do not mix azure.ai.textanalytics sync clients with azure.ai.textanalytics.aio async clients in the same call path. Choose one mode per module.
  2. Always use context managers for clients and async credentials. Wrap every client in with TextAnalyticsClient(...) as client: (sync) or async with TextAnalyticsClient(...) as client: (async). For async DefaultAzureCredential from azure.identity.aio, also use async with credential: so tokens and transports are cleaned up.
  3. Use batch operations for multiple documents (up to 10 per request)
  4. Enable opinion mining for detailed aspect-based sentiment
  5. Use async client for high-throughput scenarios
  6. Handle document errors — results list may contain errors for some docs
  7. Specify language when known to improve accuracy

Reference Files

FileContents
references/capabilities.mdAdditional non-hero capabilities, operation-group coverage, and production checklists.
references/non-hero-scenarios.mdDedicated non-hero examples for secondary/advanced scenarios.

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .github/plugins/azure-sdk-python/skills/azure-ai-textanalytics-py of microsoft/skills.

  • SKILL.md
  • references/capabilities.md
  • references/non-hero-scenarios.md

Open the folder on GitHubat commit 354361d

Used in 6 other repositories

We found 18 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 6 other GitHub owners. This page covers the copy in microsoft/skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Azure AI Textanalytics Py next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Azure AI Textanalytics Py compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Azure AI Textanalytics Py this skillmicrosoft/skills3.1k6 repos~2.4kAutomated safety check: PassMIT
Sentiment AnalysisDrchronx/ai-agent-research-starter-kit135—~516Automated safety check: PassCustom licence
Natural Languagedpearson2699/swift-ios-skills1.2k1 repos~3.5kAutomated safety check: PassCustom licence
Analyzing Text With NLPjeremylongshore/tons-of-skills-marketplace2.8k1 repos~819Automated safety check: PassMIT
Crisis Detection Intervention AIcuriositech/some_claude_skills2433 repos~3.8kAutomated safety check: PassMIT
Content Analysisliangdabiao/claude-data-analysis-ultra-main2901 repos~1.7kAutomated safety check: NotesNone

Similar skills

  • Sentiment Analysis

    Drchronx/ai-agent-research-starter-kit

    Chinese sentiment analysis workflows using dictionary scoring, traditional machine learning classifiers, and LLM API calls.

    135 GitHub stars~516 tokensUpdated 4 mo ago
    Sales & SupportAuto-check passed
  • Natural Language

    dpearson2699/swift-ios-skills

    Tokenize, tag, and analyze natural language text using Apple's NaturalLanguage framework and translate between languages with the Translation framework.

    1.2k GitHub starsUsed in 1 repo~3.5k tokens
    AI & LLM EngineeringAuto-check passed
  • Analyzing Text With NLP

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to perform natural language processing and text analysis using the nlp-text-analyzer plugin.

    2.8k GitHub starsUsed in 1 repo~819 tokens
    AI & LLM EngineeringAuto-check passed
  • Crisis Detection Intervention AI

    curiositech/some_claude_skills

    Detect crisis signals in user content using NLP, mental health sentiment analysis, and safe intervention protocols.

    243 GitHub starsUsed in 3 repos~3.8k tokens
    Productivity & AutomationAuto-check passed
  • Content Analysis

    liangdabiao/claude-data-analysis-ultra-main

    Analyze text content using both traditional NLP and LLM-enhanced methods.

    290 GitHub starsUsed in 1 repo~1.7k tokens
    Writing & ContentAuto-check: notes
  • Osmo Lerobot Training

    microsoft/physical-ai-toolchain

    Official

    Submit, monitor, analyze, and evaluate LeRobot imitation learning training jobs on OSMO with Azure ML MLflow integration and inference evaluation - Brought to you by microsoft/physical-ai-toolchain

    123 GitHub stars~3.8k tokensUpdated yesterday
    DevOps & CloudAuto-check: notes

More from microsoft/skills

All 150 skills in this repo
  • Official

    Reference for building on Microsoft Foundry with the azure-ai-projects Python SDK: project clients, versioned agents, evaluations, connections, datasets and indexes.

    3.1k GitHub starsUsed in 6 repos~2.8k tokens
    Auto-check passed
  • Official

    Python guidance for the Azure AI Search SDK covering vector, hybrid and semantic search, index management and indexers, with Entra ID authentication preferred over keys.

    3.1k GitHub starsUsed in 6 repos~4.4k tokens
    Auto-check passed
  • Official

    Covers producer, consumer, and checkpoint-store setup for Azure Event Hubs streaming in Python, with Entra ID auth and partition targeting.

    3.1k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Pydantic Models Py

    microsoft/skills

    Official

    Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants.

    3.1k GitHub starsUsed in 6 repos~496 tokens
    Auto-check passed
  • DebugView CLI

    microsoft/skills

    Official

    Captures and filters Windows user-mode and kernel debug output from the command line with the Sysinternals DebugView CLI, including bounded runs suited to agents.

    3.1k GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed
  • Frontend UI Dark TS

    microsoft/skills

    Official

    Build dark-themed React applications using Tailwind CSS with custom theming, glassmorphism effects, and Framer Motion animations.

    3.1k GitHub starsUsed in 5 repos~3.6k tokens
    Auto-check passed

Questions about Azure AI Textanalytics Py

What does Azure AI Textanalytics Py do?

Azure AI Text Analytics SDK for sentiment analysis, entity recognition, key phrases, language detection, PII, and healthcare NLP. Azure AI Textanalytics Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Azure AI Text Analytics SDK for sentiment analysis, entity recognition, key phrases, language detection, PII, and healthcare NLP.

When should I use Azure AI Textanalytics Py?

Azure AI Textanalytics Py fits situations like: natural language processing on text; tasks that involve Customer feedback analysis; tasks that involve Natural language processing.

How do I install Azure AI Textanalytics Py in Claude Code?

Run `npx skills add microsoft/skills --skill azure-ai-textanalytics-py -a claude-code`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/azure-ai-textanalytics-py in microsoft/skills) into .claude/skills/azure-ai-textanalytics-py in your project. Claude Code loads it when a task matches its description.

How do I install Azure AI Textanalytics Py in Codex?

Run `npx skills add microsoft/skills --skill azure-ai-textanalytics-py -a codex`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/azure-ai-textanalytics-py in microsoft/skills) into .agents/skills/azure-ai-textanalytics-py in your project. Codex loads it when a task matches its description.

Can I use Azure AI Textanalytics Py in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/skills --skill azure-ai-textanalytics-py -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/azure-ai-textanalytics-py, .gemini/skills/azure-ai-textanalytics-py, .github/skills/azure-ai-textanalytics-py and .opencode/skills/azure-ai-textanalytics-py in your project.

What does Azure AI Textanalytics Py need to run?

Going by SKILL.md and its folder, Azure AI Textanalytics Py needs the command-line tools its instructions call (pip) and credentials named AZURE_TOKEN_CREDENTIALS and AZURE_LANGUAGE_KEY. Our summary lists: Python 3; A credential in AZURE_LANGUAGE_KEY.

Does Azure AI Textanalytics Py access the network?

SKILL.md names 1 domain. In commands or code: learn.microsoft.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Azure AI Textanalytics Py safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Azure AI Textanalytics Py use?

Azure AI Textanalytics Py is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Azure AI Textanalytics Py use?

About 2.4k tokens (SKILL.md is roughly 9.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.3k tokens, read only when the agent opens those files.

What are the alternatives to Azure AI Textanalytics Py?

Skills that share tags, products or a category with Azure AI Textanalytics Py: Sentiment Analysis (Drchronx/ai-agent-research-starter-kit, 135 stars), Natural Language (dpearson2699/swift-ios-skills, 1.2k stars), Analyzing Text With NLP (jeremylongshore/tons-of-skills-marketplace, 2.8k stars) and Crisis Detection Intervention AI (curiositech/some_claude_skills, 243 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Azure AI Textanalytics Py?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/skills, which has 3,091 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on October 6, 2026.

Source: microsoft/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.