October 2004CSA4050 Advanced Techniques in NLP 1 CSA4050: Advanced Topics in NLP Semantics 6 Semantics of Questions and Assertions involving Quantification.

Slides:



Advertisements
Similar presentations
Prolog programming....Dr.Yasser Nada. Chapter 8 Parsing in Prolog Taif University Fall 2010 Dr. Yasser Ahmed nada prolog programming....Dr.Yasser Nada.
Advertisements

B ϋ CHIS MONADIC SECOND ORDER LOGIC Verification Seminar V.Sowjanya Lakshmi ( Subhasree M.
Some Prolog Prolog is a logic programming language
October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
Inference Rules Universal Instantiation Existential Generalization
The Logic of Quantified Statements
The Foundations: Logic and Proofs
Chapter 11 :: Logic Languages
CSA2050: DCG I1 CSA2050 Introduction to Computational Linguistics Lecture 8 Definite Clause Grammars.
First-Order Logic (and beyond)
CSA4050: Advanced Topics in NLP Semantics IV Partial Execution Proper Noun Adjective.
Standard Logical Equivalences
Semantics (Representing Meaning)
CSA2050: DCG IV1 CSA2050: Definite Clause Grammars IV Handling Gaps II Semantic Issues.
Predicates and Quantifiers
L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
First-Order Logic (FOL) aka. predicate calculus. First-Order Logic (FOL) Syntax User defines these primitives: –Constant symbols (i.e., the "individuals"
Knowledge Representation Methods
Fall Semantics Juan Carlos Guzmán CS 3123 Programming Languages Concepts Southern Polytechnic State University.
CSE 425: Logic Programming I Logic and Programs Most programs use Boolean expressions over data Logic statements can express program semantics –I.e., axiomatic.
Linguistic Theory Lecture 8 Meaning and Grammar. A brief history In classical and traditional grammar not much distinction was made between grammar and.
LING 581: Advanced Computational Linguistics Lecture Notes April 23rd.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
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.
The Foundations: Logic and Proofs
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
Artificial Intelligence 4. Knowledge Representation Course V231 Department of Computing Imperial College, London © Simon Colton.
The Relational Model: Relational Calculus
November 2003CSA4050: Semantics I1 CSA4050: Advanced Topics in NLP Semantics I What is semantics for? Role of FOL Montague Approach.
Section 1.5. Section Summary Nested Quantifiers Order of Quantifiers Translating from Nested Quantifiers into English Translating Mathematical Statements.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
CSE S. Tanimoto Horn Clauses and Unification 1 Horn Clauses and Unification Propositional Logic Clauses Resolution Predicate Logic Horn Clauses.
October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
Semantic Construction lecture 2. Semantic Construction Is there a systematic way of constructing semantic representation from a sentence of English? This.
Logic Programming CSC 358/ Outline Pattern matching Unification Logic programming.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Rules, Movement, Ambiguity
Lecture 4: Predicates and Quantifiers; Sets.
Semantics Day 38 LING Computational Linguistics Harry Howard Tulane University.
November 2006Semantics I1 Natural Language Processing Semantics I What is semantics for? Role of FOL Montague Approach.
Artificial Intelligence First-Order Logic (FOL). Outline of this Chapter The need for FOL? What is a FOL? Syntax and semantics of FOL Using FOL.
For Wednesday Read chapter 9, sections 1-3 Homework: –Chapter 7, exercises 8 and 9.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
For Friday Read chapter 8 Homework: –Chapter 7, exercises 2 and 10 Program 1, Milestone 2 due.
For Friday Finish chapter 23 Homework –Chapter 23, exercise 15.
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.
October 2004csa4050: Semantics V1 CSA4050: Advanced Topics in NLP Semantics V NL Access to Databases Semantics of Questions and Answers Simple Interpreters.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Copyright 1999Paul F. Reynolds, Jr. Foundations of Logic Programming.
November 2008NL Semantics V1 Advanced Topics in NLP Semantics V NL Access to Databases Semantics of Questions and Answers Simple Interpreters for Questions.
Predicates & Quantifiers
Natural Language Processing
Chapter 1 The Foundations: Logic and Proofs
LING 581: Advanced Computational Linguistics
CS201: Data Structures and Discrete Mathematics I
Horn Clauses and Unification
CSA4050: Advanced Topics in NLP
Predicates and Quantifiers
CS201: Data Structures and Discrete Mathematics I
Natural Language Processing
CSA4050: Advanced Topics in NLP
Presentation transcript:

October 2004CSA4050 Advanced Techniques in NLP 1 CSA4050: Advanced Topics in NLP Semantics 6 Semantics of Questions and Assertions involving Quantification

October 2004CSA4050 Advanced Techniques in NLP 2 Classification of Questions Yes/NoContent Answer Without Quantification Did Suzie walk? Did Suzie kick Felix? Who walked? Who kicked Felix? Who did Suzie kick? With Quantification Did all the cats sleep? Did a cat sleep? Did someone kick Felix? Which cats slept? How many children slept?

October 2004CSA4050 Advanced Techniques in NLP 3 Classification of Assertions Without QuantificationSuzie walked Suzie kicked Felix With QuantificationSuzie kicked a cat. Every woman kicked Felix. A woman kicked the cat. The cat is a mammal

October 2004CSA4050 Advanced Techniques in NLP 4 Issues Handling questions ≠ Handling assertions Semantic issues: –What LF? –How to process LF Syntactic issues –how to parse sentences –how to build LF

October 2004CSA4050 Advanced Techniques in NLP 5 Semantics of Question Type Did all the cats sleep? how to represent meaning q1(all(X,cat(X),sleep(X)) how to process meaning provide definition for all(X,R,S) intuitively, this succeeds if for every X where R succeeds, S also succeeds it fails if there is a single counterexample i.e. cat(X) succeeds and sleep(X) fails.

October 2004CSA4050 Advanced Techniques in NLP 6 Defining all all(_,R,S) :- \+(R,\+S). NB \+ (G) succeeds if G fails. Goal1,Goal2 succeeds if Goal1, then Goal2 succeed What happens if R fails?

October 2004CSA4050 Advanced Techniques in NLP 7 Semantics of Question Type Did a cat sleep? how to represent meaning q1(some(X,cat(X),sleep(X)) how to process meaning provide definition for some(X,R,S) intuitively, this succeeds if there is an X which satisfies R and S. it fails if there is no such X. Only one example need be established.

October 2004CSA4050 Advanced Techniques in NLP 8 Defining some some(_,R,S) :- R, S. NB Can this be made more efficient?

October 2004CSA4050 Advanced Techniques in NLP 9 Getting a List of Solutions Which cats sleep? The built in predicate setof(X,Goal,L) binds L to a list of X that satisfy Goal So for example with a database containing cat(majlo). sleep(majlo). cat(felix). sleep(felix). cat(cobweb). ?- setof(X,(cat(X),sleep(X)),L). L = [majlo,felix]

October 2004CSA4050 Advanced Techniques in NLP 10 How many cats slept? "How many" questions require a numerical answer that is obtained by counting the number of solutions. This can be acheived as follows using setof in conjunction with the built-in length predicate. howmany(X,Goal,N) :- setof(X,Goal,L), length(L,N).

October 2004CSA4050 Advanced Techniques in NLP 11 Assertions with Quantification Universal Statements Universal statements are those whose LF involves all(,R,S). This translates into the Prolog clause S :- R Example –English= Every cat sleeps –LF= all(X,cat(X),sleep(X)). –Prolog = sleep(X) :- cat(X)

October 2004CSA4050 Advanced Techniques in NLP 12 Restrictions on Translation into Prolog Prolog uses the Horn Clause subset of FOL. A rule of the form a(X) :- a1(X),..., an(X) corresponds to the FOL statement  x (a1(x) &... & an(x)  a(x)) Outermost quantifier must be universally quantifed Conclusion must be a single predicate

October 2004CSA4050 Advanced Techniques in NLP 13 Assertions with Quantification: Simple existential statements With simple assertions like Suzie chased Felix we simply assert the corresponding LF chased(suzie,felix) into the database. This will not work with sentences like Suzie chased a cat whose LF is some(X,cat(X),chase(suzie,X))

October 2004CSA4050 Advanced Techniques in NLP 14 Establishing the truth of quantified sentences In order to find out what has to be asserted, let’s see what happens with corresponding query, given that some(_,R,S) :- R, S. Clearly, the query ?- some(X,cat(X),chase(suzie,X)). will cause subgoals cat(X), chase(suzie,X) to be tried. These will fail

October 2004CSA4050 Advanced Techniques in NLP 15 Anonymous Names cat(X) and chased(suzie,felix) will succeed if we have, e.g. cat(felix), chased(suzie,felix) in the database. But when we assert some(X,cat(X),chased(suzie,X)) no such name is mentioned, so we have to invent an anonymous name. The simplest names are integers: cat(100). chased(suzie,100).

October 2004CSA4050 Advanced Techniques in NLP 16 Discourse Referents Such names are more properly called discourse referents. Discourse referents are entities that are referred to by different parts of a discourse. Some parts introduce new DRs. Others refer back to already established DRs. Discourse Representation Theory A baby cried. He was hungry

October 2004CSA4050 Advanced Techniques in NLP 17 Interpreting Wh Questions Semantically, issue is quite simple We want the semantic interpretation of the question to query the database and bind the result to a variable. Let SEM be the semantic interpretation of "who sees fido“. We want the following behaviour ?- interpret(SEM,Ans) Ans = [john,mary] What does SEM have to look like?

October 2004CSA4050 Advanced Techniques in NLP 18 Representing Meaning QuestionSemantic Representation Who sees Fido?q2(X,setof(Y,see(Y,fido),X)) Who did John see?q2(X,setof(Y,see(john,Y),X))

October 2004CSA4050 Advanced Techniques in NLP 19 How Internal Bindings Yield the Answer interpret(q2(X,....X....),X) The first occurrence of X identifies what the unknown is called. The second occurrence identifies where the unknown information is situated in the second arg. position of q2). The last occurrence will become bound to the answer.

October 2004CSA4050 Advanced Techniques in NLP 20 Syntax of Wh Questions How do we build the right semantic representation from the question? Need to look carefully at the syntactic structure of the questions. In particular, need to look at the way sentences have been derived. Hypothesis: the word who can substitute any noun phrase.