310 likes | 430 Views
LING 388: Language and Computers. Sandiway Fong Lecture 21. Administrivia. Homework 6 graded Reminder Exercise 4 from Thursday is Extra Credit Homework 7 d ue today. Homework 6 Review. Question 1: Object relative clauses. Need to call checkNPVP here. 3 rd person singular VBZ.
E N D
LING 388: Language and Computers Sandiway Fong Lecture 21
Administrivia • Homework 6 graded • Reminder • Exercise 4from Thursday is Extra Credit Homework 7 • due today
Homework 6 Review • Question 1: Object relative clauses Need to call checkNPVP here 3rd person singular VBZ 3rd person singular VB 3rd person singular VBP
Homework 6 Review • Code: • Sample runs:
Homework 6 Review • Question 2: s_infl1 + checkNPVP: 3rd person singular VB
Homework 6 Review • Question 2: s_infl1 + checkNPVP • Code: or checkNPVP(_,_,vb).
Homework 6 Review • Question 2: s_infl1 + checkNPVP • Code: or checkNPVP(_,_,vb). • There’s a problem with allowing Ending= vb into checkNPVP: 3rd person singular VB
Homework 6 Review • Question 2: s_infl1 without checkNPVP: Idea: only tensed clauses call checkNPVP, untensed clauses don’t
Homework 6 Review • Question 2: s_infl1 without checkNPVP: Can set Ending to vb (uninflected form of the verb) But not strictly necessary since Ending will be set to vb below…
Homework 6 Review • Question 3: • checkNPVP must apply for empty NP subjects
Homework 6 Review • Question 3: • checkNPVP must apply for empty NP subjects • Code: • All rules that call empty_np previously with 1 argument must be updated to call empty_np with 3 arguments:
Homework 6 Review • Sample Runs: • Assuming we have the inflected forms for see:
Homework 6 Review • Extra Credit Question 4: • Number and Person feature warnings: It means that variables Number and Person are only mentioned once in the rule (= singleton variable)
Homework 6 Review • Extra Credit Question 4: • checkNPVP is not called in rules for s_infl1 and s_infl2 • So Number and Person produced by np and empty_np are not used • That means we can replace them by an underscore • (the anonymous variable)
Homework 6 Review • Extra Credit Question 4 • Code: Ending too! Code looks a bit more informative if underscore is prepended to the variable name
Homework 6 Review • Extra Credit Question 4 • Code: In English, we don’t check V and object agreement
Homework 6 Review • Extra Credit Question 4 • Remaining warnings:
Homework 6 Review • Extra Credit Question 4 • Remaining warnings:
Homework 6 Review • Extra Credit Question 4 • Remaining warnings: • All warnings eliminated:
g21.pl • From the course website, incorporates: • Homework 6 checkNPVP solutions • Perfective have, progressive be and passive be • A few excerpts..
g21.pl • S rules: checkNPVP for tensed verbs
g21.pl • checkNPVP: vbp_m, vbp_r, vbd_sg, vbd_pl for be
g21.pl • S rules: v_aux (be), v_aux2 (have)
g21.pl • S rules: v_aux (be), v_aux2 (have)
Case Constraint • there is a Case Constrainton pronouns • examples • I ate the sandwich(active with subject pronoun) • *me ate the sandwich • the boy saw me (active with object pronoun) • *the boy saw I • the sandwich was eaten (passive) • *the sandwich was ate • the sandwich was eaten by me (passive + subject in by-phrase) • *the sandwich was eaten by I • Let’s modify the grammar to handle the above examples in class
Case Constraint • We need to add a lexical feature Case to all NPs Since common and proper nouns can appear in any position, we leave Case unrestricted, i.e. set the value of Case to be the anonymous variable (_) for those NPs
Case Constraint • We need to update the lexical entries for pronouns to report the value of Case Values: nom Nominative acc Accusative • Also add accusative Case versions of the pronouns
Case Constraint • NPs are inserted as subject and object of clauses (also objects of prepositions) nom nom Values: nom Nominative acc Accusative Values: nom Nominative Subject positions acc Accusative Object positions
Case Constraint • NPs are inserted as subject and object of clauses (also objects of prepositions) acc acc acc Values: nom Nominative Subject positions acc Accusative Object positions
PP by-Phrase • Example: • The sandwich had been eaten by me/him/*I/*he • Parse? acc • Only one by-phrase (agent) is allowed • It attaches to the vbn (-en) verb following passive be in the Stanford Parser
PP by-Phrase • Modify the v_aux rule rule associated with passive be: • Desired output: