LING 388: Language and Computers Sandiway Fong Lecture 24: 11/16.

Slides:



Advertisements
Similar presentations
Lecture 3a Clause functions Adapted from Mary Laughren.
Advertisements

LING 388: Language and Computers Sandiway Fong Lecture 23.
Review of Homework 4 November 20, Exercise 1 (A) 1 pt Modify the DCG to accept the omission of the complementizer that for object relative clauses.
LING/C SC/PSYC 438/538 Lecture 22 Sandiway Fong 1.
LING 388: Language and Computers Sandiway Fong Lecture 15: 10/18.
LING 388: Language and Computers Sandiway Fong Lecture 22.
LING 388: Language and Computers Sandiway Fong Lecture 23 11/10.
LING 388: Language and Computers Sandiway Fong Lecture 28 12/1.
Wh-movement movement of question words. Two kinds of Questions n Yes/No questions: –Did you see the octopus?yes/no/*dog –Have you eaten yet?yes/no/*apple.
Long Distance Dependencies (Filler-Gap Constructions) and Relative Clauses October 10, : Grammars and Lexicons Lori Levin (Examples from Kroeger.
LING 388: Language and Computers Sandiway Fong Lecture 24 11/15.
LING 388: Language and Computers Sandiway Fong Lecture 15.
Natural Language Processing - Feature Structures - Feature Structures and Unification.
LING 388: Language and Computers Sandiway Fong Lecture 16: 10/20.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 10: 9/27.
LING 388: Language and Computers Sandiway Fong Lecture 27: 12/1.
LING 388: Language and Computers Sandiway Fong Lecture 15: 10/17.
LING 388: Language and Computers Sandiway Fong Lecture 21: 11/7.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 22: 11/15.
LING 388: Language and Computers Sandiway Fong Lecture 20: 11/2.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
LING 388: Language and Computers Sandiway Fong Lecture 23: 11/14.
LING 388: Language and Computers Sandiway Fong Lecture 14: 10/13.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 9: 9/25.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
LING 388: Language and Computers Sandiway Fong Lecture 27: 11/30.
LING 388 Language and Computers Lecture 10 10/2/03 Sandiway FONG.
LING 388 Language and Computers Lecture 20 11/6/03 Sandiway FONG.
LING 388 Language and Computers Lecture 18 10/30/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 26: 11/28.
LING 388: Language and Computers Sandiway Fong Lecture 17: 10/25.
LING 388: Language and Computers Sandiway Fong Lecture 25: 11/21.
LING 388: Language and Computers Sandiway Fong Lecture 16: 10/19.
LING 388 Language and Computers Lecture 13 10/14/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 17: 10/24.
LING 364: Introduction to Formal Semantics Lecture 5 January 26th.
LING 388: Language and Computers Sandiway Fong Lecture 13: 10/10.
LING 388: Language and Computers Sandiway Fong Lecture 19: 11/1.
LING 388 Language and Computers Lecture 12 10/9/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 22 11/8.
CAS LX 522 Syntax I Week 11a. Wh-movement.
11 CS 388: Natural Language Processing: Syntactic Parsing Raymond J. Mooney University of Texas at Austin.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
LING 388: Language and Computers Sandiway Fong Lecture 14 10/11.
LING 388: Language and Computers Sandiway Fong Lecture 17.
LING 388: Language and Computers Sandiway Fong Lecture 27.
LING 388: Language and Computers Sandiway Fong Lecture 7.
LING/C SC/PSYC 438/538 Lecture 14 Sandiway Fong. Administrivia Midterm – This Wednesday – A bit like doing a homework in real time – Bring your laptop.
LING 388: Language and Computers Sandiway Fong Lecture 15 10/13.
LING 388: Language and Computers Sandiway Fong Lecture 18.
LING 388: Language and Computers Sandiway Fong Lecture 26 11/22.
LING 388: Language and Computers Sandiway Fong Lecture 21 11/3.
LING 388: Language and Computers Sandiway Fong Lecture 10.
LING 388: Language and Computers Sandiway Fong Lecture 19.
LING 388: Language and Computers Sandiway Fong Lecture 13.
11 Chapter 14 Part 1 Statistical Parsing Based on slides by Ray Mooney.
LING/C SC/PSYC 438/538 Lecture 26 Sandiway Fong. Administrivia 538 Presentations – Send me your choices if you haven’t already Thanksgiving Holiday –
LING 388: Language and Computers Sandiway Fong Lecture 20: 11/3.
LING 388: Language and Computers Sandiway Fong Lecture 12.
LING 388: Language and Computers Sandiway Fong Lecture 11: 10/4.
Rules, Movement, Ambiguity
LING 388: Language and Computers Sandiway Fong Lecture 21.
LING 388: Language and Computers Sandiway Fong Lecture 25.
LING 388: Language and Computers Sandiway Fong Lecture 16.
1 Some English Constructions Transformational Framework October 2, 2012 Lecture 7.
LING 388: Language and Computers Sandiway Fong Lecture 20.
LING 388: Language and Computers Sandiway Fong Lecture 23.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
Lecture 4b: Verb Processes
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
Presentation transcript:

LING 388: Language and Computers Sandiway Fong Lecture 24: 11/16

2 Last Time Japanese language properties –head-final: Subject Object Verb –case particles: -ga (nominative), -o (accusative) –wh-in-situ (not fronted): dare (who), nani (what) –sentence-final Q-particle: ka examples –Taroo-ga hon-o katta(declarative) –taroo-nom book-acc bought –Taroo-ga nani-o katta ka(object wh-question) –dare-ga hon-o katta ka(subject wh-question)

3 Last Time DCG grammar for Japanese –s(s(Y,Z)) --> np(Y,Q1), nomcase, vp(Z,Q2), sf(Q1,Q2). –vp(vp(Z,Y),Q) --> np(Z,Q), acccase, transitive(Y). –transitive(v(katta)) --> [katta]. –nomcase --> [ga]. –acccase --> [o]. –np(np(taroo),notwh) --> [taroo]. –np(np(hon),notwh) --> [hon]. –np(np(dare),wh) --> [dare]. –np(np(nani),wh) --> [nani]. –sf(wh,notwh) --> [ka]. –sf(notwh,wh) --> [ka]. –sf(notwh,notwh) --> []. –sf(wh,wh) --> [ka]. we can both parse and generate with this simple grammar NPs have an extra argument {notwh,wh} nomcase, acccase and sf are new nonterminals that don’t generate any structure

4 Exercise 1 Test the Japanese grammar Sentences: –Taroo-ga hon-o katta John-nom book-acc buy-PAST –dare-ga hon-o katta ka who-nom book-acc buy-PAST Q –*dare-ga hon-o katta who-nom book-acc buy-PAST –Taroo-ga nani-o katta ka John-nom what-acc buy-PAST Q –*Taroo-ga nani-o katta John-nom what-acc buy-PAST –dare-ga nani-o katta ka who-nom what-acc buy-PAST Q –*dare-ga nani-o katta who-nom what-acc buy-PAST

5 Wh-Questions: English English –declarative John bought a book –wh-question Who bought a book?(subject wh-phrase) *John bought what?(only possible as an echo-question) What did John buy?(object wh-phrase) grammar implementation –subject wh-question straightforward - same word order as declarative counterpart –object wh-question complex operation (irregular) 1.object wh-phrase must be fronted 2.do-support (insertion of past tense form of “do”) 3.bought  buy (untensed form) John bought a bookJohn bought whatwhat John boughtwhat did John boughtwhat did John buy

6 English Grammar starting point 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]. pronoun(me) --> [me]. vp(vp(Y)) --> unergative(Y). vp(vp(Y,Z)) --> transitive(Y,_), np(Z). vp(vp(A,V)) --> aux(A), transitive(V,en). 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)) --> [was].

7 Exercise 2: Step 1 Let’s modify the example grammar to handle the following sentences declarative –John bought a book wh-question –Who bought a book? –(subject wh-phrase) –*John bought what? –(only possible as an echo-question) –What did John buy? –(object wh-phrase) add rules for the new words –bought bookjohn –who what Note: the Japanese grammar incorporates the wh/notwh feature –np(np(taroo),notwh) --> [taroo]. –np(np(hon),notwh) --> [hon]. –np(np(dare),wh) --> [dare]. –np(np(nani),wh) --> [nani].

8 Exercise 2: Step 1 wh-feature has been added to nouns –got to pass wh feature information up to the noun phrase node level grammar rules –s(s(Y,Z)) --> np(Y,Q), vp(Z). –np(np(Y),Q) --> pronoun(Y,Q). –np(np(N),notwh) --> proper_noun(N). –np(np(D,N),Q) --> det(D,Number),common_noun(N,Number,Q). –vp(vp(Y,Z)) --> transitive(Y,_), np(Z,Q). Check your grammar declarative sentences should work as before –?- s(X,[john,bought,a,book],[]). –X = s(np(john),vp(v(bought),np(det(a),n(book))))

9 Exercise 2: Step 1 check the grammar subject wh-question –?- s(X,[who,bought,a,book],[]). –X = s(np(who),vp(v(bought),np(det(a),n(book)))) note –this is an overly simple in-situ analysis –(normally, it is assumed that who is raised to a higher specifier position, e.g. Specifier of CP) object wh-question –?- s(X,[john,bought,what],[]). –X = s(np(john),vp(v(bought),np(what))) assuming it’s not an echo question how do we block this analysis? –by stipulating the value of Q to be notwh –vp(vp(Y,Z)) --> transitive(Y,_), np(Z,notwh).

10 Exercise 2: Step 2 grammar –s(s(Y,Z)) --> np(Y,Q), vp(Z). –vp(vp(Y,Z)) --> transitive(Y,_), np(Z,notwh). –pronoun(who,wh) --> [who]. –pronoun(what,wh) --> [what]. object wh-question –?- s(X,[what,did,john,buy],[]). we need to write rules for wh-object fronting –First, some rules for “do” –aux(aux(was)) --> [was]. –do(aux(did)) --> [did]. –do(aux(do)) --> [do]. –do(aux(does)) --> [does]. s npvp v sbar np what buy john aux did

11 Exercise 2: Step 2 grammar –s(s(Y,Z)) --> np(Y,Q), vp(Z). –vp(vp(Y,Z)) --> transitive(Y,_), np(Z,notwh). –pronoun(who,wh) --> [who]. –pronoun(what,wh) --> [what]. object wh-question –complex operation (irregular) 1.object wh-phrase must be fronted 2.do-support (insertion of past tense form of “do”) 3.bought  buy (untensed form) 1.fronting –sbar(sbar(X,Y)) --> np(X,wh), s(Y). s npvp v sbar np what buy john aux did

12 Exercise 2: Step 2 grammar –s(s(Y,Z)) --> np(Y,Q), vp(Z). –vp(vp(Y,Z)) --> transitive(Y,_), np(Z,notwh). –pronoun(who,wh) --> [who]. –pronoun(what,wh) --> [what]. object wh-question –complex operation (irregular) 1.object wh-phrase must be fronted 2.do-support (insertion of past tense form of “do”) 3.bought  buy (untensed form) 2.do-support –sbar(sbar(X,A,Y)) --> np(X,wh), do(A), s(Y). s npvp v sbar np what buy john aux did

13 Exercise 2: Step 3 grammar –sbar(sbar(X,A,Y)) --> np(X,wh), do(A), s(Y). –s(s(Y,Z)) --> np(Y,Q), vp(Z). –vp(vp(Y,Z)) --> transitive(Y,_), np(Z,notwh). –pronoun(who,wh) --> [who]. –pronoun(what,wh) --> [what]. object wh-question –complex operation (irregular) 1.object wh-phrase must be fronted 2.do-support (insertion of past tense form of “do”) 3.bought  buy (untensed form) 3.untensed main verb –transitive(v(bought),ed) --> [bought]. –transitive(v(buy),root) --> [buy]. s npvp v sbar np what buy john aux did

14 Exercise 2: Step 3 grammar –sbar(sbar(X,A,Y)) --> np(X,wh), do(A), s(Y). –s(s(Y,Z)) --> np(Y,Q), vp(Z). –vp(vp(Y,Z)) --> transitive(Y,_), np(Z,notwh). –pronoun(who,wh) --> [who]. –pronoun(what,wh) --> [what]. Object wh-question: –complex operation (irregular) 1.object wh-phrase must be fronted 2.do-support (insertion of past tense form of “do”) 3.bought  buy (untensed form) 3.VP rule for missing (fronted) object –transitive(v(buy),root) --> [buy]. –vp(vp(Y)) --> transitive(Y,root). s npvp v sbar np what buy john aux did

15 Exercise 2: Step 3 Grammar check Test the modified grammar on –What did John buy? Does the grammar accept –John bought what?

16 Exercise 2: Step 4 How do we force our VP fronted rule to be used? One method: –signal or pass information down the tree encoded in the nonterminal name Modify rule –sbar(sbar(X,A,Y)) --> np(X,wh), do(A), s_objectwh(Y). Add new rule –s_objectwh(s(Y,Z)) --> np(Y,Q), vp_objectwh(Z). Modify rule –vp_objectwh(vp(Y)) --> transitive(Y,root). s[objectwh] np vp [objectwh] v sbar np what buy john aux did

17 Exercise 2: Step 4 Check all the original sentences work –Declarative: John bought a book –Wh-Question: Who bought a book?(subject wh-phrase) *John bought what?(only possible as an echo-question) What did John buy?(object wh-phrase) grammar –s(s(Y,Z)) --> np(Y,Q), vp(Z). –vp(vp(Y,Z)) --> transitive(Y,_), np(Z,notwh). –pronoun(who,wh) --> [who]. –pronoun(what,wh) --> [what]. –sbar(sbar(X,A,Y)) --> np(X,wh), do(A), s_objectwh(Y). –s_objectwh(s(Y,Z)) --> np(Y,Q), vp_objectwh(Z). –vp_objectwh(vp(Y)) --> transitive(Y,root). query –?- sbar(X,[what,did,john,buy],[]). –X = sbar(np(what),aux(did),s(np(john),vp(v(buy)))) cleaning up, add new rule –sbar(S) --> s(S). s[objectwh] np vp [objectwh] v sbar np what buy john aux did

18 Exercise 3 Subject and object wh-nouns do not end up in the same place in this simple grammar. Modify the grammar to use traces of movement. Generate the following structures: –[ Sbar Who [ S [ NP trace] [ VP bought [ NP a book]]]] –[ Sbar What did [ S [ NP John] [ VP buy [ NP trace]]]]

19 Exercise 3 sbar(sbar(X,Y,Z)) --> np(X,wh), do(Y), s_objectwh(Z). sbar(sbar(X,Y)) --> np(X,wh), s_subjectwh(Y). sbar(S) --> s(S). % convenience s(s(Y,Z)) --> np(Y,notwh), vp(Z). s_subjectwh(s(np(trace),Z)) --> np(np(trace),WH), vp(Z). s_objectwh(s(Y,Z)) --> np(Y,WH), vp_objectwh(Z). np(np(trace),_) --> []. np(np(X),notwh) --> propernoun(X). np(np(Y),WH) --> pronoun(Y,WH). np(np(D,N),notwh) --> det(D,Number), common_noun(N,Number). det(det(the),_) --> [the]. det(det(a),sg) --> [a]. propernoun(john) --> [john]. common_noun(n(ball),sg) --> [ball]. common_noun(n(man),sg) --> [man]. common_noun(n(men),pl) --> [men]. common_noun(n(book),sg) --> [book]. pronoun(i,notwh) --> [i]. pronoun(we,notwh) --> [we]. pronoun(me,notwh) --> [me]. pronoun(who,wh) --> [who]. pronoun(what,wh) --> [what]. vp(vp(Y)) --> unergative(Y). vp(vp(Y,Z)) --> transitive(Y,_), np(Z,notwh). vp_objectwh(vp(Y,np(trace))) --> transitive(Y,root), np(np(trace),_). vp(vp(A,V)) --> aux(A), transitive(V,en). 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]. transitive(v(buy),root) --> [buy]. transitive(v(bought),ed) --> [bought]. aux(aux(was)) --> [was]. do(aux(was)) --> [did].

20 Next Time We’ll talk about machine translation