ling 388: language and computers sandiway fong lecture 17

Post on 11-Jan-2016

216 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

LING 388: Language and Computers

Sandiway FongLecture 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

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

Last Time

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

Triple the numberof rules!

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

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

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

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

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

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

Subject Verb Agreement

• Worry about other S NP VP rules later…

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

Subject Verb Agreement

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

Subject Verb Agreement

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

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

Subject Verb Agreement

• Implementation 1: use verb endings

Subject Verb Agreement

• Implementation 2: use POS tags

top related