In 2005, a blog post went viral that showed a bootleg copy of Revenge of the Sith with its Chinese version translated (apparently by low-quality machine translation) back into an English movie called Backstroke of the West. Can you do better?
Clone the Homework 5 repository. It contains the following files:
train.zh-en | training data (Chinese-English) |
train.zh | training data (Chinese side) |
train.en | training data (English side) |
test.zh | test data (Chinese side) |
test.en | test data (English side) |
backstroke.en | Backstroke of the West |
bleu.py | evaluation script for translation |
translate.py | IBM Model 1 decoder |
lm.py | Language model used by translate.py |
The training data is Star Wars Episodes 1, 2, and 4–6. The test data is Episode 3.
You may write code in any language you choose. You may reuse any code you've used in previous homework assignments, or even the solution or another student's code as long as you cite properly.
train.zh-en
.1 It contains one sentence pair per line, with the Chinese and English versions separated by a tab (\t
). Both sides have been tokenized. Below, we assume that a fake word $\text{NULL}$ is prepended to every English sentence, so that $e_0 = \text{NULL}$.In this part, you'll use the provided Model 1 decoder to try to translate Episode 3 better than Backstroke of the West.
captain 船长 0.7648140965086824
captain 看 2.1415989262858237e-11
captain 我们 2.5532871116116466e-09
captain 搜查 2.1644056596004747e-09
captain 了 1.1592984773140098e-07
NULL 船长 3.7303483172036556e-20
NULL 是 0.04330894875722255
NULL 长官 7.859239306612376e-14
NULL ? 3.5071699071940116e-05
NULL 通知 3.890691080886856e-19
The order of the lines does not matter.
test.zh
). The decoder should be run like this:
translate.py your_ttable train.en test.zh
Translations are written to stdout.
In your report, show the output on lines 475–492.1 Comment on what problems you see, and how they might be fixed.3bleu.py your_translations test.en
The score is between 0 and 1 (higher is better). What BLEU score does Backstroke of the West get?1
What does your system get?1 You must do better than Backstroke of the West.3
Please submit all of the following in a gzipped tar archive (.tar.gz or .tgz; not .zip or .rar) via Sakai: