Learning Context-dependent Mappings from Sentences to Logical Form Luke Zettlemoyer and Michael Collins MIT Computer Science and Artificial Intelligence Lab
Context-dependent Analysis Show me flights from New York to Singapore. Which of those are nonstop? Show me the cheapest one. What about connecting?
Context-dependent Analysis Show me flights from New York to Singapore. λ x.flight ( x ) ∧ from ( x,NYC) ∧ to ( x,SIN ) Which of those are nonstop? Show me the cheapest one. What about connecting?
Context-dependent Analysis Show me flights from New York to Singapore. λ x.flight ( x ) ∧ from ( x,NYC) ∧ to ( x,SIN ) Which of those are nonstop? λ x.flight ( x ) ∧ from ( x,NYC) ∧ to ( x,SIN ) ∧ nonstop ( x ) Show me the cheapest one. What about connecting?
Context-dependent Analysis Show me flights from New York to Singapore. λ x.flight ( x ) ∧ from ( x,NYC) ∧ to ( x,SIN ) Which of those are nonstop? λ x.flight ( x ) ∧ from ( x,NYC) ∧ to ( x,SIN ) ∧ nonstop ( x ) Show me the cheapest one. argmax ( λ x.flight ( x ) ∧ from ( x,NYC) ∧ to ( x,SIN ) ∧ nonstop ( x ), λ y.cost ( y )) What about connecting?
Context-dependent Analysis Show me flights from New York to Singapore. λ x.flight ( x ) ∧ from ( x,NYC) ∧ to ( x,SIN ) Which of those are nonstop? λ x.flight ( x ) ∧ from ( x,NYC) ∧ to ( x,SIN ) ∧ nonstop ( x ) Show me the cheapest one. argmax ( λ x.flight ( x ) ∧ from ( x,NYC) ∧ to ( x,SIN ) ∧ nonstop ( x ), λ y.cost ( y )) What about connecting? argmax ( λ x.flight ( x ) ∧ from ( x,NYC) ∧ to ( x,SIN ) ∧ connect ( x ), λ y.cost ( y ))
A Supervised Learning Problem Training Examples: sequences of sentences and logical forms Show me flights from New York to Seattle. λ x.flight ( x ) ∧ from ( x,NYC) ∧ to ( x,SEA ) List ones from Newark on Friday. λ x.flight ( x ) ∧ from ( x,NEW) ∧ to ( x,SEA ) ∧ day ( x,FRI ) Show me the cheapest. argmax ( λ x.flight ( x ) ∧ from ( x,NEW) ∧ to ( x,SEA ) ∧ day ( x,FRI ), λ y.cost ( y ))
A Supervised Learning Problem Goal: Find a function f λ x.flight ( x ) ∧ from ( x,NYC ) ∧ to ( x,SEA ) Show me the cheapest? λ x.flight ( x ) ∧ to ( x,SEA ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) f argmax ( λ x.flight ( x ) ∧ from ( x,NEW) ∧ to ( x,SEA ) ∧ day ( x,FRI ), λ y.cost ( y ))
A Supervised Learning Problem Goal: Find a function f λ x.flight ( x ) ∧ from ( x,NYC ) ∧ to ( x,SEA ) Show me the cheapest? λ x.flight ( x ) ∧ to ( x,SEA ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) f argmax ( λ x.flight ( x ) ∧ from ( x,NEW) ∧ to ( x,SEA ) ∧ day ( x,FRI ), λ y.cost ( y )) Key Challenges: • Structured input and output (lambda calculus) • Hidden variables (only annotate final logical forms)
Talk Outline • Sketch of the Approach • Context-sensitive Derivations • A Learning Algorithm • Evaluation
An Example Analysis Show me flights from New York to Seattle. λ x.flight ( x ) ∧ from ( x,NYC) ∧ to ( x,SEA ) List ones from Newark on Friday.
An Example Analysis Context: Current sentence: λ x.flight ( x ) ∧ from ( x,NYC ) List ones from Newark on Friday. ∧ to ( x,SEA )
An Example Analysis Context: Current sentence: λ x.flight ( x ) ∧ from ( x,NYC ) List ones from Newark on Friday. ∧ to ( x,SEA ) Step 1: Context-independent parse
An Example Analysis Context: Current sentence: λ x.flight ( x ) ∧ from ( x,NYC ) List ones from Newark on Friday. ∧ to ( x,SEA ) λ x. ! f ( x ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) Step 1: Context-independent parse
An Example Analysis Context: Current sentence: λ x.flight ( x ) ∧ from ( x,NYC ) List ones from Newark on Friday. ∧ to ( x,SEA ) λ x. ! f ( x ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) Step 1: Context-independent parse
An Example Analysis Context: Current sentence: λ x.flight ( x ) ∧ from ( x,NYC ) List ones from Newark on Friday. ∧ to ( x,SEA ) λ x. ! f ( x ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) Step 1: Context-independent parse
An Example Analysis Context: Current sentence: λ x.flight ( x ) ∧ from ( x,NYC ) List ones from Newark on Friday. ∧ to ( x,SEA ) λ x. ! f ( x ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) Step 1: Context-independent parse Step 2: Resolve reference
An Example Analysis Context: Current sentence: λ x.flight ( x ) ∧ from ( x,NYC ) List ones from Newark on Friday. ∧ to ( x,SEA ) λ x. ! f ( x ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) λ x.flight ( x ) ∧ to ( x,SEA ) Step 1: Context-independent parse Step 2: Resolve reference
An Example Analysis Context: Current sentence: λ x.flight ( x ) ∧ from ( x,NYC ) List ones from Newark on Friday. ∧ to ( x,SEA ) λ x. ! f ( x ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) λ x.flight ( x ) ∧ to ( x,SEA ) λ x.flight ( x ) ∧ to ( x,SEA ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) Step 1: Context-independent parse Step 2: Resolve reference
Talk Outline • Sketch of Approach • Context-sensitive Derivations • A Learning Algorithm • Evaluation
Derivations List ones from Newark on Friday. λ x.flight ( x ) ∧ from ( x,NYC ) ∧ to ( x,SEA ) λ x. ! f ( x ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) λ x.flight ( x ) ∧ to ( x,SEA ) λ x.flight ( x ) ∧ to ( x,SEA ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) Three step process: • Step 1: Context-independent parsing • Step 2: Resolve all references • Step 3: Optionally, perform an elaboration
Derivations List ones from Newark on Friday. λ x.flight ( x ) ∧ from ( x,NYC ) ∧ to ( x,SEA ) λ x. ! f ( x ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) λ x.flight ( x ) ∧ to ( x,SEA ) λ x.flight ( x ) ∧ to ( x,SEA ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) Three step process: • Step 1: Context-independent parsing • Step 2: Resolve all references • Step 3: Optionally, perform an elaboration
Step 1: CCG Parsing List Singapore flights to NP S/N N (N\N)/NP λ f.f ( x ) λ x.flight ( x ) λ y. λ f. λ x.f ( x ) ∧ to ( x,y ) sin N\N λ f. λ x.f ( x ) ∧ to ( x,sin ) N λ x.flight ( x ) ∧ to ( x,sin ) S λ x.flight ( x ) ∧ to ( x,sin )
Step 1: CCG Parsing List Singapore flights to NP S/N N (N\N)/NP λ f.f ( x ) λ x.flight ( x ) λ y. λ f. λ x.f ( x ) ∧ to ( x,y ) sin N\N λ f. λ x.f ( x ) ∧ to ( x,sin ) N λ x.flight ( x ) ∧ to ( x,sin ) S λ x.flight ( x ) ∧ to ( x,sin )
Step 1: CCG Parsing List Singapore flights to NP S/N N (N\N)/NP λ f.f ( x ) λ x.flight ( x ) λ y. λ f. λ x.f ( x ) ∧ to ( x,y ) sin N\N λ f. λ x.f ( x ) ∧ to ( x,sin ) N λ x.flight ( x ) ∧ to ( x,sin ) S λ x.flight ( x ) ∧ to ( x,sin )
Step 1: CCG Parsing List Singapore flights to NP S/N N (N\N)/NP λ f.f ( x ) λ x.flight ( x ) λ y. λ f. λ x.f ( x ) ∧ to ( x,y ) sin N\N λ f. λ x.f ( x ) ∧ to ( x,sin ) N λ x.flight ( x ) ∧ to ( x,sin ) S λ x.flight ( x ) ∧ to ( x,sin )
Step 1: CCG Parsing List Singapore flights to NP S/N N (N\N)/NP λ f.f ( x ) λ x.flight ( x ) λ y. λ f. λ x.f ( x ) ∧ to ( x,y ) sin N\N λ f. λ x.f ( x ) ∧ to ( x,sin ) N λ x.flight ( x ) ∧ to ( x,sin ) S λ x.flight ( x ) ∧ to ( x,sin )
Step 1: Referential lexical items List ones from Newark on Friday. λ x. ! f ( x ) ∧ from ( x,NEW ) ∧ day ( x,FRI )
Step 1: Referential lexical items List ones from Newark on Friday. λ x. ! f ( x ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) First extension: • Add referential lexical items N λ x. ! f ( x) ones NP ! e it ...
Step 1: Type-shifting operations Second extension: • Add type-shifting operators for elliptical expressions the cheapest
Step 1: Type-shifting operations Second extension: • Add type-shifting operators for elliptical expressions the cheapest NP/N λ g.argmin ( g , λ y.cost ( y ))
Step 1: Type-shifting operations Second extension: • Add type-shifting operators for elliptical expressions the cheapest NP/N λ g.argmin ( g , λ y.cost ( y )) NP argmin ( λ x. ! f ( x ), λ y.cost ( y ))
Step 1: Type-shifting operations Second extension: • Add type-shifting operators for elliptical expressions the cheapest NP/N λ g.argmin ( g , λ y.cost ( y )) NP argmin ( λ x. ! f ( x ), λ y.cost ( y )) A/B : g => A : g( λ x. ! f ( x ) ) where g is a function with input type <e,t>
Derivations List ones from Newark on Friday. λ x.flight ( x ) ∧ from ( x,NYC ) ∧ to ( x,SEA ) λ x. ! f ( x ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) λ x.flight ( x ) ∧ to ( x,SEA ) λ x.flight ( x ) ∧ to ( x,SEA ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) Three step process: • Step 1: Context-independent parsing • Step 2: Resolve all references • Step 3: Optionally, perform an elaboration
Derivations List ones from Newark on Friday. λ x.flight ( x ) ∧ from ( x,NYC ) ∧ to ( x,SEA ) λ x. ! f ( x ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) λ x.flight ( x ) ∧ to ( x,SEA ) λ x.flight ( x ) ∧ to ( x,SEA ) ∧ from ( x,NEW ) ∧ day ( x,FRI ) Three step process: • Step 1: Context-independent parsing • Step 2: Resolve all references • Step 3: Optionally, perform an elaboration
Recommend
More recommend