> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started With Text Analysis in Azure

> Guide comparing prompt-driven general-purpose AI models and Azure Language for text analysis, explaining use cases, examples, and when to choose each.

Welcome to this lesson on text analysis in Azure. This guide covers two complementary approaches for extracting meaning from text:

* Flexible, prompt-driven general-purpose AI models (e.g., GPT-style models).
* Specialized Azure Language capabilities with pre-built, production-ready NLP features.

We first explore general-purpose models and a practical example, then review Azure Language and when to choose it. By the end, you’ll know which approach fits different scenarios and how to get started in the Azure portal.

***

## Text analysis with general-purpose AI models

General-purpose AI models are designed to handle many language tasks through natural-language prompts instead of requiring a different model for every task. You describe what you want in plain language and the model returns the result.

Common tasks you can perform with a single general-purpose model:

* Key phrase extraction: Identify important words or phrases (e.g., "excellent battery life", "bright display").
* Named Entity Recognition (NER): Detect entities like people, organizations, locations, and dates.
* Sentiment analysis: Determine tone (positive, negative, neutral).
* Text summarization: Create concise summaries that capture the main points.

The big advantage: you can ask for different analyses without switching services or endpoints—just change the prompt.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/4HrJDvvNdgcJzo1X/images/AI-901-Microsoft-Azure-AI-Fundamentals/Getting-Started-With-Text-Analysis/Getting-Started-With-Text-Analysis-in-Azure/general-ai-text-analysis-slide.jpg?fit=max&auto=format&n=4HrJDvvNdgcJzo1X&q=85&s=35fc69c5427655112d2e29f7c1b588d7" alt="A slide titled &#x22;Text Analysis With General-Purpose AI Models&#x22; that says natural language prompts can handle text analysis without task-specific models. Four labeled boxes list Key Phrase Extraction, Named Entity Recognition, Sentiment Analysis, and Text Summarization with colorful icons." width="1920" height="1080" data-path="images/AI-901-Microsoft-Azure-AI-Fundamentals/Getting-Started-With-Text-Analysis/Getting-Started-With-Text-Analysis-in-Azure/general-ai-text-analysis-slide.jpg" />
</Frame>

### Example: prompt-driven extraction

Below is a simple playground-style example that shows how you can extract locations using a single prompt (for example using `gpt-4.1-mini` or a similar general-purpose model):

```text theme={null}
List the places mentioned in this text:
---
Welcome to the AI Tour!
We're looking forward to seeing you in New York, Boston, Seattle, or San Francisco in July!
See the website for dates and venue details!
```

Example model output:

```text theme={null}
The places mentioned in the text are:
1. New York
2. Boston
3. Seattle
4. San Francisco
```

This interaction shows how the model interprets your instruction and returns only the requested information, without you having to build explicit extraction rules.

<Callout icon="lightbulb" color="#1CB2FE">
  General-purpose models are ideal for exploratory workflows, rapid prototyping, and tasks that change frequently—because you can refine or expand the prompt at any time.
</Callout>

<Callout icon="warning" color="#FF6B6B">
  Important: Outputs from general-purpose models can be non-deterministic. Responses may vary between runs (especially when generation settings like temperature allow randomness). For production systems that require highly consistent, structured outputs, you may need additional validation or post-processing.
</Callout>

***

## Text analysis with Azure Language

Azure Language provides specialized, pre-built NLP features that return structured results suited for production use. Instead of one flexible model, you get focused tools designed for specific tasks with predictable, structured outputs.

Key Azure Language capabilities:

* PII detection and redaction: Detect and optionally redact personally identifiable information (names, addresses, emails, phone numbers, SSNs), returning labeled entities or redacted text.
* Language detection: Automatically identify the language of a text to route content appropriately.
* Named Entity Recognition (NER): Detect entities (type, text, and character offsets).
* Text Analytics for health: Domain-specific extraction for clinical concepts—conditions, medications, procedures.
* Confidence scores: Each detected item typically includes a confidence value to support deterministic handling.

These features are useful when your workflow requires consistent output formats, compliance controls, or high-volume processing.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/4HrJDvvNdgcJzo1X/images/AI-901-Microsoft-Azure-AI-Fundamentals/Getting-Started-With-Text-Analysis/Getting-Started-With-Text-Analysis-in-Azure/azure-ai-language-text-pii-redaction.jpg?fit=max&auto=format&n=4HrJDvvNdgcJzo1X&q=85&s=f4ef9c2171ad1998f73f283a331dda86" alt="A screenshot of an Azure AI Language web UI titled &#x22;Text Analysis With Azure AI Language,&#x22; showing a &#x22;Text PII redaction&#x22; playground. The interface highlights detected PII in sample text (dates, names, organizations, addresses, SSNs) and lists extraction results in a sidebar." width="1920" height="1080" data-path="images/AI-901-Microsoft-Azure-AI-Fundamentals/Getting-Started-With-Text-Analysis/Getting-Started-With-Text-Analysis-in-Azure/azure-ai-language-text-pii-redaction.jpg" />
</Frame>

When redaction is enabled, the service can return text with sensitive values replaced by labels (for example, `[PERSON]` or `[ADDRESS]`) and provide the extracted items and confidence scores separately so downstream systems do not process raw PII.

***

## Choosing the right approach

Use this quick reference to decide which approach fits your needs.

| Scenario / Requirement | Recommended approach | Why |
| - | - | - |
| Exploratory analysis, ad-hoc queries, or conversational outputs | General-purpose AI models | Flexible prompts let you try multiple tasks without changing services. |
| Multiple different analyses in a single request | General-purpose AI models | You can ask the model to perform several tasks (e.g., topic extraction + sentiment + summary) in one prompt. |
| Production-grade, high-volume processing with predictable output | Azure Language | Structured results, consistent behavior, and efficient scaling. |
| Compliance-sensitive workflows (PII detection/redaction) | Azure Language | Built-in redaction and confidence scores simplify compliance controls. |
| Healthcare and clinical text processing | Azure Language (Text Analytics for health) | Domain-specific models trained for clinical extraction. |

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/4HrJDvvNdgcJzo1X/images/AI-901-Microsoft-Azure-AI-Fundamentals/Getting-Started-With-Text-Analysis/Getting-Started-With-Text-Analysis-in-Azure/choosing-right-approach-ai-vs-foundry.jpg?fit=max&auto=format&n=4HrJDvvNdgcJzo1X&q=85&s=16550cae39c785788956c828bd469ff7" alt="A slide titled &#x22;Choosing the Right Approach&#x22; comparing &#x22;General-Purpose AI Models&#x22; and &#x22;Azure Language in Foundry Tools.&#x22; Each column lists key points — flexible, prompt-driven NLP and natural-language responses on the left, and structured, production-grade results with confidence scores and compliance features on the right." width="1920" height="1080" data-path="images/AI-901-Microsoft-Azure-AI-Fundamentals/Getting-Started-With-Text-Analysis/Getting-Started-With-Text-Analysis-in-Azure/choosing-right-approach-ai-vs-foundry.jpg" />
</Frame>

***

## Summary and next steps

* Choose general-purpose models for flexibility, conversational outputs, and rapid iteration.
* Choose Azure Language for deterministic, structured, and compliance-focused text analysis at scale.
* In many workflows you may combine both: use general-purpose models for higher-level understanding and Azure Language for downstream, structured processing and compliance.

Proceed to the Azure portal to try sample projects, the Language Studio, and the PII redaction playground to evaluate which approach fits your use case.

## Links and references

* Azure Language documentation: [https://learn.microsoft.com/azure/ai-services/language/](https://learn.microsoft.com/azure/ai-services/language/)
* Azure Text Analytics overview: [https://learn.microsoft.com/azure/ai-services/text-analytics/](https://learn.microsoft.com/azure/ai-services/text-analytics/)
* Azure AI services: [https://azure.microsoft.com/services/cognitive-services/](https://azure.microsoft.com/services/cognitive-services/)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/ai-901-microsoft-azure-ai-fundamentals/module/623cf693-98db-46bd-b36b-b9f1d8ce4287/lesson/0699e986-3cfa-4f4e-83e0-b8a1b15b09ab" />
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.