seq2seq翻译模型,代码简化自fairseq和opennmt-py等框架。
支持Bi-LSTM及Transformer模型
支持多gpu训练
支持延迟更新
preprocess.py文件用于将文本文件转化为二进制文件,方便保存,并加快读取速度
需要修改文件中的源语言及目标语言的文件及对应字典,并指定生成的二进制文件,然后运行
训练的入口文件是main.py 需要根据需求指定部分参数, 详细内容见文件内部的参数说明
可以通过参数指定多少次update保存模型,以及是否保存optimizer参数。
可以通过参数指定是否在训练时测试bleu,如需测试要提供字典文件路径,测试文件以及参考文件。
调用翻译的入口文件是translate.py 需要根据具体需求修改部分参数,详见内部说明