Features & Unification Ling 571 Deep Processing Techniques for - - PowerPoint PPT Presentation

features unification
SMART_READER_LITE
LIVE PREVIEW

Features & Unification Ling 571 Deep Processing Techniques for - - PowerPoint PPT Presentation

Features & Unification Ling 571 Deep Processing Techniques for NLP January 31, 2011 Roadmap Features: Motivation Constraint & compactness Features Definitions & representations Unification


slide-1
SLIDE 1

Features & Unification

Ling 571 Deep Processing Techniques for NLP January 31, 2011

slide-2
SLIDE 2

Roadmap

— Features: Motivation

— Constraint & compactness

— Features

— Definitions & representations

— Unification — Application of features in the grammar

— Agreement, subcategorization

— Parsing with features & unification

— Augmenting the Earley parser, unification parsing

— Extensions: Types, inheritance, etc — Conclusion

slide-3
SLIDE 3

Constraints & Compactness

— Constraints in grammar

— S -> NP VP

— They run. — He runs.

slide-4
SLIDE 4

Constraints & Compactness

— Constraints in grammar

— S -> NP VP

— They run. — He runs.

— But…

— *They runs — *He run — *He disappeared the flight

slide-5
SLIDE 5

Constraints & Compactness

— Constraints in grammar

— S -> NP VP

— They run. — He runs.

— But…

— *They runs — *He run — *He disappeared the flight

— NP -> Det Nom

— This flight

slide-6
SLIDE 6

Constraints & Compactness

— Constraints in grammar

— S -> NP VP

— They run. — He runs.

— But…

— *They runs — *He run — *He disappeared the flight

— NP -> Det Nom

— This flight — These flights

slide-7
SLIDE 7

Constraints & Compactness

— Constraints in grammar

— S -> NP VP

— They run. — He runs.

— But…

— *They runs — *He run — *He disappeared the flight

— NP -> Det Nom

— This flight — These flights — *This flights

slide-8
SLIDE 8

Constraints & Compactness

— Constraints in grammar

— S -> NP VP

— They run. — He runs.

— But…

— *They runs — *He run — *He disappeared the flight

— NP -> Det Nom

— This flight — These flights — *This flights

— Violate agreement (number), subcategorization

slide-9
SLIDE 9

Enforcing Constraints

— Enforcing constraints

slide-10
SLIDE 10

Enforcing Constraints

— Enforcing constraints

— Add categories, rules

slide-11
SLIDE 11

Enforcing Constraints

— Enforcing constraints

— Add categories, rules

— Agreement:

— S-> NPsg3p VPsg3p, — S-> NPpl3p VPpl3p,

slide-12
SLIDE 12

Enforcing Constraints

— Enforcing constraints

— Add categories, rules

— Agreement:

— S-> NPsg3p VPsg3p, — S-> NPpl3p VPpl3p,

— Subcategorization:

— VP-> Vtrans NP

,

— VP -> Vintrans, — VP->Vditrans NP NP

slide-13
SLIDE 13

Enforcing Constraints

— Enforcing constraints

— Add categories, rules

— Agreement:

— S-> NPsg3p VPsg3p, — S-> NPpl3p VPpl3p,

— Subcategorization:

— VP-> Vtrans NP

,

— VP -> Vintrans, — VP->Vditrans NP NP

— Explosive!, loses key generalizations

slide-14
SLIDE 14

Features

— person: 1st, 2nd, 3rd

— I, we; you; he, she, they — am, are, is

slide-15
SLIDE 15

Features

— person: 1st, 2nd, 3rd

— I, we; you; he, she, they — am, are, is

— number: sg, pl

— I am; we are

slide-16
SLIDE 16

Features

— person: 1st, 2nd, 3rd

— I, we; you; he, she, they — am, are, is

— number: sg, pl

— I am; we are

— case: nom, acc

— I, he; me, him

slide-17
SLIDE 17

Features

— person: 1st, 2nd, 3rd

— I, we; you; he, she, they — am, are, is

— number: sg, pl

— I am; we are

— case: nom, acc

— I, he; me, him

— gender: masc, fem, neut

slide-18
SLIDE 18

Features

— person: 1st, 2nd, 3rd

— I, we; you; he, she, they — am, are, is

— number: sg, pl

— I am; we are

— case: nom, acc

— I, he; me, him

— gender: masc, fem, neut — animacy: +/- — etc

slide-19
SLIDE 19

Why features?

— Need compact, general constraints

— S -> NP VP

slide-20
SLIDE 20

Why features?

— Need compact, general constraints

— S -> NP VP

— Only if NP and VP agree

slide-21
SLIDE 21

Why features?

— Need compact, general constraints

— S -> NP VP

— Only if NP and VP agree

— How can we describe agreement, subcat?

slide-22
SLIDE 22

Why features?

— Need compact, general constraints

— S -> NP VP

— Only if NP and VP agree

— How can we describe agreement, subcat?

— Decompose into elementary features that must

be consistent

— E.g. Agreement

slide-23
SLIDE 23

Why features?

— Need compact, general constraints

— S -> NP VP

— Only if NP and VP agree

— How can we describe agreement, subcat?

— Decompose into elementary features that must

be consistent

— E.g. Agreement

— Number, person, gender, etc

slide-24
SLIDE 24

Why features?

— Need compact, general constraints

— S -> NP VP

— Only if NP and VP agree

— How can we describe agreement, subcat?

— Decompose into elementary features that must be

consistent

— E.g. Agreement

— Number, person, gender, etc

— Augment CF rules with feature constraints

— Develop mechanism to enforce consistency — Elegant, compact, rich representation

slide-25
SLIDE 25

Feature Representations

— Fundamentally, Attribute-

Value pairs — Features: atomic symbols

from a finite set

slide-26
SLIDE 26

Feature Representations

— Fundamentally, Attribute-

Value pairs — Features: atomic symbols

from a finite set

— Values may be

— Atomic symbols from a

finite set Attribute-value matrix (AVM)

slide-27
SLIDE 27

Feature Representations

— Fundamentally, Attribute-

Value pairs — Features: atomic symbols

from a finite set

— Values may be

— Atomic symbols from a

finite set Attribute-value matrix (AVM)

NUMBER PL

slide-28
SLIDE 28

Feature Representations

— Fundamentally, Attribute-

Value pairs — Features: atomic symbols

from a finite set

— Values may be

— Atomic symbols from a

finite set Attribute-value matrix (AVM)

NUMBER PL PERSON 3

slide-29
SLIDE 29

Feature Representations

— Fundamentally, Attribute-

Value pairs — Features: atomic symbols

from a finite set

— Values may be

— Atomic symbols from a

finite set Attribute-value matrix (AVM)

NUMBER PL PERSON 3 NUMBER PL PERSON 3

slide-30
SLIDE 30

Feature Representations

— Fundamentally, Attribute-

Value pairs — Features: atomic symbols

from a finite set

— Values may be

— Atomic symbols from a

finite set Attribute-value matrix (AVM)

NUMBER PL PERSON 3 NUMBER PL PERSON 3 CAT NP NUMBER PL PERSON 3

slide-31
SLIDE 31

Feature Representations

— Fundamentally, Attribute-Value pairs

— Features: atomic symbols from a finite set — Values may be

— Atomic symbols from a finite set

— Values may also be feature structures themselves

Attribute-value matrix (AVM)

CAT NP AGREEMENT NUMBER PL PERSON 3

slide-32
SLIDE 32

Feature Representations

— Feature path:

— Sequence of features through a feature structure

leading to a particular value

CAT NP AGREEMENT NUMBER PL PERSON 3

slide-33
SLIDE 33

Feature Representations

— Feature path:

— Sequence of features through a feature structure

leading to a particular value

CAT NP AGREEMENT NUMBER PL PERSON 3

<AGREEMENT NUMBER> -> PL

slide-34
SLIDE 34

Feature Representations

— Feature path:

— Sequence of features through a feature structure

leading to a particular value

CAT NP AGREEMENT NUMBER PL PERSON 3

<AGREEMENT NUMBER> -> PL <AGREEMENT PERSON> -> 3

slide-35
SLIDE 35

Feature Representations

— Reentrant feature structures

— Features share some feature structure as value

— Not merely equal values — Shared substructure — Feature paths lead to same node

CAT S HEAD AGREEM’T NUMBER PL PERSON 3 1 SUBJECT AGREEMENT 1

slide-36
SLIDE 36

Head-Subject Agreement

CAT S HEAD AGREEM’T NUMBER PL PERSON 3 1 SUBJECT AGREEMENT 1

slide-37
SLIDE 37

Feature representations

— Feature structures can also be represented as DAGs

— Directed, acyclic graphs

— Edges are features — Nodes values

slide-38
SLIDE 38

Reentrant DAG

slide-39
SLIDE 39

Unification

— Two key roles:

slide-40
SLIDE 40

Unification

— Two key roles:

— Merge compatible feature structures

slide-41
SLIDE 41

Unification

— Two key roles:

— Merge compatible feature structures — Reject incompatible feature structures

slide-42
SLIDE 42

Unification

— Two key roles:

— Merge compatible feature structures — Reject incompatible feature structures

— Two structures can unify if

slide-43
SLIDE 43

Unification

— Two key roles:

— Merge compatible feature structures — Reject incompatible feature structures

— Two structures can unify if

— Feature structures are identical

— Result in same structure

slide-44
SLIDE 44

Unification

— Two key roles:

— Merge compatible feature structures — Reject incompatible feature structures

— Two structures can unify if

— Feature structures are identical

— Result in same structure

— Feature structures match where both have values,

differ in missing or underspecified — Resulting structure incorporates constraints of both

slide-45
SLIDE 45

Subsumption

— Relation between feature structures

— Less specific f.s. subsumes more specific f.s. — F

.s. F subsumes f.s. G iff

— For every feature x in F

, F(x) subsumes G(x)

— For all paths p and q in F s.t. F(p)=F(q), G(p)=G(q)

slide-46
SLIDE 46

Subsumption

— Relation between feature structures

— Less specific f.s. subsumes more specific f.s. — F

.s. F subsumes f.s. G iff

— For every feature x in F

, F(x) subsumes G(x)

— For all paths p and q in F s.t. F(p)=F(q), G(p)=G(q)

— Examples:

— A: [Number SG], B: [Person 3] — C:[Number SG]

— [Person 3]

slide-47
SLIDE 47

Subsumption

— Relation between feature structures

— Less specific f.s. subsumes more specific f.s. — F

.s. F subsumes f.s. G iff

— For every feature x in F

, F(x) subsumes G(x)

— For all paths p and q in F s.t. F(p)=F(q), G(p)=G(q)

— Examples:

— A: [Number SG], B: [Person 3] — C:[Number SG]

— [Person 3]

— A subsumes C

slide-48
SLIDE 48

Subsumption

— Relation between feature structures

— Less specific f.s. subsumes more specific f.s. — F

.s. F subsumes f.s. G iff

— For every feature x in F

, F(x) subsumes G(x)

— For all paths p and q in F s.t. F(p)=F(q), G(p)=G(q)

— Examples:

— A: [Number SG], B: [Person 3] — C:[Number SG]

— [Person 3]

— A subsumes C; B subsumes C

slide-49
SLIDE 49

Subsumption

— Relation between feature structures

— Less specific f.s. subsumes more specific f.s. — F

.s. F subsumes f.s. G iff

— For every feature x in F

, F(x) subsumes G(x)

— For all paths p and q in F s.t. F(p)=F(q), G(p)=G(q)

— Examples:

— A: [Number SG], B: [Person 3] — C:[Number SG]

— [Person 3]

— A subsumes C; B subsumes C; B,A don’t subsume

— Partial order on f.s.

slide-50
SLIDE 50

Subsumption

— Relation between feature structures

— Less specific f.s. subsumes more specific f.s. — F

.s. F subsumes f.s. G iff

— For every feature x in F

, F(x) subsumes G(x)

— For all paths p and q in F s.t. F(p)=F(q), G(p)=G(q)

— Examples:

— A: [Number SG], B: [Person 3] — C:[Number SG]

— [Person 3]

— A subsumes C; B subsumes C; B,A don’t subsume

— Partial order on f.s.

slide-51
SLIDE 51

Unification

— Two structures can unify if

— Feature structures are identical

— Result in same structure

— Feature structures match where both have values,

differ in missing or underspecified — Resulting structure incorporates constraints of both

slide-52
SLIDE 52

Unification Examples

— Identical

— [Number SG] U [Number SG]

slide-53
SLIDE 53

Unification Examples

— Identical

— [Number SG] U [Number SG]=[Number SG]

— Underspecified

— [Number SG] U [Number []]

slide-54
SLIDE 54

Unification Examples

— Identical

— [Number SG] U [Number SG]=[Number SG]

— Underspecified

— [Number SG] U [Number []] = [Number SG]

— Different specification

— [Number SG] U [Person 3]

slide-55
SLIDE 55

Unification Examples

— Identical

— [Number SG] U [Number SG]=[Number SG]

— Underspecified

— [Number SG] U [Number []] = [Number SG]

— Different specification

— [Number SG] U [Person 3] = [Number SG] — [Person 3] — [Number SG] U [Number PL]

slide-56
SLIDE 56

Unification Examples

— Identical

— [Number SG] U [Number SG]=[Number SG]

— Underspecified

— [Number SG] U [Number []] = [Number SG]

— Different specification

— [Number SG] U [Person 3] = [Number SG] — [Person 3]

— Mismatched

— [Number SG] U [Number PL] -> Fails!

slide-57
SLIDE 57

More Unification Examples

AGREEMENT [1] SUBJECT AGREEMENT [1] SUBJECT AGREEMENT PERSON 3 NUMBER SG U = SUBJECT AGREEMENT [1] PERSON 3 NUMBER SG AGREEMENT [1]

slide-58
SLIDE 58

Features in CFGs: Agreement

— Goal:

— Support agreement of NP/VP

, Det Nominal

— Approach:

— Augment CFG rules with features — Employ head features

— Each phrase: VP

, NP has head — Head: child that provides features to phrase — Associates grammatical role with word — VP – V; NP – Nom, etc

slide-59
SLIDE 59

Agreement with Heads and Features

VP -> Verb NP <VP HEAD> = <Verb HEAD> NP -> Det Nominal <NP HEAD> = <Nominal HEAD> <Det HEAD AGREEMENT> = <Nominal HEAD AGREEMENT> Nominal -> Noun <Nominal HEAD> = <Noun HEAD> Noun -> flights <Noun HEAD AGREEMENT NUMBER> = PL Verb -> serves <Verb HEAD AGREEMENT NUMBER> = SG <Verb HEAD AGREEMENT PERSON> = 3

slide-60
SLIDE 60

Feature Applications

— Subcategorization:

— Verb-Argument constraints

— Number, type, characteristics of args (e.g. animate) — Also adjectives, nouns

— Long distance dependencies

— E.g. filler-gap relations in wh-questions, rel

slide-61
SLIDE 61

Implementing Unification

— Data Structure:

— Extension of the DAG representation — Each f.s. has a content field and a pointer field

— If pointer field is null, content field has the f.s. — If pointer field is non-null, it points to actual f.s.

slide-62
SLIDE 62
slide-63
SLIDE 63

Implementing Unification: II

— Algorithm:

— Operates on pairs of feature structures

— Order independent, destructive

— If fs1 is null, point to fs2 — If fs2 is null, point to fs1 — If both are identical, point fs1 to fs2, return fs2

— Subsequent updates will update both

— If non-identical atomic values, fail!

slide-64
SLIDE 64

Implementing Unification: III

— If non-identical, complex structures

— Recursively traverse all features of fs2 — If feature in fs2 is missing in fs1

— Add to fs1 with value null

— If all unify, point fs2 to fs1 and return fs1

slide-65
SLIDE 65

Unification

slide-66
SLIDE 66

Example

AGREEMENT [1] NUMBER SG SUBJECT AGREEMENT [1] SUBJECT AGREEMENT PERSON 3 U [ AGREEMENT [1]] U [AGREEMENT [PERSON 3]] [NUMBER SG] U [PERSON 3] [NUMBER SG] U [PERSON 3] [PERSON NULL]

slide-67
SLIDE 67
slide-68
SLIDE 68
slide-69
SLIDE 69
slide-70
SLIDE 70

Unification Example

(From S.F ., 2010) Grammar entry for sentence

slide-71
SLIDE 71

Unification Example

(From S.F ., 2010) Grammar entry for NP

slide-72
SLIDE 72

Unification Example

(From S.F ., 2010)

Lexical entries

slide-73
SLIDE 73

Unification Example

(From S.F ., 2010)

slide-74
SLIDE 74

Unification Example

(From S.F ., 2010)

Unifying NP with Determiner

slide-75
SLIDE 75

Unification Example

(From S.F ., 2010)

slide-76
SLIDE 76

Unification and the Earley Parser

— Employ constraints to restrict addition to chart — Actually pretty straightforward

— Augment rules with feature structure — Augment state (chart entries) with DAG

— Prediction adds DAG from rule — Completion applies unification (on copies)

— Adds entry only if current DAG is NOT subsumed

slide-77
SLIDE 77

Parsing with Features

— One strategy:

— Parse as usual — Test completed parses for unification constraints

slide-78
SLIDE 78

Parsing with Features

— One strategy:

— Parse as usual — Test completed parses for unification constraints

— Pros:

— Simple, requires little modification

slide-79
SLIDE 79

Parsing with Features

— One strategy:

— Parse as usual — Test completed parses for unification constraints

— Pros:

— Simple, requires little modification

— Cons:

— Wasted effort — Builds many partial parses that can’t unify

slide-80
SLIDE 80

Parsing with Features

— One strategy:

— Parse as usual — Test completed parses for unification constraints

— Pros:

— Simple, requires little modification

— Cons:

— Wasted effort — Builds many partial parses that can’t unify

— Integrate unification in parse construction

slide-81
SLIDE 81

Parsing, Unification, & Earley

— Augment existing Earley parser for unification

— Fairly straightforward

— Modify representations:

— Augment CFG rules with constraints

— Use constraints to create feature structure as DAG

— Add DAG to state representation

— E.g., S -> Ÿ NP VP

, [0,0],[],Dag

slide-82
SLIDE 82

Integrating Unification

— Main change: Completer

— Advances Ÿ in rules where next constituent matches a

just-completed constituent

— Now, unifies Dag from completed constituent with

the part of the feature structure in rules advanced — If fails, no new entry in chart

— Second change:

— Only add state if NOT subsumed by states in chart

slide-83
SLIDE 83
slide-84
SLIDE 84
slide-85
SLIDE 85

Unification Parsing

— Abstracts over categories

— S-> NP VP =>

— X0 -> X1 X2; <X0 cat> = S; <X1 cat>=NP; — <X2 cat>=VP

— Conjunction:

— X0->X1 and X2; <X1 cat> =<X2 cat>; — <X0 cat>=<X1 cat>

— Issue: Completer depends on categories — Solution: Completer looks for DAGs which unify

with the just-completed state’s DAG

slide-86
SLIDE 86

Extensions

— Types and inheritance

— Issue: generalization across feature structures

— E.g. many variants of agreement

— More or less specific: 3rd vs sg vs 3rdsg

— Approach: Type hierarchy

— Simple atomic types match literally — Multiple inheritance hierarchy

— Unification of subtypes is most general type that is more

specific than two input types

— Complex types encode legal features, etc

slide-87
SLIDE 87

Conclusion

— Features allow encoding of constraints

— Enables compact representation of rules — Supports natural generalizations

— Unification ensures compatibility of features

— Integrates easily with existing parsing mech.

— Many unification-based grammatical theories