LING 388: Language and Computers Sandiway Fong Lecture 20: 11/2.

Slides:



Advertisements
Similar presentations
LING 388: Language and Computers Sandiway Fong Lecture 23.
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.
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 24: 11/16.
LING 388: Language and Computers Sandiway Fong Lecture 15.
LING 388: Language and Computers Sandiway Fong Lecture 16: 10/20.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/12.
LING 364: Introduction to Formal Semantics Lecture 9 February 9th.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 9: 9/21.
LING 388: Language and Computers Sandiway Fong Lecture 15: 10/17.
LING 388: Language and Computers Sandiway Fong Lecture 21: 11/7.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/11.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 22: 11/15.
LING 388: Language and Computers Sandiway Fong Lecture 23: 11/14.
LING 388: Language and Computers Sandiway Fong Lecture 14: 10/13.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 9: 9/25.
LING 388: Language and Computers Sandiway Fong Lecture 6: 9/7.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 23: 11/20.
LING 388 Language and Computers Lecture 10 10/2/03 Sandiway FONG.
LING 388 Language and Computers Take-Home Final Examination 12/9/03 Sandiway FONG.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 2.
LING 388 Language and Computers Lecture 18 10/30/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 17: 10/25.
LING 388: Language and Computers Sandiway Fong Lecture 16: 10/19.
LING 388 Language and Computers Lecture 9 9/30/03 Sandiway FONG.
LING 388 Language and Computers Lecture 13 10/14/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 17: 10/24.
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 Sandiway Fong Lecture 19: 11/1.
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 22 11/8.
LING 388: Language and Computers Sandiway Fong Lecture 8.
11 CS 388: Natural Language Processing: Syntactic Parsing Raymond J. Mooney University of Texas at Austin.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
Embedded Clauses in TAG
1 Features and Unification Chapter 15 October 2012 Lecture #10.
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 27.
Grammar Rules- Agreement Within a sentence, subjects and verbs must agree. That means, if the subject is plural, the verb must be plural too. Within a.
LING 388: Language and Computers Sandiway Fong Lecture 7.
LING/C SC/PSYC 438/538 Lecture 14 Sandiway Fong. Administrivia Midterm – This Wednesday – A bit like doing a homework in real time – Bring your laptop.
LING 388: Language and Computers Sandiway Fong Lecture 15 10/13.
LING 388: Language and Computers Sandiway Fong Lecture 18.
LING 388: Language and Computers Sandiway Fong Lecture 26 11/22.
LING 388: Language and Computers Sandiway Fong Lecture 10.
LING 388: Language and Computers Sandiway Fong Lecture 19.
LING 388: Language and Computers Sandiway Fong Lecture 13.
11 Chapter 14 Part 1 Statistical Parsing Based on slides by Ray Mooney.
LING/C SC/PSYC 438/538 Lecture 26 Sandiway Fong. Administrivia 538 Presentations – Send me your choices if you haven’t already Thanksgiving Holiday –
LING 388: Language and Computers Sandiway Fong Lecture 20: 11/3.
Syntax III November 19, Sentences The basic phrase types include: NP, VP, AP, PP A basic sentence is an “inflectional phrase” (IP). The head of.
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 21.
LING 388: Language and Computers Sandiway Fong Lecture 25.
LING/C SC/PSYC 438/538 Lecture 20 Sandiway Fong 1.
LING 388: Language and Computers Sandiway Fong Lecture 16.
LING/C SC/PSYC 438/538 Lecture 18 Sandiway Fong. Adminstrivia Homework 7 out today – due Saturday by midnight.
1 Some English Constructions Transformational Framework October 2, 2012 Lecture 7.
LING 388: Language and Computers Sandiway Fong Lecture 20.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 22 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 24 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 26 Sandiway Fong.
Presentation transcript:

LING 388: Language and Computers Sandiway Fong Lecture 20: 11/2

Administrivia homework 6 –out today –usual rules –due next Thursday

Last Lab Class case study –how to implement the passive construction syntax of passives verb inflection: –constraint between auxiliary and main verbs: was eaten/*ate –(passive) be V-en –feature: Inflected Form (root,s,ed,en) optional by-phrase –adjunction VP →VP PP subject-verb agreement –feature: Number control left recursion in VP →VP PP –lookahead (by) –mark (loop count) s aux vp v np detn the ball hit was vppp p np byme s aux vp v np detn the ball hit was s aux vp v np detn the ball balls hit was were

Assume Grammar Grammar at the end of Lecture 18 with “some bells and whistles” 1.s(s(Y,Z)) --> np(Y,Number), vp(Z,Number). 2.np(np(Y),_) --> pronoun(Y). 3.np(np(Y),sg) --> proper_noun(Y). 4.np(np(Y),pl) --> common_noun (Y,pl). 5.np(np(D,N),Number) --> det(D,Number), common_noun(N,Number). 6.det(det(the),_) --> [the]. 7.det(det(a),sg) --> [a]. 8.common_noun(n(X),sg) --> [X], {member(X,[ball,man,apple])}. 9.common_noun(n(balls),pl) --> [X], {member(X,[balls,men,apples])}. 10.pronoun(i) --> [i]. 11.pronoun(we) --> [we]. 12.pronoun(me) --> [me]. 13.proper_noun(john) --> [john]. 14.pp(pp(P,NP)) --> preposition(P), np(NP,_). 15.preposition(p(by)) --> [by,mark]. 16.vp(vp(A,V),Number) --> aux(A,Number), transitive(V,en). 17.vp(vp(Y),_) --> unergative(Y). 18.vp(vp(Y,Z),_) --> transitive(Y,_), np(Z,_). 19.vp(vp(A,B),Number, L1, L2) :- append(Left,[by|Right],L1), \+ Right = [mark|_], append(Left,[by,mark|Right],L1p), vp(A, Number, L1p, L3), pp(B, L3, L2). 20.unergative(v(ran)) --> [ran]. 21.transitive(v(hit),_) --> [hit]. 22.transitive(v(eat),root) --> [eat]. 23.transitive(v(eats),s) --> [eats]. 24.transitive(v(ate),ed) --> [ate]. 25.transitive(v(eaten),en) --> [eaten]. 26.aux(aux(was),sg) --> [was]. 27.aux(aux(were),pl) --> [were].

Exercise 0 Task 1 –load grammar into Prolog –test it –Example: ?- s(X,[the,ball,was,hit,by,john],[]). X = s(np(det(the),n(ball)),vp(vp(aux(was),v(hi t)),pp(p(by),np(john)))) ? ; no note that it doesn’t go into an infinite loop (despite the left recursion) when you ask for more answers

Exercise 0 Task 2 –the NP system here has several new features membership list for singular and plural nouns bare plurals –Example John eats apples –But the agreement system is incomplete –np(np(Y),_) --> pronoun(Y). 1.np(np(Y),_) --> pronoun(Y). 2.np(np(Y),sg) --> proper_noun(Y). 3.np(np(Y),pl) --> common_noun (Y,pl). 4.np(np(D,N),Number) --> det(D,Number), common_noun(N,Number). 5.det(det(the),_) --> [the]. 6.det(det(a),sg) --> [a]. 7.common_noun(n(X),sg) --> [X], {member(X,[ball,man,apple])}. 8.common_noun(n(X),pl) --> [X], {member(X,[balls,men,apples]) }. 9.pronoun(i) --> [i]. 10.pronoun(we) --> [we]. 11.pronoun(me) --> [me]. 12.proper_noun(john) --> [john].

Exercise 0 Task 3 –But the agreement system is incomplete –np(np(Y),_) --> pronoun(Y). –pronoun NP rule does not constrain number –Examples John eats apples *I eats apples *We eats apples He eats apples They eat apple –Let’s add rules to constrain this properly –Note: need to add rules for words he and they 1.np(np(Y),_) --> pronoun(Y). 2.np(np(Y),sg) --> proper_noun(Y). 3.np(np(Y),pl) --> common_noun (Y,pl). 4.np(np(D,N),Number) --> det(D,Number), common_noun(N,Number). 5.det(det(the),_) --> [the]. 6.det(det(a),sg) --> [a]. 7.common_noun(n(X),sg) --> [X], {member(X,[ball,man,apple])}. 8.common_noun(n(balls),pl) --> [X], {member(X,[balls,men,apples])}. 9.pronoun(i) --> [i]. 10.pronoun(we) --> [we]. 11.pronoun(me) --> [me]. 12.proper_noun(john) --> [john].

Exercise 0 Task 3 –Examples John eats apples *I eats apples *We eats apples He eats apples They eat apple –Let’s modify the grammar to constrain this properly -s form of the verb is compatible with 3rd person singular only Hint: we have to do feature propagation transitive(v(eat),root) --> [eat]. transitive(v(eats),s) --> [eats]. transitive(v(ate),ed) --> [ate]. transitive(v(eaten),en) --> [eaten]. 1.np(np(Y),_) --> pronoun(Y). 2.np(np(Y),sg) --> proper_noun(Y). 3.np(np(Y),pl) --> common_noun (Y,pl). 4.np(np(D,N),Number) --> det(D,Number), common_noun(N,Number). 5.det(det(the),_) --> [the]. 6.det(det(a),sg) --> [a]. 7.common_noun(n(X),sg) --> [X], {member(X,[ball,man,apple])}. 8.common_noun(n(balls),pl) --> [X], {member(X,[balls,men,apples])}. 9.pronoun(i) --> [i]. 10.pronoun(we) --> [we]. 11.pronoun(me) --> [me]. 12.proper_noun(john) --> [john].

Exercise 0 Modified rules for the NP system are given on the right Summary –Pronouns must report number and person features –These features must in turn be reported by NP –NP rules therefore have 3 extra arguments: (1) parse tree, (2) number, and (3) person –Every reference to NP in the grammar needs to have 3 extra arguments 1.np(np(Y),Num,Per) --> pronoun(Y,Num,Per). 2.np(np(Y),sg,3) --> proper_noun(Y). 3.np(np(Y),pl,3) --> common_noun (Y,pl). 4.np(np(D,N),Number,3) --> det(D,Number), common_noun(N,Number). 5.det(det(the),_) --> [the]. 6.det(det(a),sg) --> [a]. 7.common_noun(n(X),sg) --> [X], {member(X,[ball,man,apple])}. 8.common_noun(n(balls),pl) --> [X], {member(X,[balls,men,apples])}. 9.pronoun(i,sg,1) --> [i]. 10.pronoun(we,pl,1) --> [we]. 11.pronoun(me,sg,1) --> [me]. 12.proper_noun(john) --> [john].

Exercise 0 Modified rules for the VP system are given on the right Summary –verbs must report the Inflection feature –the VP nonterminal must have 3 extra arguments to report: (1) parse tree, (2) number, and (3) inflection 14.vp(vp(A,V),Number,_) --> aux(A,Number), transitive(V,en). 15.vp(vp(Y),_,_) --> unergative(Y). 16.vp(vp(Y,Z),_,Infl) --> transitive(Y,Infl), np(Z,_,_). 17.vp(vp(A,B),Number, Infl, L1, L2) :- append(Left,[by|Right],L1), \+ Right = [mark|_], append(Left,[by,mark|Right],L 1p), vp(A, Number, Infl, L1p, L3), pp(B, L3, L2).

Exercise 0 Constraint is at the top level Modified S rule is shown on the right Summary –a call is made to a Prolog predicate p3sg (person 3rd singular) from S –it must be enclosed in curly braces it’s not a nonterminal it’s a Prolog goal –p3sg takes 3 arguments (1) Number from the subject NP (2) Person from the subject NP (3) Inflection feature from the VP and imposes the constraint that Number and Person must be singular ( s ) and 3rd ( 3 ), respectively, when Inflection == s ( == means “identical to”: here, the variable Inflection must be instantiated to s, if the variable Inflection is still a variable, Inflection == s fails) s(s(Y,Z)) --> np(Y,Number,Person), vp(Z,Number,Inflection), {p3sg(Number,Person,Inflection)}. p3sg(Number,Person,Inflection) :- Inflection == s -> Number = sg, Person = 3 ; true. Notes: true is always true (always succeeds) the if-then-else programming construct is used here. Syntax: If -> Then ; Else

Question 1 there is a Case Constraint on pronouns examples –I hit the ball(active with subject pronoun) –*me hit the ball –the ball hit me(active with object pronoun) –*the ball hit I –the ball was hit(passive) –I was hit –*me was hit –the ball was hit by me(passive + subject in by-phrase) –*the ball was hit by I (8pts) modify the grammar to handle the examples above –give the grammar rules –show the parses for the grammatical cases –show the parser rejects the ungrammatical cases

Question 2 other verbal morphology constraints progressive be takes -ing –rule: (progressive) be V-ing –examples I was eating dinner *I was ate dinner progressive + passive –rule: (progressive) be be-ing V+en –examples dinner was being eaten (progressive passive) *dinner was been eating(*passive progressive) (6pts) modify the grammar to handle the examples above –give the grammar rules –show the parses for the grammatical cases –show the parser rejects the ungrammatical cases –note: need to add the rule for noun “dinner” s aux vp np n was dinner aux vp being v eaten

Question 3 new constructions double objects –John gave [ NP Mary] [ NP a book] –*John gave [ NP a book][ NP Mary] –John gave [ NP a book] [ PP to Mary] –*John donated [ NP Mary] [ NP a book] –*John donated [ NP a book][ NP Mary] –John donated [ NP a book] [ PP to Mary] (6pts) modify the grammar to handle give and donate –give the grammar rules –show the parses for the grammatical cases –show the parser rejects the ungrammatical case –hint: use ternary branching for the verb plus two objects s v vp np john gavemary np detn booka

Summary Question 1: Case constraint on pronouns (8pts) Question 2: progressive be morphological constraint (6pts) Question 3: double object constructions for give and donate (6pts) Total: 20 pts