guangyliu / EISL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EISL

Source code of paper: Don’t Take It Literally: An Edit-Invariant Sequence Loss for Text Generation

https://arxiv.org/abs/2106.15078

NAACL 2022 Main Conference, Oral Presentation

Usage (Fairseq)

Put the EISL.py file in to fairseq/fairseq/criterions/EISL.py, then you can train with EISL loss by adding --criterion EISL into fairseq command.

If you want to reproduce our results, please refer to fairseq/README.md for more implementation details (pretrained models, preprocessed datasets, running scripts, and generated files).

Non-Autoregressive Machine Translation

For the NAT experiments, NAT codes (fairseq) and models are released in the NAT folder. We also provide the models trained by CE loss. The results are reported in the paper.

Usage (HuggingFace, Need to be verified)

You can override the compute_loss function of Trainer like shown in EISL_trainer.py.

About


Languages

Language:Python 78.8%Language:Shell 7.8%Language:Roff 6.7%Language:Jupyter Notebook 5.2%Language:Cuda 0.8%Language:C++ 0.4%Language:Cython 0.3%Language:Lua 0.1%Language:Batchfile 0.0%Language:Makefile 0.0%