score('ils regardent .','they are watching .',k=2)
```
输出:
```
bleu 1.000, predict: they are watching .
```
测试一个不在训练集中的样本。
``` python
score('ils sont canadiens .','they are canadian .',k=2)
```
输出:
```
bleu 0.658, predict: they are russian .
```
## 小结
* 可以将编码器—解码器和注意力机制应用于机器翻译中。
* BLEU可以用来评价翻译结果。
## 参考文献
[1] Papineni, K., Roukos, S., Ward, T., & Zhu, W. J. (2002, July). BLEU: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics (pp. 311-318). Association for Computational Linguistics.