LING/CSC/PSYC438/538
Lecture20SandiwayFong
1
538PresentaAons
Name Column1Last FirstRomeroDiaz DamianMuriel JorgePike AmmonJohnsonFarahnak FaridehLee PuayLengPatriciaBrown RachelSullivan TrevorXu Dongfang
• SofarI'vereceivedresponsesfromthefollowingpeople:
LastTimeCoursewebpage:g19.pl !Johnkickedtheball
themenkickedtheballamankickedtheball
PhraseStructureGrammars
• BerkeleyParser:Johnkickedtheball
PhraseStructureGrammars
• BerkeleyParser:themenkickedtheball
PhraseStructureGrammars
• BerkeleyParser:amankickedtheball
g19.pl
rejects
PhraseStructureGrammars
• BerkeleyParser:amenkickedtheball
ExtraArguments:Agreement
• Englishexhibitssubject-verbagreement
• Examples:– Johnkickedtheball– Themenkickedtheball– Johnkickstheballs– Themen*kicks/kicktheball
Constraint:1. -sformoftheverbiscompaAblewith3rdpersonsingular
onlyforthesubjectNP2. uninflectedformisnotcompaAblewith3rdpersonsingular
forthesubjectNP
SubjectVerbAgreement• WeneedfeaturepercolaAon:
eats*eat
Form Ending Commenteat uninflected not3rdperson
singulareats -s 3rdpersonsingularate -ed pasteaten -en pastparAcipleea;ng -ing gerund
Person !Number !
Ending !
SubjectandVPcometogetheratthisrule
Person !Number ! Ending !
POStags
SubjectVerbAgreement• ImplementaAon:usingPOStags
• Constrainttable:– % table of Person Number Tag possible combinations– table(3,plural,vb).– table(3,plural,vbd).– table(3,singular,vbz).– table(3,singular,vbd).
Person,NumberfromSubjectNP
POStagfromverb
Topics
• Mechanisms:1. ExtraargumentforPrologtermrepresentaAon
ofaparse2. Extraargumentsforfeaturevalueagreement3. Dealingwithle<recursiverules:grammar
transformaAon
Le_recursionandProlog
Le_recursivegrammars:• weknowfromanearlierlecturethatle_recursiverulesareano-nogivenProlog’sle_-to-rightdepth-firstcomputaAonrule…
• Example:1. s --> a, [!].2. a --> ba, [a]. 3. a --> a, [a].4. ba --> b, [a].5. b --> [b].
?- s([b,a,!],[]).ERROR: Out of local stack
s
a
a
a
a ...
PreposiAonPhrase(PP)Aeachment
• ThepreferredsyntacAcanalysisisale_recursiveparse• Examples:
– Johnsawtheboywithatelescope– (structuralambiguity:automaAcallyhandledbyProlog)
withpossessive
withinstrument
PreposiAonPhrase(PP)Aeachment
• ThepreferredsyntacAcanalysisisale_recursiveparseCan“stack”PPs:– JohnsawtheboywithalimpwithMarywithatelescope– ambiguity:withpossessive,withaccompaniment,withinstrument
PreposiAonPhraseAeachment• LinguisAcally:– PP(recursively)adjoinstoNPorVP– np(np(NP,PP)) --> np(NP), pp(PP).– vp(vp(VP,PP)) --> vp(VP), pp(PP).
• Le_recursiongivesPrologproblems• DerivaAon(top-down,le_-to-right):
1. vp2. vppp3. vppppp4. vppppppp5. vppppppppp infiniteloop…
otherextraargumentsnotshownhere…
TransformaAon
• ApplythegeneraltransformaAon:
• toNPandVPrules:1. np(np(DT,NN))-->dt(DT,Number),nn(NN,Number).2. np(np(NP,PP))-->np(NP),pp(PP).
3. vp(vp(VBD,NP))-->vbd(VBD),np(NP).4. vp(vp(VP,PP))-->vp(VP),pp(PP).
x(x(X,y))-->x(X),[y].x(x(z))-->[z].
[z]
[y]xx
x(X)-->[z],w(X,x(z)).x(x(z))-->[z].w(W,X)-->[y],w(W,x(X,y)).w(x(X,y),X)-->[y].
[z]
[y]xx
Note:wisafreshnon-terminalthattakes2arguments
xistherecursivenonterminal