Computing Science, University of Aberdeen1 CS4025: Logic-Based Semantics l Compositionality in practice l Producing logic-based meaning representations.

Slides:



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

Biointelligence Lab School of Computer Sci. & Eng.
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
First-Order Logic (and beyond)
CSA4050: Advanced Topics in NLP Semantics IV Partial Execution Proper Noun Adjective.
Semantic Analysis Read J & M Chapter 15.. The Principle of Compositionality There’s an infinite number of possible sentences and an infinite number of.
Grammars, constituency and order A grammar describes the legal strings of a language in terms of constituency and order. For example, a grammar for a fragment.
Statistical NLP: Lecture 3
CSE 425: Semantic Analysis Semantic Analysis Allows rigorous specification of a program’s meaning –Lets (parts of) programming languages be proven correct.
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.
LTAG Semantics on the Derivation Tree Presented by Maria I. Tchalakova.
Meaning Representation and Semantic Analysis Ling 571 Deep Processing Techniques for NLP February 9, 2011.
NaLIX: A Generic Natural Language Search Environment for XML Data Presented by: Erik Mathisen 02/12/2008.
CS 4705 Semantic Analysis: Syntax-Driven Semantics.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
CS 4705 Lecture 17 Semantic Analysis: Syntax-Driven Semantics.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 2.
CS 4705 Semantic Analysis: Syntax-Driven Semantics.
Models of Generative Grammar Smriti Singh. Generative Grammar  A Generative Grammar is a set of formal rules that can generate an infinite set of sentences.
February 2009Introduction to Semantics1 Logic, Representation and Inference Introduction to Semantics What is semantics for? Role of FOL Montague Approach.
Predicates & Quantifiers Goal: Introduce predicate logic, including existential & universal quantification Introduce translation between English sentences.
October 2004csa4050: Semantics II1 CSA4050: Advanced Topics in NLP Semantics II The Lambda Calculus Semantic Representation Encoding in Prolog.
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.
Natural Language Processing
Chapter 15. Semantic Analysis
CAS LX 502 Semantics 3a. A formalism for meaning (cont ’ d) 3.2, 3.6.
Chapter 2 Syntax A language that is simple to parse for the compiler is also simple to parse for the human programmer. N. Wirth.
LING 388: Language and Computers Sandiway Fong Lecture 7.
November 2003CSA4050: Semantics I1 CSA4050: Advanced Topics in NLP Semantics I What is semantics for? Role of FOL Montague Approach.
10. Parsing with Context-free Grammars -Speech and Language Processing- 발표자 : 정영임 발표일 :
1 Natural Language Processing Lecture Notes 11 Chapter 15 (part 1)
Semantic Analysis CMSC Natural Language Processing May 8, 2003.
October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
Markus Egg, Alexander Koller, Joachim Niehren The Constraint Language for Lambda Structures Ventsislav Zhechev SfS, Universität Tübingen
1 Natural Language Processing Chapter 15 (part 2).
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.
Grammars Grammars can get quite complex, but are essential. Syntax: the form of the text that is valid Semantics: the meaning of the form – Sometimes semantics.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
PARSING 2 David Kauchak CS159 – Spring 2011 some slides adapted from Ray Mooney.
November 2006Semantics I1 Natural Language Processing Semantics I What is semantics for? Role of FOL Montague Approach.
Basic Scheme February 8, 2007 Compound expressions Rules of evaluation Creating procedures by capturing common patterns.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 2.
Copyright © Peter Cappello 2011 Predicates & Quantifiers.
Albert Gatt LIN3021 Formal Semantics Lecture 3. Aims This lecture is divided into two parts: 1. We make our first attempts at formalising the notion of.
NATURAL LANGUAGE PROCESSING
CS : Language Technology for the Web/Natural Language Processing Pushpak Bhattacharyya CSE Dept., IIT Bombay Parsing Algos.
PARSING David Kauchak CS159 – Fall Admin Assignment 3 Quiz #1  High: 36  Average: 33 (92%)  Median: 33.5 (93%)
Basic Scheme February 8, 2007 Compound expressions Rules of evaluation
Beginning Syntax Linda Thomas
Statistical NLP: Lecture 3
Natural Language Processing
Predicates & Quantifiers
The function of knowledge representation scheme is
Natural Language Processing
Natural Language Processing
CS : Speech, NLP and the Web/Topics in AI
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
CSCI 5832 Natural Language Processing
CPSC 503 Computational Linguistics
Parsing and More Parsing
CSCI 5832 Natural Language Processing
Semantics: Representations and Analyses
Linguistic Essentials
What would be our focus ? Geometry deals with Declarative or “What is” knowledge. Computer Science deals with Imperative or “How to” knowledge 2/23/2019.
Introduction to the Lab
Natural Language Processing
David Kauchak CS159 – Spring 2019
Presentation transcript:

Computing Science, University of Aberdeen1 CS4025: Logic-Based Semantics l Compositionality in practice l Producing logic-based meaning representations l Use of the lambda calculus l Problems with quantification See J&M chap 15 in 1 st ed, 18 in 2 nd

Computing Science, University of Aberdeen2 Two stage approach to NLU

Computing Science, University of Aberdeen3 Compositionality “ The meaning of the whole is a function of the meanings of the parts ” »A necessary assumption if we want a general approach to meaning extraction beyond a listing of sentences with their meanings »What are the parts? It ’ s up to our grammar to yield appropriate parts »What are the functions and what types of meanings do the parts have? These are very challenging questions…

Computing Science, University of Aberdeen4 Result of semantic analysis How to get there compositionally?

Computing Science, University of Aberdeen5 Expressing semantic rules l Associate semantic information with each grammar rule – semantic attachments. l These say how the semantics of the whole phrase is computed from the semantics of the parts A  a1 a2 … a2 { f(a1.sem,a2.sem,a3.sem) } This says that the semantics of an A recognised by this rule is function f of the semantics of the parts a1 a2 … an (ai.sem = semantics of ai)

Computing Science, University of Aberdeen6 Example – English number grammar Num  Digit hundred and Ty Digit { 100*Digit1.sem + Ty.sem + Digit2.sem } Digit  two{ 2 } Digit  three { 3 } … Ty  twenty { 20 } Ty  thirty { 30 } … What is the semantics of “ two hundred and thirty two ” ?

Computing Science, University of Aberdeen7 Alternative Approach l Instead of putting semantic attachments with grammar rules, write rules for translating parse trees. l This is equivalent (as each use of a grammar rule corresponds to a node in the parse tree) Num DigithundredandTyDigit  $$Digit1*100 + $$Ty + $$Digit2

Computing Science, University of Aberdeen8 Initial semantic attachments for English ProperNoun  AyCaramba { AyCaramba } MassNoun  meat { Meat } Verb  serves NB note caseframe approach of logic representation (makes handling, e.g. adverbs easier) How do these combine together to give meanings for the larger phrases?

Computing Science, University of Aberdeen9 Propagating meanings up NPs NP  ProperNoun { ProperNoun.sem } NP  MassNoun { MassNoun.sem } l When a phrase just has one part, often just return the meaning of this as the meaning of the whole phrase

Computing Science, University of Aberdeen10 VP meanings What should the meaning of “ serves Meat ” be? Arguably, something like: l How do we compute this from the Verb and NP meanings: Verb: NP: Meat Need to somehow “ incoporate ” the NP meaning into the Verb meaning

Computing Science, University of Aberdeen11 Basic Idea Represent the Verb meaning as having a “ hole ” where the NP meaning will go: l Create the VP meaning by filling the hole: l Informal grammar rule: VP  V NP { fillHole(V.sem,NP.sem) }

Computing Science, University of Aberdeen12 The Lambda Calculus The Lambda Calculus is an extension to Predicate Calculus that allows us to have “ named holes ” l The above Verb meaning would be represented as: (or could have any other name instead of y ) l Filling the hole in X with Y is called applying X to Y and is denoted X(Y) VP  Verb NP { Verb.sem(NP.sem) }

Computing Science, University of Aberdeen13 Examples of Application

Computing Science, University of Aberdeen14 Computing the S meaning We now have NP meaning: AyCaramba VP meaning: How to combine to get the S meaning: This is the same problem as before! Now the Verb meaning needs to have two holes…

Computing Science, University of Aberdeen15 Basic Idea l Order the holes in a formula according to the order in which they are going to be filled: l First the hole corresponding to the object of the verb will be filled, then the subject

Computing Science, University of Aberdeen16 In Lambda Calculus l Use nesting (and different variable names) to indicate order of holes – the outermost name corresponds to the first hole to be filled

Computing Science, University of Aberdeen17 Examples with nested and complex lambda expressions

Computing Science, University of Aberdeen18 Revised Verb, VP, S rules Verb  serves VP  Verb NP { Verb.sem(NP.sem) } S  NP VP { VP.sem(NP.sem) }

Computing Science, University of Aberdeen19 Final result

Computing Science, University of Aberdeen20 More complex NPs l Some possible rules: NP  every N NP  a N N  restaurant { Restaurant } But what about “ every restaurant serves meat ” ? We get:

Computing Science, University of Aberdeen21 Dealing with Quantification (1a) l Since the quantifiers coming from NPs need to be at the outside of the S meaning, put the NP in charge, rather than the VP: S  NP VP { NP.sem(VP.sem) } NP  every N VP etc as before

Computing Science, University of Aberdeen22 Dealing with Quantification (1b) NP semantics: VP semantics (as before): S semantics:

Computing Science, University of Aberdeen23 Dealing with Quantification (2) l Leave the placing of quantifiers for a post- processing stage. l This means allowing quantifiers where terms would normally be expected – called complex-terms NP  every N S meaning from original rules:

Computing Science, University of Aberdeen24 Handling Quantifier Ambiguity By the second method, “ every restaurant serves a salad ” comes out as: l The two quantifiers can be moved to the outside of the formula in different orders, corresponding to different interpretations l The Hobbs-Shieber algorithm enumerates all possibilities

Computing Science, University of Aberdeen25 Formal Semantics The field of “ formal semantics ” studies how to model many phenomena of natural language in this kind of way One inspiration was the work of the logician Montague in the 1970 ’ s ( “ Montague grammar ” ). Montagu was the first person to suggest this kind of formal approach to NL semantics l We have presented just the tip of the iceberg of a large research area