|
#!/usr/bin/env bash |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! -d "src/transformers" ]; then |
|
echo "Error: This script needs to be run from the top of the transformers repo" |
|
exit 1 |
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
export PAIR=en-ru |
|
export DATA_DIR=data/$PAIR |
|
export SAVE_DIR=data/$PAIR |
|
export BS=8 |
|
export NUM_BEAMS=8 |
|
mkdir -p $DATA_DIR |
|
sacrebleu -t wmt19 -l $PAIR --echo src | head -10 > $DATA_DIR/val.source |
|
sacrebleu -t wmt19 -l $PAIR --echo ref | head -10 > $DATA_DIR/val.target |
|
echo $PAIR |
|
PYTHONPATH="src:examples/seq2seq" python examples/seq2seq/run_eval.py facebook/wmt19-$PAIR $DATA_DIR/val.source $SAVE_DIR/test_translations.txt --reference_path $DATA_DIR/val.target --score_path $SAVE_DIR/test_bleu.json --bs $BS --task translation --num_beams $NUM_BEAMS |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export PAIR=ru-en |
|
export DATA_DIR=data/$PAIR |
|
export SAVE_DIR=data/$PAIR |
|
export BS=8 |
|
export NUM_BEAMS=50 |
|
mkdir -p $DATA_DIR |
|
sacrebleu -t wmt19 -l $PAIR --echo src > $DATA_DIR/val.source |
|
sacrebleu -t wmt19 -l $PAIR --echo ref > $DATA_DIR/val.target |
|
PYTHONPATH="src:examples/seq2seq" python examples/seq2seq/run_eval.py facebook/wmt19-$PAIR $DATA_DIR/val.source $SAVE_DIR/test_translations.txt --reference_path $DATA_DIR/val.target --score_path $SAVE_DIR/test_bleu.json --bs $BS --task translation --num_beams $NUM_BEAMS |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export PAIR=en-ru |
|
export DATA_DIR=data/$PAIR |
|
export SAVE_DIR=data/$PAIR |
|
export BS=8 |
|
export NUM_BEAMS=50 |
|
mkdir -p $DATA_DIR |
|
sacrebleu -t wmt19 -l $PAIR --echo src > $DATA_DIR/val.source |
|
sacrebleu -t wmt19 -l $PAIR --echo ref > $DATA_DIR/val.target |
|
echo $PAIR |
|
PYTHONPATH="src:examples/seq2seq" python examples/seq2seq/run_eval.py facebook/wmt19-$PAIR $DATA_DIR/val.source $SAVE_DIR/test_translations.txt --reference_path $DATA_DIR/val.target --score_path $SAVE_DIR/test_bleu.json --bs $BS --task translation --num_beams $NUM_BEAMS |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export PAIR=en-de |
|
export DATA_DIR=data/$PAIR |
|
export SAVE_DIR=data/$PAIR |
|
export BS=8 |
|
mkdir -p $DATA_DIR |
|
sacrebleu -t wmt19 -l $PAIR --echo src > $DATA_DIR/val.source |
|
sacrebleu -t wmt19 -l $PAIR --echo ref > $DATA_DIR/val.target |
|
echo $PAIR |
|
PYTHONPATH="src:examples/seq2seq" python examples/seq2seq/run_eval.py facebook/wmt19-$PAIR $DATA_DIR/val.source $SAVE_DIR/test_translations.txt --reference_path $DATA_DIR/val.target --score_path $SAVE_DIR/test_bleu.json --bs $BS --task translation --num_beams $NUM_BEAMS |
|
|
|
|
|
|
|
|
|
|
|
|
|
export PAIR=de-en |
|
export DATA_DIR=data/$PAIR |
|
export SAVE_DIR=data/$PAIR |
|
export BS=8 |
|
export NUM_BEAMS=50 |
|
mkdir -p $DATA_DIR |
|
sacrebleu -t wmt19 -l $PAIR --echo src > $DATA_DIR/val.source |
|
sacrebleu -t wmt19 -l $PAIR --echo ref > $DATA_DIR/val.target |
|
echo $PAIR |
|
PYTHONPATH="src:examples/seq2seq" python examples/seq2seq/run_eval.py facebook/wmt19-$PAIR $DATA_DIR/val.source $SAVE_DIR/test_translations.txt --reference_path $DATA_DIR/val.target --score_path $SAVE_DIR/test_bleu.json --bs $BS --task translation --num_beams $NUM_BEAMS |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export PAIR=ru-en |
|
export DATA_DIR=data/$PAIR |
|
export SAVE_DIR=data/$PAIR |
|
export BS=32 |
|
mkdir -p $DATA_DIR |
|
sacrebleu -t wmt19 -l $PAIR --echo src > $DATA_DIR/val.source |
|
sacrebleu -t wmt19 -l $PAIR --echo ref > $DATA_DIR/val.target |
|
CUDA_VISIBLE_DEVICES="0" PYTHONPATH="src:examples/seq2seq" python examples/seq2seq/run_eval_search.py facebook/wmt19-$PAIR $DATA_DIR/val.source $SAVE_DIR/test_translations.txt --reference_path $DATA_DIR/val.target --score_path $SAVE_DIR/test_bleu.json --bs $BS --task translation --search="num_beams=5 length_penalty=0.6:0.7:0.8:0.9:1.0:1.1" |
|
|
|
|
|
|
|
|
|
export PAIR=en-ru |
|
export DATA_DIR=data/$PAIR |
|
export SAVE_DIR=data/$PAIR |
|
export BS=16 |
|
mkdir -p $DATA_DIR |
|
mkdir -p $DATA_DIR |
|
sacrebleu -t wmt19 -l $PAIR --echo src > $DATA_DIR/val.source |
|
sacrebleu -t wmt19 -l $PAIR --echo ref > $DATA_DIR/val.target |
|
CUDA_VISIBLE_DEVICES="0" PYTHONPATH="src:examples/seq2seq" python examples/seq2seq/run_eval_search.py facebook/wmt19-$PAIR $DATA_DIR/val.source $SAVE_DIR/test_translations.txt --reference_path $DATA_DIR/val.target --score_path $SAVE_DIR/test_bleu.json --bs $BS --task translation --search="num_beams=5:8:11:15 length_penalty=0.6:0.7:0.8:0.9:1.0:1.1 early_stopping=true:false" |
|
|
|
|
|
|
|
export PAIR=en-de |
|
export DATA_DIR=data/$PAIR |
|
export SAVE_DIR=data/$PAIR |
|
export BS=16 |
|
mkdir -p $DATA_DIR |
|
sacrebleu -t wmt19 -l $PAIR --echo src > $DATA_DIR/val.source |
|
sacrebleu -t wmt19 -l $PAIR --echo ref > $DATA_DIR/val.target |
|
CUDA_VISIBLE_DEVICES="1" PYTHONPATH="src:examples/seq2seq" python examples/seq2seq/run_eval_search.py facebook/wmt19-$PAIR $DATA_DIR/val.source $SAVE_DIR/test_translations.txt --reference_path $DATA_DIR/val.target --score_path $SAVE_DIR/test_bleu.json --bs $BS --task translation --search="num_beams=5:8:11:15 length_penalty=0.6:0.7:0.8:0.9:1.0:1.1 early_stopping=true:false" |
|
|
|
|
|
|
|
export PAIR=de-en |
|
export DATA_DIR=data/$PAIR |
|
export SAVE_DIR=data/$PAIR |
|
export BS=16 |
|
mkdir -p $DATA_DIR |
|
mkdir -p $DATA_DIR |
|
sacrebleu -t wmt19 -l $PAIR --echo src > $DATA_DIR/val.source |
|
sacrebleu -t wmt19 -l $PAIR --echo ref > $DATA_DIR/val.target |
|
CUDA_VISIBLE_DEVICES="1" PYTHONPATH="src:examples/seq2seq" python examples/seq2seq/run_eval_search.py facebook/wmt19-$PAIR $DATA_DIR/val.source $SAVE_DIR/test_translations.txt --reference_path $DATA_DIR/val.target --score_path $SAVE_DIR/test_bleu.json --bs $BS --task translation --search="num_beams=5:8:11:15 length_penalty=0.6:0.7:0.8:0.9:1.0:1.1 early_stopping=true:false" |
|
|