NP - Cognitive Science
NP - Cognitive Science
NP - Cognitive Science
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Introduction to Computational Linguistics Summer Term 2010<br />
Intro CL | Session 8:<br />
Feature Unification Grammars<br />
Stefan Evert<br />
Institute of <strong>Cognitive</strong> <strong>Science</strong><br />
University of Osnabrück
Context-free grammars<br />
2
Context-free grammars<br />
◆ Advantages of CFG<br />
• generate “appropriate” structural analyses<br />
• recursion & long-distance dependencies<br />
• efficient parsers available (e.g. CYK with O(n 3 · m))<br />
2
Context-free grammars<br />
◆ Advantages of CFG<br />
• generate “appropriate” structural analyses<br />
• recursion & long-distance dependencies<br />
• efficient parsers available (e.g. CYK with O(n 3 · m))<br />
◆ Problems & shortcomings<br />
• cannot account for all human languages<br />
• modelling free word order (German, Latin)<br />
• agreement & complementation<br />
• broad-coverage grammars unintuitive & cumbersome<br />
2
A simple phrase-structure CFG<br />
◆ Phrase structure rules<br />
• S → <strong>NP</strong> VP<br />
VP → V <strong>NP</strong> <strong>NP</strong> | V <strong>NP</strong> | V | VP PP<br />
<strong>NP</strong> → Det A N | Det N | A N | N | Pron | <strong>NP</strong> PP<br />
PP → P <strong>NP</strong><br />
• no clausal complements, subcategorised PPs,<br />
coordination, full <strong>NP</strong>s, adverbs, complex tenses, …<br />
◆ Lexical rules for preterminals<br />
• N → boy | boys | girl | girls | water | …<br />
Det → the | a | no | one | two | …<br />
V → give | gives | gave | sleep | sleeps | slept | …<br />
3
A simple phrase-structure CFG<br />
◆ Phrase structure rules<br />
• S → <strong>NP</strong> VP<br />
VP → V (<strong>NP</strong> (<strong>NP</strong>)) | VP PP<br />
<strong>NP</strong> → (Det) (A) N | Pron | <strong>NP</strong> PP<br />
PP → P <strong>NP</strong><br />
• no clausal complements, subcategorised PPs,<br />
coordination, full <strong>NP</strong>s, adverbs, complex tenses, …<br />
◆ Lexical rules for preterminals<br />
• N → boy | boys | girl | girls | water | …<br />
Det → the | a | no | one | two | …<br />
V → give | gives | gave | sleep | sleeps | slept | …<br />
4
A simple phrase-structure CFG<br />
S<br />
<strong>NP</strong> <strong>NP</strong><br />
VP<br />
<strong>NP</strong> <strong>NP</strong><br />
Det N V Det N Det N P N<br />
The boys gave the girl a glass of water<br />
<strong>NP</strong><br />
PP<br />
5
Problems of this CFG<br />
6
Problems of this CFG<br />
◆ Ungrammatical structures licensed by CFG<br />
• the boys gives the girl a book ➞ agreement (number)<br />
• the boy gave she a book ➞ agreement (case)<br />
• the cats slept a book, the boy gave ➞ complementation<br />
6
Problems of this CFG<br />
◆ Ungrammatical structures licensed by CFG<br />
• the boys gives the girl a book ➞ agreement (number)<br />
• the boy gave she a book ➞ agreement (case)<br />
• the cats slept a book, the boy gave ➞ complementation<br />
◆ Word order variation, e.g. in German<br />
Maria gibt dem Mann ein Buch.<br />
Ein Buch gibt Maria dem Mann.<br />
Dem Mann gibt Maria ein Buch.<br />
Ein Buch gibt dem Mann Maria.<br />
…<br />
6
CFG solution: subcategorisation<br />
7
CFG solution: subcategorisation<br />
◆ Expand nonterminals into multiple,<br />
fine-grained subcategories<br />
• e.g. <strong>NP</strong> ➞ <strong>NP</strong>sg / <strong>NP</strong>pl<br />
• agreement ensured by using only valid combinations<br />
of subcategories in CFG productions<br />
7
CFG solution: subcategorisation<br />
◆ Expand nonterminals into multiple,<br />
fine-grained subcategories<br />
• e.g. <strong>NP</strong> ➞ <strong>NP</strong>sg / <strong>NP</strong>pl<br />
• agreement ensured by using only valid combinations<br />
of subcategories in CFG productions<br />
◆ This procedure is called subcategorisation<br />
• argument structure (complementation) of verbs is<br />
one particular example of subcategorisation<br />
(intransitive, transitive, ditransitive, …)<br />
7
Verb complementation in CFG<br />
8
Verb complementation in CFG<br />
◆ The number and form of verbal complements<br />
(argument structure) is lexically determined<br />
8
Verb complementation in CFG<br />
◆ The number and form of verbal complements<br />
(argument structure) is lexically determined<br />
◆ Many types of “subcategorisation frames”:<br />
• intransitive: Peter left.<br />
• transitive: Mary read [<strong>NP</strong> the book].<br />
• ditransitive: Mary gave [<strong>NP</strong> Peter] [<strong>NP</strong> the book].<br />
• ditrans-PP: Peter put [<strong>NP</strong> the book] [PP on a shelf].<br />
• trans-CP: Paul says [CP that Mary kissed Peter].<br />
• ditrans-VP: Paul saw [<strong>NP</strong> Mary] [VP kiss Peter].<br />
…<br />
8
Verb complementation in CFG<br />
9
Verb complementation in CFG<br />
◆ Add new “types” of verbs ➞ subcategories<br />
• Vintrans → sleep | walk | run | leave | …<br />
Vtrans → read | write | see | eat | leave | …<br />
Vditrans → give | tell | write | leave | …<br />
Vcomp → say | claim | think | believe | …<br />
• inflected forms of verbs need to be listed on RHS<br />
9
Verb complementation in CFG<br />
◆ Add new “types” of verbs ➞ subcategories<br />
• Vintrans → sleep | walk | run | leave | …<br />
Vtrans → read | write | see | eat | leave | …<br />
Vditrans → give | tell | write | leave | …<br />
Vcomp → say | claim | think | believe | …<br />
• inflected forms of verbs need to be listed on RHS<br />
◆ Separate complementation rules for verb types<br />
• VP → Vintrans<br />
VP → Vtrans <strong>NP</strong><br />
VP → Vditrans <strong>NP</strong> <strong>NP</strong> | Vditrans <strong>NP</strong> PPto<br />
VP → Vcomp CP<br />
9
Agreement in CFG<br />
10
Agreement in CFG<br />
◆ English verbs agree with their subject <strong>NP</strong><br />
• in number (sg, pl) and person (1 st , 2 nd , 3 rd )<br />
10
Agreement in CFG<br />
◆ English verbs agree with their subject <strong>NP</strong><br />
• in number (sg, pl) and person (1 st , 2 nd , 3 rd )<br />
◆ Introduce new <strong>NP</strong> and V categories<br />
• <strong>NP</strong> ➞ <strong>NP</strong>1sg, <strong>NP</strong>2sg, <strong>NP</strong>3sg, <strong>NP</strong>1pl, <strong>NP</strong>2pl, <strong>NP</strong>3pl<br />
• V ➞ V1sg, V2sg, V3sg, V1pl, V2pl, V3pl<br />
10
Agreement in CFG<br />
◆ New lexical entries & duplicated CFG rules<br />
• S → <strong>NP</strong>1sg VP1sg | <strong>NP</strong>2sg VP2sg | <strong>NP</strong>3sg VP3sg | …<br />
• VP1sg → V1sg (<strong>NP</strong> (<strong>NP</strong>)) | VP1sg PP<br />
VP2sg → V2sg (<strong>NP</strong> (<strong>NP</strong>)) | VP2sg PP<br />
…<br />
• <strong>NP</strong>3sg → (Detsg) (A) Nsg | <strong>NP</strong>3sg PP<br />
<strong>NP</strong>3pl → (Detpl) (A) Npl | <strong>NP</strong>3pl PP<br />
• V1sg → go | went | say | said | …<br />
V3sg → goes | went | says | said | …<br />
• <strong>NP</strong>1sg → I, <strong>NP</strong>2sg → you, <strong>NP</strong>3sg → he | she | it, …<br />
• Nsg → book|mouse|water|…, Npl → books|mice|…<br />
11
Agreement in CFG: problems<br />
12
Agreement in CFG: problems<br />
◆ Multiplies out with verb complementation<br />
• VP1sg → V1sg,intrans | V1sg,trans <strong>NP</strong> | V1sg,ditrans <strong>NP</strong> <strong>NP</strong> | …<br />
VP2sg → V2sg,intrans | V2sg,trans <strong>NP</strong> | V2sg,ditrans <strong>NP</strong> <strong>NP</strong> | …<br />
…<br />
12
Agreement in CFG: problems<br />
◆ Multiplies out with verb complementation<br />
• VP1sg → V1sg,intrans | V1sg,trans <strong>NP</strong> | V1sg,ditrans <strong>NP</strong> <strong>NP</strong> | …<br />
VP2sg → V2sg,intrans | V2sg,trans <strong>NP</strong> | V2sg,ditrans <strong>NP</strong> <strong>NP</strong> | …<br />
…<br />
◆ Underspecification ➞ redundant lexical entries<br />
• leave can be V1sg, V2sg, V1pl, V2pl, or V3pl<br />
• or rather: V1sg,intrans, V1sg,trans, V1sg,ditrans, V2sg,intrans,<br />
V2sg,trans, V2sg,ditrans, V1pl,intrans, V1pl,trans, V1pl,ditrans, …<br />
12
Agreement in CFG: problems<br />
13
Agreement in CFG: problems<br />
◆ Further dimensions of agreement<br />
• German nouns agree with determiners and adjectives<br />
in case (nom, gen, acc, dat), number (sg, pl) and<br />
gender (masc, fem, neut)<br />
• <strong>NP</strong> ➞ <strong>NP</strong>nom,sg,masc, <strong>NP</strong>gen,sg,masc, <strong>NP</strong>dat,sg,masc,<br />
<strong>NP</strong>acc,sg,masc, <strong>NP</strong>nom,pl,masc, …, <strong>NP</strong>nom,sg,fem, …<br />
• underspecified lexical entries: e.g. Blume (sg) and<br />
Blumen (pl) underspecified for case ➞ 4 categories<br />
13
Agreement in CFG: problems<br />
◆ Further dimensions of agreement<br />
• German nouns agree with determiners and adjectives<br />
in case (nom, gen, acc, dat), number (sg, pl) and<br />
gender (masc, fem, neut)<br />
• <strong>NP</strong> ➞ <strong>NP</strong>nom,sg,masc, <strong>NP</strong>gen,sg,masc, <strong>NP</strong>dat,sg,masc,<br />
<strong>NP</strong>acc,sg,masc, <strong>NP</strong>nom,pl,masc, …, <strong>NP</strong>nom,sg,fem, …<br />
• underspecified lexical entries: e.g. Blume (sg) and<br />
Blumen (pl) underspecified for case ➞ 4 categories<br />
◆ Interaction with subject–verb agreement<br />
• S → <strong>NP</strong>nom,sg,masc,1st VP1sg | <strong>NP</strong>nom,sg,masc,2nd VP2sg | …<br />
| <strong>NP</strong>nom,sg,fem,1st VP1sg | <strong>NP</strong>nom,sg,fem,2nd VP2sg | …<br />
13
Free word order in CFG<br />
14
Free word order in CFG<br />
◆ German ditransitives with arbitrary ordering<br />
• S → <strong>NP</strong>nom VPditrans,acc,dat | <strong>NP</strong>acc VPditrans,nom,dat<br />
| <strong>NP</strong>dat VPditrans,nom,acc<br />
• VPditrans,acc,dat → Vditrans <strong>NP</strong>acc <strong>NP</strong>dat | Vditrans <strong>NP</strong>dat <strong>NP</strong>acc<br />
VPditrans,nom,dat → Vditrans <strong>NP</strong>nom <strong>NP</strong>dat | Vditrans <strong>NP</strong>dat <strong>NP</strong>nom<br />
VPditrans,nom,acc → Vditrans <strong>NP</strong>nom <strong>NP</strong>acc | Vditrans <strong>NP</strong>acc <strong>NP</strong>nom<br />
• a second set of similar rules for verb-final clauses<br />
14
Free word order in CFG<br />
◆ German ditransitives with arbitrary ordering<br />
• S → <strong>NP</strong>nom VPditrans,acc,dat | <strong>NP</strong>acc VPditrans,nom,dat<br />
| <strong>NP</strong>dat VPditrans,nom,acc<br />
• VPditrans,acc,dat → Vditrans <strong>NP</strong>acc <strong>NP</strong>dat | Vditrans <strong>NP</strong>dat <strong>NP</strong>acc<br />
VPditrans,nom,dat → Vditrans <strong>NP</strong>nom <strong>NP</strong>dat | Vditrans <strong>NP</strong>dat <strong>NP</strong>nom<br />
VPditrans,nom,acc → Vditrans <strong>NP</strong>nom <strong>NP</strong>acc | Vditrans <strong>NP</strong>acc <strong>NP</strong>nom<br />
• a second set of similar rules for verb-final clauses<br />
◆ Multiplies out with agreement & complementation<br />
• <strong>NP</strong>nom is really <strong>NP</strong>nom,sg,masc,1st or <strong>NP</strong>nom,sg,masc,2nd or …<br />
• Vditrans is really Vditrans,1sg or Vditrans,2sg or …<br />
14
Problem summary<br />
◆ New subcategories for different phenomena<br />
multiplied out into huge number of CFG rules<br />
• new rules and improvements of existing rules have to<br />
be kept consistent across all subcategories<br />
◆ Lexical entries become highly ambiguous<br />
• redundancy in lexicon, becomes difficult to maintain<br />
◆ Parsing with such CFG becomes inefficient<br />
• large number of nonterminals and CFG rules<br />
• high degree of (local) ambiguity<br />
15
A solution: feature bundles<br />
16
A solution: feature bundles<br />
◆ Decompose syntactic subcategories into<br />
bundles of features<br />
• major category (S, <strong>NP</strong>, VP, PP, V, N, …)<br />
• agreement (case, number, gender, person)<br />
• verb complementation (intrans, trans, ditrans, …)<br />
16
A solution: feature bundles<br />
◆ Decompose syntactic subcategories into<br />
bundles of features<br />
• major category (S, <strong>NP</strong>, VP, PP, V, N, …)<br />
• agreement (case, number, gender, person)<br />
• verb complementation (intrans, trans, ditrans, …)<br />
dem Mann: <strong>NP</strong>dat,sg,masc,3rd ➞<br />
⎡<br />
category<br />
⎢<br />
⎢agreement<br />
⎣<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎢num<br />
⎢<br />
⎣gend<br />
⎤<br />
⎤⎥<br />
dat ⎥<br />
sg<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
masc⎦<br />
⎥<br />
⎦<br />
pers 3<br />
16
Lexical entries<br />
for feature bundles<br />
<strong>NP</strong>nom,sg,3rd → he | she | it<br />
V3sg,trans → reads | eats | …<br />
17
Lexical entries<br />
for feature bundles<br />
<strong>NP</strong>nom,sg,3rd → he | she | it<br />
⎡<br />
category<br />
⎢<br />
⎣agreement<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
sg ⎦<br />
⎥<br />
⎦<br />
pers 3<br />
V3sg,trans → reads | eats | …<br />
he | she | it<br />
17
Lexical entries<br />
for feature bundles<br />
<strong>NP</strong>nom,sg,3rd → he | she | it<br />
⎡<br />
category<br />
⎢<br />
⎣agreement<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
sg ⎦<br />
⎥<br />
⎦<br />
pers 3<br />
V3sg,trans → reads | eats | …<br />
⎡<br />
category<br />
⎢<br />
⎢agreement<br />
⎣<br />
v<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
sg ⎥<br />
3 ⎥<br />
⎦<br />
subcat trans<br />
he | she | it<br />
reads | eats | …<br />
17
Phrase-structure rules<br />
for feature bundles<br />
S → <strong>NP</strong>nom,sg,3rd VP3sg | …<br />
VP3sg → V3sg,trans <strong>NP</strong>acc,pl,2nd | …<br />
18
Phrase-structure rules<br />
for feature bundles<br />
S → <strong>NP</strong>nom,sg,3rd VP3sg | …<br />
<br />
cat s<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
VP3sg → V3sg,trans <strong>NP</strong>acc,pl,2nd | …<br />
⎡<br />
⎤<br />
cat vp<br />
⎢ ⎥<br />
⎢<br />
⎣ num sg ⎥<br />
agr<br />
⎦<br />
pers 3<br />
18
Phrase-structure rules<br />
for feature bundles<br />
S → <strong>NP</strong>nom,sg,3rd VP3sg | …<br />
<br />
cat s<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
VP3sg → V3sg,trans <strong>NP</strong>acc,pl,2nd | …<br />
⎡<br />
⎤<br />
cat vp<br />
⎢ ⎥<br />
⎢<br />
⎣ num sg ⎥<br />
agr<br />
⎦<br />
pers 3<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
v<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
sg ⎥<br />
3 ⎥<br />
⎦<br />
subcat trans<br />
⎡<br />
⎤<br />
cat vp<br />
⎢ ⎥<br />
⎢<br />
⎣ num sg ⎥<br />
agr<br />
⎦<br />
pers 3<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
pl ⎥<br />
⎦<br />
pers 2<br />
18
⎡<br />
⎤<br />
cat vp<br />
⎢ ⎥<br />
⎢<br />
⎣ num sg ⎥<br />
agr<br />
⎦<br />
pers 3<br />
Phrase-structure rules<br />
for feature bundles<br />
S → <strong>NP</strong>nom,sg,3rd VP3sg | …<br />
<br />
cat s<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
VP3sg → V3sg,trans <strong>NP</strong>acc,pl,2nd | …<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
v<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
sg ⎥<br />
3 ⎥<br />
⎦<br />
subcat trans<br />
⎡<br />
⎤<br />
cat vp<br />
⎢ ⎥<br />
⎢<br />
⎣ num sg ⎥<br />
agr<br />
⎦<br />
pers 3<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
pl ⎥<br />
⎦<br />
pers 2<br />
19
⎡<br />
⎤<br />
cat vp<br />
⎢ ⎥<br />
⎢<br />
⎣ num sg ⎥<br />
agr<br />
⎦<br />
pers 3<br />
Phrase-structure rules<br />
for feature bundles<br />
S → <strong>NP</strong>nom,sg,3rd VP3sg | …<br />
<br />
cat s<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
VP3sg → V3sg,trans <strong>NP</strong>acc,pl,2nd | …<br />
x<br />
y<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
v<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
sg ⎥<br />
3 ⎥<br />
⎦<br />
subcat trans<br />
⎡<br />
⎤<br />
cat vp<br />
⎢ ⎥<br />
⎢<br />
⎣ num xsg<br />
⎥<br />
agr<br />
⎦<br />
pers 3<br />
y<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
pl ⎥<br />
⎦<br />
pers 2<br />
19
⎡<br />
⎤<br />
cat vp<br />
⎢ ⎥<br />
⎢<br />
⎣ num sg ⎥<br />
agr<br />
⎦<br />
pers 3<br />
Phrase-structure rules<br />
for feature bundles<br />
S → <strong>NP</strong>nom,sg,3rd VP3sg | …<br />
<br />
cat s<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
VP3sg → V3sg,trans <strong>NP</strong>acc,pl,2nd | …<br />
x<br />
y<br />
x<br />
y<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
v<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
xsg<br />
⎥<br />
y3<br />
⎥<br />
⎦<br />
subcat trans<br />
⎡<br />
⎤<br />
cat vp<br />
⎢ ⎥<br />
⎢<br />
⎣ num xsg<br />
⎥<br />
agr<br />
⎦<br />
pers 3<br />
y<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
pl ⎥<br />
⎦<br />
pers 2<br />
19
⎡<br />
⎤<br />
cat vp<br />
⎢ ⎥<br />
⎢<br />
⎣ num sg ⎥<br />
agr<br />
⎦<br />
pers 3<br />
Phrase-structure rules<br />
for feature bundles<br />
S → <strong>NP</strong>nom,sg,3rd VP3sg | …<br />
<br />
cat s<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
VP3sg → V3sg,trans <strong>NP</strong>acc,pl,2nd | …<br />
x<br />
y<br />
x<br />
y<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
v<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
xsg<br />
⎥<br />
y3<br />
⎥<br />
⎦<br />
subcat trans<br />
⎡<br />
⎤<br />
cat vp<br />
⎢ ⎥<br />
⎢<br />
⎣ num xsg<br />
⎥<br />
agr<br />
⎦<br />
pers 3<br />
y<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
pl ⎥<br />
⎦<br />
pers 2<br />
?<br />
?<br />
19
a → b c<br />
Phrase-structure rules<br />
for feature bundles<br />
= vp<br />
= v<br />
= np<br />
= [= x]<br />
= [= y]<br />
= trans<br />
= acc<br />
⎡<br />
⎤<br />
cat vp<br />
⎢ ⎥<br />
⎢<br />
⎣ num sg ⎥<br />
agr<br />
⎦<br />
pers 3<br />
x<br />
y<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
v<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
xsg<br />
⎥<br />
y3<br />
⎥<br />
⎦<br />
subcat trans<br />
path<br />
notation<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
pl ⎥<br />
⎦<br />
pers 2<br />
?<br />
?<br />
20
VP → V <strong>NP</strong><br />
Phrase-structure rules<br />
for feature bundles<br />
= <br />
= <br />
= trans<br />
= acc<br />
⎡<br />
⎤<br />
cat vp<br />
⎢ ⎥<br />
⎢<br />
⎣ num sg ⎥<br />
agr<br />
⎦<br />
pers 3<br />
x<br />
y<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
v<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
xsg<br />
⎥<br />
y3<br />
⎥<br />
⎦<br />
subcat trans<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
pl ⎥<br />
⎦<br />
pers 2<br />
?<br />
?<br />
21
Underspecified feature bundles<br />
⎡<br />
⎤<br />
cat np<br />
⎣ ⎦<br />
agr case acc<br />
22
Underspecified feature bundles<br />
◆ The object <strong>NP</strong> in our VP rule is underspecified<br />
• only = acc<br />
• encodes partial information<br />
⎡<br />
⎤<br />
cat np<br />
⎣ ⎦<br />
agr case acc<br />
22
Underspecified feature bundles<br />
◆ The object <strong>NP</strong> in our VP rule is underspecified<br />
• only = acc<br />
• encodes partial information<br />
◆ <strong>NP</strong> expansion rules require fully specified <strong>NP</strong><br />
• = acc<br />
• = sg<br />
• = 3<br />
⎡<br />
⎤<br />
cat np<br />
⎣ ⎦<br />
agr case acc<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
◆ How can we match these feature bundles?<br />
22
Unification<br />
◆ Feature bundles are not matched by equality,<br />
but by merging (partial) information<br />
• possible whenever feature bundles are consistent<br />
◆ This process is called unification<br />
• unification result = “smallest” feature bundle that<br />
contains all information from the two arguments<br />
• unification does not add further information<br />
23
Conflicting vs. consistent<br />
feature bundles<br />
24
Conflict:<br />
Conflicting vs. consistent<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
feature bundles<br />
↯<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
↯ ↯<br />
24
Conflict:<br />
Conflicting vs. consistent<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
Consistent:<br />
feature bundles<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
↯<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
↯ ↯<br />
✓<br />
⎡<br />
⎤<br />
cat np<br />
⎣ ⎦<br />
agr case acc<br />
24
Subsumption<br />
25
Subsumption<br />
◆ Feature bundle A subsumes feature bundle B<br />
iff B contains more information than A<br />
• A and B must be consistent<br />
• B may contain additional information<br />
• A must not contain any information not present in B<br />
25
Subsumption<br />
◆ Feature bundle A subsumes feature bundle B<br />
iff B contains more information than A<br />
• A and B must be consistent<br />
• B may contain additional information<br />
• A must not contain any information not present in B<br />
◆ Notation: A ⊑ B<br />
⎡<br />
⎤<br />
cat np<br />
⎣ ⎦<br />
agr case acc<br />
⊑<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
25
Unification<br />
◆ Consistent feature bundles can be unified<br />
• even if A does not subsume B, and vice versa<br />
◆ Notation: A ⊔ B<br />
⎡<br />
⎤<br />
cat np<br />
⎢ ⎥<br />
⎢<br />
⎣ case acc ⎥<br />
agr<br />
⎦<br />
pers 3<br />
⊔<br />
⎡<br />
⎤<br />
cat np<br />
⎢ ⎥<br />
⎢<br />
⎣ case acc ⎥<br />
agr<br />
⎦<br />
num sg<br />
26
Unification<br />
◆ Consistent feature bundles can be unified<br />
• even if A does not subsume B, and vice versa<br />
◆ Notation: A ⊔ B<br />
⎡<br />
⎤<br />
cat np<br />
⎢ ⎥<br />
⎢<br />
⎣ case acc ⎥<br />
agr<br />
⎦<br />
pers 3<br />
=<br />
⊔<br />
⎡<br />
⎤<br />
cat np<br />
⎢ ⎥<br />
⎢<br />
⎣ case acc ⎥<br />
agr<br />
⎦<br />
num sg<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣num<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
sg ⎥<br />
⎦<br />
pers 3<br />
26
Underspecification<br />
and unification<br />
27
Underspecification<br />
and unification<br />
◆ Underspecification and unification are<br />
important devices of feature grammars<br />
• lexical entries are often underspecified<br />
• unification combines partial information from<br />
different feature bundles<br />
27
Underspecification<br />
and unification<br />
◆ Underspecification and unification are<br />
important devices of feature grammars<br />
• lexical entries are often underspecified<br />
• unification combines partial information from<br />
different feature bundles<br />
◆ Consider German <strong>NP</strong> agreement: die Blume<br />
• <strong>NP</strong> → Det N<br />
= <br />
= <br />
= 3<br />
• merge (= unify) and expand AGR feature bundles<br />
27
Underspecification<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
det<br />
⎡<br />
case<br />
⎢<br />
⎣gend<br />
⎤<br />
⎤⎥<br />
nom, acc<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
fem<br />
⎥<br />
⎦<br />
num sg<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
det<br />
⎡<br />
⎣ case<br />
⎤<br />
⎤<br />
⎥<br />
nom, acc ⎥<br />
⎦<br />
num pl<br />
and unification<br />
die Blume<br />
⎡<br />
⎤<br />
cat n<br />
⎢ ⎥<br />
⎢<br />
⎣ gend fem ⎥<br />
agr<br />
⎦<br />
num sg<br />
28
Underspecification<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
det<br />
⎡<br />
case<br />
⎢<br />
⎣gend<br />
⎤<br />
⎤⎥<br />
nom, acc<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
fem<br />
⎥<br />
⎦<br />
num sg<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
det<br />
⎡<br />
⎣ case<br />
⎤<br />
⎤<br />
⎥<br />
nom, acc ⎥<br />
⎦<br />
num pl<br />
and unification<br />
die Blume<br />
This is a problem we are<br />
not going to deal with<br />
→ multiple lexical entries<br />
⎡<br />
⎤<br />
cat n<br />
⎢ ⎥<br />
⎢<br />
⎣ gend fem ⎥<br />
agr<br />
⎦<br />
num sg<br />
28
Underspecification<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
det<br />
⎡<br />
case<br />
⎢<br />
⎣gend<br />
⎤<br />
⎤⎥<br />
nom, acc<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
fem<br />
⎥<br />
⎦<br />
num sg<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
det<br />
⎡<br />
⎣ case<br />
⎤<br />
⎤<br />
⎥<br />
nom, acc ⎥<br />
⎦<br />
num pl<br />
and unification<br />
die Blume<br />
⎡<br />
⎤<br />
cat n<br />
⎢ ⎥<br />
⎢<br />
⎣ gend fem ⎥<br />
agr<br />
⎦<br />
num sg<br />
29
Underspecification<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
det<br />
⎡<br />
case<br />
⎢<br />
⎣gend<br />
⎤<br />
⎤⎥<br />
nom, acc<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
fem<br />
⎥<br />
⎦<br />
num sg<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
det<br />
⎡<br />
⎣ case<br />
⎤<br />
⎤<br />
⎥<br />
nom, acc ⎥<br />
⎦<br />
num pl<br />
and unification<br />
die Blume<br />
⎡<br />
⎤<br />
cat n<br />
⎢ ⎥<br />
⎢<br />
⎣ gend fem ⎥<br />
agr<br />
⎦<br />
num sg<br />
29
Underspecification<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
det<br />
⎡<br />
case<br />
⎢<br />
⎣gend<br />
⎤<br />
⎤⎥<br />
nom, acc<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
fem<br />
⎥<br />
⎦<br />
num sg<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
det<br />
⎡<br />
⎣ case<br />
⎤<br />
⎤<br />
⎥<br />
nom, acc ⎥<br />
⎦<br />
num pl<br />
and unification<br />
die Blume<br />
↯<br />
⎡<br />
⎤<br />
cat n<br />
⎢ ⎥<br />
⎢<br />
⎣ gend fem ⎥<br />
agr<br />
⎦<br />
num sg<br />
29
Underspecification<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
det<br />
⎡<br />
case<br />
⎢<br />
⎣gend<br />
⎤<br />
⎤⎥<br />
nom, acc<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
fem<br />
⎥<br />
⎦<br />
num sg<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
det<br />
⎡<br />
⎣ case<br />
⎤<br />
⎤<br />
⎥<br />
nom, acc ⎥<br />
⎦<br />
num pl<br />
and unification<br />
die Blume<br />
✓<br />
⎡<br />
⎤<br />
cat n<br />
⎢ ⎥<br />
⎢<br />
⎣ gend fem ⎥<br />
agr<br />
⎦<br />
num sg<br />
29
Underspecification<br />
and unification<br />
die Blume<br />
⎡<br />
⎤<br />
cat det<br />
⎢ ⎡ ⎤⎥<br />
⎢ case nom, acc<br />
⎥<br />
⎢ ⎢<br />
⎥<br />
⎥<br />
⎢agr<br />
⎢<br />
⎥<br />
⎥<br />
⎣ ⎣gend<br />
fem<br />
⎥<br />
⎦<br />
⊔<br />
⎡<br />
⎤<br />
num sg<br />
cat n<br />
⎢ ⎥<br />
⎢<br />
⎣ gend fem ⎥<br />
agr<br />
⎦<br />
num sg<br />
29
Underspecification<br />
and unification<br />
die Blume<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣gend<br />
⎤<br />
⎤⎥<br />
nom, acc<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
⎥<br />
fem<br />
⎥<br />
⎦<br />
num sg<br />
30
Towards feature structures<br />
31
Towards feature structures<br />
◆ We still need many different rules for verb<br />
complementation (depending on )<br />
• VP → Vintrans<br />
VP → Vtrans <strong>NP</strong>acc<br />
VP → Vtrans,dat <strong>NP</strong>dat (in German)<br />
VP → Vcomp CP<br />
• specified in terms of feature constraints, of course<br />
31
Towards feature structures<br />
◆ We still need many different rules for verb<br />
complementation (depending on )<br />
• VP → Vintrans<br />
VP → Vtrans <strong>NP</strong>acc<br />
VP → Vtrans,dat <strong>NP</strong>dat (in German)<br />
VP → Vcomp CP<br />
• specified in terms of feature constraints, of course<br />
◆ We would like to be able to write this:<br />
• VP → V x<br />
= x<br />
• lexical entry of V specifies category, case, … of argument<br />
31
Towards feature structures<br />
32
Towards feature structures<br />
◆ Value of the feature is a full<br />
feature bundle, not just an atomic symbol<br />
• looked like a feature bundle, but can be seen<br />
as a convenient notation for grouping related features<br />
• for verb complementation, we want to allow arbitrarily<br />
complex structures as values of <br />
32
Towards feature structures<br />
◆ Value of the feature is a full<br />
feature bundle, not just an atomic symbol<br />
• looked like a feature bundle, but can be seen<br />
as a convenient notation for grouping related features<br />
• for verb complementation, we want to allow arbitrarily<br />
complex structures as values of <br />
◆ Feature bundles that<br />
allow such complex<br />
values are called<br />
feature structures<br />
⎡<br />
⎤<br />
cat v<br />
⎢ ⎥<br />
⎢<br />
num sg ⎥<br />
⎢agr<br />
⎥<br />
⎢ pers 3 ⎥<br />
⎢ ⎡<br />
⎤⎥<br />
⎢ cat np ⎥<br />
⎣subcat<br />
⎣ <br />
⎥<br />
⎦<br />
agr case acc<br />
32
Feature structures<br />
33
Feature structures<br />
◆ Recursive unification of feature structures<br />
• atomic values must match exactly to be unified<br />
• complex values are unified recursively<br />
• atomic value cannot be unified with feature structure<br />
(except for empty, or “null” feature structure [])<br />
33
Feature structures<br />
◆ Recursive unification of feature structures<br />
• atomic values must match exactly to be unified<br />
• complex values are unified recursively<br />
• atomic value cannot be unified with feature structure<br />
(except for empty, or “null” feature structure [])<br />
◆ Typical case: unification of sub-structures<br />
• e.g. agreement information from Det, A and N<br />
33
Feature structures<br />
◆ Recursive unification of feature structures<br />
• atomic values must match exactly to be unified<br />
• complex values are unified recursively<br />
• atomic value cannot be unified with feature structure<br />
(except for empty, or “null” feature structure [])<br />
◆ Typical case: unification of sub-structures<br />
• e.g. agreement information from Det, A and N<br />
◆ Implementation based on graph representation<br />
• useful to define and understand unification procedure<br />
33
Representation of<br />
feature structures<br />
⎡<br />
⎤<br />
cat v<br />
⎢ ⎥<br />
⎢<br />
num sg ⎥<br />
⎢agr<br />
⎥<br />
⎢ pers 3 ⎥<br />
⎢ ⎡<br />
⎤⎥<br />
⎢ cat np ⎥<br />
⎣subcat<br />
⎣ <br />
⎥<br />
⎦<br />
agr case acc<br />
attribute-value matrix (AVM)<br />
34
= v<br />
= sg<br />
= 3<br />
= np<br />
= acc<br />
path notation<br />
Representation of<br />
feature structures<br />
⎡<br />
⎤<br />
cat v<br />
⎢ ⎥<br />
⎢<br />
num sg ⎥<br />
⎢agr<br />
⎥<br />
⎢ pers 3 ⎥<br />
⎢ ⎡<br />
⎤⎥<br />
⎢ cat np ⎥<br />
⎣subcat<br />
⎣ <br />
⎥<br />
⎦<br />
agr case acc<br />
attribute-value matrix (AVM)<br />
34
= v<br />
= sg<br />
= 3<br />
= np<br />
= acc<br />
path notation<br />
CAT<br />
AGR<br />
SUBCAT<br />
graph<br />
notation<br />
Representation of<br />
feature structures<br />
v<br />
NUM<br />
PERS<br />
CAT<br />
AGR<br />
sg<br />
3<br />
np<br />
⎡<br />
⎤<br />
cat v<br />
⎢ ⎥<br />
⎢<br />
num sg ⎥<br />
⎢agr<br />
⎥<br />
⎢ pers 3 ⎥<br />
⎢ ⎡<br />
⎤⎥<br />
⎢ cat np ⎥<br />
⎣subcat<br />
⎣ <br />
⎥<br />
⎦<br />
agr case acc<br />
attribute-value matrix (AVM)<br />
CASE<br />
acc<br />
34
Unification example<br />
= <br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎢<br />
⎣subcat<br />
v<br />
<br />
num<br />
pers<br />
⎡<br />
cat<br />
⎣<br />
agr<br />
<br />
sg<br />
3<br />
np<br />
<br />
case<br />
⎤<br />
⎥<br />
⎤ ⎥<br />
<br />
⎥<br />
⎦<br />
acc<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
np<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
pl ⎥<br />
1 ⎥<br />
⎦<br />
animate +<br />
35
Unification example<br />
= <br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎢<br />
⎣subcat<br />
v<br />
<br />
num<br />
pers<br />
⎡<br />
cat<br />
⎣<br />
agr<br />
<br />
sg<br />
3<br />
np<br />
<br />
case<br />
⎤<br />
⎥<br />
⎤ ⎥<br />
<br />
⎥<br />
⎦<br />
acc<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
np<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
pl ⎥<br />
1 ⎥<br />
⎦<br />
animate +<br />
35
Unification example<br />
= <br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎢<br />
⎣subcat<br />
v<br />
<br />
num<br />
pers<br />
⎡<br />
cat<br />
⎣<br />
agr<br />
<br />
sg<br />
3<br />
np<br />
<br />
case<br />
⎤<br />
⎥<br />
⎤ ⎥<br />
<br />
⎥<br />
⎦<br />
acc<br />
CAT<br />
AGR<br />
SUBCAT<br />
v<br />
NUM<br />
PERS<br />
CAT<br />
AGR<br />
sg<br />
3<br />
np<br />
CASE<br />
acc<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
np<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
pl ⎥<br />
1 ⎥<br />
⎦<br />
animate +<br />
CAT<br />
ANIMATE<br />
AGR<br />
np<br />
+<br />
NUM<br />
PERS<br />
pl<br />
1<br />
35
Unification example<br />
= <br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎢<br />
⎣subcat<br />
v<br />
<br />
num<br />
pers<br />
⎡<br />
cat<br />
⎣<br />
agr<br />
<br />
sg<br />
3<br />
np<br />
<br />
case<br />
⎤<br />
⎥<br />
⎤ ⎥<br />
<br />
⎥<br />
⎦<br />
acc<br />
CAT<br />
AGR<br />
SUBCAT<br />
v<br />
NUM<br />
PERS<br />
CAT<br />
AGR<br />
sg<br />
3<br />
np<br />
CASE<br />
acc<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
np<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
pl ⎥<br />
1 ⎥<br />
⎦<br />
animate +<br />
CAT<br />
ANIMATE<br />
AGR<br />
np<br />
+<br />
NUM<br />
PERS<br />
pl<br />
1<br />
35
CAT<br />
AGR<br />
SUBCAT<br />
CAT<br />
AGR<br />
SUBCAT<br />
v<br />
Unification example<br />
v<br />
NUM<br />
PERS<br />
CAT<br />
AGR<br />
NUM<br />
PERS<br />
sg<br />
3<br />
np<br />
CAT<br />
ANIMATE<br />
AGR<br />
CASE<br />
sg<br />
3<br />
np<br />
+<br />
acc<br />
CASE<br />
NUM<br />
PERS<br />
acc<br />
pl<br />
1<br />
CAT<br />
ANIMATE<br />
AGR<br />
np<br />
+<br />
NUM<br />
PERS<br />
pl<br />
1<br />
36
Shared structure & reentrancy<br />
37
Shared structure & reentrancy<br />
◆ Merged information vs. structure sharing<br />
• unification can either build new FS with merged<br />
information, or identify unified substructures<br />
(➞ multiple features point to the same FS)<br />
• standard algorithm modifies and links unification<br />
arguments in the process (Jurafsky & Martin, Ch. 15)<br />
37
Shared structure & reentrancy<br />
◆ Merged information vs. structure sharing<br />
• unification can either build new FS with merged<br />
information, or identify unified substructures<br />
(➞ multiple features point to the same FS)<br />
• standard algorithm modifies and links unification<br />
arguments in the process (Jurafsky & Martin, Ch. 15)<br />
◆ Feature structures with shared substructures<br />
are called reentrant<br />
• = nodes with multiple incoming edges in graph<br />
• important distinction: equal values (value identity)<br />
vs. shared structure (reentrancy)<br />
37
Shared structure and reentrancy<br />
we speak<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
np<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
pl ⎥<br />
1 ⎥<br />
⎦<br />
animate +<br />
⎡<br />
⎤<br />
cat vp<br />
⎢ <br />
⎥<br />
⎢<br />
⎣ num pl ⎥<br />
agr<br />
⎦<br />
tense pres<br />
38
Shared structure and reentrancy<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
np<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
pl ⎥<br />
1 ⎥<br />
⎦<br />
animate +<br />
CAT<br />
ANIMATE<br />
AGR<br />
we speak<br />
np<br />
+<br />
NUM<br />
PERS<br />
= <br />
pl<br />
1<br />
⎡<br />
⎤<br />
cat vp<br />
⎢ <br />
⎥<br />
⎢<br />
⎣ num pl ⎥<br />
agr<br />
⎦<br />
tense pres<br />
CAT<br />
AGR<br />
vp<br />
NUM<br />
TENSE<br />
pl<br />
pres<br />
38
Shared structure and reentrancy<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
np<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
pl ⎥<br />
1 ⎥<br />
⎦<br />
animate +<br />
CAT<br />
ANIMATE<br />
AGR<br />
we speak<br />
np<br />
+<br />
NUM<br />
PERS<br />
= <br />
pl<br />
1<br />
⎡<br />
⎤<br />
cat vp<br />
⎢ <br />
⎥<br />
⎢<br />
⎣ num pl ⎥<br />
agr<br />
⎦<br />
tense pres<br />
CAT<br />
AGR<br />
vp<br />
NUM<br />
TENSE<br />
pl<br />
pres<br />
38
Shared structure and reentrancy<br />
we speak<br />
⎡<br />
cat<br />
⎢<br />
⎢agr<br />
⎣<br />
np<br />
<br />
num<br />
pers<br />
⎤<br />
⎥<br />
pl ⎥<br />
1 ⎥<br />
⎦<br />
animate +<br />
CAT<br />
ANIMATE<br />
AGR<br />
AGR<br />
CAT<br />
np<br />
+<br />
vp<br />
NUM<br />
PERS<br />
TENSE<br />
⎡<br />
⎤<br />
cat vp<br />
⎢ <br />
⎥<br />
⎢<br />
⎣ num pl ⎥<br />
agr<br />
⎦<br />
tense pres<br />
pl<br />
1<br />
pres<br />
39
Shared structure and reentrancy<br />
we speak<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
⎤<br />
np<br />
⎥<br />
1 ⎦<br />
animate +<br />
CAT<br />
ANIMATE<br />
AGR<br />
AGR<br />
CAT<br />
np<br />
+<br />
vp<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
vp<br />
⎡<br />
num<br />
⎢<br />
1⎣pers<br />
pl<br />
1<br />
⎤<br />
⎤ ⎥<br />
⎥<br />
⎥<br />
⎦<br />
tense pres<br />
NUM<br />
PERS<br />
TENSE<br />
pl<br />
1<br />
pres<br />
40
Shared structure and reentrancy<br />
we speak<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
⎤<br />
np<br />
⎥<br />
1 ⎦<br />
animate +<br />
reentrancy<br />
CAT<br />
ANIMATE<br />
AGR<br />
AGR<br />
CAT<br />
np<br />
+<br />
vp<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
vp<br />
⎡<br />
num<br />
⎢<br />
1⎣pers<br />
pl<br />
1<br />
⎤<br />
⎤ ⎥<br />
⎥<br />
⎥<br />
⎦<br />
tense pres<br />
NUM<br />
PERS<br />
TENSE<br />
pl<br />
1<br />
pres<br />
40
Full parse example<br />
⎡<br />
⎤<br />
cat v<br />
⎢ ⎡ ⎤ ⎥<br />
⎢ case nom ⎥<br />
⎢ ⎢ ⎥ ⎥<br />
⎢agr<br />
⎣pers<br />
3 ⎦ ⎥<br />
⎢ num sg ⎥<br />
⎡<br />
⎤ ⎡<br />
⎤⎢<br />
⎡<br />
⎤⎥<br />
⎢<br />
cat det cat n ⎢ cat np ⎥<br />
⎣ ⎦<br />
⎣ ⎦⎣subcat<br />
⎣ <br />
⎥<br />
⎦<br />
agr pers 3 agr pers 3<br />
agr case acc<br />
The sheep likes me<br />
41
Full parse example<br />
VP → V <strong>NP</strong><br />
= <br />
= <br />
⎡<br />
⎤<br />
cat v<br />
⎢ ⎡ ⎤ ⎥<br />
⎢ case nom ⎥<br />
⎢ ⎢ ⎥ ⎥<br />
⎢agr<br />
⎣pers<br />
3 ⎦ ⎥<br />
⎢ num sg ⎥<br />
⎡<br />
⎤ ⎡<br />
⎤⎢<br />
⎡<br />
⎤⎥<br />
⎢<br />
cat det cat n ⎢ cat np ⎥<br />
⎣ ⎦<br />
⎣ ⎦⎣subcat<br />
⎣ <br />
⎥<br />
⎦<br />
agr pers 3 agr pers 3<br />
agr case acc<br />
The sheep likes me<br />
41
⎡<br />
⎤ ⎡<br />
⎤<br />
cat det cat n<br />
⎣ ⎦<br />
⎣ ⎦<br />
agr pers 3 agr pers 3<br />
Full parse example<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
vp<br />
⎡<br />
case<br />
⎢<br />
1⎣pers<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
3 ⎦<br />
⎥<br />
⎦<br />
num sg<br />
⎡<br />
cat<br />
⎤<br />
v<br />
⎢<br />
⎣agr<br />
⎥ 1 ⎦<br />
subcat 2<br />
The sheep likes me<br />
42
⎡<br />
⎤ ⎡<br />
⎤<br />
cat det cat n<br />
⎣ ⎦<br />
⎣ ⎦<br />
agr pers 3 agr pers 3<br />
Full parse example<br />
<strong>NP</strong> → Det N<br />
= <br />
= <br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
vp<br />
⎡<br />
case<br />
⎢<br />
1⎣pers<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
3 ⎦<br />
⎥<br />
⎦<br />
num sg<br />
⎡<br />
cat<br />
⎤<br />
v<br />
⎢<br />
⎣agr<br />
⎥ 1 ⎦<br />
subcat 2<br />
The sheep likes me<br />
42
⎡<br />
⎤<br />
cat np<br />
⎣ ⎦<br />
agr 3 pers 3<br />
<br />
cat det cat n<br />
agr 3<br />
Full parse example<br />
agr 3<br />
<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
vp<br />
⎡<br />
case<br />
⎢<br />
1⎣pers<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
3 ⎦<br />
⎥<br />
⎦<br />
num sg<br />
⎡<br />
cat<br />
⎤<br />
v<br />
⎢<br />
⎣agr<br />
⎥ 1 ⎦<br />
subcat 2<br />
The sheep likes me<br />
43
⎡<br />
⎤<br />
cat np<br />
⎣ ⎦<br />
agr 3 pers 3<br />
<br />
cat det cat n<br />
agr 3<br />
Full parse example<br />
agr 3<br />
<br />
S → <strong>NP</strong> VP<br />
= <br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
vp<br />
⎡<br />
case<br />
⎢<br />
1⎣pers<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
3 ⎦<br />
⎥<br />
⎦<br />
num sg<br />
⎡<br />
cat<br />
⎤<br />
v<br />
⎢<br />
⎣agr<br />
⎥ 1 ⎦<br />
subcat 2<br />
The sheep likes me<br />
43
cat np<br />
agr 1<br />
<br />
cat det cat n<br />
agr 1<br />
Full parse example<br />
agr 1<br />
<br />
cat s<br />
<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
vp<br />
⎡<br />
case<br />
⎢<br />
1⎣pers<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
3 ⎦<br />
⎥<br />
⎦<br />
num sg<br />
⎡<br />
cat<br />
⎤<br />
v<br />
⎢<br />
⎣agr<br />
⎥ 1 ⎦<br />
subcat 2<br />
The sheep likes me<br />
44
cat np<br />
agr 1<br />
<br />
cat det cat n<br />
agr 1<br />
Full parse example<br />
agr 1<br />
<br />
cat s<br />
<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
vp<br />
⎡<br />
case<br />
⎢<br />
1⎣pers<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
⎥<br />
⎥<br />
3 ⎦<br />
⎥<br />
⎦<br />
num sg<br />
⎡<br />
cat<br />
⎤<br />
v<br />
⎢<br />
⎣agr<br />
⎥ 1 ⎦<br />
subcat 2<br />
2<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
case<br />
⎢<br />
⎣pers<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
3 ⎦<br />
⎥<br />
⎦<br />
num sg<br />
The sheep likes me<br />
45
cat np<br />
agr 1<br />
<br />
cat det cat n<br />
agr 1<br />
Full parse example<br />
agr 1<br />
<br />
cat s<br />
CAT AGR CAT AGR AGR AGR CAT CAT AGR SUBCAT CAT<br />
<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
vp<br />
⎡<br />
case<br />
⎢<br />
1⎣pers<br />
⎤<br />
⎤⎥<br />
nom ⎥<br />
AGR<br />
⎥<br />
⎥<br />
3 ⎦<br />
⎥<br />
⎦<br />
num sg<br />
n np<br />
det vp v<br />
sg<br />
NUMPERS CASE<br />
3<br />
nom<br />
⎡<br />
cat<br />
⎤<br />
v<br />
⎢<br />
⎣agr<br />
⎥ 1 ⎦<br />
subcat 2<br />
1<br />
2<br />
⎡<br />
cat<br />
⎢<br />
⎣agr<br />
np<br />
⎡<br />
acc case<br />
⎢<br />
⎣pers<br />
⎤<br />
⎤⎥<br />
acc ⎥<br />
⎥<br />
⎥<br />
3 ⎦<br />
⎥<br />
⎦<br />
num sg<br />
The sheep likes me<br />
sg<br />
CAT<br />
np<br />
NUM PERS CASE<br />
45
Feature CFG in Python/NLTK<br />
% start S<br />
toy_english.fcfg<br />
## lexical rules (NB: full AVM must be on single line!)<br />
Det[AGR=[PERS=3]] -> 'the'<br />
N[AGR=[PERS=3]] -> 'sheep'<br />
V[AGR=[CASE=nom, PERS=3, NUM=sg],…<br />
…SUBCAT=[CAT=np, AGR=[CASE=acc]]] -> 'likes'<br />
Pron[AGR=[CASE=acc, PERS=1, NUM=sg]] -> 'me'<br />
## phrase-structure rules<br />
S -> <strong>NP</strong>[AGR=?x] VP[AGR=?x]<br />
<strong>NP</strong>[AGR=?x] -> Det[AGR=?x] N[AGR=?x]<br />
<strong>NP</strong>[AGR=?x] -> Pron[AGR=?x]<br />
VP[AGR=?x] -> V[AGR=?x, SUBCAT=[CAT=np, AGR=?y]] <strong>NP</strong>[AGR=?y]<br />
46
Feature CFG in Python/NLTK<br />
from nltk.parse.featurechart import load_earley<br />
parser = load_earley("file:toy_english.fcfg")<br />
# add trace=2 to see how parser works<br />
input = "the sheep likes me".split()<br />
trees = parser.nbest_parse(input)<br />
for tree in trees:<br />
print tree # no true unification of AVMs!<br />
# graphical presentation of parse trees<br />
from nltk.draw.tree import draw_trees<br />
draw_trees(*trees) # better layout with typewriter font<br />
47
Reentrancy in Python/NLTK<br />
from nltk.featstruct import FeatStruct<br />
AVM = """<br />
[ SUBJ=[CAT=np, AGR=(1)[NUM=sg, PERS=3, CASE=nom]],<br />
OBJ =(2)[CAT=np, AGR=[NUM=sg, PERS=1, CASE=acc]],<br />
PRED=[CAT=v, AGR->(1), SUBCAT->(2)]<br />
]<br />
"""<br />
# - coindexed FS must be defined before it's referenced<br />
# - cannot represent reentrancy between multiple AVMs<br />
fs = FeatStruct(AVM)<br />
print fs<br />
48
Advanced topics<br />
◆ Verb argument lists in SUBCAT feature<br />
◆ Handling movement with “slash” features<br />
◆ Lexicon-driven grammars ➞ free word order<br />
◆ Grammar formalisms based on feature<br />
structures and unification<br />
• PATR (Shieber 1983), FUG (Kay 1979), GPSG (Gazdar<br />
et al. 1985), LFG (Bresnan 1982–present), HPSG<br />
(Pollard & Sag 1987, 1994–present)<br />
◆ Parsing with feature structures<br />
49
Reading & homework<br />
◆ Reading assignment<br />
NLTK Book, Chapter 9<br />
• optional: Jurafsky & Martin, Ch. 15<br />
◆ Homework assignment #5<br />
• will be available on homepage later today, as usual<br />
50