Download presentation
Presentation is loading. Please wait.
Published byAnastasia Baldwin Modified over 9 years ago
1
1 Natural Language Processing Lecture Notes 11 Chapter 15 (part 1)
2
2 Semantic Analysis –These notes: syntax driven compositional semantic analysis –Assign meanings based only on the grammar and lexicon (no inference, ignore context)
3
3 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
4
4 Example AyCaramba serves meat
5
5 Compositional Analysis
6
6 Augmented Rules We’ll accomplish this by attaching semantic formation rules to our syntactic CFG rules Abstractly 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.
7
7 Example Easy parts… –NP -> PropNoun –NP -> MassNoun –PropNoun -> AyCaramba –MassNoun -> meat Attachments {PropNoun.sem} {MassNoun.sem} {AyCaramba} {MEAT }
8
8 Example S -> NP VP VP -> Verb NP Verb -> serves {VP.sem(NP.sem)} {Verb.sem(NP.sem)} ???
9
9 Example
10
10 Example
11
11 Example
12
12 Example
13
13 Key Points Each node in a tree corresponds to a rule in the grammar Each grammar rule has a semantic rule associated with it that specifies how the semantics of the RHS of that rule can be computed from the semantics of its daughters.
14
14 Quantified Phrases Consider A restaurant serves meat. Assume that A restaurant looks like If we do the normal lambda thing we get
15
15 Complex Terms Allow the compositional system to pass around representations like the following as objects with parts: Complex-Term →
16
16 Example Our restaurant example winds up looking like
17
17 Conversion So… complex terms wind up being embedded inside predicates. So pull them out and redistribute the parts in the right way… P( ) turns into Quantifier var body connective P(var)
18
18 Example
19
19 Quantifiers and Connectives If the quantifier is an existential, then the connective is an ^ (and) If the quantifier is a universal, then the connective is an -> (implies)
20
20 Multiple Complex Terms Note that the conversion technique pulls the quantifiers out to the front of the logical form… That leads to ambiguity if there’s more than one complex term in a sentence.
21
21 Quantifier Ambiguity Consider –Every restaurant has a menu –That could mean that every restaurant has a menu –Or that There’s some uber-menu out there and all restaurants have that menu
22
22 Quantifier Scope Ambiguity
23
23 Ambiguity Much like the prepositional phrase attachment problem The number of possible interpretations goes up exponentially with the number of complex terms in the sentence The best we can do: weak methods to prefer one interpretation over another
24
24 Integration with a Parser Assume you’re using a dynamic-programming style parser (Earley or CYK). As with feature structures for agreement and subcategorization, we add semantic attachments to states. As constituents are completed and entered into the table, we compute their semantics.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.