1 / 22

LING 388: Language and Computers

LING 388: Language and Computers. Sandiway Fong Lecture 15 10/13. Administrivia. Reminder Homework 5 due next Monday. Today’s Topic. case study How to implement the passive construction in a traditional grammar framework verb inflection constraints between auxiliary and main verbs

yan
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 15 10/13

  2. Administrivia • Reminder • Homework 5 due next Monday

  3. Today’s Topic • case study • How to implement the passive construction in a traditional grammar framework • verb inflection • constraints between auxiliary and main verbs • subcategorization and adjuncts

  4. Example Grammar • grammar so far • including extra arguments for parse tree • and simple 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 of words all rules take one extra argument for the parse tree however det and common_noun take two extra arguments: one for the parse tree and one for Number verb classes only one extra argument for the parse tree

  5. in English... passivization 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 verbs encoded in the grammar using the transitive non-terminal not for unaccusative or unergative verbs I arrived *I was arrived unaccusative(v(arrived)) --> [arrived]. We ran *We were ran/run unergative(v(ran)) --> [ran]. Passivization

  6. s np vp s v np i det n vp hit np ball the aux v det n ball the was hit Passivization • simple phrase structure • I hit the ball (active) • the ball was hit (passive) A first pass (simplistic non-movement account) • avoiding empty categories for simplicity (can be added, see later slide): • the ball was hit e • [the ball]i was hit ti

  7. s vp np aux v det n ball the was hit 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].

  8. Passivization • 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))) 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].

  9. Passivization • We are (free to) modify the parse for the VP constituent to include items not found in the input • sometimes this can be very useful • e.g. there are good linguistic reasons why we might prefer to write • vp(vp(Aux,vp(V,np(trace))),Number) --> aux(Aux,Number), transitive(V,Ending), {Ending = en}. instead, which produces: s vp np vp aux det n v np ball the was hit trace

  10. Passive Morphology other morphological rules (progressive) be V-ing e.g. was eating (passive+progressive) e.g. was being eaten • verbal inflection • hit eat • hits eats (-s) • hit ate (-ed) • hit 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 to indicate the verb form fortransitive

  11. Passive Morphology • verbal inflection • eat (root) • eats (-s) • ate (-ed) • eaten (-en) • use an extra argument to signal the inflected form, e.g. • transitive(v(eat),root) --> [eat]. • transitive(v(eat-s),s) --> [eats]. • transitive(v(eat-ing),ing) --> [eating]. • transitive(v(eat-ed),ed) --> [ate]. • transitive(v(eat-en),en) --> [eaten]. • original rule • vp(vp(A,V)) --> aux(A), transitive(V). • modified rule • vp(vp(A,V)) --> aux(A), transitive(V,en). equivalently vp(vp(A,V)) --> aux(A), transitive(V,Ending),{Ending=en}. Constraint for -en realized by Prolog pattern-matching

  12. Passive Morphology • grammar 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) example: was eaten

  13. attempted match fails Passive Morphology • grammar 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 example: *was ate

  14. s s vp np np vp aux v det n det n vp pp ball the was hit ball the aux v p np was hit 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) optional prepositional phrase (PP) is adjoined to the verb phrase (VP)

  15. s np vp det n vp pp ball the aux v p np was hit 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) • add PP rules • pp(pp(P,NP)) --> preposition(P), np(NP). • preposition(p(by)) --> [by]. • add VP adjunction rule • vp(vp(VP,PP)) --> vp(VP), pp(PP). • add pronoun rule • np(np(Y)) --> pronoun(Y). • pronoun(i) --> [i]. • pronoun(we) --> [we]. • pronoun(me) --> [me]. • there is a Case Constraint • (not implemented here) • by me • *by I • *me hit the ball

  16. s vp np aux v det n ball balls the was were hit Other Constraints • examples • I hit the ball (active) • the ball was hit (passive) • the ball was hit by me (passive + 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).

  17. s number vp np number number number aux v det n ball balls the was were hit Other Constraints • examples • the ball was hit by me (passive + 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 • must propagate number feature up the tree! • 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). number • s(s(Y,Z)) --> np(Y,Number), vp(Z,Number).

  18. Grammar so far • new additions today • verbal inflection and passive morphology • (passive) be V-en • PP by-phrase • “by me” • Subject-Verb Agreement Rule • “the ball/balls was/were” • grammar is still not fully implemented • see underscores “-” for Subject-Verb Agreement s(s(Y,Z)) --> np(Y,Number), vp(Z,Number). np(np(Y),_) --> pronoun(Y). np(np(D,N),Number) --> 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(balls),pl) --> [balls]. common_noun(n(man),sg) --> [man]. common_noun(n(men),pl) --> [men]. pronoun(i) --> [i]. pronoun(we) --> [we]. pronoun(me) --> [me]. pp(pp(P,NP)) --> preposition(P), np(NP,_). preposition(p(by)) --> [by]. vp(vp(VP,PP),_) --> vp(VP,_), pp(PP). vp(vp(A,V),Number) --> aux(A,Number), transitive(V,en). vp(vp(Y),_) --> unergative(Y). vp(vp(Y,Z),_) --> transitive(Y,_), np(Z,_). unergative(v(ran)) --> [ran]. transitive(v(hit),_) --> [hit]. transitive(v(eat),root) --> [eat]. transitive(v(eats),s) --> [eats]. transitive(v(ate),ed) --> [ate]. transitive(v(eaten),en) --> [eaten]. aux(aux(was),sg) --> [was]. aux(aux(were),pl) --> [were].

  19. Grammar built in class: Part 1 • s(s(Y,Z)) --> np(Y,Num1), vp(Z,Num2), {Num1 = Num2}. % Partial Subject-Verb agreement • np(np(Y),Number) --> pronoun(Y,Number). • np(np(D,N),Number) --> det(D,Number), common_noun(N,Number). • det(det(the),_) --> [the]. • det(det(a),sg) --> [a]. • common_noun(n(apple),sg) --> [apple]. • common_noun(n(ball),sg) --> [ball]. • common_noun(n(man),sg) --> [man]. • common_noun(n(men),pl) --> [men]. • pronoun(i,sg) --> [i]. • pronoun(we,pl) --> [we]. • pronoun(me,sg) --> [me]. • vp(vp(Y),_) --> unergative(Y). • vp(vp(Y,Z),_) --> transitive(Y,_), np(Z,_). • vp(vp(Aux,vp(V,np(trace))),Number) --> aux(Aux,Number), transitive(V,Ending), {Ending = en}. • vp(vp(VP,NP),Number) --> vp(VP,Number), pp(NP).

  20. Grammar built in class: Part 2 • unergative(v(ran)) --> [ran]. • transitive(v(hit),root) --> [hit]. • transitive(v(hit-s),s) --> [hits]. • transitive(v(hit-ing),ing) --> [hitting]. • transitive(v(hit-ed),ed) --> [hit]. • transitive(v(hit-en),en) --> [hit]. • transitive(v(eat),root) --> [eat]. • transitive(v(eat-ing),ing) --> [eating]. • transitive(v(eat-s),s) --> [eats]. • transitive(v(eat-ed),ed) --> [ate]. • transitive(v(eat-en),en) --> [eaten]. • aux(aux(was),sg) --> [was]. • aux(aux(was),pl) --> [were]. • pp(pp(P,NP)) --> p(P), np(NP,_). • p(p(by)) --> [by].

  21. Outstanding issues • The relative order of the VP rules is critical e.g. what happens when the rule vp(vp(VP,PP),Number) --> vp(VP,Number), pp(PP). is moved around in the program for the following query? ?-s(X,[the,balls,were,hit,by,me],[]). • how to block recursion (iteration) for *the balls were hit by me by the man? ?- s(X,[the,balls,were,hit,by,me,by,the,man],[]). • would (less linguistically desirable) ternary branching for the VP adjunct work better computationally? e.g. vp(vp(A,V,PP)) --> aux(A), transitive(V,en), pp(PP).

  22. More to come… • Grammar also has infinite loops, i.e. does not terminate properly • We’ll fix these issues next time

More Related