Unformatted text preview:

Natural Language Processing Lecture 20 11 6 2012 Jim Martin Today More Compositional Semantics Review Lambdas Quantifier scoping ambiguity Representing categories 01 14 19 Speech and Language Processing Jurafsky and Martin 2 Compositional Analysis Principle of Compositionality The meaning of a whole is derived from the meanings of the parts What parts The constituents of the syntactic parse of the input What could it mean for a part to have a meaning 01 14 19 Speech and Language Processing Jurafsky and Martin 3 But First NOVA PBS show on IBM Watson http www pbs org wgbh nova tech sm artest machine on earth html 01 14 19 Speech and Language Processing Jurafsky and Martin 4 Example Franco likes Frasca 01 14 19 Speech and Language Processing Jurafsky and Martin 5 Compositional Analysis 01 14 19 So we need the ability to allow the verb to provide a template like structure with slots to be filled in And we need to specify where the slot fillers come from Speech and Language Processing Jurafsky and Martin 6 Augmented Rules We ll accomplish this by attaching semantic formation rules to our syntactic CFG rules Abstractly A a 1 an f a 1 sem an sem This should be read as the semantics we attach to A can be computed from some function applied to the semantics of A s parts 01 14 19 Speech and Language Processing Jurafsky and Martin 7 YACC Again for those of you who like compilers this is a YACC Bison style example for simple expressions expr expr expr 1 3 In our notation that s expr expr expr expr sem expr sem 01 14 19 Speech and Language Processing Jurafsky and Martin 8 Example Easy parts NP PropNoun PropNoun Frasca PropNoun Franco 01 14 19 Attachments PropNoun sem Frasca Franco Speech and Language Processing Jurafsky and Martin 9 Example S NP VP VP Verb NP Verb likes 01 14 19 VP sem NP sem Verb sem NP sem Speech and Language Processing Jurafsky and Martin 10 Lambda Forms A simple addition to FOL Take a FOL sentence with variables in it that are to be bound Allow those variables to be bound by treating the lambda form as a function with formal arguments 01 14 19 l xP x l xP x Sally P Sally Speech and Language Processing Jurafsky and Martin 11 Compositional Semantics by Lambda Application 01 14 19 Speech and Language Processing Jurafsky and Martin 12 Lambda Applications and Reductions VP VP Verb NP Verb sem NP Sem Frasca 01 14 19 Speech and Language Processing Jurafsky and Martin 13 Lambda Applications and Reductions S Franco S NP VP 01 14 19 VP sem NP sem Speech and Language Processing Jurafsky and Martin 14 Complications You really ought to be suspicious that all those examples involve proper nouns that map to constants in the representation That s the simplest possible case Making it work for harder cases is more involved Mismatches between the syntax and semantics Complex NPs with quantifiers 01 14 19 Speech and Language Processing Jurafsky and Martin 15 Complex NPs Things get quite a bit more complicated when we start looking at more complicated NPs Such as A menu Every restaurant Not every waiter Most restaurants All the morning non stop flights to Houston 01 14 19 Speech and Language Processing Jurafsky and Martin 16 Quantifiers Contrast Frasca closed eClosed e ClosedThing e Frasca With Every restaurant closed 01 14 19 Speech and Language Processing Jurafsky and Martin 17 Quantified NPs So from a compositional point of view what should the semantic fragment for every restaurant look like Hint This isn t it 01 14 19 Speech and Language Processing Jurafsky and Martin 18 Quantifiers Roughly every in an NP like this is used to stipulate something about every member of some class The NP is specifies the class And somebody else is specifies the thing stipulated So the NP is a template like thing The trick is going to be getting the Q to be right thing 01 14 19 Speech and Language Processing Jurafsky and Martin 19 Quantifiers Wrap a lambda around it This requires a change to the kind type of things that we ll allow lambda variables to range over Now it s both FOL predicates and terms 01 14 19 Speech and Language Processing Jurafsky and Martin 20 Rules 01 14 19 Speech and Language Processing Jurafsky and Martin 21 Example NP NP Det Nominal Det Sem Nominal Sem Every 01 14 19 Speech and Language Processing Jurafsky and Martin restaurant 22 Every Restaurant Closed 01 14 19 Speech and Language Processing Jurafsky and Martin 23 Grammar Engineering Remember in the rule to rule approach we re designing separate semantic attachments for each grammar rule So we now have to check to see if things still work with the rest of the rules we developed earlier and clearly they don t Two places to revise The S rule S NP VP VP Sem NP Sem Simple NP s like proper nouns Proper Noun Sally 01 14 19 Sally Speech and Language Processing Jurafsky and Martin 24 S Rule We were applying the semantics of the VP to the semantics of the NP Now we re swapping that around S NP VP 01 14 19 NP Sem VP Sem Speech and Language Processing Jurafsky and Martin 25 Every Restaurant Closed 01 14 19 Speech and Language Processing Jurafsky and Martin 26 Simple NP fix And the semantics of proper nouns used to just be things that amounted to constants Franco Now they need to be a little more complex This works lambda x Franco x 01 14 19 Speech and Language Processing Jurafsky and Martin 27 Revised Now all these examples should work Every restaurant closed Sunflower closed What about x e Restaurant x Closing e Closed e x A restaurant closed This rule stays the same NP Det Nominal Just need an attachment for Det a 01 14 19 Speech and Language Processing Jurafsky and Martin 28 Revised So if the template for every is Then the template for a should be what 01 14 19m Speech and Language Processing Jurafsky and Martin 29 So Far So Good We can make effective use of lambdas to overcome Mismatches between the syntax and semantics While still preserving strict compositionality 01 14 19 Speech and Language Processing Jurafsky and Martin 30 Problem Contrast Every American has a governor Every Coloradan has a governor Given our current scheme which one do we get 01 14 19 Speech and Language Processing Jurafsky and Martin 31 Problem Clearly these sentences have the same syntax The only difference is in the words American and Coloradan Words that have the same part of speech lexical class and very similar meanings The fact that both interpretations are possible is an idiosyncratic fact about our political system Not something in the language 01 14 19


View Full Document

CU-Boulder CSCI 5832 - Lecture 20

Loading Unlocking...
Login

Join to view Lecture 20 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 20 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?