LING 388: Language and Computers Sandiway Fong Lecture 23: 11/14.

Slides:



Advertisements
Similar presentations
LING 388: Language and Computers Sandiway Fong Lecture 23.
Advertisements

Japanese Syntax. Outline  Review of typological characteristics of JL  Syntactic Structures Syntactic Constituency Phrase Structures Phrase Structure.
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.
LING 388: Language and Computers Sandiway Fong Lecture 24: 11/16.
LING 388: Language and Computers Sandiway Fong Lecture 24 11/15.
LING 388: Language and Computers Sandiway Fong Lecture 29: 12/6.
LING 388: Language and Computers Sandiway Fong Lecture 24.
LING 388: Language and Computers Sandiway Fong Lecture 16: 10/20.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/12.
LING 364: Introduction to Formal Semantics Lecture 9 February 9th.
LING 388: Language and Computers Sandiway Fong Lecture 27: 12/1.
LING 388: Language and Computers Sandiway Fong Lecture 15: 10/17.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/11.
LING 388: Language and Computers Sandiway Fong Lecture 28: 12/6.
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 14: 10/13.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 9: 9/25.
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 Take-Home Final Examination 12/9/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 28: 12/5.
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 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.
Context-Free Grammar CSCI-GA.2590 – Lecture 3 Ralph Grishman NYU.
LING 388: Language and Computers Sandiway Fong 10/4 Lecture 12.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
Context Free Grammars Reading: Chap 12-13, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Paul Tarau, based on Rada.
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 3.
LING 388: Language and Computers Sandiway Fong Lecture 30 12/8.
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 20: 11/3.
Syntax Why is the structure of language (syntax) important? How do we represent syntax? What does an example grammar for English look like? What strategies.
LING 388: Language and Computers Sandiway Fong Lecture 12.
LING 388: Language and Computers Sandiway Fong Lecture 11: 10/4.
Grammars Grammars can get quite complex, but are essential. Syntax: the form of the text that is valid Semantics: the meaning of the form – Sometimes semantics.
Rules, Movement, Ambiguity
LING 388: Language and Computers Sandiway Fong Lecture 21.
1 Natural Language Processing Lectures 8-9 Auxiliary Verbs Movement Phenomena Reading: James Allen NLU (Chapter 5)
LING 388: Language and Computers Sandiway Fong Lecture 25.
◦ Process of describing the structure of phrases and sentences Chapter 8 - Phrases and sentences: grammar1.
LING/C SC/PSYC 438/538 Lecture 20 Sandiway Fong 1.
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 23: 11/14

Administrivia This Thursday –Laboratory Class –meet in Social Sciences 224

Last Time computation of predicate-argument structure –?- s(P, [i,hit,the,ball], []). P = s(np(i),vp(v(hit),np(det(the),n(ball)))) P = hit(i,ball) predicate: hit arguments: i ball –involved calling Prolog predicates from grammar rules {... } –headof(X,H) ?- headof(vp(v(hit),np(det(the),n(ball))),V). X = hit another application of {... } –counting # of a’s and b’s for modifying a regular grammar for a + b + –into a grammar for a n b n

Today’s Topics another step towards a simple language translator... –we can write a grammar for Japanese –differences between English and Japanese canonical word order syntax of wh-questions

Japanese head-final language –we introduced the notion “head of a phrase” (see last lecture) e.g. verb is the head of a verb phrase –hit the ball –ran noun is the head of a noun phrase –the man (that I saw) –the old man –John’s mother –Japanese sentence word order(canonical) Subject Object Verb cf. English word order –Subject Verb Object

Japanese head-final language –sentence word order(canonical) Subject Object Verb(Japanese) Subject Verb Object(English) example –John bought a book(English) –John a book bought(Japanese word order) –Taroo-ga hon-o katta(Japanese) –case markers ga = nominative case marker o = accusative case marker –note: no determiner present in the Japanese sentence

Japanese head-final language –sentence word order(canonical) Subject Object Verb –Japanese also allows “scrambling” e.g. object and subject can be switched in order Subject Object Verb Object Subject Verb *Subject Verb Object(still head-final) example –John bought a book(English) –John a book bought –Taroo-ga hon-o katta(Japanese - canonical) –hon-o Taroo-ga katta(Japanese - scrambled) –*Taroo-ga katta hon-o(English word order) –ga = nominative case marker –o = accusative case marker

Japanese example –John bought a book –John a book bought –taroo-ga hon-o katta –ga = nominative case marker –o = accusative case marker parser input –(as a Prolog list with case markers separated) –[taroo,ga,hon,o,katta] grammar rules –s(s(Y,Z)) --> np(Y), nomcase, vp(Z). –vp(vp(Z,Y)) --> np(Z), acccase, transitive(Y). –transitive(v(katta)) --> [katta]. –nomcase --> [ga]. –acccase --> [o]. –np(np(taroo)) --> [taroo]. –np(np(hon)) --> [hon]. note: new nonterminals nomcase acccase do not create structure order of np, transitive in the VP reflects Japanese word order

Japanese example –John a book bought –taroo-ga hon-o katta –ga = nominative case marker –o = accusative case marker computation tree –?- s(X,[taroo,ga,hon,o,katta],[]). ?- np(Y,[taroo,ga,hon,o,katta],L1). ?- nomcase(L1,L2). ?- vp(Z,L2,[]). –?- np(Y,[taroo,ga,hon,o,katta],L1). Y = np(taroo)L1 = [ga,hon,o,katta] –?- nomcase([ga,hon,o,katta],L2). L2 = [hon,o,katta] –?- vp(vp(Z’,Y’), [hon,o,katta],[]). Z = vp(Z’,Y’) ?- np(Z’,[hon,o,katta],L1’). ?- acccase(L1’,L2’). ?- transitive(Y’,L2’,[]). 1.s(s(Y,Z)) --> np(Y), nomcase, vp(Z). 2.vp(vp(Z,Y)) --> np(Z), acccase, transitive(Y). 3.transitive(v(katta)) --> [katta]. 4.nomcase --> [ga]. 5.acccase --> [o]. 6.np(np(taroo)) --> [taroo]. 7.np(np(hon)) --> [hon].

Japanese example –John a book bought –taroo-ga hon-o katta –ga = nominative case marker –o = accusative case marker computation tree –?- vp(vp(Z’,Y’), [hon,o,katta],[]). ?- np(Z’,[hon,o,katta],L1’). ?- acccase(L1’,L2’). ?- transitive(Y’,L2’,[]). –?- np(Z’,[hon,o,katta],L1’) Z’ = np(hon)L1’ = [o,katta] –?- acccase([o,katta],L2’). L2’ = [katta] –?- transitive(Y’,[katta],[]). Y’ = v(katta) answer –?- s(X,[taroo,ga,hon,o,katta],[]). –X = s(np(taroo), vp(np(hon), v(katta))) 1.s(s(Y,Z)) --> np(Y), nomcase, vp(Z). 2.vp(vp(Z,Y)) --> np(Z), acccase, transitive(Y). 3.transitive(v(katta)) --> [katta]. 4.nomcase --> [ga]. 5.acccase --> [o]. 6.np(np(taroo)) --> [taroo]. 7.np(np(hon)) --> [hon].

Japanese example –John a book bought –taroo-ga hon-o katta –ga = nominative case marker –o = accusative case marker grammar –can be run “backwards” for sentence generation –we’ll need this query –?- s(s(np(taroo), vp(np(hon), v(katta))),L,[]). –L = [taroo, ga, hon, o, katta] 1.s(s(Y,Z)) --> np(Y), nomcase, vp(Z). 2.vp(vp(Z,Y)) --> np(Z), acccase, transitive(Y). 3.transitive(v(katta)) --> [katta]. 4.nomcase --> [ga]. 5.acccase --> [o]. 6.np(np(taroo)) --> [taroo]. 7.np(np(hon)) --> [hon]. Generator SentenceParse tree Parser SentenceParse tree

Japanese example –John a book bought –taroo-ga hon-o katta –ga = nominative case marker –o = accusative case marker query (generation) –?- s(s(np(taroo),vp(np(hon),v(katta))),L,[]). Y = np(taroo)Z = vp(np(hon),v(katta))) ?- np(np(taroo),L,L1). ?- nomcase(L1,L2). ?- vp(vp(np(hon),v(katta))),L2,[]). –?- np(np(taroo),L,L1). L = [taroo|L1] –?- nomcase(L1,L2). L1 = [ga|L2] –? - vp(vp(np(hon),v(katta))),L2,[]). Z’ = np(hon)Y’ = v(katta) ?- np(np(hon),L2,L3). ?- acccase(L3,L4). ?- transitive(v(katta),L4,[]). 1.s(s(Y,Z)) --> np(Y), nomcase, vp(Z). 2.vp(vp(Z,Y)) --> np(Z), acccase, transitive(Y). 3.transitive(v(katta)) --> [katta]. 4.nomcase --> [ga]. 5.acccase --> [o]. 6.np(np(taroo)) --> [taroo]. 7.np(np(hon)) --> [hon].

Japanese example –John a book bought –taroo-ga hon-o katta –ga = nominative case marker –o = accusative case marker query (generation) –?- vp(vp(np(hon),v(katta))),L2,[]). Z’ = np(taroo)Y’ = v(katta) ?- np(np(hon),L2,L3). ?- acccase(L3,L4). ?- transitive(v(katta),L4,[]). –?- np(np(hon),L2,L3). L2 = [hon|L3] –?- acccase(L3,L4). L3 = [o|L4] –?- transitive(v(katta),L4,[]). L4 = [katta|[]] 1.s(s(Y,Z)) --> np(Y), nomcase, vp(Z). 2.vp(vp(Z,Y)) --> np(Z), acccase, transitive(Y). 3.transitive(v(katta)) --> [katta]. 4.nomcase --> [ga]. 5.acccase --> [o]. 6.np(np(taroo)) --> [taroo]. 7.np(np(hon)) --> [hon].

Japanese example –John a book bought –taroo-ga hon-o katta –ga = nominative case marker –o = accusative case marker query (generation) –back-substituting... –?- np(np(taroo),L,L1). L = [taroo|L1] –?- nomcase(L1,L2). L1 = [ga|L2] –?- np(np(hon),L2,L3). L2 = [hon|L3] –?- acccase(L3,L4). L3 = [o|L4] –?- transitive(v(katta),L4,[]). L4 = [katta|[]] answer –L = [taroo, ga, hon, o, katta] 1.s(s(Y,Z)) --> np(Y), nomcase, vp(Z). 2.vp(vp(Z,Y)) --> np(Z), acccase, transitive(Y). 3.transitive(v(katta)) --> [katta]. 4.nomcase --> [ga]. 5.acccase --> [o]. 6.np(np(taroo)) --> [taroo]. 7.np(np(hon)) --> [hon].

Japanese wh-NP phrases –English –examples John bought a book Who bought a book?(subject wh-phrase) *John bought what?(echo-question only) What did John buy?(object wh-phrase) object wh-phrase case –complex operation required from the declarative form: »object wh-phrase must be fronted »do-support (insertion of past tense form of “do”) »bought  buy (untensed form) John bought a bookJohn bought whatwhat John boughtwhat did John boughtwhat did John buy

Japanese wh-NP phrases –English Who bought a book?(subject wh-phrase) *John bought what?(only possible as an echo-question) What did John buy?(object wh-phrase) –Japanese wh-in-situ: –meaning wh-phrase appears in same position as a regular noun phrase –easy to implement!(no complex series of operations) taroo-ga nani-o katta ka –nani: means what –ka: sentence-final question particle dare-ga hon-o katta ka –dare: means who

Japanese wh-in-situ: –taroo-ga nani-o katta ka nani: means what ka: sentence-final question particle –dare-ga hon-o katta ka dare: means who grammar –s(s(Y,Z)) --> np(Y), nomcase, vp(Z). –vp(vp(Z,Y)) --> np(Z), acccase, transitive(Y). –transitive(v(katta)) --> [katta]. –nomcase --> [ga]. –acccase --> [o]. –np(np(taroo)) --> [taroo]. –np(np(hon)) --> [hon]. add new wh-words –np(np(dare)) --> [dare]. –np(np(nani)) --> [nani].

Japanese wh-in-situ: –taroo-ga nani-o katta ka nani: means what ka: sentence-final question particle –dare-ga hon-o katta ka dare: means who grammar –s(s(Y,Z)) --> np(Y), nomcase, vp(Z). –vp(vp(Z,Y)) --> np(Z), acccase, transitive(Y). –transitive(v(katta)) --> [katta]. –nomcase --> [ga]. –acccase --> [o]. –np(np(taroo)) --> [taroo]. –np(np(hon)) --> [hon]. –np(np(dare)) --> [dare]. –np(np(nani)) --> [nani]. allows sentences –Taroo-ga hon-o katta –Taroo-ga nani-o katta (ka) –dare-ga hon-o katta (ka) How do we enforce the constraint that ka is obligatory when a wh-phrase is in the sentence?

Japanese wh-in-situ: –taroo-ga nani-o katta ka nani: means what ka: sentence-final question particle –dare-ga hon-o katta ka dare: means who grammar –s(s(Y,Z)) --> np(Y,Q), nomcase, vp(Z). –vp(vp(Z,Y)) --> 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]. answer –employ an extra argument to encode the lexical feature wh (with values wh, notwh ) for nouns

Japanese wh-in-situ: –taroo-ga nani-o katta ka nani: means what ka: sentence-final question particle –dare-ga hon-o katta ka dare: means who grammar –s(s(Y,Z)) --> np(Y,Q1), nomcase, vp(Z,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]. answer –employ an extra argument to encode the lexical feature wh for nouns –propagate this feature up to the (top) sentence rule means adding extra argument Q to the VP nonterminal

Japanese wh-in-situ: –taroo-ga nani-o katta ka nani: means what ka: sentence-final question particle –dare-ga hon-o katta ka dare: means who grammar –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]. answer –employ an extra argument to encode the lexical feature wh for nouns –propagate this feature up to the s rule –add a sentence-final particle rule ( sf ) that generates ka when this feature is wh

Japanese wh-in-situ: –taroo-ga nani-o katta ka nani: means what ka: sentence-final question particle –dare-ga hon-o katta ka dare: means who grammar –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]. sentence-final particle rule ( sf/2 ) –sf(wh,notwh) --> [ka]. –sf(notwh,wh) --> [ka]. –sf(notwh,notwh) --> []. (empty) –sf(wh,wh) --> [ka].( example: dare-ga nani-o katta ka: who bought what )

Japanese wh-in-situ: –taroo-ga nani-o katta ka nani: means what ka: sentence-final question particle –dare-ga hon-o katta ka dare: means who computation tree –?- s(X,[taroo,ga,nani,o,katta,ka],[]). –X = s(np(taroo),vp(np(nani),v(katta))) –?- s(X,[taroo,ga,nani,o,katta],[]). –no 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 may want to modifiy the parse tree to represent the sentence-final particle ka as well

Japanese grammar choices so far –s(s(Y,Z)) --> np(Y,Q1), nomcase, vp(Z,Q2), sf(Q1,Q2). could have written –s(s(Y,Z)) --> np(Y,notwh), nomcase, vp(Z,notwh). –s(s(Y,Z)) --> np(Y,Q1), nomcase, vp(Z,Q2), {\+ Q1=notwh ; \+ Q2=notwh }, sf. –sf --> [ka]. or –s(s(Y,Z)) --> np(Y,notwh), nomcase, vp(Z,notwh). –s(s(Y,Z,ka)) --> np(Y,Q1), nomcase, vp(Z,Q2), {\+ Q1=notwh ; \+ Q2=notwh }, sf. –sf --> [ka]. –generates different structures for declarative vs. wh-NP questions

Next Time we’ll look at wh-questions in English... and also take one more step towards our machine translator