Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Latest commit

 

History

History
20 lines (13 loc) · 1016 Bytes

File metadata and controls

20 lines (13 loc) · 1016 Bytes

Transformer in Pytorch

Source code for the Transformer model used in the paper "Neural Machine Translation of Text from Non-Native Speakers" https://arxiv.org/abs/1808.06267. Require Python3.6 and Pytorch 1.0.

Pretty much just the transformer model, but the validator validates on different dev sets at a time and keeps best checkpoint for each dev set.

How to train a new model

Write a config function in configurations.py. Then run python3 -m nmt --proto config_name.

The best checkpoints are saved in nmt/saved_models/model_name. To decode with a checkpoint: python3 -m nmt --proto config_name --mode translate --model-file nmt/saved_models/model_name/checkpoint_name.path --input-file path_to_input_file.

References

A lot of code / scripts are borrowed from:

...