This demo is just for learning Transformer, which is basing on only one pair of sentences:
Input sentence: ['<bos>', 'i', 'am', 'iron', 'man', '<eos>']
After translate: ['<bos>', '我', '是', '钢铁', '侠', '<eos>']
Entire tutorial of Transformer Translation model, please see: https://zhuanlan.zhihu.com/p/360343417
$ pip install -r requirements.txt
$ python no_mask_train.py
$ python no_mask_infer.py
$ python key_padding_mask_train.py
$ python key_padding_mask_infer.py
$ python triu_mask_train.py
$ python triu_mask_infer.py