Analyze text with Azure Language in Foundry Tools | AI-103 | Episode 15
Need to identify a document’s language, extract people and places, or remove personal data? Azure Language in Foundry Tools provides purpose-built NLP capabilities without requiring an LLM.
Core capabilities to know
| Capability | Use it for |
|---|---|
| Language Detection | Identify the primary language of text |
| Named Entity Recognition (NER) | Extract and classify people, organizations, locations, dates, etc. |
| PII Detection | Find sensitive personal information and produce redacted text |
Key decision: prefer these specialized tools when you need predictable, focused text analysis. Compared with general-purpose LLMs, they can also be more appropriate where cost and latency matter. An LLM is better suited when the task requires broader reasoning or flexible natural-language generation.
Python mental model
from azure.identity import DefaultAzureCredential
from azure.ai.textanalytics import TextAnalyticsClient
client = TextAnalyticsClient(
endpoint=endpoint,
credential=DefaultAzureCredential()
)
docs = ["Alex visited Seattle last week."]
language = client.detect_language(docs)
entities = client.recognize_entities(docs)
pii = client.recognize_pii_entities(docs)
print(language[0].primary_language.name)
print([(e.text, e.category) for e in entities[0].entities])
print(pii[0].redacted_text)
Remember: endpoint + credential → TextAnalyticsClient → analysis method → structured result. Authentication can use credentials such as Microsoft Entra ID; document operations can also be performed in batches.
Scenario clues: “extract people, places and dates” → NER. “Remove customer details before publishing” → PII detection/redaction.
Comments