CS 4705 Semantic Analysis: Syntax-Driven Semantics.

Slides:



Advertisements
Similar presentations
Problems of syntax-semantics interface ESSLLI 02 Trento.
Advertisements

Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
CS Morphological Parsing CS Parsing Taking a surface input and analyzing its components and underlying structure Morphological parsing:
Semantics (Representing Meaning)
Semantic Analysis Read J & M Chapter 15.. The Principle of Compositionality There’s an infinite number of possible sentences and an infinite number of.
Statistical NLP: Lecture 3
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.
Natural Language Processing - Feature Structures - Feature Structures and Unification.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Semantics.
 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.
Meaning Representation and Semantic Analysis Ling 571 Deep Processing Techniques for NLP February 9, 2011.
Introduction to Semantics To be able to reason about the meanings of utterances, we need to have ways of representing the meanings of utterances. A formal.
Amirkabir University of Technology Computer Engineering Faculty AILAB Efficient Parsing Ahmad Abdollahzadeh Barfouroush Aban 1381 Natural Language Processing.
Artificial Intelligence 2005/06 From Syntax to Semantics.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
CS 4705 Semantics: Representations and Analyses. What kinds of meaning do we want to capture? Categories/entities –IBM, Jane, a black cat, Pres. Bush.
CS 4705 Lecture 17 Semantic Analysis: Syntax-Driven Semantics.
Final Review CS4705 Natural Language Processing. Semantics Meaning Representations –Predicate/argument structure and FOPC Thematic roles and selectional.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
CS 4705 Semantic Analysis: Syntax-Driven Semantics.
CS 4705 Lecture 11 Feature Structures and Unification Parsing.
Stochastic POS tagging Stochastic taggers choose tags that result in the highest probability: P(word | tag) * P(tag | previous n tags) Stochastic taggers.
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.
Some slides adapted from Dorr, Kurfess: 481/W03/Slides/3-Knowledge-Representation.ppt.
Natural Language Processing
Chapter 15. Semantic Analysis
BİL711 Natural Language Processing
CS 4705: Semantic Analysis: Syntax-Driven Semantics
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)
Semantic Analysis CMSC Natural Language Processing May 8, 2003.
PARSING David Kauchak CS159 – Spring 2011 some slides adapted from Ray Mooney.
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.
Linguistic Essentials
Semantic Construction lecture 2. Semantic Construction Is there a systematic way of constructing semantic representation from a sentence of English? This.
Albert Gatt LIN3021 Formal Semantics Lecture 4. In this lecture Compositionality in Natural Langauge revisited: The role of types The typed lambda calculus.
Rules, Movement, Ambiguity
Artificial Intelligence: Natural Language
CS412/413 Introduction to Compilers and Translators Spring ’99 Lecture 3: Introduction to Syntactic Analysis.
November 2006Semantics I1 Natural Language Processing Semantics I What is semantics for? Role of FOL Montague Approach.
CPSC 422, Lecture 27Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 27 Nov, 16, 2015.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 2.
SYNTAX 1 NOV 9, 2015 – DAY 31 Brain & Language LING NSCI Fall 2015.
PARSING David Kauchak CS159 – Fall Admin Assignment 3 Quiz #1  High: 36  Average: 33 (92%)  Median: 33.5 (93%)
PPL Syntax & Formal Semantics Lecture Notes: Chapter 2.
Lec. 10.  In this section we explain which constituents of a sentence are minimally required, and why. We first provide an informal discussion and then.
10/31/00 1 Introduction to Cognitive Science Linguistics Component Topic: Formal Grammars: Generating and Parsing Lecturer: Dr Bodomo.
Operational Semantics of Scheme
Statistical NLP: Lecture 3
Basic Parsing with Context Free Grammars Chapter 13
Natural Language Processing
Semantics (Representing Meaning)
Natural Language Processing
Natural Language Processing
CPE 480 Natural Language Processing
CSCI 5832 Natural Language Processing
CS 4705: Semantic Analysis: Syntax-Driven Semantics
Semantics September 23, /22/2018.
Semantics: Representations and Analyses
Linguistic Essentials
CS4705 Natural Language Processing
David Kauchak CS159 – Spring 2019
Presentation transcript:

CS 4705 Semantic Analysis: Syntax-Driven Semantics

Semantics and Syntax Some representations of meaning: The cat howls at the moon. –Logic: howl(cat,moon) –Frames: Event: howling Agent: cat Patient: moon How do we decide what we want to represent? –Entities, categories, events, time, aspect –Predicates, arguments (constants, variables) –And…quantifiers, operators (e.g. temporal) Today: How can we compute meaning about these categories from these representations?

Compositional Semantics Assumption: The meaning of the whole is comprised of the meaning of its parts –George cooks. Dan eats. Dan is sick. –Cook(George) Eat(Dan) Sick(Dan) –If George cooks and Dan eats, Dan will get sick. (Cook(George) ^ eat(Dan))  Sick(Dan) Meaning derives from –The people and activities represented (predicates and arguments, or, nouns and verbs) –The way they are ordered and related: syntax of the representation, which may also reflect the syntax of the sentence

Syntax-Driven Semantics S NP VP eat(Dan) Nom V N Dan eats So….can we link syntactic structures to a corresponding semantic representation to produce the ‘meaning’ of a sentence in the course of parsing it?

Specific vs. General-Purpose Rules We don’t want to have to specify for every possible parse tree what semantic representation it maps to We want to identify general mappings from parse trees to semantic representations One approach: –Augment the lexicon and the grammar (as we did with feature structures) –Devise a mapping between rules of the grammar and rules of semantic representation (Rule-to-Rule Hypothesis: such a mapping can be found)

Semantic Attachments Extend each grammar rule with instructions on how to map the components of the rule to a semantic representation S  NP VP {VP.sem(NP.sem)} Each semantic function defined in terms of the semantic representation of choice Problem: how to define these functions and how to specify their composition so we always get the meaning representation we want from our grammar?

A Simple Example McDonald’s serves burgers. Associating constants with constituents –ProperNoun  McDonald’s {McDonald’s} –PlNoun  burgers {burgers} Defining functions to produce these from input –NP  ProperNoun {ProperNoun.sem} –NP  PlNoun {PlNoun.sem} –Assumption: meaning representations of children are passed up to parents for non-branching constuents Verbs are where the action is

–V  serves {E(e,x,y) Isa(e,Serving) ^ Server(e,x) ^ Served(e,y)} where e = event, x = agent, y = patient –Will every verb have its own distinct representation? McDonald’s hires students. McDonald’s gave customers a bonus. Predicate(Agent, Patient, Beneficiary) Once we have the semantics for each consituent, how do we combine them? –VP  V NP {V.sem(NP.sem)} –Goal for VP semantics: E(e,x) Isa(e,Serving) ^ Server(e,x) ^ Served(e,Meat) –VP.sem must tell us Which variables to be replaced by which arguments How this replacement is done

Lambda Notation Extension to First Order Predicate Calculus x P(x) + variable(s) + FOPC expression in those variables Lambda binding Apply lambda-expression to logical terms to bind lambda-expression’s parameters to terms (lambda reduction) Simple process: substitute terms for variables in lambda expression xP(x)(car) P(car)

Lambda Notation Provides Means Formal parameter list makes variables within body of logical expression available for binding to external arguments provided by semantics of other constituents (e.g. NPs) –Lambda reduction implements replacement Semantic attachment for –V  serves {V.sem(NP.sem)} {E(e,x,y) Isa(e,Serving) ^ Server(e,y) ^ Served(e,x)} converts to the lambda expression: { x E(e,y) Isa(e,Serving) ^ Server(e,y) ^ Served(e,x)} –Now ‘x’ is available to be bound when V.sem is applied to NP.sem of direct object (V.sem(NP.sem))

– application binds x to value of NP.sem (burgers) – -reduction replaces x within -expression with burgers –Value of VP.sem becomes: {E(e,y) Isa(e,Serving) ^ Server(e,y) ^ Served(e,burgers)} Similarly, we need a semantic attachment for S  NP VP {VP.sem(NP.sem)} to add the subject NP to our semantic representation of McDonald’s serves burgers –Back to V.sem for serves –We need another -expression in the value of VP.sem –But currently V.sem doesn’t give us one –So, we change it to include another argument to be bound later –V  serves { x y E(e) Isa(e,Serving) ^ Server(e,y) ^ Served(e,x)}

–Value of VP.sem becomes: { y E(e) Isa(e,Serving) ^ Server(e,y) ^ Served(e,burgers)} VP  V NP {V.sem(NP.sem)} binds the outer - expression to the object NP (burgers) but leaves the inner -expression for subsequent binding to the subject NP when the semantics of S is determined S  NP VP {VP.sem(NP.sem)} { y E(e) Isa(e,Serving) ^ Server(e,y) ^ Served(e,burgers)}(McDonald’s) {E(e) Isa(e,Serving) ^ Server(e,McDonald’s) ^ Served(e,burgers)}

But this is just the tip of the iceberg…. For example, terms can be complex A restaurant serves burgers. –‘a restaurant’: E x Isa(x,restaurant) –E e Isa(e,Serving) ^ Server(e, ) ^ Served(e,burgers) –Allows quantified expressions to appear where terms can by providing rules to turn them into well-formed FOPC expressions Issues of quantifier scope Every restaurant serves burgers. Every restaurant serves every burger.

Semantic representations for other constituents? –Adjective phrases: Happy people, cheap food, purple socks intersective semantics Nom  Adj Nom { x Nom.sem(x) ^ Isa(x,Adj.sem)} Adj  cheap {Cheap} x Isa(x, Food) ^ Isa(x,Cheap) …works ok … But….fake gun? Local restaurant? Former friend? Would- be singer? Ex Isa(x, Gun) ^ Isa(x,Fake)

Doing Compositional Semantics To incorporate semantics into grammar we must –Figure out right representation for each constituent based on the parts of that constituent (e.g. Adj) –Figure out the right representation for a category of constituents based on other grammar rules, making use of that constituent (e.g. V.sem) This gives us a set of function-like semantic attachments incorporated into our CFG –E.g. Nom  Adj Nom { x Nom.sem(x) ^ Isa(x,Adj.sem)}

What do we do with them? As we did with feature structures: –Alter, e.g., an Early-style parser so when constituents (dot at the end of the rule) are completed, the attached semantic function applied and meaning representation created and stored with state Or, let parser run to completion and then walk through resulting tree running semantic attachments from bottom-up

Option 1 (Integrated Semantic Analysis) S  NP VP {VP.sem(NP.sem)} –VP.sem has been stored in state representing VP –NP.sem stored with the state for NP –When rule completed, retrieve value of VP.sem and of NP.sem, and apply VP.sem to NP.sem –Store result in S.sem. As fragments of input parsed, semantic fragments created Can be used to block ambiguous representations

Drawback You also perform semantic analysis on orphaned constituents that play no role in final parse Case for pipelined approach: Do semantics after syntactic parse

Non-Compositional Language What do we do with language whose meaning isn’t derived from the meanings of its parts –Non-compositional modifiers: fake, former, local –Metaphor: You’re the cream in my coffee. She’s the cream in George’s coffee. The break-in was just the tip of the iceberg. This was only the tip of Shirley’s iceberg. –Idioms: The old man finally kicked the bucket. The old man finally kicked the proverbial bucket. –Deferred reference: The ham sandwich wants his check. Solutions? Mix lexical items with special grammar rules? Or???

Summing Up Hypothesis: Principle of Compositionality –Semantics of NL sentences and phrases can be composed from the semantics of their subparts Rules can be derived which map syntactic analysis to semantic representation (Rule-to-Rule Hypothesis) –Lambda notation provides a way to extend FOPC to this end –But coming up with rule2rule mappings is hard Idioms, metaphors perplex the process

Next Read Ch. 16 Homework 2 assigned – START NOW!!