{
  "schema": "https://ai-atoms.com/schemas/skill-v1.json",
  "type": "skill",
  "id": "skill/azure-ai-textanalytics-py",
  "version": "1.0.1",
  "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.\nTriggers: \"text analytics\", \"sentiment analysis\", \"entity recognition\", \"key phrase\", \"PII detection\", \"TextAnalyticsClient\".",
  "system_prompt_fragment": "# Azure AI Text Analytics SDK for Python\n\nClient library for Azure AI Language service NLP capabilities including sentiment, entities, key phrases, and more.\n\n## Installation\n\n```bash\npip install azure-ai-textanalytics\n```\n\n## Environment Variables\n\n```bash\nAZURE_LANGUAGE_ENDPOINT=https://<resource>.cognitiveservices.azure.com\nAZURE_LANGUAGE_KEY=<your-api-key>  # If using API key\n```\n\n## Authentication\n\n### API Key\n\n```python\nimport os\nfrom azure.core.credentials import AzureKeyCredential\nfrom azure.ai.textanalytics import TextAnalyticsClient\n\nendpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\nkey = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\nclient = TextAnalyticsClient(endpoint, AzureKeyCredential(key))\n```\n\n### Entra ID (Recommended)\n\n```python\nfrom azure.ai.textanalytics import TextAnalyticsClient\nfrom azure.identity import DefaultAzureCredential\n\nclient = TextAnalyticsClient(\n    endpoint=os.environ[\"AZURE_LANGUAGE_ENDPOINT\"],\n    credential=DefaultAzureCredential()\n)\n```\n\n## Sentiment Analysis\n\n```python\ndocuments = [\n    \"I had a wonderful trip to Seattle last week!\",\n    \"The food was terrible and the service was slow.\"\n]\n\nresult = client.analyze_sentiment(documents, show_opinion_mining=True)\n\nfor doc in result:\n    if not doc.is_error:\n        print(f\"Sentiment: {doc.sentiment}\")\n        print(f\"Scores: pos={doc.confidence_scores.positive:.2f}, \"\n              f\"neg={doc.confidence_scores.negative:.2f}, \"\n              f\"neu={doc.confidence_scores.neutral:.2f}\")\n        \n        # Opinion mining (aspect-based sentiment)\n        for sentence in doc.sentences:\n            for opinion in sentence.mined_opinions:\n                target = opinion.target\n                print(f\"  Target: '{target.text}' - {target.sentiment}\")\n                for assessment in opinion.assessments:\n                    print(f\"    Assessment: '{assessment.text}' - {assessment.sentiment}\")\n```\n\n## Entity Recognition\n\n```python\ndocuments = [\"Microsoft was founded by Bill Gates and Paul Allen in Albuquerque.\"]\n\nresult = client.recognize_entities(documents)\n\nfor doc in result:\n    if not doc.is_error:\n        for entity in doc.entities:\n            print(f\"Entity: {entity.text}\")\n            print(f\"  Category: {entity.category}\")\n            print(f\"  Subcategory: {entity.subcategory}\")\n            print(f\"  Confidence: {entity.confidence_score:.2f}\")\n```\n\n## PII Detection\n\n```python\ndocuments = [\"My SSN is 123-45-6789 and my email is john@example.com\"]\n\nresult = client.recognize_pii_entities(documents)\n\nfor doc in result:\n    if not doc.is_error:\n        print(f\"Redacted: {doc.redacted_text}\")\n        for entity in doc.entities:\n            print(f\"PII: {entity.text} ({entity.category})\")\n```\n\n## Key Phrase Extraction\n\n```python\ndocuments = [\"Azure AI provides powerful machine learning capabilities for developers.\"]\n\nresult = client.extract_key_phrases(documents)\n\nfor doc in result:\n    if not doc.is_error:\n        print(f\"Key phrases: {doc.key_phrases}\")\n```\n\n## Language Detection\n\n```python\ndocuments = [\"Ce document est en francais.\", \"This is written in English.\"]\n\nresult = client.detect_language(documents)\n\nfor doc in result:\n    if not doc.is_error:\n        print(f\"Language: {doc.primary_language.name} ({doc.primary_language.iso6391_name})\")\n        print(f\"Confidence: {doc.primary_language.confidence_score:.2f}\")\n```\n\n## Healthcare Text Analytics\n\n```python\ndocuments = [\"Patient has diabetes and was prescribed metformin 500mg twice daily.\"]\n\npoller = client.begin_analyze_healthcare_entities(documents)\nresult = poller.result()\n\nfor doc in result:\n    if not doc.is_error:\n        for entity in doc.entities:\n            print(f\"Entity: {entity.text}\")\n            print(f\"  Category: {entity.category}\")\n            print(f\"  Normalized: {entity.normalized_text}\")\n            \n            # Entity links (UMLS, etc.)\n            for link in entity.data_sources:\n                print(f\"  Link: {link.name} - {link.entity_id}\")\n```\n\n## Multiple Analysis (Batch)\n\n```python\nfrom azure.ai.textanalytics import (\n    RecognizeEntitiesAction,\n    ExtractKeyPhrasesAction,\n    AnalyzeSentimentAction\n)\n\ndocuments = [\"Microsoft announced new Azure AI features at Build conference.\"]\n\npoller = client.begin_analyze_actions(\n    documents,\n    actions=[\n        RecognizeEntitiesAction(),\n        ExtractKeyPhrasesAction(),\n        AnalyzeSentimentAction()\n    ]\n)\n\nresults = poller.result()\nfor doc_results in results:\n    for result in doc_results:\n        if result.kind == \"EntityRecognition\":\n            print(f\"Entities: {[e.text for e in result.entities]}\")\n        elif result.kind == \"KeyPhraseExtraction\":\n            print(f\"Key phrases: {result.key_phrases}\")\n        elif result.kind == \"SentimentAnalysis\":\n            print(f\"Sentiment: {result.sentiment}\")\n```\n\n## Async Client\n\n```python\nfrom azure.ai.textanalytics.aio import TextAnalyticsClient\nfrom azure.identity.aio import DefaultAzureCredential\n\nasync def analyze():\n    async with TextAnalyticsClient(\n        endpoint=endpoint,\n        credential=DefaultAzureCredential()\n    ) as client:\n        result = await client.analyze_sentiment(documents)\n        # Process results...\n```\n\n## Client Types\n\n| Client | Purpose |\n|--------|---------|\n| `TextAnalyticsClient` | All text analytics operations |\n| `TextAnalyticsClient` (aio) | Async version |\n\n## Available Operations\n\n| Method | Description |\n|--------|-------------|\n| `analyze_sentiment` | Sentiment analysis with opinion mining |\n| `recognize_entities` | Named entity recognition |\n| `recognize_pii_entities` | PII detection and redaction |\n| `recognize_linked_entities` | Entity linking to Wikipedia |\n| `extract_key_phrases` | Key phrase extraction |\n| `detect_language` | Language detection |\n| `begin_analyze_healthcare_entities` | Healthcare NLP (long-running) |\n| `begin_analyze_actions` | Multiple analyses in batch |\n\n## Best Practices\n\n1. **Use batch operations** for multiple documents (up to 10 per request)\n2. **Enable opinion mining** for detailed aspect-based sentiment\n3. **Use async client** for high-throughput scenarios\n4. **Handle document errors** — results list may contain errors for some docs\n5. **Specify language** when known to improve accuracy\n6. **Use context manager** or close client explicitly\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.",
  "applicable_domains": [
    "devops"
  ],
  "category": "devops",
  "invocation": [
    "/azure-ai-textanalytics-py"
  ],
  "authored_by": "claudeskills.in community",
  "source_url": "https://claudeskills.in/skill/azure-ai-textanalytics-py",
  "provenance": {
    "source": "claudeskills.in",
    "source_url": "https://claudeskills.in/skill/azure-ai-textanalytics-py",
    "license": "unknown",
    "imported_at": "2026-09-03",
    "notes": "Aggregated by claudeskills.in from community GitHub lists."
  },
  "tags": [
    "claudeskills",
    "devops"
  ],
  "lifecycle": "draft"
}