Semantic Analysis CMSC 35100 Natural Language Processing May 8, 2003.

Slides:



Advertisements
Similar presentations
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Advertisements

Semantic Analysis Read J & M Chapter 15.. The Principle of Compositionality There’s an infinite number of possible sentences and an infinite number of.
Chapter 4 Syntax.
1 Computational Semantics Chapter 18 November 2012 We will not do all of this… Lecture #12.
CS 4705 Slides adapted from Julia Hirschberg. Homework: Note POS tag corrections. Use POS tags as guide. You may change them if they hold you back.
For Monday Read Chapter 23, sections 3-4 Homework –Chapter 23, exercises 1, 6, 14, 19 –Do them in order. Do NOT read ahead.
Natural Language Processing - Feature Structures - Feature Structures and Unification.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
NLP and Speech Course Review. Morphological Analyzer Lexicon Part-of-Speech (POS) Tagging Grammar Rules Parser thethe – determiner Det NP → Det.
NLP and Speech 2004 Feature Structures Feature Structures and Unification.
Features & Unification Ling 571 Deep Processing Techniques for NLP January 26, 2011.
Meaning Representation and Semantic Analysis Ling 571 Deep Processing Techniques for NLP February 9, 2011.
PCFG Parsing, Evaluation, & Improvements Ling 571 Deep Processing Techniques for NLP January 24, 2011.
Features & Unification Ling 571 Deep Processing Techniques for NLP January 31, 2011.
CS 4705 Semantic Analysis: Syntax-Driven Semantics.
Artificial Intelligence 2005/06 From Syntax to Semantics.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
CS 4705 Lecture 17 Semantic Analysis: Syntax-Driven Semantics.
1/13 Parsing III Probabilistic Parsing and Conclusions.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Features and Unification
CS 4705 Lecture 7 Parsing with Context-Free Grammars.
CS 4705 Semantic Analysis: Syntax-Driven Semantics.
Artificial Intelligence 2004 Natural Language Processing - Syntax and Parsing - Language Syntax Parsing.
LING 364: Introduction to Formal Semantics Lecture 5 January 26th.
1 Basic Parsing with Context Free Grammars Chapter 13 September/October 2012 Lecture 6.
February 2009Introduction to Semantics1 Logic, Representation and Inference Introduction to Semantics What is semantics for? Role of FOL Montague Approach.
October 2004csa4050: Semantics II1 CSA4050: Advanced Topics in NLP Semantics II The Lambda Calculus Semantic Representation Encoding in Prolog.
1 Semantics Interpretation Allen ’ s Chapter 9 J&M ’ s Chapter 15.
Natural Language Processing
Chapter 15. Semantic Analysis
CS 4705: Semantic Analysis: Syntax-Driven Semantics
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
Semantics: Semantic Grammar & Information Extraction CMSC Natural Language Processing May 13, 2003.
IV. SYNTAX. 1.1 What is syntax? Syntax is the study of how sentences are structured, or in other words, it tries to state what words can be combined with.
November 2003CSA4050: Semantics I1 CSA4050: Advanced Topics in NLP Semantics I What is semantics for? Role of FOL Montague Approach.
1 Natural Language Processing Lecture Notes 11 Chapter 15 (part 1)
May 2006CLINT-LN Parsing1 Computational Linguistics Introduction Parsing with Context Free Grammars.
Parsing I: Earley Parser CMSC Natural Language Processing May 1, 2003.
October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
Computing Science, University of Aberdeen1 CS4025: Logic-Based Semantics l Compositionality in practice l Producing logic-based meaning representations.
1 Natural Language Processing Chapter 15 (part 2).
For Wednesday Read chapter 23 Homework: –Chapter 22, exercises 1,4, 7, and 14.
CSA2050 Introduction to Computational Linguistics Lecture 1 Overview.
Semantic Construction lecture 2. Semantic Construction Is there a systematic way of constructing semantic representation from a sentence of English? This.
Rules, Movement, Ambiguity
Artificial Intelligence: Natural Language
CSA2050 Introduction to Computational Linguistics Parsing I.
NLP. Introduction to NLP Background –Developed by Jay Earley in 1970 –No need to convert the grammar to CNF –Left to right Complexity –Faster than O(n.
Natural Language - General
NLP. Introduction to NLP Motivation –A lot of the work is repeated –Caching intermediate results improves the complexity Dynamic programming –Building.
Section 11.3 Features structures in the Grammar ─ Jin Wang.
November 2006Semantics I1 Natural Language Processing Semantics I What is semantics for? Role of FOL Montague Approach.
CS 4705 Lecture 10 The Earley Algorithm. Review Top-Down vs. Bottom-Up Parsers –Both generate too many useless trees –Combine the two to avoid over-generation:
Supertagging CMSC Natural Language Processing January 31, 2006.
CS 4705 Lecture 7 Parsing with Context-Free Grammars.
◦ Process of describing the structure of phrases and sentences Chapter 8 - Phrases and sentences: grammar1.
Morphology and Syntax- Week 5
October 2005CSA3180: Parsing Algorithms 21 CSA3050: NLP Algorithms Parsing Algorithms 2 Problems with DFTD Parser Earley Parsing Algorithm.
10/31/00 1 Introduction to Cognitive Science Linguistics Component Topic: Formal Grammars: Generating and Parsing Lecturer: Dr Bodomo.
Basic Parsing with Context Free Grammars Chapter 13
Natural Language Processing
Natural Language Processing
Natural Language Processing
CSCI 5832 Natural Language Processing
CPSC 503 Computational Linguistics
Natural Language - General
Semantics: Representations and Analyses
Linguistic Essentials
Artificial Intelligence 2004 Speech & Natural Language Processing
Presentation transcript:

Semantic Analysis CMSC Natural Language Processing May 8, 2003

Roadmap Semantic Analysis –Motivation: Understanding commands –Approach I: Syntax-driven semantic analysis Augment productions with semantic component –Lambda calculus formulation –Approach II: Semantic Grammar Augment with domain-specific semantics –Approach III: Information Extraction Template-based semantics

Understanding Commands “What do I have on Thursday?” Parse: S Q-Wh-obj WhwdAux NP VP/NP Pron V NP/NP Temporal P NP N What do I have t on Thursday

Understanding Commands Parser: –Yes, it’s a sentence & here’s the structure System: Great! But what do I do? S Q-Wh-obj WhwdAux NP VP/NP Pron V NP/NP Temporal P NP N What do I have t on Thursday Date: Thursday Cal Owner: User Date: Thursday Cal Owner: User Action: Check calendar Cal Owner: User Date: Thursday

Syntax-driven Semantic Analysis Key: Principle of Compositionality –Meaning of sentence from meanings of parts E.g. groupings and relations from syntax Question: Integration? Solution 1: Pipeline –Feed parse tree and sentence to semantic unit –Sub-Q: Ambiguity: Approach: Keep all analyses, later stages will select

Simple Example AyCaramba serves meat. S NP VP Prop-N V NP N AyCaramba serves meat.

Rule-to-Rule Issue: –Need detailed information about sentence, parse tree Infinitely many sentences & parse trees Solution: –Tie semantics to finite components of grammar E.g. rules & lexicon –Augment grammar rules with semantic info Aka “attachments” –Specify how RHS elements compose to LHS

Semantic Attachments Basic structure: –A-> a1….an {f(aj.sem,…ak.sem)} Language for semantic attachments –Lambda calculus Extends First Order Predicate Calculus (FOPC) with function application Example (continued): –Nouns represented by constants Prop-n -> AyCaramba {AyCaramba} N -> meat {meat}

Semantic Attachment Example Phrase semantics is function of SA of children –E.g. NP -> Prop-n {Prop-n.sem} – NP -> N {N.sem} More complex functions are parameterized –E.g. Verb -> serves – VP -> Verb NP {V.sem(NP.sem)} Application= – S -> NP VP Application=

Complex Attachments Complex terms: –Allow FOPC expressions to appear in otherwise illegal positions E.g. Server(e, x Isa(x,Restaurant)) Embed in angle brackets Translates as x Isa(x,Restaurant) Server(e,x) –Connective depends on quantifier Quantifier Scoping –Ambiguity: Every restaurant has a menu Readings: all have a menu; all have same menu Potentially O(n!) scopings (n=# quanifiers) –Solve ad-hoc fashion

Inventory of Attachments S -> NP VP {DCL(VP.sem(NP.sem))} S -> VP {IMP(VP.sem(DummyYou)} S -> Aux NP VP {YNQ(VP.sem(NP.sem))} S -> WhWord NP VP –{WHQ(NP.sem.var,VP.sem(NP.sem))} Nom -> Noun Nom {λx Nom.sem(x) NN(Noun.sem)} PP -> P NP {P.sem(NP.sem)} ;; NP mod PP -> P NP {NP.sem} ;; V arg PP P -> on {λyλx On(x,y)} Det -> a { } Nom -> N {λx Isa(x,N.sem)}

Earley Parsing with Semantics Implement semantic analysis –In parallel with syntactic parsing Enabled by compositional approach Required modifications –Augment grammar rules with semantic field –Augment chart states with meaning expression –Completer computes semantics – e.g. unifies Can also fail to unify –Blocks semantically invalid parses Can impose extra work

Sidelight: Idioms Not purely compositional –E.g. kick the bucket = die – tip of the iceberg = beginning Handling: –Mix lexical items with constituents (word nps) –Create idiom-specific const. for productivity –Allow non-compositional semantic attachments Extremely complex: e.g. metaphor

Approach II: Semantic Grammars Issue: – Grammatical overkill Constituents with little (no) contribution to meaning Constituents so general that semantics are vacuous –Mismatch of locality Components scattered around tree Solution: Semantic Grammars –Developed for dialogue systems Tied to domain Exclude unnecessary elements

Semantic Grammar Example What do I have on Thursday? –CalQ -> What Aux UserP have {on} DateP Cal action:=find; CalOwner:= head UserP; Date:=head DateP; –UserP-> Pron Head:=Head Pron –Pron-> I Head:= USER –DateP -> Dayof Week Head:= sem DayofWeek

Semantic Grammar Pros & Cons Useful with ellipsis & anaphora –Restrict input by semantic class: e.g. DataP Issues: –Limited reuse Tied to application domain –Simple rules may overgenerate