[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-333ac270-94b5-4a91-baf9-ac16f1b864f7":3,"$fHgFTzLc4sL8E5risoPG_Xq1VkqHZVtPL28ikE3wse68":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"333ac270-94b5-4a91-baf9-ac16f1b864f7","azure-ai-textanalytics-py","Azure AI文本分析SDK，用于情感分析、实体识别、关键词、语言检测、个人身份信息（PII）和医疗NLP。用于文本的自然语言处理。","cat_coding_devops","mod_coding","sickn33,coding","---\nname: azure-ai-textanalytics-py\ndescription: 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.\nrisk: unknown\nsource: community\ndate_added: '2026-02-27'\n---\n\n# 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:\u002F\u002F\u003Cresource>.cognitiveservices.azure.com\nAZURE_LANGUAGE_KEY=\u003Cyour-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.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,232,1236,"2026-05-16 13:05:25",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"DevOps","devops","mdi-cog-outline","CI\u002FCD、容器化、部署运维",3,162,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"5d8bdb19-fcdf-4ba4-bc47-f37f5005ed73","1.0.0","azure-ai-textanalytics-py.zip",2504,"uploads\u002Fskills\u002F333ac270-94b5-4a91-baf9-ac16f1b864f7\u002Fazure-ai-textanalytics-py.zip","b0b5628fc81edd9c6ca1089f2243e0e0f87875f22b263794667a75c9bea36195","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":7001}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]