D1 · Text analysis and conversational AI

Fundamentals of — Natural Language Processing

NLP allows machines to understand, interpret, and generate human language. The AI-901 evaluates both the fundamental concepts and the specific Azure services for each NLP task.

What is NLP?

NLP (Natural Language Processing) is the field of AI that lets machines understand, interpret, and generate human text and speech. Unlike structured data (tables, numbers), natural language is ambiguous, contextual, and highly variable.

🧠

Understanding (NLU)

Understanding the meaning of text or speech: what did the user mean?

✍️

Generation (NLG)

Producing coherent text: summaries, responses, translations.

💬

Interaction (NLI)

Two-way dialogue: chatbots, voice assistants.

NLP processing pipeline

Raw text goes through stages before being analyzed:

1

Text input

Raw text: review, email, tweet, document.

2

Tokenization

Splits the text into units (tokens): words, subwords, or characters.

3

Normalization

Lowercasing, punctuation removal, stopwords, stemming/lemmatization.

4

Feature extraction

Representing text as numeric vectors (TF-IDF, word embeddings, BERT).

5

Model / NLP task

Applying the trained model for the specific task (classification, NER, etc.).

6

Structured output

Result: label, entities, translation, generated response.

Tokenization and normalization

Tokenization

Splitting text into minimal units called tokens. Can be at word, subword, or character level.

// Input

"The cat sleeps."

// Word tokens

["The", "cat", "sleeps", "."]

// Subword tokens (BPE)

["The", "▁cat", "▁sle", "eps", "."]

For the exam

Modern LLMs use subword tokenization. "ChatGPT" can be several tokens. The context limit is measured in tokens, not words.

Normalization

Stopwords

Frequent words without relevant semantic meaning: "the", "a", "of", "and". They are removed in tasks like search.

Stemming

Reduces words to their root by cutting suffixes: "running" → "runn". Fast but imprecise.

Lemmatization

Reduces to the base form (lemma) with grammatical context: "running" → "run". More precise than stemming.

Lowercase / normalization

Unifying uppercase/lowercase, removing accents, special characters to reduce variability.

Main NLP tasks

😊Sentiment analysis(Sentiment Analysis)

Determines whether a text expresses a positive, negative, or neutral opinion. It can also identify sentiment by aspect (opinion about specific aspects).

Practical example

"Shipping was fast but the product arrived damaged." → positive on shipping, negative on product.

Exam trap

Sentiment Analysis detects OPINION, not emotion. To detect specific emotions (anger, joy) you use emotion analysis, a different subset.

→

In Azure: Azure AI Language → Sentiment Analysis. Returns scores (0-1) for positive/negative/neutral and opinion mining by aspect.

🏷️Named entity recognition(Named Entity Recognition (NER))

Identifies and classifies named entities in text: people, organizations, places, dates, quantities, events, products.

Practical example

"Microsoft announced on May 14 in Seattle that Azure surpassed $50B in revenue." → Microsoft (ORG), May 14 (DATE), Seattle (LOC), $50B (MONEY).

Exam trap

identifies entities in unstructured text. It is NOT the same as extracting fields from documents (that's ).

→

In Azure: Azure AI Language → Named Entity Recognition. Also available: Entity Linking (links entities to Wikipedia/Bing).

🔑Key phrase extraction(Key Phrase Extraction)

Identifies the main concepts and topics of a text, extracting the most relevant phrases without classifying them as entities.

Practical example

"Customer service was excellent and delivery arrived earlier than expected." → key phrases: "customer service", "excellent", "delivery", "earlier than expected".

Exam trap

Key Phrase Extraction ≠ NER. Key phrases are important topics/concepts; NER are entities with a specific type (person, place, date). A topic summary uses key phrases; identifying named people uses NER.

→

In Azure: Azure AI Language → Key Phrase Extraction. Automatically supports multiple languages.

🌐Language detection(Language Detection)

Identifies the language a text is written in and returns an ISO code (e.g., "es" for Spanish) along with a confidence score.

Practical example

"Bonjour, comment allez-vous?" → fr (French), confidence: 0.99.

Exam trap

Language Detection ≠ Translation. It only identifies the language; to translate you use Azure Translator. It's typically used as the first step in multilingual pipelines.

→

In Azure: Azure AI Language → Language Detection. Also integrated into Translator as an automatic step.

🗂️

Assigns one or more predefined categories to a text. It's one of the most common NLP tasks in production.

Single-label classification

Each text receives exactly one category. Example: technical support → categories "Billing", "Bug", "Feature request".

Multi-label classification

A text can belong to multiple categories simultaneously. Example: news article → ["Technology", "Business", "AI"].

Typical use cases

Support ticket classification
Spam / phishing detection
Content moderation
Product review categorization
Email triage
Legal document classification
→

In Azure: Azure AI Language → Custom Text Classification. Lets you train with your own labels without ML experience.

🌍 Machine translation

Neural machine translation (NMT)

Modern translation models use transformers that translate considering the full context of the sentence, not word by word. They produce translations that are much more fluent and precise than earlier statistical approaches.

Automatic language detection

You don't need to specify the source language. The model detects it automatically before translating.

Transliteration

Converts text between writing systems without translating the meaning: Arabic → Latin characters for pronunciation.

Exam trap

Azure Translator ≠ Azure Language Service. Translator is only for translation. Language Service does sentiment, NER, key phrases, etc.

→

In Azure: Azure Translator — supports 100+ languages, real-time translation, Custom Translator for domain-specific terminology.

🎤 Voice: Speech-to-Text and Text-to-Speech

Converts spoken audio into written text. Also known as Automatic Speech Recognition (ASR).

Real-time (streaming) transcription
Batch transcription of audio files
Speaker identification (who spoke)
Automatic punctuation and capitalization
Custom vocabulary (technical names)

Text-to-Speech (TTS)

Converts written text into synthesized speech. Modern models generate neural voice that's nearly indistinguishable from human speech.

400+ voices in 140+ languages
Neural voices with natural intonation
Custom Neural Voice (personalized voice)
SSML to control speed, pitch, pauses
Avatars with lip sync

Exam trap: Speech Translation

Azure Speech Service includes Speech Translation: STT + Translation + TTS in a single call. This is different from calling the Translator API separately. The question may specify real-time voice translation — the answer is Azure Speech Service, not Azure Translator.

→

In Azure: Azure AI Speech — unifies STT, TTS, Speech Translation, Speaker Recognition, and Custom Keyword in one service.

Frequent exam traps

❓ Do Key Phrase Extraction and NER do the same thing?

No. Key Phrase Extraction identifies the most important topics/concepts of the text (without a specific type). NER identifies entities with a concrete category: person, organization, place, date. Use NER when you need to know WHAT TYPE of entity it is; use Key Phrases when you only need the main topics.

❓ Does sentiment analysis detect emotions?

Not exactly. Sentiment Analysis classifies opinion (positive/negative/neutral). Detecting specific emotions (anger, surprise, fear) is a different, more granular task. For the exam: if the question talks about "positive/negative" → Sentiment Analysis; if it talks about specific emotions → look for Emotion Detection.

❓ Does Azure Translator do text analysis?

No. Azure Translator only translates between languages. For sentiment, NER, key phrases, or classification, you use Azure AI Language Service. They are separate services with different purposes.

❓ Are Speech-to-Text and Language Detection the same thing?

No. STT converts audio into text. Language Detection identifies the language of already-written text. For audio in an unknown language: first STT (audio → text), then Language Detection (text → identified language).

Did you get this topic?

Test what you just learned

A company receives thousands of support tickets a day in multiple languages. They want to: (1) automatically identify the language of each ticket, (2) extract the name of the product mentioned, and (3) determine whether the customer is frustrated or satisfied. Which combination of NLP tasks is needed?

Ready to test "Text analysis — NLP"?

Put what you learned to the test with original AI-901 exam questions.

Start AI-901 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.