1 / 24

Semantic Analysis in NLP

Semantic Analysis

Download Presentation

Semantic Analysis in NLP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Natural Language Processing Lecture Notes 11 Chapter 15 (part 1)

  2. Semantic Analysis • These notes: syntax driven compositional semantic analysis • Assign meanings based only on the grammar and lexicon (no inference, ignore context)

  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. Example • AyCaramba serves meat

  5. Compositional Analysis

  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. Easy parts… NP -> PropNoun NP -> MassNoun PropNoun -> AyCaramba MassNoun -> meat Attachments {PropNoun.sem} {MassNoun.sem} {AyCaramba} {MEAT} Example

  8. S -> NP VP VP -> Verb NP Verb -> serves {VP.sem(NP.sem)} {Verb.sem(NP.sem)} ??? Example

  9. Example

  10. Example

  11. Example

  12. Example

  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. Quantified Phrases • Consider A restaurant serves meat. • Assume that A restaurant looks like • If we do the normal lambda thing we get

  15. Complex Terms • Allow the compositional system to pass around representations like the following as objects with parts: Complex-Term → <Quantifier var body>

  16. Example • Our restaurant example winds up looking like

  17. Conversion • So… complex terms wind up being embedded inside predicates. So pull them out and redistribute the parts in the right way… P(<quantifier, var, body>) turns into Quantifier var body connective P(var)

  18. Example

  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. 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. 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. Quantifier Scope Ambiguity

  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. 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.

More Related