Global Inference via Linear Programming Formulation

40
Global Inference via Linear Programming Formulation Presenter: Natalia Prytkova Tutor: Maximilian Dylla 14.07.2011

description

Global Inference via Linear Programming Formulation. Presenter: Natalia Prytkova Tutor: Maximilian Dylla 14.07.2011. Outline. Motivation Naïve Algorithm LP Formulation Constraints Objective Function Applications of LP Experiments Discussion. Inference with Classifiers. Recognize - PowerPoint PPT Presentation

Transcript of Global Inference via Linear Programming Formulation

Page 1: Global Inference via Linear Programming Formulation

Global Inference via Linear Programming

Formulation

Presenter: Natalia PrytkovaTutor: Maximilian Dylla

14.07.2011

Page 2: Global Inference via Linear Programming Formulation

2

Outline

• Motivation• Naïve Algorithm• LP Formulation

– Constraints– Objective Function

• Applications of LP• Experiments• Discussion

Page 3: Global Inference via Linear Programming Formulation

3

Inference with Classifiers

Recognize entities

Recognize relations

Inference

Page 4: Global Inference via Linear Programming Formulation

4

Example

Book Author

Page 5: Global Inference via Linear Programming Formulation

5

Example

Book Author

Page 6: Global Inference via Linear Programming Formulation

6

Properties of Extracted Items

BalletWrittenBy(Ballet, Composer)

BookWrittenBy(Book, Author)

Ballet

Composer

Book

Author

Page 7: Global Inference via Linear Programming Formulation

7

Properties of Extracted Items

BalletWrittenBy(Ballet, Composer)

BookWrittenBy(Book, Author)

ShownInTheater(Ballet,Theater)

GraduatedFrom(Composer, Conservatory)

BookPublishedBy(Book, Publisher)

MemberOfUnion(Author, WritersUnion)

Ballet

Composer

Theater

Book

AuthorWritersUnionConservatory

Publisher

Page 8: Global Inference via Linear Programming Formulation

8

Example

BalletWrittenBy

Ballet Composer

Page 9: Global Inference via Linear Programming Formulation

9

Example

BalletWrittenBy

Ballet Composer

Page 10: Global Inference via Linear Programming Formulation

10

Properties of Extracted Items

• a lot of relations types• a lot of entities types• mutually dependent

Page 11: Global Inference via Linear Programming Formulation

11

Outline

• Motivation• Naïve Algorithm• ILP Formulation

– Constraints– Objective Function

• Applications of ILP• Experiments• Discussion

Page 12: Global Inference via Linear Programming Formulation

12

Outline

• Motivation• Naïve Algorithm• LP Formulation

– Constraints– Objective Function

• Applications of LP• Experiments• Discussion

Page 13: Global Inference via Linear Programming Formulation

13

Key Idea

Recognize entities

Recognize relations

Inference

Page 14: Global Inference via Linear Programming Formulation

14

Naïve Algorithm

Page 15: Global Inference via Linear Programming Formulation

15

Naïve Algorithm

P(Book BalletWrittenBy Composer) = 0.07P(Book BalletWrittenBy Author) = 0.07P(Book BookWrittenBy Composer) = 0.12P(Book BookWrittenBy Author) = 0.03P(Ballet BalletWrittenBy Composer) = 0.28P(Ballet BalletWrittenBy Author) = 0.28P(Ballet BookWrittenBy Composer) = 0.12P(Ballet BookWrittenBy Author) = 0.12…

Page 16: Global Inference via Linear Programming Formulation

16

Naïve Algorithm

P(Book BalletWrittenBy Composer) = 0.07P(Book BalletWrittenBy Author) = 0.07 n entities – O(n2) binary

relationsP(Book BookWrittenBy Composer) = 0.12 l labels – ln

2 assignments

P(Book BookWrittenBy Author) = 0.03P(Ballet BalletWrittenBy Composer) = 0.28P(Ballet BalletWrittenBy Author) = 0.28P(Ballet BookWrittenBy Composer) = 0.12P(Ballet BookWrittenBy Author) = 0.12…

Page 17: Global Inference via Linear Programming Formulation

17

Naïve Algorithm

P(Book BalletWrittenBy Composer) = 0.07P(Book BalletWrittenBy Author) = 0.07 n entities – O(n2) binary

relationsP(Book BookWrittenBy Composer) = 0.12 l labels – ln

2 assignments

P(Book BookWrittenBy Author) = 0.03P(Ballet BalletWrittenBy Composer) = 0.28P(Ballet BalletWrittenBy Author) = 0.28P(Ballet BookWrittenBy Composer) = 0.12P(Ballet BookWrittenBy Author) = 0.12…

Page 18: Global Inference via Linear Programming Formulation

18

Some Useful Properties

• Relations impose restrictions on entities• Each entity or relation can be labeled only

with one label• Relations can be directed

(BookWrittenBy) or undirected (SpouseOf)

Page 19: Global Inference via Linear Programming Formulation

19

Outline

• Motivation• Naïve Algorithm• ILP Formulation

– Constraints– Objective Function

• Applications of ILP• Experiments• Discussion

Page 20: Global Inference via Linear Programming Formulation

20

Key Idea

• Obtain a set of possible labels for entities/relations

• Optimize the global decision given a set of constraints

Page 21: Global Inference via Linear Programming Formulation

21

Definitions• Sentence S

– Linked list of words and entities. Boundaries of entities are givenPiotr Ilyich Tchaikovsky is one entity.

• Entity ε– Observed variables

• Relation– Binary relations between entities

• Class– Predefined sets of entities and relations labels.

nEEE ..., 21

composery Tchaikovsk Ilyich Piotr

ballet Nutcracker The

2

1

2

1

E

E

LE

LE

tenByBalletWrit L ) E,(E 12R2112 R

Ballet Book,Author, Composer,eL enBy BookWritttenBy,BalletWritrL

Page 22: Global Inference via Linear Programming Formulation

22

Constraints

Indicator variables

x

eE

lRx

lRx

lEx

ii

ijijeElR

ijlR

ilE

iiijij

ij

i

allfor 0 otherwise

argumentfirst

its as label the withentity it takes

and as labeled was relation iff 1

as labeled was relation iff 1

as labeled wasentity iff 1

},,,{

},{

},{

Page 23: Global Inference via Linear Programming Formulation

23

Constraints

0 1

0 1

0 1

, ,

},{},{

}, ,,{}, ,,{

},{},{

11

112112

1212

1221

bookEballetE

bookEtenByBalletWritRballetEtenByBalletWritR

nByBookWritteRtenByBalletWritR

REE

xx

xx

xx

tenByBalletWritLcomposerLballetL

Page 24: Global Inference via Linear Programming Formulation

24

Constraints

• Each entity or relation can be labeled only with one label

• Assignment to each entity or relation variable is consistent with the assignments to its neighboring variables

Page 25: Global Inference via Linear Programming Formulation

25

Objective Function

• Assignment cost– e.g. – Cost of deviating from the assignments given by

classifiers

• Constraint cost

– e.g.

– Cost of breaking constraints between two neighboring entities

)log()( plcv

otherwise ,),( if 0),( 11 Cffffdiijiij ERER

Vv R

ERERvv

ij

jijiijffdffdfcfC )],(),([)(min)(min 21

)8.0log()(1

balletcE

),(

0),(2

1

authortenByballetWritd

ballettenByballetWritd

Page 26: Global Inference via Linear Programming Formulation

26

Naïve Algorithm

P(Book BalletWrittenBy Composer) = 0.07P(Book BalletWrittenBy Author) = 0.07 n entities – O(n2) binary

relationsP(Book BookWrittenBy Composer) = 0.12 l labels – ln

2 assignments

P(Book BookWrittenBy Author) = 0.03P(Ballet BalletWrittenBy Composer) = 0.28P(Ballet BalletWrittenBy Author) = 0.28P(Ballet BookWrittenBy Composer) = 0.12P(Ballet BookWrittenBy Author) = 0.12…

Page 27: Global Inference via Linear Programming Formulation

27

Useful Property

ILP is NP hard in general, but sometimes can be solved in polynomial time.

Page 28: Global Inference via Linear Programming Formulation

28

Outline

• Motivation• Naïve Algorithm• ILP Formulation

– Constraints– Objective Function

• Applications of ILP• Experiments• Discussion

Page 29: Global Inference via Linear Programming Formulation

29

Viterbi

Shortest path

Page 30: Global Inference via Linear Programming Formulation

30

Viterbi

',,1',

]1,0[0,

]1,0[0,

]1,0['''',

1]-m[0,y'',

]1,0[',],1,0[

',

and between edge an is there-

}1,0{

1

1

]1,0[],1,0[ 0

s.t.

)',(logmin

yiyiyyi

myyend

myystart

myyyiyyi

myyni

yyii

vvx

x

x

x

mynixx

xyyM

Page 31: Global Inference via Linear Programming Formulation

31

Phrases Identification

Page 32: Global Inference via Linear Programming Formulation

32

Phrases Identification

Page 33: Global Inference via Linear Programming Formulation

33

Phrases Identification

phrasea is pair y that theprobabilit theis

}1,0{x

sconstraint pathshortest s.t.

min

),(),,(),,(),,(),,(),,(),,(),,(:

i

1

6454625232615131

ip

xp

ttttttttttttttttx

i

n

iii

i

Page 34: Global Inference via Linear Programming Formulation

34

Outline

• Motivation• Naïve Algorithm• ILP Formulation

– Constraints– Objective Function

• Applications of ILP• Experiments• Discussion

Page 35: Global Inference via Linear Programming Formulation

35

Experiments

E -> R E <-> R

Separate

R -> E Omniscient

E

R

I

E

R

I

E

R

I

E

R

I

E

R

I

Page 36: Global Inference via Linear Programming Formulation

36

Experiments

Page 37: Global Inference via Linear Programming Formulation

37

Experiments

• 5 336 entities• 19 048 pairs of entities • 1 437 sentences• running time < 30 sec on Pentium III 800

MHz

Page 38: Global Inference via Linear Programming Formulation

38

Outline

• Motivation• Naïve Algorithm• ILP Formulation

– Constraints– Objective Function

• Applications of ILP• Experiments• Discussion

Page 39: Global Inference via Linear Programming Formulation

39

Discussion

• Guarantees optimality• Supports correct decisions by imposing

limitations • LP solvers are available• Not scalable

– cplex accepts at most 231 variables and constraints• ~ 46 000 entities

– student edition accepts only 500 =)• ~ 20 entities

• No feedback to extractors

Page 40: Global Inference via Linear Programming Formulation

40

References

• Dan Roth and Wen-tau Yih:A Linear Programming Formulation for Global Inference in Natural Language Tasks, CoNLL'04

• Dan Roth and Wen-tau Yih:Global Inference for Entity and Relation Identification via a Linear Programming Formulation, Introduction to Statistical Relational Learning, 2007