1CS 294-5: StatisticalNatural Language ProcessingCompositional SemanticsLecture 17: 11/2/05Includes slides / examples from Eisner, Jurafsky, GildeaSemantic Interpretation Back to meaning! A very basic approach to computational semantics Truth-theoretic notion of semantics (Tarskian) Assign a “meaning” to each word Word meanings combine according to the parse structure People can and do spend entire courses on this topic We’ll spend about an hour! What’s NLP and what isn’t? Designing meaning representations? Computing those representations? Reasoning with them? Supplemental reading will be on the web page.Meaning “Meaning” What is meaning? “The computer in the corner.” “Bob likes Alice.” “I think I am a gummi bear.” Knowing whether a statement is true? Knowing the conditions under which it’s true? Being able to react appropriately to it? “Who does Bob like?” “Close the door.” A distinction: Linguistic (semantic) meaning “The door is open.” Speaker (pragmatic) meaning Today: assembling the semantic meaning of sentence from its partsEntailment and Presupposition Some notions worth knowing: Entailment: A entails B if A being true necessarily implies B is true ? “Twitchy is a big mouse” → “Twitchy is a mouse” ? “Twitchy is a big mouse” → “Twitchy is big” Presupposition: A presupposes B if A is only well-defined if B is true “The computer in the corner is broken” presupposes that there is a (salient) computer in the cornerTruth-Conditional Semantics Linguistic expressions: “Bob sings” Logical translations: sings(bob) Could be p_1218(e_397) Denotation: [[bob]] = some specific person (in some context) [[sings(bob)]] = ??? Types on translations: bob : e (for entity) sings(bob) : t (for truth-value)SNPBobbobVPsingsλy.sings(y)sings(bob)Truth-Conditional Semantics Proper names: Refer directly to some entity in the world Bob : bob Sentences: Are either true or false (givenhow the world actually is) Bob sings : sings(bob) So what about verbs (and verb phrases)? sings must combine with bob to produce sings(bob) The λ-calculus is a notation for functions whose arguments are not yet filled. sings : λx.sings(x) This is predicate – a function which takes an entity (type e) and produces a truth value (type t). We can write its type as e→t. Adjectives?SNPBobbobVPsingsλy.sings(y)sings(bob)2Compositional Semantics So now we have meanings for the words How do we know how to combine words? Associate a combination rule with each grammar rule: S : β(α) → NP : α VP : β (function application) VP : λx . α(x) ∧β(x) → VP : α and : ∅ VP : β (intersection) Example:SNPVPBob VP andsingsVPdancesbobλy.sings(y)λz.dances(z)λx.sings(x) ∧ dances(x)[λx.sings(x) ∧ dances(x)](bob)sings(bob) ∧ dances(bob)Denotation What do we do with logical translations? Translation language (logical form) has fewer ambiguities Can check truth value against a database Denotation (“evaluation”) calculated using the database More usefully: assert truth and modify a database Questions: check whether a statement in a corpus entails the (question, answer) pair: “Bob sings and dances” → “Who sings?” + “Bob” Chain together facts and use them for comprehensionOther Cases Transitive verbs: likes : λx.λy.likes(y,x) Two-place predicates of type e→(e→t). likes Amy : λy.likes(y,Amy) is just like a one-place predicate. Quantifiers: What does “Everyone” mean here? Everyone : λf.∀x.f(x) Mostly works, but some problems Have to change our NP/VP rule. Won’t work for “Amy likes everyone.” “Everyone like someone.” This gets tricky quickly!SNPVPEveryone VBP NPAmylikesλx.λy.likes(y,x)λy.likes(y,amy)amyλf.∀x.f(x)[λf.∀x.f(x)](λy.likes(y,amy))∀x.likes(x,amy)Indefinites First try “Bob ate a waffle” : ate(bob,waffle) “Amy ate a waffle” : ate(amy,waffle) Can’t be right! ∃ x : waffle(x) ∧ ate(bob,x) What does the translationof “a” have to be? What about “the”? What about “every”?SNPVPBob VBD NPa waffleateGrounding Grounding So why does the translation likes : λx.λy.likes(y,x) have anything to do with actual liking? It doesn’t (unless the denotation model says so) Sometimes that’s enough: wire up bought to the appropriate entry in a database Meaning postulates Insist, e.g ∀x,y.likes(y,x) → knows(y,x) This gets into lexical semantics issues Statistical version?Tense and Events In general, you don’t get far with verbs as predicates Better to have event variables e “Alice danced” : danced(alice) ∃ e : dance(e) ∧ agent(e,alice) ∧ (time(e) < now) Event variables let you talk about non-trivial tense / aspect structures “Alice had been dancing when Bob sneezed” ∃ e, e’ : dance(e) ∧ agent(e,alice) ∧sneeze(e’) ∧ agent(e’,bob) ∧(start(e) < start(e’) ∧ end(e) = end(e’)) ∧(time(e’) < now)3Adverbs What about adverbs? “Bob sings terribly” terribly(sings(bob)? (terribly(sings))(bob)? ∃e present(e) ∧type(e, singing) ∧agent(e,bob) ∧manner(e, terrible) ?SNPVPBob VBP ADVPterriblysingsPropositional Attitudes “Bob thinks that I am a gummi bear” thinks(bob,gummi(me)) ? thinks(bob,^gummi(me)) Usual solution involves intensions (^X) which are, roughly, the set of possible worlds (or conditions) in which X is true Hard to deal with computationally Modeling other agents models, etc Can come up in simple dialog scenarios, e.g., if you want to talk about what your bill claims you bought vs. what you actually boughtTrickier Stuff Non-Intersective Adjectives green ball : λx.[green(x) ∧ ball(x)] fake diamond : λx.[fake(x) ∧ diamond(x)] ? Generalized Quantifiers the : λf.[unique-member(f)] all : λf. λg [∀x.f(x) → g(x)] most? Could do with more general second order predicates, too (why worse?) the(cat, meows), all(cat, meows) Generics “Cats like naps” “The players scored a goal” Pronouns (and bound anaphora) “If you have a dime, put it in the meter.” … the list goes on and on!λx.[fake(diamond(x))Multiple Quantifiers Quantifier
View Full Document