Skip to content

Code of "Improving Machine Translation with Human Feedback: An Exploration of Quality Estimation as a Reward Model"

Notifications You must be signed in to change notification settings

cooelf/FeedbackMT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FeedbackMT

Code of Improving Machine Translation with Human Feedback: An Exploration of Quality Estimation as a Reward Model

Environment

conda create -n feedbackmt python=3.10.0
conda activate feedbackmt
cd src/LMFlow
pip3 install -e .
cd ../../
pip3 install -r requirements.txt
conda install mpi4py

Data

Download from Google drive.

unzip data.zip

Training

See training_scripts.

Inference

python3 src/inference_sft.py \
    --model-name-or-path <model path> \
    --inst-file data/instruct_follow.txt \
    --lang-pair en-zh \
    --input-file <input file> \
    --output-file <output file> \
    --search-algorithm beam \
    --batch 2 \
    --seed 0 \
    --model-type s2s \ # --model-type s2s for NLLB; --model-type causal for LLAMA-2
    --beam 4

Critical code

src/LMFlow/src/lmflow/pipeline/raft_aligner.py     # RAFT/RAFT+ for LLAMA2
src/LMFlow/src/lmflow/pipeline/raft_aligner_t2t.py # RAFT/RAFT+ for NLLB
src/LMFlow/src/lmflow/pipeline/mrt_aligner_t2t.py  # MRT/MRT+   for NLLB

Citation

@article{he2023feedbackmt,
  title={Improving Machine Translation with Human Feedback: An Exploration of Quality Estimation as a Reward Model},
  author={He, Zhiwei and Wang, Xing and Jiao, Wenxiang and Zhang, Zhuosheng and Wang, Rui and Shi, Shuming and Tu, Zhaopeng},
  journal={arXiv preprint arXiv:2401.12873},
  year={2024}
}

Acknowledgement

About

Code of "Improving Machine Translation with Human Feedback: An Exploration of Quality Estimation as a Reward Model"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 88.8%
  • Shell 11.1%
  • Dockerfile 0.1%