LING 364: Introduction to Formal Semantics Lecture 16 March 7th.

Slides:



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

Review of Homework 4 November 20, Exercise 1 (A) 1 pt Modify the DCG to accept the omission of the complementizer that for object relative clauses.
November 2008NLP1 Natural Language Processing Definite Clause Grammars.
LING 364: Introduction to Formal Semantics Lecture 24 April 13th.
LING 388: Language and Computers Sandiway Fong Lecture 5: 9/8.
CSA4050: Advanced Topics in NLP Semantics IV Partial Execution Proper Noun Adjective.
LING 364: Introduction to Formal Semantics Lecture 18 March 21st.
Natural Language Processing DCG and Syntax NLP DCG A “translation” example: special case A DCG recogniser.
LING 388: Language and Computers Sandiway Fong Lecture 15.
LING 364: Introduction to Formal Semantics Lecture 8 February 7th.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/12.
LING 364: Introduction to Formal Semantics Lecture 10 February 14th.
LING 364: Introduction to Formal Semantics Lecture 12 February 21st.
LING 364: Introduction to Formal Semantics Lecture 14 February 28th.
LING 388 Language and Computers Lecture 2 9/04/03 Sandiway FONG.
LING 364: Introduction to Formal Semantics Lecture 9 February 9th.
LING 388 Language and Computers Lecture 19 11/04/03 Sandiway FONG.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 9: 9/21.
© Patrick Blackburn, Johan Bos & Kristina Striegnitz Lecture 8: More DCGs Theory –Examine two important capabilities offered by DCG notation: Extra arguments.
LING 388: Language and Computers Sandiway Fong Lecture 15: 10/17.
LING 364: Introduction to Formal Semantics
LING 364: Introduction to Formal Semantics Lecture 17 March 9th.
LING 388 Language and Computers Lecture 14 10/16/03 Sandiway FONG.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
LING 364: Introduction to Formal Semantics Lecture 11 February 16th.
LING 364: Introduction to Formal Semantics Lecture 22 April 6th.
LING 388: Language and Computers Sandiway Fong Lecture 6: 9/13.
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 388 Language and Computers Take-Home Final Examination 12/9/03 Sandiway FONG.
LING 364: Introduction to Formal Semantics Lecture 7 February 2nd.
LING 364: Introduction to Formal Semantics Lecture 3 January 19th.
LING 388 Language and Computers Lecture 18 10/30/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 17: 10/25.
LING 364: Introduction to Formal Semantics Lecture 13 February 23rd.
LING 388 Language and Computers Lecture 9 9/30/03 Sandiway FONG.
LING 364: Introduction to Formal Semantics Lecture 5 January 26th.
LING 388 Language and Computers Lecture 17 10/28/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 13: 10/10.
LING 388 Language and Computers Lecture 12 10/9/03 Sandiway FONG.
LING 388 Language and Computers Lecture 15 10/21/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 8.
LING 388: Language and Computers Sandiway Fong 10/4 Lecture 12.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
LING 388: Language and Computers Sandiway Fong Lecture 11.
October 2004csa4050: Semantics II1 CSA4050: Advanced Topics in NLP Semantics II The Lambda Calculus Semantic Representation Encoding in Prolog.
CAS LX 502 Semantics 3a. A formalism for meaning (cont ’ d) 3.2, 3.6.
LING 388: Language and Computers Sandiway Fong Lecture 14 10/11.
LING 388: Language and Computers Sandiway Fong Lecture 17.
LING 388: Language and Computers Sandiway Fong Lecture 7.
LING 388: Language and Computers Sandiway Fong Lecture 18.
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.
LING 388: Language and Computers Sandiway Fong Lecture 10.
October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
LING 388: Language and Computers Sandiway Fong Lecture 13.
LING 388: Language and Computers Sandiway Fong Lecture 12.
Albert Gatt LIN3021 Formal Semantics Lecture 4. In this lecture Compositionality in Natural Langauge revisited: The role of types The typed lambda calculus.
Rules, Movement, Ambiguity
Computational Semantics Day II: A Modular Architecture
◦ Process of describing the structure of phrases and sentences Chapter 8 - Phrases and sentences: grammar1.
LING 388: Language and Computers Sandiway Fong Lecture 16.
CAS LX 502 9b. Formal semantics Pronouns and quantifiers.
LING 364: Introduction to Formal Semantics Lecture 21 April 4th.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
Natural Language Processing
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
LING 581: Advanced Computational Linguistics
LING/C SC/PSYC 438/538 Lecture 25 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 26 Sandiway Fong.
CSA4050: Advanced Topics in NLP
CSA4050: Advanced Topics in NLP
Presentation transcript:

LING 364: Introduction to Formal Semantics Lecture 16 March 7th

Administrivia Homework 2 –returned –if you didn’t get , let me know Homework 3 –should get it back sometime this week

Administrivia New Handout –Chapter 5: Complexities of Referring Expressions –read it for next time (Quiz 4) Thursday’s Class –in the computer lab (SS 224) –exercises based on Chapter 5 –no homework (upcoming Spring break)

Today’s Class Two topics 1.Homework 3 Review 2.Start looking at Chapter 5

Part 1: Homework 3 Review

Homework 3 Review Phrase Structure Grammar (PSG) sbar(sbar(NP,S)) --> wh_np(NP), s(S). sbar(sbar(S)) --> s(S). s(s(VP)) --> vp(VP). s(s(NP,VP)) --> np(NP), vp(VP). wh_np(np(who)) --> [who]. np(np(john)) --> [john]. np(np(pete)) --> [pete]. np(np(mary)) --> [mary]. np(np(Det,N)) --> det(Det), n(N). np(np(Neg,NP)) --> neg(Neg), np(NP). np(np(NP1,Conj,NP2)) --> np(NP1), conj(Conj), np(NP2). neg(neg(not)) --> [not]. conj(conj(and)) --> [and]. vp(vp(V,NP)) --> v(V), np(NP). v(v(is)) --> [is]. det(det(a)) --> [a]. n(n(student)) --> [student]. n(n(baseball_fan)) --> [baseball,fan]. Meaning Grammar (MG) saturate1((P1,P2),X) :- !, saturate1(P1,X), saturate1(P2,X). saturate1((\+ P),X) :- !, saturate1(P,X). saturate1(P,X) :- arg(1,P,X). sbar(P) --> wh_np(X), s(P), {saturate1(P,X)}. sbar(P) --> s(P). s(P) --> vp(P). s(P) --> np(X), vp(P), {saturate1(P,X)}. np(john) --> [john]. np(pete) --> [pete]. np(mary) --> [mary]. np(P) --> det(a), n(P). np((\+ P)) --> neg, np(P). np((P1,P2)) --> np(P1), conj(and), np(P2). wh_np(_X) --> [who]. neg --> [not]. conj(and) --> [and]. vp(P) --> v(copula), np(P). v(copula) --> [is]. det(a) --> [a]. n(student(_X)) --> [student]. n(baseball_fan(_X)) --> [baseball,fan].

Exercise 1 Modify the PSG to handle –(1) Shelby is small –(2) Shelby is a dog –(3) Hannibal is a dog Phrase structure: [ Sbar [ S [ NP Shelby][ VP [ V is] [ AP [ A small]]]]] AP = adjectival phrase, A = adjective NP rules np(np(john)) --> [john]. n(n(student)) --> [student]. add: np(np(shelby)) --> [shelby]. np(np(hannibal)) --> [hannibal]. n(n(dog)) --> [dog]. AP rules ap(ap(A)) --> a(A). a(a(small)) --> [small]. VP rule vp(vp(V,NP)) --> v(V), np(NP). add: vp(vp(V,AP)) --> v(V), ap(AP).

Exercise 1 The order matters (NP is recursive) sbar(sbar(NP,S)) --> wh_np(NP), s(S). sbar(sbar(S)) --> s(S). s(s(VP)) --> vp(VP). s(s(NP,VP)) --> np(NP), vp(VP). wh_np(np(who)) --> [who]. np(np(john)) --> [john]. np(np(pete)) --> [pete]. np(np(mary)) --> [mary]. np(np(shelby)) --> [shelby]. np(np(hannibal)) --> [hannibal]. np(np(Det,N)) --> det(Det), n(N). np(np(Neg,NP)) --> neg(Neg), np(NP). np(np(NP1,Conj,NP2)) --> np(NP1), conj(Conj), np(NP2). neg(neg(not)) --> [not]. conj(conj(and)) --> [and]. vp(vp(V,AP)) --> v(V), ap(AP). vp(vp(V,NP)) --> v(V), np(NP). v(v(is)) --> [is]. det(det(a)) --> [a]. n(n(student)) --> [student]. n(n(baseball_fan)) --> [baseball,fan]. n(n(dog)) --> [dog]. ap(ap(A)) --> a(A). a(a(small)) --> [small]. NP rules np(np(john)) --> [john]. n(n(student)) --> [student]. add: np(np(shelby)) --> [shelby]. np(np(hannibal)) --> [hannibal]. n(n(dog)) --> [dog]. AP rules ap(ap(A)) --> a(A). a(a(small)) --> [small]. VP rule vp(vp(V,NP)) --> v(V), np(NP). add: vp(vp(V,AP)) --> v(V), ap(AP).

Exercise 1 Modify the MG to handle –(1) Shelby is small –(2) Shelby is a dog –(3) Hannibal is a dog Phrase structure: [ Sbar [ S [ NP Shelby][ VP [ V is] [ AP [ A small]]]]] AP = adjectival phrase, A = adjective NP rules np(john) --> [john]. n(student(_X)) --> [student]. add: np(shelby) --> [shelby]. np(hannibal) --> [hannibal]. n(dog(_X)) --> [dog]. AP rules ap(P) --> a(P). a(small(_X)) --> [small]. VP rule vp(P) --> v(copula), np(P). add: vp(P) --> v(copula), ap(P). ?- sbar(X,[hannibal,is,a,dog],[]). X = dog(hannibal) ? yes | ?- sbar(X,[shelby,is,small],[]). X = small(shelby) ? yes | ?- sbar(X,[shelby,is,a,dog],[]). X = dog(shelby) ? yes

Exercise 2 Possible worlds Part A: using assert with exercise 1 facts Part B: Modify MG to handle: –(4a) Who is small and a dog? –(4b) Who is a dog and not small? –Note: you need to handle the semantics for “not small” Negation rule np((\+ P)) --> neg, np(P). add ap((\+ P)) --> neg, ap(P). Conjunction rules (simplest way) np((P1,P2)) --> np(P1), conj(and), np(P2). add: np((P1,P2)) --> ap(P1), conj(and), np(P2). np((P1,P2)) --> np(P1), conj(and), ap(P2). Note: looks like we’re conjoining dissimilar categories, e.g. AP (small) and NP (a dog) or can view it as a reduced form of sentential conjunction, e.g. (4a’) [ sbar Who is small ] and [ sbar who is a dog] or that we’re conjoining semantically similar types: i.e. predicates with one saturated argument ?- sbar(X,[who,is,small,and,a,dog],[]). X = small(_A),dog(_A) ? | ?- sbar(X,[who,is,a,dog,and,not,small],[]). X = dog(_A),\+small(_A) ? (same variable: enforced from saturate1/2)

Exercise 3 Relative Clauses Modify PSG and MG to parse: –(5) Shelby saw Hannibal –(6) Hannibal is who Shelby saw Need to handle transitive verbs Need to decide on some phrase structure for NP “who Shelby saw” e.g. [ NP [ NP who][ S [ NP Shelby][ VP [ V saw]]]] V rule vp(vp(V,AP)) --> v(V), ap(AP). vp(vp(V,NP)) --> v(V), np(NP). v(v(is)) --> [is]. add: v(v(saw)) --> [saw]. (allows *Shelby saw small as well) NP rule np(np(WH,S)) --> wh_np(WH), s(S). VP rule (not worrying about empty categories or overgeneration) vp(vp(V,NP)) --> v(V), np(NP). add: vp(vp(V)) --> v(V).

Exercise 3 Order matters bar(sbar(NP,S)) --> wh_np(NP), s(S). sbar(sbar(S)) --> s(S). s(s(VP)) --> vp(VP). s(s(NP,VP)) --> np(NP), vp(VP). wh_np(np(who)) --> [who]. np(np(john)) --> [john]. np(np(pete)) --> [pete]. np(np(mary)) --> [mary]. np(np(shelby)) --> [shelby]. np(np(hannibal)) --> [hannibal]. np(np(Det,N)) --> det(Det), n(N). np(np(Neg,NP)) --> neg(Neg), np(NP). np(np(WH,S)) --> wh_np(WH), s(S). np(np(NP1,Conj,NP2)) --> np(NP1), conj(Conj), np(NP2). neg(neg(not)) --> [not]. conj(conj(and)) --> [and]. vp(vp(V,AP)) --> v(V), ap(AP). vp(vp(V)) --> v(V). vp(vp(V,NP)) --> v(V), np(NP). v(v(is)) --> [is]. v(v(saw)) --> [saw]. det(det(a)) --> [a]. n(n(student)) --> [student]. n(n(baseball_fan)) --> [baseball,fan]. n(n(dog)) --> [dog]. ap(ap(A)) --> a(A). a(a(small)) --> [small]. V rule vp(vp(V,AP)) --> v(V), ap(AP). vp(vp(V,NP)) --> v(V), np(NP). v(v(is)) --> [is]. add: v(v(saw)) --> [saw]. (allows *Shelby saw small as well) NP rule np(np(WH,S)) --> wh_np(WH), s(S). VP rule (not worrying about empty categories or overgeneration) vp(vp(V,NP)) --> v(V), np(NP). add: vp(vp(V)) --> v(V).

Exercise 3 Relative Clauses Modify MG to parse: –(5) Shelby saw Hannibal –(6) Hannibal is who Shelby saw –we have only saturate1/2 here V rule v(v(saw)) --> [saw]. transfer: v(saw(_X,_Y)) --> [saw]. NP rule (for object relative clause) np(np(WH,S)) --> wh_np(WH), s(S). transfer: np(P) --> wh_np(WH), s(P), {saturate2(P,WH)}. VP rules vp(P) --> v(copula), np(P). add: vp(P) --> v(P), np(Y), {saturate2(P,Y)}. vp(vp(V)) --> v(V). transfer: vp(P) --> v(P). (Lecture 7) Meaning DCG: sentence(P) --> np(NP1), vp(P), {saturate1(P,NP1)}. vp(P) --> v(P), np(NP2), {saturate2(P,NP2)}. v(likes(X,Y)) --> [likes]. np(john) --> [john]. np(mary) --> [mary]. saturate1(P,A) :- arg(1,P,A). saturate2(P,A) :- arg(2,P,A). Transfer new PS rules to MG

Exercise 3 Relative Clauses –(6) Hannibal is who Shelby saw Doesn’t work perfectly Why? V rule v(v(saw)) --> [saw]. transfer: v(saw(_X,_Y)) --> [saw]. NP rule (for object relative clause) np(np(WH,S)) --> wh_np(WH), s(S). transfer: np(P) --> wh_np(WH), s(P), {saturate2(P,WH)}. VP rules vp(P) --> v(copula), np(P). add: vp(P) --> v(P), np(Y), {saturate2(P,Y)}. vp(vp(V)) --> v(V). transfer: vp(P) --> v(P). Transfer new PS rules to MG Steps: Hannibal is who Shelby saw Hannibal is who Shelby saw(X,Y) Hannibal is who saw(shelby,Y) Hannibal is saw(shelby,Y) Hannibal saw(shelby,Y) s(P) --> np(X), vp(P), {saturate1(P,X)}.

Exercise 3 Relative Clauses –(6) Hannibal is who Shelby saw Doesn’t work perfectly Why? Quick and Dirty Fix s(P) --> np(X), vp(P), {saturate1(P,X)}. s(P) --> np(X), vp(P), {saturate1(P,X); saturate2(P,X)}. Perhaps a better fix use the lambda calculus idea: semantics of who is λx Hannibal is who saw(shelby,Y) Hannibal is lambda(Y,saw(shelby,Y)) then saturate/1 works Rule change: np(P) --> wh_np(WH), s(P), {saturate2(P,WH)}. adjust to: np(lambda(Y,P)) --> wh_np(Y), s(P), {saturate2(P,Y)}. Steps: Hannibal is who Shelby saw Hannibal is who Shelby saw(X,Y) Hannibal is who saw(shelby,Y) Hannibal is saw(shelby,Y) Hannibal saw(shelby,Y) s(P) --> np(X), vp(P), {saturate1(P,X)}.

Exercise 4 Adjectives (Intersective interpretation) Modify PSG and MG: –(7) Ossie is a bird bird(ossie). –(8) Ossie is tall tall(ossie). tall: predicative adjective –(9) Ossie is a tall bird use the intersective intepretation i.e. tall(X),bird(X) a tall bird [ NP [ Det a][ N [ A tall][ N bird]]] PSG Step 1: –np(np(ossie)) --> [ossie]. –n(n(bird)) --> [bird]. –a(a(tall)) --> [tall]. Step 2: –n(n(A,N)) --> a(A), n(N). MG –np(ossie) --> [ossie]. –n(bird(_X)) --> [bird]. –a(tall(_X)) --> [tall]. –n((P1,P2)) --> a(P1), n(P2), {saturate1(P1,X),saturate1(P2,X)}.

Part 2 Chapter 5: Complexities of Referring Expressions (start this today, quiz on Thursday in lab class)

Definite NPs Semantic differences between: –a dog –the dog –Shelby is a dog –Shelby is the dog

Definite NPs Definite NP –begin with a definite article (“the”) –refer or “point” to some entity (in some world) Examples –the dog –the old man –the picture of Mary –the woman who Susan knows I met

Definite NPs Imagine a world –Shelby is the only dog which lives at Paul’s house Then same truth conditions for: –(1) Shelby is cute –(2) The dog which lives at Paul’s house is cute Predicates: –cute: cute(X). or λx.x cute –dog: dog(X). or λx.x a dog What is the role played by “the”? –The dog is cute –cf. *dog is cute

Definite NPs Predicates: –cute: cute(X). or λx.x cute –dog: dog(X).or λx.x a dog What is the role played by “the”? –The dog is cutecf. *dog is cute Idea: –“the” is a function (a robot in Chapter 5’s terms) –takes a property, e.g. dog(X). –and picks out something individual in the world, e.g. dog42 Example –The dog is cute –The dog(X) is cute(Y) –dog42 is cute(Y) –cute(dog42).