In this work, we introduce how to train the Seq2Seq model for machine translation tasks from Chinese to English. The code is public with the notebook above. After training, the obtained model is able to take as input a Chinese sentence and output an English translation. Examples:
Input | Output | |
---|---|---|
1 | 天气又冷又湿。 | The weather was not only cold, but also wet. |
2 | 她明年會去美國嗎? | Will she go to america next year? |
Dataset for training and evaluate: CMN [link]
At this work, I solve machine translation tasks with Encoder-Decoder architecture. In this architecture, the network is partitioned into two parts, the encoder and the decoder. The encoder’s role is encoding the inputs into hidden state, or hidden representation, which often contains several tensors. Then the hidden state is passed into the decoder to generate the outputs.
- Neural Machine Translation model with GRU layers and Bahdanau Attention.
Some predictions of the model.
To be continued.......
- Tensorflow official tutorial: Neural Machine Translation with Attention
- Seq2Seq Learning & Neural Machine Translation
- Bahdanau Attention: Neural Machine Translation by Jointly Learning to Align and Translate