Lecture slides - CSE, IIT Bombay

Download Report

Transcript Lecture slides - CSE, IIT Bombay

Techniques of Grammatical
Analysis
Rajat Kumar Mohanty
[email protected]
IIT Bombay
What is Grammar?
• A theory of language
• A theory of competence of a native
speaker
• An explicit model of competence
• A finite set of rules
What are the requirements?
• A model of competence
– Should be able to generate an infinite set of
grammatical sentences of the language
– Should not generate any ungrammatical ones
– Should be able to account for ambiguities
– If two sentences are understood to have same
meaning, the grammar should give the same
structure for both at some level
– If two sentences are understood to have different
internal relationship, the grammar should assign
different structural description
Techniques of Grammatical Analysis
• Two main devices
– Breaking up a string
• Sequential
• Hierarchical
• Transformational
– Labeling the constituents
• Morphological
• Categorial
• Functional
• A grammar may combine any of these devices
for grammatical analysis.
Grammatical Analysis Techniques
Breaking up
Sequential
Transformational
Hierarchical
Labeling
Morphological
Functional
Categorial
Breaking up and Labeling
– Sequential Breaking up
• Sequential Breaking up and Morphological labeling
• Sequential Breaking up and Categorial labeling
• Sequential Breaking up and Functional labeling
– Hierarchical Breaking up
• Hierarchical Breaking up and Categorial Labeling
• Hierarchical Breaking up and Functional Labeling
Sequential Breaking up
• This device breaks up a sentence into a sequence of
morphemes
the + boy + s + kill + ed + the + un + happy + rat + s
raam + ne + dande + se + saap + ko + maar + aa
• If a sentence is understood in two different ways, a
grammar should give two corresponding descriptions
– They + can + fish
• They are able to fish
• They put fish in cans
Sequential Breaking up and
Morphological labeling
After breaking up a sentence, we can give morphological
labels to each units
the + boy + s + kill + ed + the + un + happy + rat + s
word
stem affix
stem
affix
word
affix stem
stem
affix
raam + ne + dande + se + saap + ko + maar + aa
word
affix
word
affix
word
affix
word
affix
Sequential Breaking up and
Categorical Labeling
• This boy can solve the problem
S
This
boy
Det
N
can
Aux
solve
V
the
Det
problem
N
Sequential Breaking up and
Categorical Labeling (…continued)
• They
Pronoun
• They
Pronoun
can
fish
Aux
Verb
can
fish
Verb
Noun
Sequential Breaking up and
Categorical Labeling (…continued)
• They
called
Pronoun Verb
her
a
taxi
Pronoun Article Noun
– They said she was a taxi
– They called a taxi for her
Sequential Breaking up and
Functional labeling
They
called
her
a taxi
Subject
Verbal
IO
DO
called
her
a taxi
They
Subject Verbal
DO
Object
Complement
Sequential Breaking up and
Functional labeling (…continued)
Old
men
modifier
Head
and
women
coordinator
Head
Hierarchical Breaking up
• This device breaks up a sentence into its
constituents at different hierarchies or
levels
Old men and
women
Old
men and women
men
and
women
Old men and
women
Old men
Old
men
and
women
Hierarchical Breaking up and
Categorial Labeling
Poor
ADJ
NP
John
ran
away
N
V
ADV
VP
Hierarchical Breaking up and
Functional Labeling
• Immediate Constituent Analysis
• Construction types in terms of the function
of the constituents:
– Predication (subject + predicate)
– Modification (modifier + head)
– Complementation (verbal + complement)
– Subordination (subordinator + dependent unit)
– Coordination (independent unit + coordinator
+ independent unit)
In the morning, the sky
looked much brighter
Mod
Mod
Head
Mod Head
Verbal
Sub
DU
Modifier
Head
Subject
Complement
Predicate
Head
Hierarchical Breaking up and
Categorial /Functional Labeling
• Hierarchical Breaking up coupled with Categorial
/Functional Labeling is a very powerful device
• But there are ambiguities which demand
something more powerful
Love of God
• Someone loves God
• God loves someone
Love of God
Noun
Phrase
love
Love of God
Prepositional
Phrase
of
God
Head
love
Modifier
Sub-
DU
of
God
Generative Grammar
• A generative grammar
– generates all the grammatical sentences of the
language
– rejects all the ungrammatical ones
• It is free to choose and combine any of the
techniques of breaking up and labeling
• Depending upon what tools the grammar
combines, we have different types of grammar
Types of Generative Grammar
•
Finite State Model
(sequential)
•
Phrase Structure Model
(sequential + hierarchical)
•
Transformational Model
(sequential + hierarchical + transformational)
Phrase Structure Model
• Inadequacies
– Ambiguity
– Paraphrase Relationship
– Constructional Homonymy
Ambiguity
• If a sentence is understood to have two
meanings, a grammar should give two
corresponding structural descriptions
• PS grammar fails to meet this demand
• The shooting of the hunters
– The hunter shot someone
– Someone shot the hunters
NP
PP
NP
Det
the
N
shooting
P
of
NP
Det
N
the
hunters
Paraphrase Relationship
• If two sentences are understood to have the
same meaning, a grammar should give the
same structural description for the two
sentences at some level
• PS grammar fails to meet this demand
• Examples
– The boy slapped the girl
– The girl was slapped by the boy
S
VP
NP
Det
The
N
boy
V
slapped
NP
Det
N
the
girl
S
VP
NP
Det
The
N
girl
V
PP
Aux
V
P
was
slapped
by
NP
the
boy
Constructional Homonymy
• If two sentences are not understood the same
way, a grammar should give two structural
descriptions
• PS grammar cannot do this
– The audience was asked to leave by the side-door
– The audience was asked to leave by the chairman
S
VP
NP
Det
V
N
Aux
Inf. Phr
V
VP
Inf.
V
PP
P
NP
Det
The
audience was
asked
to
leave
by the
N
Sidedoor
S
VP
NP
Det
V
N
Aux
Inf. Phr
V
VP
Inf.
V
PP
P
NP
Det
The
audience was
asked
to
leave
by the
N
Chairman
Transformational Model
• If a generative grammar makes use of all
the three
-sequential
-hierarchical and
-transformational
is called a Transformational grammar.
PS model
• Makes use of PS
rules exclusively
• PS rules generate
surface structure
Transformational
model
• Makes use of PS
rules and
transformational rules
• PS rules generate
DS
• DS is converted into
the surface structure
by transformational
rules
PS grammar
Surface
Structure
PS rules
Transformational grammar
PS rules
Deep
Structure
Transformation
Surface
Structure
Why wasn’t he punished?
• PS rules:
S
 NP – VP
VP
 V - NP – PP
V
 Aux – V
Aux (Tense)-(Modal)-(Perf)-(Prog)
Tense  {pres/past}
NP  (PreDet) - (Det) - (Ord) -(Quan) -(AP)-N
Lexical substitution
S
VP
NP
VG
Aux
NP
PP
V
Tense
Someone
past
punish
him
for some
reason
Why wasn’t he punished?
(…continued)
• Transformations
– Passivization
– Agent deletion
– Negation
– Neg. Contraction
– Wh- substitution
– Interrogation
– Wh- fronting
– Affix switch
Passivization
S
VP
NP
VG
Aux
Tense
He
past
PP
V
Pass
be en punish
P
PP
NP
N
by someone
for
Some
reason
Agent
Deletion
S
VP
NP
VG
Aux
Tense
He
past
PP
V
Pass
be en punish
for some reason
Negation
S
VP
NP
VG
Aux
Tense
He
past
PP
V
Pass
be not
en punish
for some reason
Neg.
Contraction
S
VP
NP
VG
Aux
Tense
He
past
PP
V
Pass
be’not
en punish
for some reason
WhSubstitution
S
VP
NP
VG
Aux
Tense
He
past
WH
V
Pass
be’not
en punish
why
Interrogative
S
Aux
VP
NP
VG
WH
V
Tense
past
be’not
he
en
punish
why
WH
Aux
S
Wh-fronting
NP
VP
VG
V
Tense
why
past
be’not
he
en
punish
WH
Aux
S
Affix switch
NP
VP
VG
Tense
V
be’not
past
punish
why
was’not
he
en
punished
Suggested Readings
• Lyons, John. 1977. Chomsky. Fontana,
London.
• Palmer, Frank. Grammar
• Crystal, David. Linguistics
THANK YOU
Q\A