SPEECH A ND LA NGUA GE
PROCES SING (BCSE4 19)
o DR. SUVIDHA RUPESH KUMAR,
o ASSISTANT PROFESSOR,
o SCOPE, VIT CHENNAI
COURSE OBJECTIVES
1. BE COMPETENT WITH FUNDAMENTAL CONCEPTS
FOR NATURAL LANGUAGE PROCESSING AND
AUTOMATIC SPEECH RECOGNITION
2. TO UNDERSTAND TECHNOLOGIES INVOLVED IN
DEVELOPING SPEECH AND LANGUAGE
APPLICATIONS. o MODULE 1: INTRODUCTION TO NATURAL
3. TO DEMONSTRATE THE USE OF DEEP LEARNING
FOR BUILDING APPLICATIONS IN SPEECH AND
LANGUAGE PROCESSING
NATURAL LANGUAGE PROCESSING
o MODULE 2: TEXT PROCESSING AND
FEATURE REPRESENTATION
Course Outcomes At the end of this course,
student will be able to: o MODULE 3: APPLICATIONS OF NLP-1
1. Describe the importance of different NLP o MODULE 4: APPLICATIONS OF NLP-2
modules in Text processing and fundamentals
o MODULE 5: INTRODUCTION TO SPEECH
of speech production
2. Describe ways to represent speech and text
PROCESSING
3. Demonstrate the working of sequence models o MODULE 6: FEATURE REPRESENTATION
for text OF SPEECH SIGNAL
4. Use signal processing techniques to
analyze/represent the speech signal o MODULE 7: AUTOMATIC SPEECH AND
5. Execute trials of speech/language systems SPEAKER RECOGNITION
“I SAW THE MAN WITH A TELESCOPE.”
o ["I", "SAW", "THE", "MAN", "WITH", "A", "TELESCOPE"]
This sentence is useful because it has two possible o ["I", "SAW", "MAN", "TELESCOPE"]
meanings:
I used a telescope to see the man.
o I → PRONOUN
The man I saw was carrying a telescope. SAW → VERB
MAN → NOUN
WITH → PREPOSITION
TELESCOPE → NOUN
Overview of NLP
Introduction to Natural Language Processing (NLP) Why NLP is Important
Human language is:
What is NLP? • ambiguous,
• context-dependent,
Natural Language Processing (NLP) is a branch of Artificial
Intelligence and Computational Linguistics that enables computers to
• emotionally nuanced,
understand, interpret, generate, and interact with human language. • grammatically flexible.
In simple terms: For example:
NLP is the technology that allows machines to “read,” “listen,” “I saw the man with the telescope.”
“understand,” and “respond” to human language.
This sentence has two possible meanings:
It combines:
•Computer Science algorithms, data structures, machine learning
•Linguistics grammar, syntax, semantics, pragmatics
• You used a telescope to see the man.
•Statistics & Deep Learning pattern recognition from huge text • The man had a telescope.
datasets Humans understand such ambiguity naturally using contex
Machines require advanced NLP systems to interpret it
correctly.
Core Objectives of NLP
NLP systems attempt to solve several fundamental problems:
Task Goal
Text Understanding Extract meaning from text
Language Generation Produce human-like responses
Speech Processing Convert speech text
Translation Convert one language into another
Information Extraction Identify names, dates, entities
Sentiment Analysis Detect emotions/opinions
Question Answering Answer natural language queries
Introduction to Levels of NLP
Fundamental Levels of NLP
1
Lexical Analysis
Breaking text into smaller meaningful units called words/tokens.
1. Lexical Analysis Example:
Input: "NLP is amazing!"
2. Syntax Analysis (Parsing) Tokens: ["NLP", "is", "amazing"]
This process is called Tokenization.
3. Semantic Analysis
4. Pragmatic Analysis 3 Semantic Analysis
Determining meaning.
Example:
2 "Apple released a new device."
Syntax Analysis Does “Apple” mean:
Understanding grammatical structure. •the fruit?
Example: •or Apple Inc.?
"The cat chased the mouse." Semantic analysis resolves such ambiguity.
The system identifies:
•Subject → cat 4 Pragmatic Analysis
•Verb → chased
•Object → mouse Understanding meaning from context.
NLP models often use: Example:
•Context-Free Grammars "It's cold here."
•Dependency Parsing Literal meaning:
•Constituency Trees •temperature is low
Pragmatic meaning:
•someone may want the window closed
This level is extremely difficult for AI.
Morhpology: Derivational & Inflectional Morphology
Where Morphology Fits in NLP
In Natural Language Processing, Morphology belongs to the linguistic preprocessing and lexical analysis layer of language understanding.
It studies the internal structure of words and how words are formed from smaller meaning-bearing units called morphemes.
What is a Morpheme?
A morpheme is the smallest meaningful unit in language.
Examples:
Word Morphemes
unhappy un + happy
cats cat + s
replayed re + play + ed
Here:
•un, re, ed, s are morphemes
•happy, play, cat are root morphemes
A simplified NLP pipeline looks like this:
Raw Text
↓
Tokenization
↓
Morphological Analysis
↓
POS Tagging
↓
Syntax Parsing
↓
Semantic Analysis
↓
Pragmatic Understanding
Morphological Analysis
Morphological analysis determines:
• root word,
• prefixes,
• suffixes, Two Major Types of Morphology
• tense,
• plurality, 1. Inflectional Morphology
• grammatical role. 2. Derivational Morphology
Example:
"students"
Morphological analyzer output:
Root: student
Feature: plural noun
Morphological Analysis
Inflectional Morphology Derivational Morphology
Inflectional morphology changes the grammatical form of a Derivational morphology creates new words and
word without changing its core meaning or word class. often changes:
meaning, or grammatical category.
Examples:
Examples:
Base Word Inflected Form Function
play played past tense Root Derived Word Change
cat cats plural adjective →
happy happiness
noun
big bigger comparative
teach teacher verb → noun
Key idea: noun →
nation national
•grammatical variation only adjective
•meaning remains fundamentally same
Example:
run → running Example:
Still a verb. modern → modernization
This creates a new lexical meaning.
Morphological Analysis
Why Morphology is Important in NLP
Morphology helps NLP systems:
•understand grammatical structure,
•reduce vocabulary size,
•improve language understanding,
•handle rich languages like Tamil, Hindi, Arabic.
Important NLP Techniques – Text Normalization
Tokenization
Splitting sentences into words/subwords.
Example:
"I love AI"
["I", "love", "AI"]
Stemming
Reducing words to root forms.
Example:
Chops off affixes, often resulting in incomplete roots (faster)
running → run
connected → connect
Lemmatization
More linguistically accurate root extraction.
Example:
better → good Returns a real word, uses context and morphological analysis (slower)
was → be
Important NLP Techniques – Text Normalization
Challenge: Languages like Chinese do not have spaces between words, so tokenization becomes difficult
sang
sung
sing
Lemmatization
sings
Stemming refers to the simpler version of lemmatization
Sentence segmentation
Part-of-Speech (POS) Tagging
Assigning grammatical roles.
Example:
"She eats apples"
She → Pronoun
eats → Verb
apples → Noun
Named Entity Recognition (NER)
Detecting entities like people, organizations,
locations.
Example:
"Elon Musk founded SpaceX."
Entities:
•Elon Musk → Person
•SpaceX → Organization
Part-of-Speech (POS) Tagging
Parsing
Parsing is the process of analyzing a sentence based on its grammar. It checks if the sentence follows the rules
and breaks it into meaningful parts. This helps computers understand and work with human languages.
Types of Parsing:
• Top-Down parsing
• Bottom-Up parsing
• Recursive Descent parsing
• Predictive parsing
• Shift-reduce parsing
• Dependency parsing
• Constituency parsing
• Chart parsing
• CKY parsing
• Probabilistic parsing
• Neural Parsing
Parsing
Parsing Type Direction Main Idea
Top-Down Root → Leaves Start from S
Bottom-Up Leaves → Root Start from words
Recursive Descent Top-Down Recursive procedures
Predictive Top-Down Uses lookahead
Shift-Reduce Bottom-Up Stack operations
Dependency Parsing Relations Word dependencies
Constituency Parsing Phrase structure NP, VP etc.
CKY Bottom-Up Dynamic programming
Earley Chart parsing General CFG parsing
Probabilistic Parsing Probability-based Most likely parse
Neural Parsing Deep learning Learned parsing
Parsing
Shallow Parsing (Chunking)
Shallow parsing identifies basic grammatical chunks in a sentence without building a complete sentence
structure.
It groups words into meaningful phrases like:
•Noun Phrase (NP) → “the red car”
•Verb Phrase (VP) → “is running”
•Prepositional Phrase (PP) → “on the road”
Example
Sentence:
“The little boy kicked the ball.”
After POS tagging:
Parsing
Shallow parsing output:
[NP The little boy] [VP kicked] [NP the ball]
It does not show full grammatical relationships between words.
Purpose
•Information extraction
•Named entity recognition
•Chatbots
•Fast NLP processing
Advantages
•Faster and simpler
•Requires less computation
•Useful for basic NLP tasks
Limitation
•Cannot fully understand sentence structure
What is Chunking? "The cat sat on the mat"
Chunking groups words into meaningful units called chunks based on Chunked Output:
POS tags. [NP The cat]
[VP sat]
[PP on]
[NP the mat]
Parsing Here:
•kicked is the main/root verb.
•Other words depend on it directly or indirectly.
Dependency Parsing
Dependency parsing identifies the grammatical relationships kicked
between words in a sentence. / \
It builds a structure showing: boy ball
• which word depends on another word |
• how words are connected little
• The sentence is represented as a dependency tree.
Example Purpose
Sentence: Machine translation
“The little boy kicked the ball.” Question answering
Dependency relations: Semantic analysis
kicked → boy (subject) Voice assistants
kicked → ball (object) Advantages
boy → little (modifier) Gives deep grammatical understanding
ball → the (determiner) Captures relationships clearly
boy → The (determiner) Limitation
More computationally expensive
More complex than shallow parsing
This is constituency parse tree (also called a phrase structure parse
tree)
CFG (Context-Free Grammar) is one type of grammar in the Chomsky Hierarchy.
It was proposed by Noam Chomsky.
Chomsky Hierarchy
The hierarchy classifies grammars into 4 levels based on their power.
Type 0 → Unrestricted Grammar
Type 1 → Context-Sensitive Grammar (CSG)
Type 2 → Context-Free Grammar (CFG)
Type 3 → Regular Grammar
CFG = Type-2 Grammar CFG Rule Format
So: A CFG rule always has:
CFG ∈ Chomsky Hierarchy Single non-terminal on the left side
It is the Type-2 grammar. Form:
A→ α
Where:
•A = one non-terminal
•α = terminals/non-terminals
Example CFG
S → NP VP
NP → Det Noun
VP → Verb NP
Sentence:
the boy kicked the ball
Tree:
S
/ \
NP VP S → NP VP
Example CFG
S → NP VP
NP → Det Noun
VP → Verb NP
Sentence:
the boy kicked the ball
Tree:
S
/ \
NP VP NP → Det Noun
VP → Verb NP
/\ / \
Det Noun Verb NP
Example CFG
S → NP VP
NP → Det Noun
VP → Verb NP
Sentence:
the boy kicked the ball
Tree:
S
/ \
NP VP
/\ / \
Det Noun Verb NP
| | |
the boy kicked
Example CFG
S → NP VP
NP → Det Noun
VP → Verb NP
Sentence:
the boy kicked the ball
Tree:
S
/ \
NP VP
/\ / \
Det Noun Verb NP
| | | /\
the boy kicked Det Noun
| |
the ball
2. Phrase Structure
In NLP
Phrase structure means sentences are built from smaller
CFG is extremely important because it models:
meaningful groups called phrases.
•sentence structure
Example phrases:
•phrase structure
•recursion
•noun phrase (NP) Example Sentence
•verb phrase (VP) the red ball
•nested language patterns
•prepositional phrase (PP) Grammar:
NP → Det Adj Noun
1. Sentence Structure
Sentence structure shows how a full sentence is organized into NP
major components like: / | \
•Subject Det Adj Noun
•Predicate | | |
CFG rule: the red ball
S → NP VP
Example:
3. Recursion computer science student Nominal
Recursion means: / \
a grammar rule refers to itself Nominal Noun
This allows infinitely expandable language. / \ |
Nominal Noun student
Recursive Rule | |
Nominal → Nominal Noun computer science
4. Nested Language Patterns NP
/ \
Example Sentence NP PP
the boy with the telescope /\ / \
Grammar: Det Noun Prep NP
NP → Det Noun | | | /\
PP → Prep NP the boy with Det Noun
NP → NP PP | |
the telescope
S → NP VP
VP → Verb NP
VP → VP PP
Meaning 1
NP → Pronoun I used a telescope to see the man
NP → Det Nominal
NP → NP PP Here:
with a telescope
Nominal → Noun belongs to the VP.
PP → Prep NP
Pronoun → I
Verb → saw Meaning 2
I saw a man who had a telescope
Det → the Here:
Det → a with a telescope
belongs to the NP.
Noun → man
Noun → telescope
Prep → with
Parse 1: [Telescope Attached to VP]
Structure
[S [NP I] [VP [VP [Verb saw] [NP the man] ] [PP with a telescope] ] ]
Parse Tree [NP [Det the] [Noun man]]
S
/ \
NP VP
| / \
I VP PP
/\ / \
Verb NP Prep NP
| /\ | /\
saw Det Noun with Det Noun
| | | |
the man a telescope
Parse 2: [Telescope Attached to NP]
Structure
[S [NP I] [VP [Verb saw] [NP [NP the man] [PP with a telescope] ] ] ]
Parse Tree
S
/ \
NP VP
| / \
I Verb NP
| / \
saw NP PP
/\ / \
Det Noun Prep NP
| | | /\
the man with Det Noun
| |
a telescope
CKY Parsing (Bottom-Up)
the boy sees a dog
S
S → NP VP
/ \
NP → DT N
NP VP
VP → V NP
/\ / \ Top-down(Constituent Parsing)
DT → the
DT NN VBZ NP
DT → a
| | | / \
N → boy
the boy sees DT NN
N → dog
| |
V → sees
a dog
Bottom-up(CKY Parsing)
(work on CNF grammer
PCKY Parsing (Probabilistic CKY)
PCKY is probabilistic CKY.
Each grammar rule has a probability.
S → NP VP [1.0]
NP → DT N [0.8]
VP → V NP [1.0]
DT → the [0.6]
DT → a [0.4]
N → boy [0.5]
N → dog [0.5]
V → sees [1.0]
Main Types of Ambiguity
[Link] Ambiguity
[Link] Ambiguity
[Link] Ambiguity
[Link] Ambiguity
[Link] Ambiguity
[Link] Ambiguity
[Link] Ambiguity