LING 364: Introduction to Formal Semantics Lecture 13 February 23rd.

Slides:



Advertisements
Similar presentations
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.
Advertisements

LING 388: Language and Computers Sandiway Fong Lecture 5: 9/5.
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.
LING 388: Language and Computers Sandiway Fong Lecture 2.
LING 388: Language and Computers Sandiway Fong Lecture 2: 8/24.
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 364: Introduction to Formal Semantics Lecture 9 February 9th.
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 364: Introduction to Formal Semantics Lecture 28 May 2nd.
LING 364: Introduction to Formal Semantics Lecture 27 April 27th.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 6: 9/6.
LING 364: Introduction to Formal Semantics Lecture 11 February 16th.
LING 364: Introduction to Formal Semantics Lecture 22 April 6th.
LING 364: Introduction to Formal Semantics Lecture 1 January 12th.
LING 388 Language and Computers Take-Home Final Examination 12/9/03 Sandiway FONG.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 12: 10/5.
LING 364: Introduction to Formal Semantics Lecture 7 February 2nd.
LING 364: Introduction to Formal Semantics Lecture 16 March 7th.
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 Lecture 16 10/23/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 1: 8/23.
LING 388 Language and Computers Lecture 13 10/14/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 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.
LING 388: Language and Computers Sandiway Fong Lecture 14 10/11.
Please open Daily Quiz 34. A scientific calculator may be used on this quiz. You can keep your yellow formula sheets out when you take the quiz. Remember.
LING 388: Language and Computers Sandiway Fong Lecture 17.
LING 388: Language and Computers Sandiway Fong Lecture 4.
LING 388: Language and Computers Sandiway Fong Lecture 7.
LING 388: Language and Computers Sandiway Fong Lecture 3.
LING 388: Language and Computers Sandiway Fong Lecture 18.
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.
LING 388: Language and Computers Sandiway Fong Lecture 11: 10/4.
Rules, Movement, Ambiguity
LING 388: Language and Computers Sandiway Fong Lecture 16.
October 2004csa4050: Semantics V1 CSA4050: Advanced Topics in NLP Semantics V NL Access to Databases Semantics of Questions and Answers Simple Interpreters.
LING 364: Introduction to Formal Semantics Lecture 21 April 4th.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
LING 581: Advanced Computational Linguistics
Natural Language Processing
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
LING 581: Advanced Computational Linguistics
LING 581: Advanced Computational Linguistics
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 13 February 23rd

Administrivia Homework 3 –due next Thursday – (midnight deadline)

Administrivia Worried about your grade? Course Philosophy –Use the homeworks to learn and practice using what we’ve talked about in class –If you perform well on the homework, great! –If you understood the material but didn’t do so well, there will be a second opportunity to display your understanding –Idea: you are not penalized for learning There will be a take-home final (given out May 2nd): –if you didn’t do so well on the homework but perform well on the equivalent question on the take-home final, your homework score will be up-scaled (for the purposes of computing your final grade) –this second opportunity idea makes it possible to still get an A

Homework 3 Assume basically 1 the phrase structure and meaning grammars given in Homework 2 Review (lecture 12) 1 Note: use the following two grammars: the grammars given here are lightly customized versions of those given in lecture 12 to make the homework work out better

Phrase Structure Grammar Starting point –from lecture 12 slides 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 Starting point –from lecture 12 slides 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]. _X is a variable: leading underscore prevents warning messages about singleton variables ! is the cut symbol: prevents Prolog from trying other cases when looking for more solutions

Homework 3 We’ll do exercises 1 and 2 in class today. You’ll do exercises 3 and 4 Exercise 5 is extra-credit I’ve also tentatively reserved the Computer Lab classroom for next Thursday (3:30pm – 4:45pm) –for Homework 3 questions

Exercise 1 Part A: (3pts) Modify the phrase structure grammar to handle –(1) Shelby is small –(2) Shelby is a dog –(3) Hannibal is a dog Use the following phrase structure for (1): –[ Sbar [ S [ NP Shelby][ VP [ V is] [ AP [ A small]]]]] –AP = adjectival phrase, A = adjective Part B: (3pts) Modify the meaning grammar to handle examples (1)–(3) For parts (A) and (B), submit the grammars as well as the Prolog execution

Exercise 2 Possible worlds –recall (from homework 1) ?- assert(Fact). adds Fact to the database ?- retract(Fact). removes Fact from the database (3pts) Part A Use your meaning grammar to interpret and add the Prolog equivalent of examples (1) through (3) from Exercise 1 –e.g. ?- sbar(M,[shelby,is,a,dog],[]), assert(M). –should result in fact dog(shelby). –being added to the database check with ?- listing. or ?- dog(X). Submit your Prolog execution and database check

Exercise 2 Possible worlds –Prolog built-in call/1 ?- call(Fact). true if Fact is provable from the database (false, otherwise) (5pts) Part B Modify your meaning grammar to get answers to the following questions (given the facts in Part A): –(4a) Who is small and a dog? –(4b) Who is a dog and not small? –e.g. ?- sbar(Q,[who,is,small,and,a,dog],[]), call(Q). –should come back with shelby as an answer –Note: your Q should be something like: (small(X),dog(X)) –Note: you need to handle the semantics for “not small” Submit your Prolog execution

Exercise 3 Relative Clauses Part A (4pts) Modify your phrase structure and meaning grammars to parse: –(5) Shelby saw Hannibal Part B (6pts) Modify your phrase structure and meaning grammars to parse: –(6) Hannibal is who Shelby saw Submit your grammars and the Prolog execution

Exercise 4 Adjectives (Intersective interpretation) (6pts) Modify your phrase structure and meaning grammars to handle: –(7) Ossie is a bird bird(ossie). –(8) Ossie is tall tall(ossie). tall: predicative adjective –(9) Ossie is a tall bird tall: attributive adjective (modifies noun bird) use the intersective intepretation here use (simplified) phrase structure a tall bird [ NP [ Det a][ N [ A tall][ N bird]]] Submit your grammars and the Prolog execution

Exercise 5 Extra Credit (10pts) Modify your meaning grammar to handle –(9) Ossie is a tall bird with the semantics of “tall” being relativized for “birds” i.e. compute some meaning expression where the truth conditions are that: –(A) Ossie is a bird –(B) Ossie is tall with respect to birds in general –e.g. you could use the “average bird” idea discussed in lecture 12

Homework 3 Summary –Exercise 1: 6pts –Exercise 2 (Possible Worlds): 8pts –Exercise 3 (Relative Clauses): 10pts –Exercise 4 (Adjectives): 6pts –TOTAL: 30 pts Extra Credit –Exercise 5: 10pts