180 likes | 291 Views
This lecture covers the implementation of passive constructions in natural language processing, focusing on verb inflection and the intricacies of subcategorization and adjuncts. We explore case studies to illustrate how to apply rules for transitive verbs and discuss constraints on auxiliary and main verbs. The presentation will also address context-free grammars (CFG) and demonstrate how to construct parse trees that respect determiner-noun agreement. A practical example will facilitate understanding of passive morphology within Prolog.
E N D
LING 388: Language and Computers Sandiway Fong Lecture 12: 10/6
Administrivia • Computer Laboratory Class • next Monday (11th October) • homework #3 will be handed out • meet in SBS 224, Instructional Computing Lab (not here)
Last Time • Context-Free Grammars (CFG) • extra arguments • used to implement determiner-noun agreement • as well as to hold a parse tree
Today’s Topic • Case study • How to implement the passive construction • verb inflection • constraints between auxiliary and main verbs • subcategorization and adjuncts
Example Grammar • Grammar rules so far including extra arguments for parse tree and determiner-noun agreement • s(s(Y,Z)) --> np(Y), vp(Z). • np(np(Y)) --> pronoun(Y). • np(np(D,N)) --> det(D,Number), common_noun(N,Number). • det(det(the),_) --> [the]. • det(det(a),sg) --> [a]. • common_noun(n(ball),sg) --> [ball]. • common_noun(n(man),sg) --> [man]. • common_noun(n(men),pl) --> [men]. • pronoun(i) --> [i]. • pronoun(we) --> [we]. • vp(vp(Y)) --> unergative(Y). • vp(vp(Y,Z)) --> transitive(Y), np(Z). • unergative(v(ran)) --> [ran]. • transitive(v(hit)) --> [hit]. • Query: • ?- s(X,Sentence,[]). Sentence = Prolog list
Passivization • In English... • Applies only to transitive verbs • I hit the ball (active) • the ball was hit (passive) • transitive(v(hit)) --> [hit]. • i.e. passivization should only apply to verb encoded in the grammar using the transitive non-terminal • I arrived/*I was arrived • unaccusative(v(arrived)) --> [arrived]. • We ran/*We were ran • unergative(v(ran)) --> [ran].
s np vp s v np i det n vp hit the ball aux v np det n was hit the ball Passivization • Phrase Structure: • I hit the ball (active) • the ball was hit (passive) (non-movement account)
s vp aux v np det n was hit the ball Passivization • Phrase Structure: • the ball was hit (passive) • Rules (active sentence) • s(s(Y,Z)) --> np(Y), vp(Z). • vp(vp(Y,Z)) --> transitive(Y), np(Z). • transitive(v(hit)) --> [hit]. • New Rules (passive sentence) • vp(vp(A,V)) --> aux(A), transitive(V). • aux(aux(was)) --> [was].
Passivization • s(s(Y,Z)) --> np(Y), vp(Z). • np(np(Y)) --> pronoun(Y). • np(np(D,N)) --> det(D,Number), common_noun(N,Number). • det(det(the),_) --> [the]. • det(det(a),sg) --> [a]. • common_noun(n(ball),sg) --> [ball]. • common_noun(n(man),sg) --> [man]. • common_noun(n(men),pl) --> [men]. • pronoun(i) --> [i]. • pronoun(we) --> [we]. • vp(vp(A,V)) --> aux(A), transitive(V). • vp(vp(Y)) --> unergative(Y). • vp(vp(Y,Z)) --> transitive(Y), np(Z). • unergative(v(ran)) --> [ran]. • transitive(v(hit)) --> [hit]. • aux(aux(was)) --> [was]. • Query • ?- s(X,[the,ball,was,hit],[]). • Computation tree • ?- s(X,[the,ball,was,hit],[]). • ?- np(Y,[the,ball,was,hit],L). • ?- vp(Z,L,[]). • ?- np(Y,[the,ball,was,hit],L). • Y=np(det(the),n(ball)) L=[was,hit] • ?- vp(vp(A,V),[was,hit],[]). • ?- aux(A,[was,hit],L’). • ?- transitive(V,L’,[]). • ?- aux(A,[was,hit],L’). • A=aux(was) L’=[hit] • ?- transitive(V,[hit],[]). • V=v(hit) • X=s(np(det(the),n(ball)),vp(aux(was),v(hit)))
Passive Morphology • Verbal inflection • eat • eats (-s) • ate (-ed) • eaten (-en) • Verbal inflection and passive morphology • Rule: (passive) be V-en • was hit (ambiguous between -ed and -en) • *was ate (-ed) • was eaten (-en) • How to implement this restriction? • vp(vp(A,V)) --> aux(A), transitive(V). • Idea: • use an extra argument for transitive Other rules (progressive) be V-ing e.g. was eating
Passive Morphology • Verbal inflection • eat (root) • eats (-s) • ate (-ed) • eaten (-en) • Use an argument to signal the inflected form • Rules for eat • transitive(v(eat),root) --> [eat]. • transitive(v(eats),s) --> [eats]. • transitive(v(ate),ed) --> [ate]. • transitive(v(eaten),en) --> [eaten]. • Original Rule • vp(vp(A,V)) --> aux(A), transitive(V). • Modified Rule • vp(vp(A,V)) --> aux(A), transitive(V,en). Constraint for -en realized by Prolog pattern-matching
Passive Morphology • Rules (Partial) • transitive(v(eat),root) --> [eat]. • transitive(v(eats),s) --> [eats]. • transitive(v(ate),ed) --> [ate]. • transitive(v(eaten),en) --> [eaten]. • vp(vp(A,V)) --> aux(A), transitive(V,en). • aux(aux(was)) --> [was]. • Query • ?- vp(X,[was,eaten],[]). • Computation tree • ?- vp(X,[was,eaten],[]). X=vp(A,V) • ?- aux(A,[was,eaten],L). • ?- transitive(V,en,L,[]). • ?- aux(A,[was,eaten],L). • A=aux(was) L=[eaten] • ?- transitive(V,en,[eaten],[]). • V=v(eaten)
Passive Morphology • Rules (Partial) • transitive(v(eat),root) --> [eat]. • transitive(v(eats),s) --> [eats]. • transitive(v(ate),ed) --> [ate]. • transitive(v(eaten),en) --> [eaten]. • vp(vp(A,V)) --> aux(A), transitive(V,en). • aux(aux(was)) --> [was]. • Query • ?- vp(X,[was,ate],[]). • Computation tree • ?- vp(X,[was,ate],[]). X=vp(A,V) • ?- aux(A,[was,ate],L). • ?- transitive(V,en,L,[]). • ?- aux(A,[was,ate],L). • A=aux(was) L=[ate] • ?- transitive(V,en,[ate],[]). • No
s vp np aux v vp pp det n was the ball hit np p by me Subject in By-Phrase • Phrase Structure: • I hit the ball (active) • the ball was hit (passive) • the ball was hit by me (passive + subject in by-phrase) preposition phrase (pp) is adjoined to the verb phrase (vp)
s vp np aux v vp pp det n was the ball hit np p by me Subject in By-Phrase • Phrase Structure: • I hit the ball (active) • the ball was hit (passive) • the ball was hit by me (passive + subject in by-phrase) • PP rules • pp(pp(P,NP)) --> preposition(P), np(NP). • preposition(p(by)) --> [by]. • VP adjunction rule • vp(vp(VP,PP)) --> vp(VP), pp(PP). • Pronoun rule • np(np(Y)) --> pronoun(Y). • pronoun(i) --> [i]. • pronoun(we) --> [we]. • pronoun(me) --> [me]. • Case Constraint (not implemented here) • by me • *by I • *me hit the ball
s vp aux v np det n were hit the balls Other Constraints • Examples: • I hit the ball (active) • the ball was hit (passive) • the ball was hit by me (passive + subject in by-phrase) • *the ball were hit by me • *the balls was hit by me • the balls were hit by me • Subject-Verb Agreement Rule • subject must agree with the verb for number • np(np(D,N)) --> det(D,Number), common_noun(N,Number). • common_noun(n(ball),sg) --> [ball]. • common_noun(n(balls),pl) --> [balls]. • np(np(D,N),Number) --> det(D,Number), common_noun(N,Number).
s vp aux v np det n were pl hit the balls pl Other Constraints • Examples: • the ball was hit by me (passive + subject in by-phrase) • *the ball were hit by me • *the balls was hit by me • the balls were hit by me • Subject-Verb Agreement Rule • subject must agree with the verb for number • np(np(D,N),Number) --> det(D,Number), common_noun(N,Number). common_noun(n(ball),sg) --> [ball]. • common_noun(n(balls),pl) --> [balls]. • s(s(Y,Z)) --> np(Y,Number), vp(Z). • s(s(Y,Z)) --> np(Y,Number), vp(Z,Number).
Next Time • We will practice implementing natural language constraints in the laboratory session • like the morphological case constraint • like the subject-verb agreement constraint