Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS...
Transcript of Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS...
![Page 1: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/1.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Outline of today’s lecture
Lecture 5: Parsing with constraint-based grammars
Beyond simple CFGs
Feature structures
Encoding agreement
Encoding subcategorisation
Interface to morphology
Dependency structures
![Page 2: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/2.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Beyond simple CFGs
Subjects, verbs and objects
subject verb object
John bought a book
◮ Subject-verb rule:
S -> NP VP
◮ Verb-object rule:
VP -> V NP
![Page 3: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/3.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Beyond simple CFGs
Expanded CFG (from last time)
◮ number agreement: subject verb agreement. e.g., they
fish, it fishes, *it fish, *they fishes. * means ungrammatical
◮ case: pronouns (and maybe who/whom) e.g., they like
them, *they like they
S -> NP-sg-nom VP-sg
S -> NP-pl-nom VP-pl
VP-sg -> V-sg NP-sg-acc
VP-sg -> V-sg NP-pl-acc
VP-pl -> V-pl NP-sg-acc
VP-pl -> V-pl NP-pl-acc
NP-sg-nom -> he
NP-sg-acc -> him
NP-sg-nom -> fish
NP-pl-nom -> fish
NP-sg-acc -> fish
NP-pl-acc -> fish
BUT: very large grammar, misses generalizations, no way of
saying when we don’t care about agreement.
![Page 4: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/4.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Beyond simple CFGs
Constraint-based grammar (feature structures)
Providing a more adequate treatment of syntax than simple
CFGs by replacing the atomic categories by more complex data
structures.
◮ allow to encode a set of constraints on the categories
◮ these constraints will be instantiated when a rule is applied
◮ e.g. to encode number agreement in the subject-verb rule
or case in the verb-object rule
![Page 5: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/5.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Beyond simple CFGs
Intuitive solution for case and agreement
◮ Separate slots, features, for CASE and AGR
◮ Slot values for CASE may be nom (e.g., they), acc (e.g.,
them) or unspecified (i.e., don’t care)
◮ Slot values for AGR may be sg, pl or unspecified
◮ Subjects have the same value for AGR as their verbs
◮ Subjects have CASE nom, objects have CASE acc
dog (n)
CASE [ ]
AGR sg
fish (n)
CASE [ ]
AGR [ ]
she
CASE nom
AGR sg
them
CASE acc
AGR pl
![Page 6: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/6.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Feature structures
Feature structures
CASE [ ]
AGR sg
1. Features like AGR with simple values: atomic-valued
2. Values for some features themselves have features:
complex-valued, e.g. subcategorisation features
3. Unspecified values possible on features: compatible with
any value.
4. Unification: combining two feature structures, retaining all
information from each, or fail if information is incompatible.
5. In grammars, rules relate FSs — i.e. lexical entries and
phrases are represented as FSs
6. Rule application by unification
![Page 7: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/7.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Feature structures
Simple unification examples
1.
CASE [ ]
AGR sg
⊓
CASE nom
AGR [ ]
=
CASE nom
AGR sg
2.
CASE [ ]
AGR sg
⊓
CASE nom
AGR pl
= fail
![Page 8: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/8.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding agreement
CFG with agreement
S -> NP-sg VP-sg
S -> NP-pl VP-pl
VP-sg -> V-sg NP-sg
VP-sg -> V-sg NP-pl
VP-pl -> V-pl NP-sg
VP-pl -> V-pl NP-pl
V-pl -> like
V-sg -> likes
NP-sg -> it
NP-pl -> they
NP-sg -> fish
NP-pl -> fish
![Page 9: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/9.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding agreement
FS grammar fragment encoding agreement
subj-verb rule
CAT S
AGR 1
→
CAT NP
AGR 1
,
CAT VP
AGR 1
verb-obj rule
CAT VP
AGR 1
→
CAT V
AGR 1
,
CAT NP
AGR [ ]
Root structure:[
CAT S]
they
CAT NP
AGR pl
fish
CAT NP
AGR [ ]
it
CAT NP
AGR sg
like
CAT V
AGR pl
likes
CAT V
AGR sg
![Page 10: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/10.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding agreement
Parsing ‘they like it’
◮ The lexical structures for like and it are unified with the
corresponding structures on the right hand side of the
verb-obj rule (unifications succeed).
◮ The structure corresponding to the mother of the rule is
then:
CAT VP
AGR pl
◮ This unifies with the rightmost daughter position of the
subj-verb rule.
◮ The structure for they is unified with the leftmost daughter.
◮ The result unifies with root structure.
![Page 11: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/11.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding agreement
Rules as FSsBut what does the coindexation of parts of the rule mean? Treat
rule as a FS: e.g., rule features MOTHER, DTR1, DTR2 . . . DTRN.
informally:
CAT VP
AGR 1
→
CAT V
AGR 1
,
CAT NP
AGR [ ]
actually:
MOTHER
CAT VP
AGR 1
DTR1
CAT V
AGR 1
DTR2
CAT NP
AGR [ ]
![Page 12: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/12.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding agreement
Verb-obj rule applicationFeature structure for like unified with the value of DTR1:
MOTHER
[
CAT VP
AGR 1 pl
]
DTR1
[
CAT V
AGR 1
]
DTR2
[
CAT NP
AGR [ ]
]
Feature structure for it unified with the value for DTR2:
MOTHER
[
CAT VP
AGR 1 pl
]
DTR1
[
CAT V
AGR 1
]
DTR2
[
CAT NP
AGR sg
]
![Page 13: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/13.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding agreement
Subject-verb rule application 1MOTHER value from the verb-object rule acts as the DTR2 of the
subject-verb rule:
[
CAT VP
AGR pl
]
unified with the DTR2 of:
MOTHER
[
CAT S
AGR 1
]
DTR1
[
CAT NP
AGR 1
]
DTR2
[
CAT VP
AGR 1
]
Gives:
MOTHER
[
CAT S
AGR 1 pl
]
DTR1
[
CAT NP
AGR 1
]
DTR2
[
CAT VP
AGR 1
]
![Page 14: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/14.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding agreement
Subject rule application 2
FS for they:
[
CAT NP
AGR pl
]
Unification of this with the value of DTR1 succeeds (but adds no
new information):
MOTHER
[
CAT S
AGR 1 pl
]
DTR1
[
CAT NP
AGR 1
]
DTR2
[
CAT VP
AGR 1
]
Final structure unifies with the root structure:[
CAT S]
![Page 15: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/15.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Subcategorisation
Subcategorisation: constraints that predicates (typically verbs)
place onto their arguments
◮ number of arguments
◮ types of arguments
Verbs can be
◮ intransitive: take only subject NP, e.g. Kim slept
◮ transitive: take a subject and one object, e.g. Kim adored
Sandy
◮ ditransitive: take a subject and two objects, e.g. Kim gave
Sandy a book
![Page 16: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/16.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Concepts for subcategorisation[
HEAD
[
CAT noun
AGR pl
]]
◮ HEAD: information shared between a lexical entry and the
dominating phrases of the same category
S
NP VP
V VP
VP PP
V P NP
![Page 17: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/17.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Concepts for subcategorisation[
HEAD
[
CAT noun
AGR pl
]]
◮ HEAD: information shared between a lexical entry and the
dominating phrases of the same category
S
NP VP
V VP
VP PP
V P NP
+
+
![Page 18: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/18.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Concepts for subcategorisation[
HEAD
[
CAT noun
AGR pl
]]
◮ HEAD: information shared between a lexical entry and the
dominating phrases of the same category
S
NP VP
V VP
VP PP
V P NP
+
+
![Page 19: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/19.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Concepts for subcategorisation[
HEAD
[
CAT noun
AGR pl
]]
◮ HEAD: information shared between a lexical entry and the
dominating phrases of the same category
S
NP VP
V VP
VP PP
V P NP
+
+
![Page 20: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/20.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Concepts for subcategorisation[
HEAD
[
CAT noun
AGR pl
]]
◮ HEAD: information shared between a lexical entry and the
dominating phrases of the same category
S
NP VP
V VP
VP PP
V P NP
+
+
![Page 21: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/21.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Concepts for subcategorisation[
HEAD
[
CAT noun
AGR pl
]]
◮ HEAD: information shared between a lexical entry and the
dominating phrases of the same category
S
NP VP
V VP
VP PP
V P NP
+
+
![Page 22: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/22.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Concepts for subcategorisation
[
HEAD
[
CAT noun
AGR pl
]]
◮ HEAD: information shared between a lexical entry and the
dominating phrases of the same category
◮ SUBJ: constraints on the subject
![Page 23: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/23.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Concepts for subcategorisation
[
HEAD
[
CAT noun
AGR pl
]]
◮ HEAD: information shared between a lexical entry and the
dominating phrases of the same category
◮ SUBJ: constraints on the subject
◮ OBJ: constraints on the object
![Page 24: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/24.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Lexicon: verbs
fish
HEAD
[
CAT verb
AGR pl
]
OBJ filled
SUBJ[
HEAD[
CAT noun] ]
can (modal)
HEAD
[
CAT verb
AGR
[ ]
]
OBJ[
HEAD[
CAT verb]]
SUBJ[
HEAD[
CAT noun]]
can (transitive)
HEAD
[
CAT verb
AGR pl
]
OBJ
[
HEAD[
CAT noun]
OBJ filled
]
SUBJ[
HEAD[
CAT noun]]
![Page 25: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/25.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Lexicon: nouns
they
HEAD
[
CAT noun
AGR pl
]
OBJ filled
SUBJ filled
fish
HEAD
[
CAT noun
AGR[ ]
]
OBJ filled
SUBJ filled
it
HEAD
[
CAT noun
AGR sg
]
OBJ filled
SUBJ filled
![Page 26: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/26.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Grammar with subcategorisation
Subject-verb rule:
HEAD 1
OBJ filled
SUBJ filled
→ 2
HEAD[
AGR 3]
OBJ filled
SUBJ filled
,
HEAD 1[
AGR 3]
OBJ filled
SUBJ 2
Verb-obj rule:
HEAD 1
OBJ filled
SUBJ 3
→
HEAD 1
OBJ 2
SUBJ 3
, 2[
OBJ filled]
![Page 27: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/27.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Example rule application: they fish
Lexical entry for fish:
HEAD
[
CAT v
AGR pl
]
OBJ fld
SUBJ[
HEAD[
CAT n] ]
subject-verb rule:
HEAD 1
OBJ fld
SUBJ fld
→ 2
HEAD[
AGR 3]
OBJ fld
SUBJ fld
,
HEAD 1[
AGR 3]
OBJ fld
SUBJ 2
unification with second dtr position gives:
HEAD 1
[
CAT v
AGR 3 pl
]
OBJ fld
SUBJ fld
→ 2
HEAD
[
CAT n
AGR 3
]
OBJ fld
SUBJ fld
,
HEAD 1
OBJ fld
SUBJ 2
![Page 28: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/28.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Lexical entry for they:
HEAD
[
CAT n
AGR pl
]
OBJ fld
SUBJ fld
unify this with first dtr position:
HEAD 1
[
CAT v
AGR 3 pl
]
OBJ fld
SUBJ fld
→ 2
HEAD
[
CAT n
AGR 3
]
OBJ fld
SUBJ fld
,
HEAD 1
OBJ fld
SUBJ 2
Root is:
HEAD[
CAT v]
OBJ fld
SUBJ fld
Mother structure unifies with root, so valid.
![Page 29: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/29.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Encoding subcategorisation
Parsing with feature structure grammars
◮ standard chart parser with modified rule application
◮ Rule application:
1. copy rule2. copy daughters (lexical entries or FSs associated with
edges)3. unify rule and daughters
4. if successful, add new edge to chart with rule FS as
category
![Page 30: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/30.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Interface to morphology
Templates
Capture generalizations in the lexicon:
fish INTRANS_VERB
sleep INTRANS_VERB
snore INTRANS_VERB
INTRANS_VERB
HEAD
CAT v
AGR pl
OBJ fld
SUBJ
[
HEAD
[
CAT n]
]
![Page 31: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/31.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Interface to morphology
Interface to morphology: inflectional affixes as FSs
s PLURAL_NOUN
HEAD
CAT n
AGR pl
ε SINGULAR_NOUN
HEAD
CAT n
AGR sg
BASE_NOUN
HEAD
CAT n
AGR
[ ]
OBJ filled
SUBJ filled
dog BASE_NOUN
![Page 32: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/32.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Dependency structures
Dependency structure
◮ Alternative to syntax trees for ‘who does what to whom’.
◮ Relate words to each other via labelled directed arcs –
dependencies.
◮ May be syntactic or semantic.
some big angry dogs bark loudly✛
MOD✲
MOD✛
SUBJ✲
MOD✲
DET
![Page 33: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/33.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Dependency structures
Why are dependencies important?
Example
John hit the ball.
Dependency parsing
(SUBJ head=hit dep=John)
(OBJ head=hit dep=ball)
(DET head=ball dep=the)
![Page 34: Outline of today’s lecture - University of Cambridge · 2015-10-19 · Encoding agreement FS grammar fragment encoding agreement subj-verb rule CAT S AGR 1 → CAT NP AGR 1 , CAT](https://reader033.fdocuments.us/reader033/viewer/2022042319/5f08f1e47e708231d4247bfa/html5/thumbnails/34.jpg)
Natural Language Processing: Part II Overview of Natural Language Processing (L90): ACS Lecture 5: Constraint-based grammars
Lecture 5: Parsing with constraint-based grammars
Dependency structures
The cost of parsing errors...
Incorrect dependencies
(SUBJ head=hit dep=ball)
(OBJ head=hit dep=John)
(DET head=ball dep=the)