|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
|
|
echo `date`
|
|
devtest_data_dir=$1
|
|
model_name=${2-"Unbabel/wmt22-comet-da"}
|
|
|
|
|
|
langs=(asm_Beng ben_Beng guj_Gujr hin_Deva kan_Knda mal_Mlym mar_Deva ory_Orya pan_Guru tam_Taml tel_Telu urd_Arab)
|
|
|
|
|
|
|
|
system=(google azure nllb mbart50 m2m100 it1 it2)
|
|
|
|
|
|
|
|
for lang in "${langs[@]}"; do
|
|
|
|
mkdir -p "$devtest_data_dir/eng_Latn-$lang/comet"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for sys in "${system[@]}"; do
|
|
|
|
echo "${sys}"
|
|
|
|
|
|
if [ -f "$devtest_data_dir/eng_Latn-$lang/test.$lang.pred.$sys" ]; then
|
|
echo "eng_Latn-${lang}"
|
|
|
|
src_fname=$devtest_data_dir/eng_Latn-$lang/test.eng_Latn
|
|
pred_fname=$devtest_data_dir/eng_Latn-$lang/test.$lang.pred.$sys
|
|
ref_fname=$devtest_data_dir/eng_Latn-$lang/test.$lang
|
|
out_fname=$devtest_data_dir/eng_Latn-$lang/comet/eng_Latn_${lang}_${sys}_comet.txt
|
|
|
|
|
|
comet-score -s $src_fname -t $pred_fname -r $ref_fname --gpus 1 --model $model_name --quiet --only_system > $out_fname
|
|
fi
|
|
|
|
|
|
if [ -f "$devtest_data_dir/eng_Latn-$lang/test.eng_Latn.pred.$sys" ]; then
|
|
echo "${lang}-eng_Latn"
|
|
|
|
src_fname=$devtest_data_dir/eng_Latn-$lang/test.$lang
|
|
pred_fname=$devtest_data_dir/eng_Latn-$lang/test.eng_Latn.pred.$sys
|
|
ref_fname=$devtest_data_dir/eng_Latn-$lang/test.eng_Latn
|
|
out_fname=$devtest_data_dir/eng_Latn-$lang/comet/${lang}_eng_Latn_${sys}_comet.txt
|
|
|
|
|
|
comet-score -s $src_fname -t $pred_fname -r $ref_fname --gpus 1 --model $model_name --quiet --only_system > $out_fname
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src_fname=$devtest_data_dir/eng_Latn-$lang/test.eng_Latn
|
|
pred_fname=$devtest_data_dir/eng_Latn-$lang/test.$lang.pred.*
|
|
ref_fname=$devtest_data_dir/eng_Latn-$lang/test.$lang
|
|
out_fname=$devtest_data_dir/eng_Latn-$lang/comet/eng_Latn_${lang}_comet_stat.txt
|
|
|
|
|
|
comet-compare -s $src_fname -t $pred_fname -r $ref_fname > $out_fname
|
|
|
|
|
|
|
|
src_fname=$devtest_data_dir/eng_Latn-$lang/test.$lang
|
|
pred_fname=$devtest_data_dir/eng_Latn-$lang/test.eng_Latn.pred.*
|
|
ref_fname=$devtest_data_dir/eng_Latn-$lang/test.eng_Latn
|
|
out_fname=$devtest_data_dir/eng_Latn-$lang/comet/${lang}_eng_Latn_comet_stat.txt
|
|
|
|
|
|
comet-compare -s $src_fname -t $pred_fname -r $ref_fname > $out_fname
|
|
|
|
done
|
|
|