Semantic Analysis Read J & M Chapter 15.. The Principle of Compositionality There’s an infinite number of possible sentences and an infinite number of.

Slides:



Advertisements
Similar presentations
Intro to NLP - J. Eisner1 Modeling Grammaticality [mostly a blackboard lecture]
Advertisements

 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Semantics (Representing Meaning)
ASPECTS OF LINGUISTIC COMPETENCE 5 SEPT 11, 2013 – DAY 7 Brain & Language LING NSCI Harry Howard Tulane University.
Language and Cognition Colombo, June 2011 Day 2 Introduction to Linguistic Theory, Part 4.
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.
Meaning Representation and Semantic Analysis Ling 571 Deep Processing Techniques for NLP February 9, 2011.
CS 4705 Semantic Analysis: Syntax-Driven Semantics.
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.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
CAS LX a. A notational holiday. Sets A set is a collection of entities of any kind. They can be finite: {√2, John Saeed, 1984}. They can be infinite:
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 2.
Syntax LING October 11, 2006 Joshua Tauberer.
CS 4705 Semantic Analysis: Syntax-Driven Semantics.
LING 364: Introduction to Formal Semantics Lecture 5 January 26th.
Phrase Structure The formal means of representing constituency.
Dr. Ansa Hameed Syntax (4).
Syntax: The analysis of sentence structure
Constituency Tests Phrase Structure Rules
Syntax Nuha AlWadaani.
English 306A; Harris 1 Syntax Word patterns. English 306A; Harris 2 Syntactic arguments Syntactic form Sentence patterns Grammatical roles Phrase structure.
February 2009Introduction to Semantics1 Logic, Representation and Inference Introduction to Semantics What is semantics for? Role of FOL Montague Approach.
Context Free Grammars Reading: Chap 12-13, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Paul Tarau, based on Rada.
Language and Culture Prof. R. Hickey SoSe 2006 How language works
Natural Language Processing
Chapter 15. Semantic Analysis
Subjects and Verbs. What is a subject? What is a verb?
ASPECTS OF LINGUISTIC COMPETENCE 4 SEPT 09, 2013 – DAY 6 Brain & Language LING NSCI Harry Howard Tulane University.
Syntax I: Constituents and Structure Gareth Price – Duke University.
Natural Language Processing Lecture 6 : Revision.
1 Natural Language Processing Lecture Notes 11 Chapter 15 (part 1)
Semantic Analysis CMSC Natural Language Processing May 8, 2003.
NLP. Introduction to NLP Is language more than just a “bag of words”? Grammatical rules apply to categories and groups of words, not individual words.
October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
Context Free Grammars Reading: Chap 9, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Rada Mihalcea.
Computing Science, University of Aberdeen1 CS4025: Logic-Based Semantics l Compositionality in practice l Producing logic-based meaning representations.
Notes on Pinker ch.7 Grammar, parsing, meaning. What is a grammar? A grammar is a code or function that is a database specifying what kind of sounds correspond.
1 Natural Language Processing Chapter 15 (part 2).
For Wednesday Read chapter 23 Homework: –Chapter 22, exercises 1,4, 7, and 14.
Semantic Construction lecture 2. Semantic Construction Is there a systematic way of constructing semantic representation from a sentence of English? This.
Rules, Movement, Ambiguity
The man bites the dog man bites the dog bites the dog the dog dog Parse Tree NP A N the man bites the dog V N NP S VP A 1. Sentence  noun-phrase verb-phrase.
NL Semantics Meaning Representations Read J & M Chapter 14.
Natural Language Processing
November 2006Semantics I1 Natural Language Processing Semantics I What is semantics for? Role of FOL Montague Approach.
A noun is a person, a place, thing, or idea. Ex. Jimmy read a book in the park. Jimmy is a noun because it is a person’s name. Book is a noun because.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 2.
◦ Process of describing the structure of phrases and sentences Chapter 8 - Phrases and sentences: grammar1.
SYNTAX 1 NOV 9, 2015 – DAY 31 Brain & Language LING NSCI Fall 2015.
SYNTAX.
CAS LX 502 9b. Formal semantics Pronouns and quantifiers.
Semantics cCS 224n / Lx 237 Tuesday, May With slides borrowed from Jason Eisner.
PARSING David Kauchak CS159 – Fall Admin Assignment 3 Quiz #1  High: 36  Average: 33 (92%)  Median: 33.5 (93%)
Types of Sentences Boring, Better, Best.
Week 3. Clauses and Trees English Syntax. Trees and constituency A sentence has a hierarchical structure Constituents can have constituents of their own.
Week 2. Constituents Sentences can be analyzed into subparts which we referred to as constituents English Syntax.
SYNTAX.
Natural Language Processing Vasile Rus
Natural Language Processing
SYNTAX.
Chapter Eight Syntax.
Natural Language Processing
CSCI 5832 Natural Language Processing
Chapter Eight Syntax.
Semantics: Representations and Analyses
David Kauchak CS159 – Spring 2019
Presentation transcript:

Semantic Analysis Read J & M Chapter 15.

The Principle of Compositionality There’s an infinite number of possible sentences and an infinite number of possible meanings. But we need to specify the relationship between the two with a finite number of rules. What finite classes can we work with: Words Grammar rules So we need to find a way to define the meaning of an entire sentence as a function of the meaning of the words it contains and the rules that are used to put those words together.

Deriving the Meaning of Sentences John saw Bill.  e Isa(e, Seeing)  Agent(e, John)  AE(e, Bill) S NPVP PN VNP John saw PN Bill

Attaching Semantic Rules to Grammar Rules John saw Bill.  e Isa(e, Seeing)  Agent(e, John)  AE(e, Bill) S NPVP PN VNP John saw PN Bill A    …{f( .sem, .sem …) PN  John{John} {  e Isa(o,Person)  Name(o, John)} NP  PN{PN.sem}

Handling the Verb S NPVP PN VNP John saw PN Bill S  NP VP{VP.sem(NP.sem)} NP  PN{PN.sem} PN  John{John} PN  Bill{Bill} VP  V NP{V.sem(NP.sem)} V  saw { x y  e Isa(e, Seeing)  Agent(e,y)  AE(e,x) }

Common NPs John has a cat. S NPVP PN VNP John has DET Nom a N cat  e,x Isa(e, Owning)  Agent(e, John)  AE(e, x)  Isa(x, Cat)

When Arguments Are Quantified  e,x Isa(e, Owning)  Agent(e, John)  AE(e, x)  Isa(x, Cat) S  NP VP{VP.sem(NP.sem)} NP  PN{PN.sem} NP  DET Nom{DET.sem x Nom.sem} PN  John{John} DET  a{  } Nom  N{Isa(x N.sem)} N  cat{cat} VP  V NP{V.sem(NP.sem)} V  has{ x y  e Isa(e, Owning)  Agent(e,y)  AE(e,x) }

We Get the Wrong Answer The answer we want:  e,x Isa(e, Owning)  Agent(e, John)  AE(e, x)  Isa(x, Cat) The answer we’re going to get as things stand now:  e Isa(e, Owning)  Agent(e, John)  AE(e,  x Isa(x, Cat)) This isn’t even a valid formula.

Complex Terms A complex term has the following structure: Using one in our example, we get:  e Isa(e, Owning)  Agent(e, John)  AE(e, ) Now we add the following rewrite rule for converting complex terms to ordinary FOPC expressions: P( )  Quantifer variable body Connective P(variable) In this case: AE(e, )   x Isa(x, Cat)  AE(e, x) Note: If Quantifier is  then Connective is . If , then it’s .

The Revised Grammar S  NP VP{VP.sem(NP.sem)} NP  PN{PN.sem} NP  DET Nom{ } PN  John{John} DET  a{  } Nom  N{ z Isa(z, N.sem)} N  cat{cat} VP  V NP{V.sem(NP.sem)} V  has{ x y  e Isa(e, Owning)  Agent(e,y)  AE(e,x) }

Do We Yet Have the Right Answer? The answer we’ve got now:  e,x Isa(e, Owning)  Agent(e, John)  AE(e, x)  Isa(x, Cat) But suppose we want something like:  x Isa (x, Cat)  Owner-of(x, John) In this case, we can view our initial answer as an intermediate representation and use it to form whatever other answer we like by applying inference rules.

Or Suppose We Want a Completely Different Kind of Representation

More on Quantifiers Everyone ate a cookie. S  NP VP{VP.sem(NP.sem)} NP  Pro{Pro.sem} NP  DET Nom{ } DET  a{  } Nom  N{ z Isa(z, N.sem)} Pro  everyone{ } N  cookie{cookie} VP  V NP{V.sem(NP.sem)} V  ate{ x y  e Isa(e, Eating)  Agent(e,y)  AE(e,x) }  e  x  x' Isa(e, Eating)  (person(x')  Agent(e, x'))  Isa(x, cookie)  AE(e,x)

Different Argument Structures John served Bill. John served steak. S  NP VP{VP.sem(NP.sem)} NP  PN{PN.sem} NP  MassN{MassN.sem} MassN  steak{steak} PN  John{John} PN  Bill{Bill} VP  V NP{V.sem(NP.sem)} VP  V NP 1 NP 2 {V.sem(NP 1.sem)(NP 2.sem) V  served{ x y  e Isa(e, Serving)  Agent(e,y)  AE(e,x) } V  served{ x y  e Isa(e, Serving)  Agent(e,y)  Ben(e,x) } V  served{ x y z  e Isa(e, Serving)  Agent(e,z)  AE(e,y)  Ben(e, x)}

Sentences that Aren’t Declarative Close the window. S  VP{IMP(VP.sem(DummyYou))} Do you sell pretzels? S  Aux NP VP{YNQ(VP.sem(NP.sem))} Who sells pretzels? S  WhPro VP {WHQ(x, VP.sem(x)}} WHQ(x,  e Isa(e, Selling)  Agent(e,x)  AE(e, pretzels)

Compound Noun Phrases leather jacket{ x Isa(x, jacket)  NN(x, leather)} riding jacket winter jacket letter jacket Nom  N { x Isa(x, N.sem)} Nom  N Nom { x Nom.sem(x)  NN(x, N.sem)} N  jacket{jacket} N  leather{leather}

Compound NPs, an Alternative leather jacket{ x Isa(x, jacket)  madeof(x, leather)} riding jacket{ x Isa(x, jacket)  usedfor(x,riding)} winter jacket letter jacket Nom  N { x Isa(x, N.sem)} Nom  N Nom { x Nom.sem(x)  madeof(x, N.sem)} Nom  N Nom { x Nom.sem(x)  usedfor(x, N.sem)} N  jacket{jacket} N  leather{leather} N  winter{winter}

Infinitive Verb Phrases I told Mary to eat. S NPVP ProVNPVPto I toldPN infToVP Mary to V eat  e, f Isa(e, telling)  Isa(f, eating)  Agent(e, Speaker)  Ben(e, Mary)  AE(e, f)  Agent(f, Mary)

Noncompositional Semantics Coupons are just the tip of the iceberg. That’s just the tip of Mrs. Ford’s iceberg. John kicked the bucket. John would have kicked the bucket. # The bucket was kicked by John. She turned up her toes. # She turned up his toes. Mary threw in the towel. Mary thought about throwing in the towel. # Mary threw in the white towel. willy nilly pell mell helter skelter

Semantic Grammars If we know we have a limited semantic representation, then build a grammar that is less general and that maps more directly to the semantic interpretation we want.

Example – Eating Italian Food

An Alternative InfoRequest  I want to go (to) eat (some) FoodType Time {Retrieve (x, isa(x, Restaurant)  nationality(x, FoodType.sem))} FoodType  Nationality (food){Nationality.sem} Retrieve(x, isa(x, Restaurant)  nationality(x, Italian))