310 likes | 512 Views
LING 388: Language and Computers. Sandiway Fong Lecture 30. Last Time. Translator doesn’t necessarily produce the same number of translations for both languages Example : object wh -question. 1 English 6 Japanese. 1 Japanese 2 English. Last Time.
E N D
LING 388: Language and Computers Sandiway Fong Lecture30
Last Time • Translator doesn’t necessarily produce the same number of translations for both languages • Example: object wh-question 1 English 6 Japanese 1 Japanese 2 English
Last Time • Translator doesn’t necessarily produce the same number of translations for both languages • Example: subject wh-question 1 English 6 Japanese 1 Japanese 3 English
Last Time • Translator doesn’t necessarily produce the same number of translations for both languages • Example: declarative sentence 1 English 6 Japanese accidentally symmetric 1 Japanese 6 English
Last Time • e2j(E,J) always runs the English grammar first • inefficient when it comes to translating Japanese enumerates all possible English sentences… Count: 32732
Last Time • Order of actions is fixed in e2j(E,J) • define j2e(J,E), which calls the Japanese grammar first • computationally more efficient when translating Japanese Logically equivalent but..
Last Time • These two queries produce the same results • but the order of the answers is different • (unrestricted enumeration vs. providing an instantiated predarg structure to the English grammar)
Last Time • free enumeration: (count: 548)
Milestone • A programming milestone in this course has been reached… • You know how to implement grammars for multiple languages • We’ve seen techniques for implementing a variety of simple syntactic phenomena: basic declarative sentences, English passives, progressives, wh-questions, Japanese passives and wh-questions. • Use of extra arguments: record a parse, agreement, pass information up the rule hierarchy • Compute (Stanford Parser style) syntax trees • Compute predicate-argument structures for the translator
English Idioms • Consider the English sentence: • John kicked the bucket • Two possible interpretations: Idiomatic: “John died” Literal: John kicked the bucket idioms: non-composition meaning i.e. meaning of idiom “die” cannot be inferred from the meaning of the constitutive words kick and bucket
English Idioms • Let’s implement the idiomatic meaning first: • John kicked the bucket (fixed.. frozen VP expression) • #John kicked the buckets • #John kicked a bucket Semantic representation predarg(V,Subject,Object,Type) predarg(die+past,john,none,decl)
English Idioms • Add the VP rule to g29.pl: • what values should V, Objectand Endinghave to obtain the correct predicate argument structure? • John kicked the bucket (fixed.. frozen VP expression)
English Idioms • Let’s implement the literal meaning next: • John kicked the bucket • John kicked the buckets • John kicked a bucket We need to add the verb kick and the nouns bucket and buckets to the English grammar Note: two parses! (compare with next slide)
English Idioms • Let’s implement the literal meaning next: • John kicked the bucket • John kicked the buckets • John kicked a bucket Note: one parse only!
English Idiom Translation • Let’s modify the Japanese grammar (jg29.pl) to handle the following Japanese sentences: • Taroo-gabaketsu-o ketta • predarg(keru+past,taroo,baketsu,decl) • baketsu (バケツ) (bucket) • ketta = keru-past (kick) • kerimashita = keru+past(kick) formal • shibaita = shibaku+past(kick) • shibakimashita = shibaku+past (kick) formal • Taroo-gashinda • predarg(shinu+past,taroo,none,decl) • shinda = shinu+past(die) • nakunatta = nakunaru+past • nakunarimashita
English Idiom Translation • We will also need to modify the translation table to handle: • baketsu(バケツ) (bucket) • ketta = keru+past(kick) • kerimashita = keru+past(kick) • shinda= shinu+past(die)
Japanese Idioms • Examples • taroo-ga sensei-nigoma-osutta • taroo-nom teacher-dat sesame-acc grinded • “John flattered the teacher” • taroo-gaHanako-nigoma-osutta • taroo-nom Hanako-dat sesame-acc grinded • “John flattered Mary” • ni = (dat) dative Case marker • odateta is the Japanese counterpart for flattered Let’s implement the idiomatic meaning flattered = brown-nosed Step 1: add sensei, hanako Step 2: add VP rule for the idiom odateru suru
What do other systems do? • ExploreGoogle Translate
Example: 太郎が先生にごまをすった taroo-ga sensei-nigoma-osutta Taroo-NOM teacher-DAT sesame-ACC grind+PAST Taroo flattered the teacher Japanese Idioms case particles -gaが -oを -niに • Note on input methods (MacOS X)
Japanese Idioms • Examples: • ジョン がバケツを蹴った • John-gabaketsu-o kicked • John-NOM bucket-ACC kick+PAST • Literal “John kicked the bucket”
Examples: 医者がさじを投げる isha-gasaji-o nageru doctor-NOM spoon-ACC throw+PRES Idiom “gave up” / “threw a spoon” Japanese Idioms
101 Japanese Idioms • Listen & Learn: 101 Japanese IdiomsMichael Maynard • Sample pages from book is available online http://www.amazon.com/Listen-Learn-101-Japanese-Idioms/dp/084428341X
Sesame grinder: gomasuri (ごますり) • gomasuri (ごますり)
Sesame grinder: gomasuri (ごますり) • gomasuri (ごますり)
Sesame grinder: gomasuri (ごますり) • gomasuri (ごますり) you have to figure out how to enter Japanese examples... you can use an online Japanese dictionary e.g. http://jisho.org/
Sesame grinder: gomasuri (ごますり) • http://jisho.org/
Sesame grinder: gomasuri (ごますり) • gomasuri (ごますり) => sycophant Snapshot is from 2008
Sesame grinder: gomasuri (ごますり) Snapshot is from 2010 Snapshot is from 2012