packed computation of exact meaning representations iddo lev department of computer science stanford...

58
Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

Upload: douglas-moody

Post on 17-Dec-2015

220 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

Packed Computation of Exact Meaning

Representations

Iddo Lev Department of Computer Science

Stanford University

Page 2: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 2

Outline

Motivation From Syntax to Semantics Packed Computation Conclusion

Motivation

Page 3: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 3

Natural Language Understanding

• How can we improve accuracy?• Let’s take it for a moment to the

extreme– Exact NLU applications

Page 4: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 4

Example: Logic Puzzles

Six sculptures—C, D, E, F, G, and H—are to be exhibited in rooms 1, 2, and 3 of an art gallery.Sculptures C and E may not be exhibited in the same room.Sculptures D and G must be exhibited in the same room.If sculptures E and F are exhibited in the same room, no other sculpture may be exhibited in that room.At least one sculpture must be exhibited in each room, and no more than three sculptures may be exhibited in any room.

1. If sculpture D is exhibited in room 3 and sculptures E and F are exhibited in room 1, which of the following may be true?

(A) Sculpture C is exhibited in room 1.(B) No more than 2 sculptures are exhibited in room 3.(C) Sculptures F and H are exhibited in the same room.(D)Three sculptures are exhibited in room 2.(E) Sculpture G is exhibited in room 2.

Page 5: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 5

Example: Logic Puzzles

If sculptures E and F are exhibited in the same room, no other sculpture may be exhibited in that room.

x.[(room(x) exhibited-in(E,x) exhibited-in(F,x)) ¬y.sculpture(y) y E y F exhibited-in(y,x)]

exact meaning representation:

Page 6: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 6

Example:

• MSCS Degree Requirements– A candidate is required to complete a program of

45 units. At least 36 of these must be graded units, passed with an average 3.0 (B) grade point average (GPA) or higher. The 45 units may include no more than 21 units of courses from those listed below in Requirements 1 and 2. …

– Has Patrick Davis completed the program?– Can/must Patrick Davis take CS287?

• Similar to logic puzzles: – General constraints + specific situation

Page 7: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 7

Exact NLU

• More examples– Word problems

• Logic puzzles• Math, physics, chemistry questions

– Simple regulation texts, controlled language– NL interfaces to databases

• Like SQL, but looks like NL

• In these tasks – “Almost correct” (“only slightly wrong”) is not good

enough – Simple approximations won’t do

• E.g. syntactic matching between text and questions• Because answer does not appear explicitly in the text

– Need exact calculation of NL meaning representations• Answer needs to be inferred from the text• Need to carefully combine information/meaning throughout the

text

Page 8: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 8

Structural Semantics

• Need to rely on high-quality meaning representations and linguistic knowledge – In particular, structural semantics

• Meaning of functional words• Logical structure of sentences

• Essential for exact NLU tasks• Could also improve precision of other NLP tasks

• T: Michael Melvill guided a tiny rocket-ship more than 100 kilometers above the Earth.

• H: A rocket-ship was guided more than 80 kilometers above the Earth. Follows

• H: A rocket-ship was guided more than 120 kilometers above the Earth. Does not follow

• Relatively small size of knowledge • Functional: #functional words 400 #grammar rules 400

• Lexical: #verb frames 45,000 #nouns > 100,000

Page 9: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 9

My Dissertation

• How to map syntactic analysis to meaning representations

• How to compute all meaning representations efficiently

• Linguistic analysis of advanced NL constructions using the above framework– anaphora (interaction with truth conditions)

– comparatives – reciprocals (each other, one another)

– same/different

• How to translate meaning representations toinference representations (FOL)

Focus of this talk

Page 10: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 10

• When analyzing one sentence:– (1) Bills 2 and 6 are paid on the same day as each other.

• it might seem enough to use: x.day(x)paid-on(bill2,x)paid-on(bill6,x)

• But this is not enough when we consider other sentences:– (2) John, Mary, and Frank like each other.

– each_other({john,mary,frank}, xy.like(x,y))

• Goal– Uniformity: one analysis of “each other” for both (1) and

(2). • Should interact correctly with “the same” in (1).

– Solution should also be consistent with “different”, “similar”:

• Men and women have a different sense of humor (than each other).

Structural Semantics Challenges

Page 11: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 11

Outline

Motivation From Syntax to Semantics Packed Computation Conclusion

Page 12: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 12

From Syntax to Semantics

• How do we get from one parse tree to a semantic representation?– Classic Method (Montague): one-to-one

correspondence: assign a lambda-term to each syntactic node

S x. [dog(x) bark(x)]

λR. x. [dog(x) R(x)] NP

VP|V

barksλz. bark(z)

Detevery

λP.λR. x. [P(x) R(x)]

Noundog

λy.dog(y)

Page 13: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 13

Problem 1: Floating Operators

Frank introduced Rachel to Patrick.

introduce-to(frank, rachel, patrick)

S

NP

PP

VP

V

NP

NP

Page 14: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 14

Problem 1: Floating Operators

Frank introduced Rachel to every person who visited me that summer.

every(λx.person(x)visit(x,me), λx.introduce-to(frank, rachel, x))

S

NPVPVP

RCN’

N

NP

Det

PP

VP

V

NP

NP

every(P,Q) x. [P(x) Q(x)]

Page 15: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 15

Problem 1: Floating Operators

A brave sailor walked by.

a(λx.[sailor(x)brave(x)], λx.walk-by(x))

S

NP

N’

N

VP

AdjAn occasional sailor walked by.

occasionally(a(λx.sailor(x), λx.walk-by(x)))

S

NP

N’

N

VP

Adj

Page 16: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 16

Problem 2: More Than One Meaning

“In this country, a woman gives birth every 15 minutes. Our job is to find that woman, and stop her.”

-- Groucho Marx

every 15 minutes a woman gives birth

a woman every 15 minutes gives birth

You may not smoke.

You may not succeed.All these books are not interesting.

All that glitters is not gold.

Page 17: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 17

Glue Semantics

• Glue Semantics:A flexible framework for mapping syntax to semantics– Pieces of syntax correspond to pieces of semantics– Pieces of semantics combine with each other according

to constraints• Like jigsaw puzzle, but possibly with more than one

solution

– Not a simple one-to-one mapping

• References– Dalrymple et al. Semantics and Syntax in Lexical Functional

Grammar. 1999Mary Dalrymple. Lexical Functional Grammar. 2001Asudeh, Crouch, Dalrymple. The syntax-semantics interface. 2002

Page 18: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 18

Glue Semantics

statements

mary xy.see(x,y) john

John saw Mary

Name

NP

Name

NP

V

VPS

(simplified example)

Page 19: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 19

Glue Semantics

prover

statements

mary : cxy.see(x,y) : b c ajohn : b

John saw Mary

Name

b NP

Name

NP cV

VPS a

derivation

b b c a

c c a

a gain: order of combination does not have to follow tree hierarchy

(simplified example)

john : xy.saw(x,y) :

y.saw(john,y) :mary :

saw(john,mary) :

Page 20: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 20

Problem 1: Floating Operators

A brave sailor walked by.

S

NP VP

N’

NAdj

λPλR.a(P,R)

λPλx.[P(x)brave(x)]

λx.sailor(x) λx.walk-by(x)

λx.[sailor(x)brave(x)]

An occas. sailor walked by.

S

NP VP

N’

NAdj

λPλR.a(P,R)

λPλQλR.occasionally[Q(P,R)]

λx.sailor(x) λx.walk-by(x)

λQλR.occasionally[Q(λx.sailor(x),R)]

a(λx.[sailor(x)brave(x)], λx.walk-by(x))

occasionally[a(λx.sailor(x), λx.walk-by(x))]

Page 21: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 21

Glue Semantics

An occas. sailor walked by.

S a

b NP VP

N’ c

NAdjλPλR.a(P,R) : c (b a) a

λS.occasionally[S] : a a

λx.sailor(x) : c

λx.walk-by(x) : b a

occasionally[a(λx.sailor(x), λx.walk-by(x))]

c c (b a) a b a (b a) a a a a a

Flexible handling of floating operators.

Page 22: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 22

Glue Semantics

A woman gives birth every 15 minutes.

“gives birth” G : a“a woman” A : a a

“every 15 minutes” E : a a

two possible derivations:

G : a A : a a

A(G) : a E : a a E(A(G)) : a

G : a E : a a

E(S) : a A : a a A(E(S)) : a

Can yield more than one meaning.(simplified example)

Page 23: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 23

Glue Semantics

• Shared labels constrain how statements combine – “Resource Sensitive”:

Use each statement exactly once– Inference rules:Application

:A :AB():B

Abstraction

[x:A]¦

:B x.:AB Linear Logic

(implicative fragment)

• In Glue Semantics, can impose further constraints on combinations.

Page 24: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 24

Outline

Motivation From Syntax to Semantics Packed Computation Conclusion

Page 25: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 25

Ambiguity

• Flying planes can be dangerous. Therefore, only licensed pilots are allowed to do it.

• Flying planes can be dangerous. Therefore, some people are afraid to ride in them.

• We cannot always disambiguate the sentence just by looking at the sentence itself.

• We sometimes need to take the larger context and information into account.

Page 26: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 26

Ambiguity

Alternatives multiply across layers…

Morphology

Syntax

Sem

antics

KR

Reasoning

… so we can’t keep all the alternatives separately

Text

Page 27: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 27

Early Pruning

• Select most likely analysis at each level

X

• Oops: Strong constraints may reject the so-far-best (and only) option

Morphology

Syntax

Sem

antics

KR

Reasoning

X

X

Statistics

X

Locally less likely option but globally correct

Text

Page 28: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 28

Packing

The sheep liked the fish. More than one sheep?

More than one fish?

The sheep-sg liked the fish-sg.The sheep-pl liked the fish-sg.The sheep-sg liked the fish-pl.The sheep-pl liked the fish-pl.

Options multiplied out

The sheep liked the fish sgpl

sgpl

Options packed

Packed representation:– Encodes all analyses without loss of information– Common items represented and computed just once

Page 29: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 29

Packing

• Calculate compactly all analyses at each stage

• Push ambiguities through the stages• Possibly, filter and keep only N-best at each

stage in a packed form (not only 1-best)• This approach is being pursued in the XLE

system at PARC (and Powerset Inc.)– (Maxwell & Kaplan ’89,93,95)

Page 30: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 30

Packing In Syntax: Chart Parser

Instead of separately:

we have:

A chart parser for a context-free grammar can compute an exponential number of parse trees in O(n3) time by representing and computing them compactly.

Page 31: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 31

Packed Structures

C-structure forest Packed F-structure

true A1 A2

A1 A2 false

Choice Space:

XLE manages natural language ambiguity by packing similar structures and managing them under a free-choice space

Page 32: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 32

Currently in XLE

morph.

C-str F-str KR

answer

parser

C-F

Text

FST

unpack F-str1

F-strn

Glue1

Gluen

::

MR1

MRn

MR::

gluespec.

glueprover

pack

semantic rewrite rules

= packed calculation + possibly filter N-best

= packed

Page 33: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 33

The Goal

morph.

C-str F-str KR

answer

parser

C-F

Text

FST

MRGlue

statementsgluespec.

glueprover

= packed calculation + possibly filter N-best

= packed

Page 34: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 34

Goal: Packed Meaning Representation

Bill saw the girl with the telescope.a:1 e. see(e) agent(e,bill) theme(e,the(x.girl(x)) with(e,the(y.tele(y)))

a:2 e. see(e) agent(e,bill) theme(e, the(x. girl(x) with(x,the(y.tele(y))) )

e. see(e) agent(e,bill) ●

girl(x)

theme(e, the(x. ● ))

●●

●●

with(●,the(y.tele(y)))

x e

packed meaning representation

Page 35: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 35

Glue Specification

F-Structure

Glue specification – connecting syntactic and semantic pieces

NTYPE(f, NAME), PRED(f, p) p : f

glue statements

john : a

NTYPE(f, COMMON), PRED(f, p) λx.p(x) : fv fr

λx.cake(x) : bv br

“John ate the cake.”

Page 36: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 36

Packed Glue Input

Glue specification

{1} e.see(e) : avear

t

{2} P.e.P(e) : (avear

t)at

{3} bill : be

{4} xPe.P(e)agent(e,x) : be(avear

t)(avear

t){5} P.the(P) : (gv

egrt)ge

{6} x.girl(x) : gvegr

t

{7} xPe.P(e)theme(e,x) : ge(avear

t)(avear

t){8} P.the(P) : (hv

ehrt)he

{9} x.tele(x) : hvehr

t

{10} A1: yPe.P(e)with(e,y) : he(avear

t)(avear

t){11} A2: yPx.P(x)with(x,y) : he(gv

egrt)(gv

egrt)

This combines Glue Semantics + packingat the input level

NTYPE(f, NAME), PRED(f, p) p : f e

“Bill saw the girl with the telescope.”

Packed F-structure

Page 37: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 37

Non-packed Prover (Hepple’96)

meaning category spanf c c d {1}q c {2}r

f(q)

c

cd

{3}

{1,2}f(r) cd {1,3}

f(q,r) d {1,2,3}f(r,q) d {1,2,3}

f : c c d q : c r : c

Input:

Chart:

cannot combine:{2}{1,2}

complete derivation(all indices were used)Output:

provided S1 S2 =

: A | S1 : AB | S2

() : B | S1 S2

Rule:

Page 38: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 38

Syntactic Ambiguity

“Time flies like an arrow. Fruit-flies like a banana.”

-- Groucho Marx

Page 39: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 39

Naive Packed Algorithm

– A1: [[John]a thinks that [[time]d flies [like [an arrow]c]]b]g

– A2: [[John]a thinks that [[time flies]f like [an arrow]c]b]g

• The chart algorithm will discover one history for [[time]d flies [like [an arrow]c]]b under A1

• It may then continue under A1 with “John thinks that” • It will later discover a history for

[[time flies]f like [an arrow]c]b under A2

• So it will have to redo the work for “John thinks that” under A2

Page 40: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 40

Non-Packed Prover

– Forget about meaning terms for now• (can reconstruct them after the derivation finishes)

– Combine histories according to topological order of category graph

mean. category span

q ab {1}

p a {2}

r

s

a

ac

{3}

{4}

t bcd {5}

u df {6}

{2,4} {3,4}

{1,2} {1,3}

{1,2,5} {1,3,5}

{1,2,3,4,5}

t(q(r),s(p))t(q(p),s(r))

{1,2,3,4,5,6}

{2} {3}{1} {4}

{5}

{6}

category graph

aab ac

b cbcd

cd

d

df

f

Page 41: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 41

Packed Derivation

• (Simplified example)

– A1: [[John]a thinks that [[time]d flies [like [an arrow]c]]b]g

– A2: [[John]a thinks that [[time flies]f like [an arrow]c]b]g

premises choice

john a {1} 1

think abg {2}

anarrow c {3}

time d {4} A1

fly deb {5}

like ce {6}

timeflies f {7} A2

like fcb {8}

Page 42: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 42

Packed Derivation

• (Simplified example)

– A1: [[John]a thinks that [[time]d flies [like [an arrow]c]]b]g

– A2: [[John]a thinks that [[time flies]f like [an arrow]c]b]g

premises choice

john a {jn} 1

think abg {th}

anarrow c {ar}

time d {t} A1

fly deb {f}

like ce {k1}

timeflies f {tf} A2

like fcb {k2}

Page 43: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 43

Packed Derivation

Category graph

Imagine how each derivation works separately; then figure out how to pack.

premises choice

john a {jn} 1

think abg {th}

anarrow c {ar}

time d {t} A1

fly deb {f}

like ce {k1}

timeflies f {tf} A2

like fcb {lk2}

{th}

{jn,th}

{t}{f}

{t,f}

{k1,ar}

{t,f,k1,ar}

{jn,th,t,f,k1,ar}

{ar}{k1}

{jn}

Page 44: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 44

Packed Derivation

Category graph

Imagine how each derivation works separately; then figure out how to pack.

premises choice

john a {jn} 1

think abg {th}

anarrow c {ar}

time d {t} A1

fly deb {f}

like ce {lk1}

timeflies f {tf} A2

like fcb {k2}

{th}

{jn,th}

{ar}

{tf} {k2}

{tf,k2}

{jn,th,tf,k2,ar}

{tf,k2,ar}

{jn}

Page 45: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 45

Packed Derivation

Imagine how each derivation works separately; then figure out how to pack.

premises choice

john a {j} 1

think abg {th}

anarrow c {a}

time d {t} A1

fly deb {f}

like ce {k1}

timeflies f {tf} A2

like fcb {k2}

{jn} {th}

{jn,th}

{ar}

{tf} {k2}

A2:{tf,k2,ar}

{tf,k2}{k1}{t}{f}

{t,f}

A1:{t, f,k1,ar}

{jn,th,t,f,k1,ar}

{k1,ar}

{jn,th,tf,k2,ar}

1:{ar} A1:{t, f,k1} A2:{tf,k2}

1:{jn,th,ar} A1:{t, f,k1} A2:{tf,k2}

Page 46: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 46

{jn}{th}

{jn,th}

{ar}

{tf} {k2}

A2:{tf,k2,ar}

{tf,k2}{k1}{t}{f}

{t,f}

A1:{t, f,k1,ar}

{k1,ar}

1:{ar} A1:{t, f,k1} A2:{tf,k2}

1:{jn,th,ar} A1:{t, f,k1} A2:{tf,k2}

Packed Derivation

only possible in A1

packed common part

history under A1 under A2 packed spanh1 {ar} {ar} 1:{ar}h2 {k1,ar} A1:{k1,ar}h3 {t,f} A1:{t,f}h4 {t,f,k1,ar} A1:{t,f,k1,ar}h5 {tf,k2} A2:{tf,k2}h6 {tf,k2,ar} A2:{tf,k2,ar}h7 {t,f,k1,ar} {tf,k2,ar} 1:{ar} A1:{t,f,k1} A2:{tf,k2}h8 {jn,th} {jn,th} 1:{jn,th}h9 {jn,th,t,f,k1,ar} {jn,thtf,k2,ar} 1:{jn,th,ar} A1:{t,f,k1} A2:{tf,k2}

Page 47: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 47

Packed Derivation

• Two histories with categories A and AB can be combined:– original algorithm: if their spans are disjoint– packed algorithm: can combine them in all contexts in which

their spans are disjoint

original combination:

provided S1 S2 = and S = S1 S2

A | S1 AB | S2

B | S

packed combination: provided C1 C2 0and combinable(PS1, PS2, C)and PS = union(C, PS1, PS2)

C1 | A | PS1 C2 | AB | PS2

C | B | PS

Page 48: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 48

Packed Derivation

combinable: 1:{3,4} 1:{5,6,7}combinable: 1:{3},A1:{6,7} 1:{4,5},A2:{6,8}combinable: A1:{6},A2:{7} A1:{6},A2:{8}non-combinable: 1:{4},A1:{6} 1:{5,6},A2:{4} (6 is in A1 in both, 4 is in A2 in

both)

1:{3,4,5,6,7} 1:{3,4,5,6},A1:{7},A2:{8}

A1:{4,6} A2:{4}

A2:{7,8}

packed combination: provided C1 C2 0and combinable(PS1, PS2, C)and PS = union(C, PS1, PS2)

C1 | A | PS1 C2 | AB | PS2

C | B | PS

• Two histories with categories A and AB can be combined:– original algorithm: if their spans are disjoint– packed algorithm: can combine them in all contexts in which

their spans are disjoint

A1:{5,6} A2:{4,5,6}

Page 49: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 49

A2:{tf,k2,ar}A1:{t, f,k1,ar}

1:{ar} A1:{t, f,k1} A2:{tf,k2}

{ar}

Packed Derivation

• Two histories with the same category can be packed:– original algorithm: if their spans are identical– packed algorithm: if their spans are identical in the shared contexts

can pack: 1:{3,4,5} 1:{3,4,5}can pack: A1:{1},A2:{2} A2:{2},A3:{3}can pack: A1:{t,f,k1,ar} A2:{tf,k2,ar}cannot pack: 1:{5},A1:{6} 1:{5},A2:{7} ({5,6}{5} in A1 , {5}{5,7} in A2))

1:{3,4,5}

1:{ar}, A1:{t,f,k1}, A2:{tf,k2}

A1:{5,6} A2:{5} A1:{5} A2:{5,7}

A1:{1},A2:{2},A3:{3}

Page 50: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 50

Packed Derivation

think(john, ●)

anarrow

fly(time,like(●)) like(timeflies,●)A1 A2

history packed span meaningh1 1:{ar} l1 : anarrowh2 A1:{k1,ar} like(l1)h3 A1:{t,f} fly(time)h4 A1:{t,f,k1,ar} fly(time,like(l1))h5 A2:{tf,k2} like(timeflies)h6 A2:{tf,k2,ar} like(timeflies,l1)h7 1:{ar} A1:{t,f,k1} A2:{tf,k2} A1:fly(time,like(l1)) A2:like(timeflies,l1)h8 1:{jn,th} think(john)h9 1:{jn,th,ar} A1:{t,f,k1} A2:{tf,k2}

Reconstruction of packed meaning representation:

packed meaning representationcategory graph

Page 51: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 51

Packed Derivation

• What if the category graph has cycles?– Calculate strongly connected components (SCCs) and

the induced directed-acyclic graph (DAG) (+ topological sort)

– In each SCC, run basic algorithm to find all possibilities– If SCC is simple (X, XX) then optimize:

use as much material as possible before moving out of the cycle

XX

X

{1}{2} {3} {4}

{1} {1,2} {1,3} {1,4} {1,2,3} {1,2,4} {1,3,4}{1,2,3,4}

category graph

Page 52: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 52

Packed Derivation

XX

X

1:{grl}A2:{wt}

1:{grl} A1:{grl} A2:{grl,wt}1:{grl}, A2:{wt}

category graph

[girl [with the telescope]]A2

Page 53: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 53

Packed Derivation

be

aetaet

aetaetat

at

(gvegr

t)gegv

egrt

ge geaetaet

(hvehr

t)he hvehr

t

(gvegr

t)(gvegr

t)

he(gvegr

t)(gvegr

t)he

heaetaet

1:{9}

A2:{11}

A2:{8,9,11}

1:{6},A2:{8,9,11}

A1:{10}

A1:{8,9,10}

beaetaet

1:{1,3,4,5,6,7,8,9}, A1:{10},A2:{11}

Category graph

Need to calculate strongly-connected components before topological sort.

1:{5,6,7}, A2:{8,9,11}

1:{1,2,3,4,5,6,7,8,9}, A1:{10},A2:{11}

1:{8}

1:{8,9}

1:{3,4}

1:{2}

packing in a cycle

{1} e.see(e) : avear

t

{2} P.e.P(e) : (avear

t)at

{3} bill : be

{4} xPe.P(e)agent(e,x) : be(avear

t)(avear

t){5} P.the(P) : (gv

egrt)ge

{6} x.girl(x) : gvegr

t

{7} xPe.P(e)theme(e,x) : ge(avear

t)(avear

t){8} P.the(P) : (hv

ehrt)he

{9} x.tele(x) : hvehr

t

{10} A1: yPe.P(e)with(e,y) : he(avear

t)(avear

t){11} A2: yPx.P(x)with(x,y) : he(gv

egrt)(gv

egrt)

1:{3}

Page 54: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 54

Outline

Motivation From Syntax to Semantics Packed Computation Conclusion

Page 55: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 55

My Dissertation

• How to map syntactic analysis to meaning representations

• How to compute all meaning representations efficiently

• Linguistic analysis of advanced NL constructions using the above framework– anaphora (interaction with truth conditions)

– comparatives – reciprocals (each other, one another)

– same/different

• How to translate meaning representations toinference representations (FOL)

Focus of this talk

Page 56: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 56

Summary

• Mapping syntax to exact meaning representations using Glue Semantics– More powerful than traditional approach– Easier for users, more principled than semantic

rewrite rules– Covered advanced NL constructions

• Computing all meaning representations efficiently– Input: packed syntactic analysis– Output: packed meaning representation Pushing packed ambiguities through the

semantics stage

Page 57: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 57

Future Work

• Researchers can use this work as a basis– Use this in applications

• Logic puzzles, word problems, NLIDB, regulation texts

– Extend this approach to additional NL constructions

• (requires some linguistic research)

– Extend idea of packing to anaphora/plurality and back-end inference stages

• Some initial work on packed reasoning at PARC

– Extend statistical disambiguation to packed semantic structures

Page 58: Packed Computation of Exact Meaning Representations Iddo Lev Department of Computer Science Stanford University

April 17, 2007 Iddo Lev, Packed Computation of Exact Meaning Representations 58

Thanks

• Stanley Peters• Dick Crouch• Chris Manning• Mike Genesereth• Johan van Benthem

• NLTT group at PARC• Ivan Sag• Bill MacCartney, Mihaela Enachescu,

Powerset Inc.

• Beth Nowadnick