- Install a custom version of SimulEval.
- Enter the directory
eval/
. Assume that the source texts are intest.en
, and the reference translation texts are intest.zh
. Then run the following command for each type of models:
bash simuleval_fullsentence.sh -m teacher_cwmt_enzh -e ../expcwmt -s ./test.en -t ./test.zh
bash simuleval.sh \
-a agents/simul_t2t_waitk.py \
-m wait_1_enzh_distill \
-k 1 \
-e ../expcwmt \
-s test.en \
-t test.zh
bash simuleval.sh \
-a agents/simul_t2t_ctc.py \
-m ctc_delay3 \
-k 3 \
-e ../expcwmt \
-s test.en \
-t test.zh
Results should be under eval/cwmt_zh-results
. Each subdirectory should contain the following:
<MODEL>.cwmt/
├── instances.log
├── prediction
└── scores.1
WARNING: You need to run the latency evaluation first to get the
prediction
files necessary for quality evaluation.
- Install version 2.0 of Sacrebleu.
- Enter the directory
eval/
. - Change the paths of
REF
inrun_cwmt_bleueval.sh
to your reference file paths. - Run
bash run_cwmt_bleueval.sh
Results should be under eval/cwmt_${TGT}-results/quality-results.cwmt
. Directory should contain the following:
quality-results.cwmt/
├── delay1-systems
├── delay3-systems
├── delay5-systems
├── delay7-systems
├── delay9-systems
└── full_sentence-systems
You need to clone and install imputer-pytorch to apply ctc forced alignments.
- Clone the repo and install
cd eval/
git clone /~https://github.com/rosinality/imputer-pytorch.git
cd imputer-pytorch
python setup.py install
cd ..
- Copy (or link) the installation math to
eval/
cp -r ./imputer-pytorch/torch_imputer ./ # copy
# ln -s ./imputer-pytorch/torch_imputer torch_imputer # or use symbolic link
jupyter notebook visualize_mt.ipynb
- Enter the directory
eval/anticipation
- Assume that the source texts are in
test.en
, and the reference translation texts are intest.zh
. - Run the following
bash run_aligner.sh test en zh
The alignment file will appear as ./alignments/test.en-zh_1000000
. The k-AR will be printed at stdout. You can calculate k-AR with a specific k by:
python count_anticipation.py -k ${k} < alignments/test.en-zh_1000000