16
LING 388: Language and Computers Sandiway Fong Lecture 17

LING 388: Language and Computers Sandiway Fong Lecture 17

Embed Size (px)

Citation preview

Page 1: LING 388: Language and Computers Sandiway Fong Lecture 17

LING 388: Language and Computers

Sandiway FongLecture 17

Page 2: LING 388: Language and Computers Sandiway Fong Lecture 17

Morphology: Plural inflection• Note:

– { … } allows the insertion of Prolog code into a grammar rule– atom_concat(A1,A2,A3) can concatenate atoms A1 and A2 to form A3, or

split A3 into left side A1 and right side A2

Root must already have an entry in the grammar

Saves us writing rules for regular plurals like rat/catbut it over-generates,e.g. man/men

Page 3: LING 388: Language and Computers Sandiway Fong Lecture 17

Last Time

• Two methods for encoding the lexical feature Number– (1) Renaming the matching nonterminal

• dt becomes dt_singular/dt_plural/dt_mass• nn becomes nn_singular/nn_plural/nn_mass

– (2) adding an extra argument with a Number variable• There’s a tradeoff: – number of rules vs. – extra complexity in terms of the number of arguments

Page 4: LING 388: Language and Computers Sandiway Fong Lecture 17

Last Time

Nonterminal renaming:dt dt_singular/plural/mass and nn nn_singular/plural/mass

Triple the numberof rules!

Page 5: LING 388: Language and Computers Sandiway Fong Lecture 17

Determiner Noun Agreement• Used an extra argument for nonterminals dt and nn to hold the value

of the Number featurenp(np(np(DT,NN),SBAR)) --> dt(DT,Number), nn(NN,Number), objrel_sbar(SBAR).np(np(np(DT,NN),SBAR)) --> dt(DT,Number), nn(NN,Number), subjrel_sbar(SBAR).empty_np(np(0)) --> [].complementizer(c(that)) --> [that].dt(dt(the),_) --> [the].dt(dt(a),singular) --> [a].nn(nn(man),singular) --> [man].nn(nn(men),plural) --> [men].nn(nn(rat),singular) --> [rat].nn(nn(cat),singular) --> [cat].nn(nn(Root-Suffix),plural) --> [Word],

{atom_concat(Root,Suffix,Word), nn(_,singular,[Root],[])}.nn(nn(cheese),mass) --> [cheese].suffix(plural) --> [-s].vbd(vbd(saw)) --> [saw].vbd(vbd(ate)) --> [ate].vbd(vbd(chased)) --> [chased].

Page 6: LING 388: Language and Computers Sandiway Fong Lecture 17

Today’s Topic

• We’ve implement English determiner-noun agreement– Uses the multiple argument strategy

• Subject-verb agreement is also necessary in English• Example:

– John eats cheese– *John eat cheese

Verb inflectional endingsExample:Form Ending Commenteat base not 3rd person singulareats -s 3rd person singularate -ed past(eaten) -en past participle(eating) -ing gerund

Page 7: LING 388: Language and Computers Sandiway Fong Lecture 17

Subject Verb AgreementExamples

1. John eats cheese2. *John eat cheese3. John ate cheese4. *I eats cheese5. I ate cheese6. I eat cheese7. *We eats cheese8. We eat cheese9. We ate cheese10. *You eats cheese11. You eat cheese12. You ate cheese13. He eats cheese14. *He eat cheese15. He ate cheese16. *They eats cheese17. They eat cheese18. They ate cheese

• Let’s modify the grammar to constrain this properly:– -s form of the verb is compatible with 3rd

person singular only for the subject NP– base form is not compatible with 3rd

person singular for the subject NP

Page 8: LING 388: Language and Computers Sandiway Fong Lecture 17

Bare Mass Nouns

• For sentences like:– John eats cheese

• we can add a NP rule to allow mass nouns to not require an accompanying determiner:

np(np(N)) --> nn(N,mass).

Page 9: LING 388: Language and Computers Sandiway Fong Lecture 17

Subject Verb Agreement

• What lexical features do we need to implement agreement?

eats*eat

Form EndingComment

eat base not 3rd person singular

eats -s3rd person singular

ate -edpast

(eaten) -enpast participle

(eating) -inggerund

PersonNumber

Ending

Subject and VP come together at this rule

PersonNumber Ending

Page 10: LING 388: Language and Computers Sandiway Fong Lecture 17

Subject Verb Agreement

• S NP VP rule:

not a non-terminal, but inside curly braces, a call to Prolog predicate checkSubjVerb/3

• Add database rules for checkSubjVerb/3 to make sure only compatible endings get through:

Form Ending Commenteat base not 3rd person singulareats -s 3rd person singularate -ed past(eaten) -en past participle(eating) -ing gerund

Page 11: LING 388: Language and Computers Sandiway Fong Lecture 17

Subject Verb Agreement

• Worry about other S NP VP rules later…

Page 12: LING 388: Language and Computers Sandiway Fong Lecture 17

Subject Verb Agreement

1. Need to modify NP rules to pass up the Person and Number features

2. Need to modify VP rules to pass up the Ending feature

eats*eat

PersonNumber

Ending

PersonNumber Ending

Page 13: LING 388: Language and Computers Sandiway Fong Lecture 17

Subject Verb Agreement

• Update np(Parse) np(Parse,Number,Person)

Page 14: LING 388: Language and Computers Sandiway Fong Lecture 17

Subject Verb Agreement

• Update vp(Parse) vp(Parse,Ending)

We could use the endings suggested earlier (-s, -ed, -en, -ing)or the POS tags:

Page 15: LING 388: Language and Computers Sandiway Fong Lecture 17

Subject Verb Agreement

• Implementation 1: use verb endings

Page 16: LING 388: Language and Computers Sandiway Fong Lecture 17

Subject Verb Agreement

• Implementation 2: use POS tags