1 / 31

LING 388: Language and Computers

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.

joanne
Download Presentation

LING 388: Language and Computers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LING 388: Language and Computers Sandiway Fong Lecture 21

  2. Administrivia • Homework 6 graded • Reminder • Exercise 4from Thursday is Extra Credit Homework 7 • due today

  3. 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

  4. Homework 6 Review • Code: • Sample runs:

  5. Homework 6 Review • Question 2: s_infl1 + checkNPVP: 3rd person singular VB

  6. Homework 6 Review • Question 2: s_infl1 + checkNPVP • Code: or checkNPVP(_,_,vb).

  7. 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

  8. Homework 6 Review • Question 2: s_infl1 without checkNPVP: Idea: only tensed clauses call checkNPVP, untensed clauses don’t

  9. 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…

  10. Homework 6 Review • Question 3: • checkNPVP must apply for empty NP subjects

  11. 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:

  12. Homework 6 Review • Sample Runs: • Assuming we have the inflected forms for see:

  13. 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)

  14. 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)

  15. Homework 6 Review • Extra Credit Question 4 • Code: Ending too! Code looks a bit more informative if underscore is prepended to the variable name

  16. Homework 6 Review • Extra Credit Question 4 • Code: In English, we don’t check V and object agreement

  17. Homework 6 Review • Extra Credit Question 4 • Remaining warnings:

  18. Homework 6 Review • Extra Credit Question 4 • Remaining warnings:

  19. Homework 6 Review • Extra Credit Question 4 • Remaining warnings: • All warnings eliminated:

  20. g21.pl • From the course website, incorporates: • Homework 6 checkNPVP solutions • Perfective have, progressive be and passive be • A few excerpts..

  21. g21.pl • S rules: checkNPVP for tensed verbs

  22. g21.pl • checkNPVP: vbp_m, vbp_r, vbd_sg, vbd_pl for be

  23. g21.pl • S rules: v_aux (be), v_aux2 (have)

  24. g21.pl • S rules: v_aux (be), v_aux2 (have)

  25. 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

  26. 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

  27. 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

  28. 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

  29. 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

  30. 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

  31. PP by-Phrase • Modify the v_aux rule rule associated with passive be: • Desired output:

More Related