October 2004csa4050: Semantics II1 CSA4050: Advanced Topics in NLP Semantics II The Lambda Calculus Semantic Representation Encoding in Prolog.

Slides:



Advertisements
Similar presentations
Artificial Intelligence: Natural Language and Prolog
Advertisements

Problems of syntax-semantics interface ESSLLI 02 Trento.
Computational Semantics Aljoscha Burchardt, Alexander Koller, Stephan Walter, Universität des Saarlandes,
October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Natural Language Processing Lecture 2: Semantics.
November 2008NLP1 Natural Language Processing Definite Clause Grammars.
CSA2050: DCG I1 CSA2050 Introduction to Computational Linguistics Lecture 8 Definite Clause Grammars.
Cs7120 (Prasad)L21-DCG1 Definite Clause Grammars
07/05/2005CSA2050: DCG31 CSA2050 Introduction to Computational Linguistics Lecture DCG3 Handling Subcategorisation Handling Relative Clauses.
CSA4050: Advanced Topics in NLP Semantics IV Partial Execution Proper Noun Adjective.
Syntax. Definition: a set of rules that govern how words are combined to form longer strings of meaning meaning like sentences.
CSA2050: DCG IV1 CSA2050: Definite Clause Grammars IV Handling Gaps II Semantic Issues.
April 2010CSA50061 Logic, Representation and Inference Simple Question Answering NL Access to Databases Semantics of Questions and Answers Simple Interpreters.
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.
DEFINITE CLAUSE GRAMMARS Ivan Bratko University of Ljubljana Faculty of Computer and Information Sc.
Natural Language Processing DCG and Syntax NLP DCG A “translation” example: special case A DCG recogniser.
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.
1 Words and the Lexicon September 10th 2009 Lecture #3.
LING 364: Introduction to Formal Semantics Lecture 10 February 14th.
C. Varela; Adapted w/permission from S. Haridi and P. Van Roy1 Declarative Computation Model Defining practical programming languages Carlos Varela RPI.
LING 364: Introduction to Formal Semantics Lecture 9 February 9th.
LING 364: Introduction to Formal Semantics
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
CS 4705 Lecture 17 Semantic Analysis: Syntax-Driven Semantics.
© Patrick Blackburn, Johan Bos & Kristina Striegnitz Lecture 7: Definite Clause Grammars Theory –Introduce context free grammars and some related concepts.
LING 388 Language and Computers Take-Home Final Examination 12/9/03 Sandiway FONG.
Chapter 3: Formal Translation Models
LING 364: Introduction to Formal Semantics Lecture 5 January 26th.
LING 388: Language and Computers Sandiway Fong Lecture 13: 10/10.
LING 388 Language and Computers Lecture 15 10/21/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong 10/4 Lecture 12.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
February 2009Introduction to Semantics1 Logic, Representation and Inference Introduction to Semantics What is semantics for? Role of FOL Montague Approach.
1 Semantics Interpretation Allen ’ s Chapter 9 J&M ’ s Chapter 15.
October 2006Advanced Topics in NLP1 CSA3050: NLP Algorithms Finite State Transducers for Morphological Parsing.
October 2008csa3180: Setence Parsing Algorithms 1 1 CSA350: NLP Algorithms Sentence Parsing I The Parsing Problem Parsing as Search Top Down/Bottom Up.
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
LING 388: Language and Computers Sandiway Fong Lecture 7.
October 2004CSA4050 Advanced Techniques in NLP 1 CSA4050: Advanced Topics in NLP Semantics 6 Semantics of Questions and Assertions involving Quantification.
November 2003CSA4050: Semantics I1 CSA4050: Advanced Topics in NLP Semantics I What is semantics for? Role of FOL Montague Approach.
Semantic Analysis CMSC Natural Language Processing May 8, 2003.
Lexicografie computationala Feb., 2012 Anca Dinu University of Bucharest.
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.
2007CLINT-LIN-FEATSTR1 Computational Linguistics for Linguists Feature Structures.
Semantic Construction lecture 2. Semantic Construction Is there a systematic way of constructing semantic representation from a sentence of English? This.
Rules, Movement, Ambiguity
CSA2050 Introduction to Computational Linguistics Parsing I.
Computational Semantics Day II: A Modular Architecture
November 2006Semantics I1 Natural Language Processing Semantics I What is semantics for? Role of FOL Montague Approach.
CMSC 330: Organization of Programming Languages Operational Semantics a.k.a. “WTF is Project 4, Part 3?”
CMSC 330: Organization of Programming Languages Operational Semantics.
April 2010Semantic Grammar1 A short guide to Blackburn’s Grammar of English.
October 2004csa4050: Semantics V1 CSA4050: Advanced Topics in NLP Semantics V NL Access to Databases Semantics of Questions and Answers Simple Interpreters.
NATURAL LANGUAGE PROCESSING
7.2 Programming Languages - An Introduction to Informatics WMN Lab. Hye-Jin Lee.
10/31/00 1 Introduction to Cognitive Science Linguistics Component Topic: Formal Grammars: Generating and Parsing Lecturer: Dr Bodomo.
November 2008NL Semantics V1 Advanced Topics in NLP Semantics V NL Access to Databases Semantics of Questions and Answers Simple Interpreters for Questions.
Natural Language Processing
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
CSA4050: Advanced Topics in NLP
CSA2050 Introduction to Computational Linguistics
csa3180: Setence Parsing Algorithms 1
Natural Language Processing
Principles and Parameters (I)
CSA4050: Advanced Topics in NLP
Lecture 7: Definite Clause Grammars
Visual Programming Languages ICS 539 Icon System Visual Languages & Visual Programming, Chapter 1, Editor Chang, 1990 ICS Department KFUPM Sept. 1,
Presentation transcript:

October 2004csa4050: Semantics II1 CSA4050: Advanced Topics in NLP Semantics II The Lambda Calculus Semantic Representation Encoding in Prolog

October 2004csa4050: Semantics II2 The Lambda Calculus The λ-calculus allows us to write down the definition of a function without inventing a special name for it. We use the notation λx.ϕ where x is a variable marking the argument and ϕ is an expression defining the value of the function at that argument, e.g. λx.x+1. We allow the whole expression to stand in the place of a function symbol. So (λx.x+1)(3) is a well-formed term that denotes that function applied to the argument 3.

October 2004csa4050: Semantics II3 β-Reduction The rule of β-reduction says that an expression of the form λx.ϕ(a) can be reduced to ϕ{x=a}, i.e. the expression ϕ with all occurrences of x replaced with a. In this case (λx.x+1)(3) = 3+1. In the semantics we shall be developing, many intermediate LFs will have the form of propositions with certain parts missing. These can be modelled as functions over propositions expressed with λ-expressions.

October 2004csa4050: Semantics II4 λ-expressions as Partial Propositions to walk: λx.walk(x) John: john; Fido: fido λx.walk(x)(john) = walk(john) to kick: λx.λy.kick(x,y). λx.λy.kick(x,y)(john) = λy.kick(john,y) λy.kick(john,y)(fido) = kick(john,fido) λ-calculus can be used to model “semantic operations”

October 2004csa4050: Semantics II5 Rule to Rule Hypothesis: The Sentence Rule Syntactic Rule: S  NP VP Semantic Rule: [S] = [VP]([NP]) i.e. the LF of S is obtained by "applying" the LF of VP to the LF of NP. For this to be possible [VP] must be a function, and [NP] the argument to the function.

October 2004csa4050: Semantics II6 S write(bertrand,principia) NP bertand VP y.write(y,principia) V x. y.write(y,x) NP principia bertrand writes principia Parse Tree with Logical Forms

October 2004csa4050: Semantics II7 Summary Leaves of the tree are words. Words (or lexical entries) are associated with “semantic forms” by the dictionary (or lexicon) Grammar determines how to combine words and phrases syntactically. Associated semantic rules determine how to combine respective semantic forms.

October 2004csa4050: Semantics II8 Encoding the Semantic System 1.Encode logical forms. 2.Associate an encoded λ expression with each constituent. 3.Encode process of β-reduction

October 2004csa4050: Semantics II9 Encode Logical Forms LFProlog  x ϕ all(X, ϕ’ )  x ϕ exist(X, ϕ’ ) &, v,  &, v, => λx. ϕ X^ ϕ’ λx. λy. ϕ X^Y^ ϕ’

October 2004csa4050: Semantics II10 Associate an encoded λ expression with each constituent Reserve an argument position in a DCG rule to hold the logical form encoding. For example, ignoring the particular constraints governing the use of the rule, we might have s(S) --> np(NP), vp(VP). i.e. sentence with LF S can be formed by concatenating a noun phrase with LF NP and a verb phrase with LF VP.

October 2004csa4050: Semantics II11 Encode Process of β-reduction This is done by means of the predicate reduce(Fn,Arg,Result), which is defined by means of a unit clause as follows: reduce(X^F,X,F). NB. This predicate only performs a single, outermost reduction. It does not reduce to a canonical form.

October 2004csa4050: Semantics II12 A Very Simple DCG that computes Semantics % grammar s(S) --> np(NP), vp(VP), {reduce(VP,NP,S)}. vp(VP) --> v(V), np(NP), {reduce(V,NP,VP}. vp(VP) --> v(VP). % lexicon v(X^walk(X)) --> [walks]. v(X^Y^hit(X,Y)) --> [hits]. np(suzie) --> [suzie]. np(fido) --> [fido].

October 2004csa4050: Semantics II13 Demo ?- s(LF,[suzie,walks], [ ]). LF = walk(suzie). ?- s(LF,[suzie,kicks,fido], [ ]). LF = kick(suzie,fido).

October 2004csa4050: Semantics II14 Execution Trace Call: (7) s(_G471, [suzie, walks], []) Call: (8) np(_L183, [suzie, walks], _L184) Exit: (8) np(suzie, [suzie, walks], [walks]) Call: (8) vp(_L185, [walks], _L186) Call: (9) v(_L224, [walks], _L225) Exit: (9) v(_G529^walk(_G529), [walks], []) Call: (9) np(_L226, [], _L227) Fail: (9) np(_L226, [], _L227) Redo: (9) v(_L224, [walks], _L225) Redo: (8) vp(_L185, [walks], _L186) Call: (9) v(_L185, [walks], _L186) Exit: (9) v(_G529^walk(_G529), [walks], []) Exit: (8) vp(_G529^walk(_G529), [walks], []) Call: (8) reduce(_G529^walk(_G529), suzie, _G471) Exit: (8) reduce(suzie^walk(suzie), suzie, walk(suzie)) Call: (8) []=[] Exit: (8) []=[] Exit: (7) s(walk(suzie), [suzie, walks], [])