LING 581: Advanced Computational Linguistics

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

LING 364: Introduction to Formal Semantics Lecture 24 April 13th.
LING 388: Language and Computers Sandiway Fong Lecture 5: 9/8.
Semantics (Representing Meaning)
SEMANTICS.
9. Sense Properties and stereotypes
L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
5/10/20151 GC16/3011 Functional Programming Lecture 13 Example Programs 1. Evaluating arithmetic expressions 2. lists as functions.
For Monday Take home exam due Exam 1. For Wednesday Read chapter 10, sections 1-2 Prolog Handout 4.
CAS LX 502 8a. Formal semantics Truth and meaning The basis of formal semantics: knowing the meaning of a sentence is knowing under what conditions.
RMIT University; Taylor's College This is a story about four people named Everybody, Somebody, Anybody and Nobody. There was an important job to be done.
LING 581: Advanced Computational Linguistics Lecture Notes April 23rd.
Computability and Complexity 8-1 Computability and Complexity Andrei Bulatov Logic Reminder.
LING 364: Introduction to Formal Semantics Lecture 17 March 9th.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
LING 364: Introduction to Formal Semantics Lecture 22 April 6th.
LING 364: Introduction to Formal Semantics Lecture 19 March 20th.
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:
LING 364: Introduction to Formal Semantics Lecture 3 January 19th.
LING 364: Introduction to Formal Semantics Lecture 13 February 23rd.
LING 388: Language and Computers Sandiway Fong Lecture 13: 10/10.
LING 388 Language and Computers Lecture 15 10/21/03 Sandiway FONG.
Logic In Part 2 Modules 1 through 5, our topic is symbolic logic. We will be studying the basic elements and forms that provide the structural foundations.
Predicates and Quantifiers
Lecture 8 Introduction to Logic CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 19 Clicker Questions November 3, 2009.
Formal Models of Computation Part II The Logic Model
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
LING 581: Advanced Computational Linguistics Lecture Notes April 16th.
Lecture 3 [Self Study] Relational Calculus
October 2004CSA4050 Advanced Techniques in NLP 1 CSA4050: Advanced Topics in NLP Semantics 6 Semantics of Questions and Assertions involving Quantification.
LING 388: Language and Computers Sandiway Fong Lecture 3.
CAS LX 502 8b. Formal semantics A fragment of English.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
ARTIFICIAL INTELLIGENCE Lecture 3 Predicate Calculus.
LING 581: Advanced Computational Linguistics Lecture Notes March 8th.
Quantifiers Not all noun phrases (NPs) are (by nature) directly referential like names Quantifiers: “something to do with indicating the quantity of something”
Albert Gatt LIN3021 Formal Semantics Lecture 4. In this lecture Compositionality in Natural Langauge revisited: The role of types The typed lambda calculus.
Semantics Day 38 LING Computational Linguistics Harry Howard Tulane University.
Propositional Logic Predicate Logic
LOGIC. Logic in general  Logics are formal languages for representing information such that conclusions can be drawn  Syntax defines the sentences in.
Overview I. Whither modal semantics? II. A. Modal syntax.
LING 364: Introduction to Formal Semantics Lecture 21 April 4th.
Section 1.5 and 1.6 Predicates and Quantifiers. Vocabulary Predicate Domain Universal Quantifier Existential Quantifier Counterexample Free variable Bound.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
LING 581: Advanced Computational Linguistics Lecture Notes May 4th.
Sentential logic. Lecture based on: Graeme Forbes, Modern Logic Katarzyna Paprzycka, online lectures.
Lecture 1-3: Quantifiers and Predicates. Variables –A variable is a symbol that stands for an individual in a collection or set. –Example, a variable.
Chapter 7. Propositional and Predicate Logic
LING 581: Advanced Computational Linguistics
Direct Proof and Counterexample I: Introduction
Semantics (Representing Meaning)
Language, Logic, and Meaning
LING 581: Advanced Computational Linguistics
Logic In Part 2 Modules 1 through 5, our topic is symbolic logic.
LING 581: Advanced Computational Linguistics
LING 581: Advanced Computational Linguistics
Order Properties of the Real Numbers
Mathematics for Computer Science MIT 6.042J/18.062J
Logic for Artificial Intelligence
First Order Logic Rosen Lecture 3: Sept 11, 12.
Discrete Mathematics Lecture 2: Propositional Logic
Klenk's Tree Method for Determining the Truth Values of Statements
Chapter 7. Propositional and Predicate Logic
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Predicates and Quantifiers
Semantics 2: Syntax-Semantics Interface
LING/C SC 581: Advanced Computational Linguistics
Presentation transcript:

LING 581: Advanced Computational Linguistics Lecture Notes April 24th

Administrivia Thanks for submitting homework 9 – I've commented on a few of your submissions

From last time psg2.pl 

From last time psg2.pl 

Evaluation Check our computer implementation on… fjpSlides4.pdf

Evaluation Load psg2.pl into SWI Prolog; Syntax: (S) Proposition (P): ?- s(P,S,[jack,is,hungry],[]). P =  (findall(_1820, is_hungry(_1820), _1796), member(jack, _1796)), S = s(n(jack), vp(v(v(is), ap(hungry)))) ; false. Syntax: (S) Proposition (P): find all X s.t. is_hungry(X) is true. Name that list S Jack must be a member of S

Evaluation James likes Jack: Syntax: (S) Proposition (P): ?- s(P,S,[james,likes,jack],[]). P =  (findall(_90, likes(_90, jack), _62), member(james, _62)), S = s(n(james), vp(vt(likes), n(jack))) ; false. Syntax: (S) Proposition (P): find all X s.t. likes(X,jack) is true. Name that list S James must be a member of S

Evaluation Proposition (P): Syntax: It s not the case that James likes Jack: ?- s(P,S,[it,is,not,the,case,that,james,likes,jack],[]). P =  (\+ (findall(_102, likes(_102, jack), _74), member(james, _74))), S = s(neg, s(n(james), vp(vt(likes), n(jack)))) ; false. Proposition (P): find all X s.t. likes(X,jack) is true. Name that list S James must NOT be a member of S Syntax: (S)

Evaluation Syntax (S): Jack is hungry, and it s not the case that James likes Jack: ?- s(P,S,[jack,is,hungry,and,it,is,not,the,case,that,james,likes,jack],[]). P =  ((findall(_178, is_hungry(_178), _154), member(jack, _154)), \+ (findall(_288, likes(_288, jack), _250), member(james, _250))), S = s(s(n(jack), vp(v(v(is), ap(hungry)))), conj(and), s(neg, s(n(james), vp(vt(likes), n(jack))))) ; false. Syntax (S):

Evaluation Proposition (P1): find all X s.t. is_hungry(X) is true. Jack is hungry, and it s not the case that James likes Jack: ?- s(P,S,[jack,is,hungry,and,it,is,not,the,case,that,james,likes,jack],[]). P =  ((findall(_178, is_hungry(_178), _154), member(jack, _154)), \+ (findall(_288, likes(_288, jack), _250), member(james, _250))), S = s(s(n(jack), vp(v(v(is), ap(hungry)))), conj(and), s(neg, s(n(james), vp(vt(likes), n(jack))))) ; false. Proposition (P1): find all X s.t. is_hungry(X) is true. Name that list S Jack must be a member of S Proposition (P2): find all X s.t. likes(X,jack) is true. Name that list S James must NOT be a member of S P1 and P2 true

Evaluation Situations: Assert facts into database Closed world assumption: is fact is not in database, false. Prolog requires use to declare predicates (to guard against programming errors) using dynamic predicate/arity (= # of arguments)

Evaluation Situation V': Jack is hungry, and it is not the case that James likes Jack Assume: ?- assert(is_hungry(jack)). true. ?- dynamic likes/2. i.e.: ?- likes(jack, james). false. ?- s(P,_,[jack,is,hungry,and,it,is,not,the,case,that,james,likes,jack],[]), call(P). P =  ((findall(_2668, is_hungry(_2668), [james, jack]), member(jack, [james, jack])), \+ (findall(_2778, likes(_2778, jack), _2740), member(james, _2740))) ; false. True!

Evaluation Situation V'': Jack is hungry, and it is not the case that James likes Jack Assume: ?- assert(is_hungry(jack)). true. ?- assert(likes(jack, james)). ?- s(P,_,[jack,is,hungry,and,it,is,not,the,case,that,james,likes,jack],[]), call(P). false. False!

Evaluation Consider now (16) below (note the bracketing!):

Evaluation Situation V''': It is not the case that Jack is hungry or Sophia is boring ?- s(P,S,[it,is,not,the,case,that,jack,is,hungry,or,sophia,is,boring],[]). P =  (\+ (findall(_18234, is_hungry(_18234), _18210), member(jack, _18210));findall(_18314, is_boring(_18314), _18290), member(sophia, _18290)), S = s(s(neg, s(n(jack), vp(v(v(is), ap(hungry))))), conj(or), s(n(sophia), vp(v(v(is), ap(boring))))) ; P =  (\+ (findall(_18162, is_hungry(_18162), _18138), member(jack, _18138);findall(_18242, is_boring(_18242), _18218), member(sophia, _18218))), S = s(neg, s(s(n(jack), vp(v(v(is), ap(hungry)))), conj(or), s(n(sophia), vp(v(v(is), ap(boring)))))) ; false. 1st parse: Narrow scope for negation 2nd parse: Wide scope for negation

Evaluation Situation V''': It is not the case that Jack is hungry or Sophia is boring ?- assert(is_hungry(jack)). true. ?- assert(is_boring(sophia)). Cut (!) preserves only the first reading (narrow scope for neg): ?- s(P,_,[it,is,not,the,case,that,jack,is,hungry,or,sophia,is,boring], []), !, call(P). P =  (\+ (findall(_2828, is_hungry(_2828), _2804), member(jack, _2804));findall(_2908, is_boring(_2908), [sophia]), member(sophia, [sophia])). True!

Evaluation Suppose Jack is not hungry, does this change the proposition's truth value? ?- retract(is_hungry(jack)). true. ?- is_hungry(jack). false. Still true! ?- s(P,_,[it,is,not,the,case,that,jack,is,hungry,or,sophia,is,boring],[]), !, call(P). P =  (\+ (findall(_2838, is_hungry(_2838), _2814), member(jack, _2814));findall(_2918, is_boring(_2918), _2894), member(sophia, _2894)) .

Evaluation Almost situation V'''': It is not the case that Jack is hungry or Sophia is boring ?- retract(is_boring(sophia)). true. ?- is_boring(sophia). false. Since Jack is not hungry, proposition remains true! ?- s(P,_,[it,is,not,the,case,that,jack,is,hungry,or,sophia,is,boring],[]) , !, call(P). P =  (\+ (findall(_2844, is_hungry(_2844), _2820), member(jack, _2820));findall(_2924, is_boring(_2924), _2900), member(sophia, _2900)) .

Evaluation Proposition now false! Now situation V'''': It is not the case that Jack is hungry or Sophia is boring ?- assert(is_hungry(jack)). true. Proposition now false! ?- s(P,_,[it,is,not,the,case,that,jack,is,hungry,or,sophia,i s,boring],[]), !, call(P). false.

Quantifiers nobody has seen a unicorn means roughly (Prolog-style): Not all noun phrases (NPs) are (by nature) directly referential like names Quantifiers: “something to do with indicating the quantity of something” Examples: every child nobody two dogs several animals most people nobody has seen a unicorn means roughly (Prolog-style): ?- setof(X,(person(X), seen(X,Y), unicorn(Y)),Set),cardinality(Set,0).

Quantifiers Database setof vs. findall (recall last lecture) Fix: nobody has seen a unicorn means roughly (Prolog-style): ?- setof(X,(person(X), seen(X,Y), unicorn(Y)),Set),cardinality(Set,0). Database setof vs. findall (recall last lecture) Fix:

Quantifiers Semantic compositionality: Example: elements of a sentence combine in piecewise fashion to form an overall (propositional) meaning for the sentence Example: (4) Every baby cried Word Meaning cried cried(X). baby baby(X). every ? every baby cried proposition (True/False) that can be evaluated for a given situation

Quantifiers Scenario (Possible World): suppose there are three babies... baby(noah). baby(merrill). baby(dani). all three cried cried(noah). cried(merrill). cried(dani). only Dani jumped jumped(dani). Noah and Dani swam swam(noah). swam(dani). (6) every baby exactly one baby most babies cried ✓ jumped swam think of quantifiers as “properties-of-properties” every_baby(P) is a proposition P: property every_baby(P) true for P=cried every_baby(P) false for P=jumped and P=swam