|
conda activate onmtkd2 |
|
BASE="output-translation/flores" |
|
|
|
|
|
INP="input-files/flores/eng.devtest" |
|
|
|
LOW=$BASE"/test-low.en" |
|
TOK=$BASE"/test-tok.en" |
|
BPE=$BASE"/test-hyp.en" |
|
TRANS=$BASE"/test.hi" |
|
|
|
|
|
OUT=$BASE"/test-flores.hi" |
|
|
|
MODEL="en-hi/model.pt" |
|
CODES="en-hi/bpe-codes/codes.en" |
|
|
|
|
|
|
|
|
|
tools/mosesdecoder/scripts/tokenizer/lowercase.perl < $INP > $LOW |
|
|
|
tools/mosesdecoder/scripts/tokenizer/tokenizer.perl < $LOW > $TOK |
|
|
|
subword-nmt apply-bpe -c $CODES < $TOK > $BPE |
|
|
|
onmt_translate -model $MODEL -src $BPE -output $TRANS |
|
|
|
sed -r -i 's/(@@ )|(@@ ?$)//g; s/ ▁//g' $TRANS |
|
|
|
python3 tools/indic_nlp_library/indicnlp/tokenize/indic_detokenize.py $TRANS $OUT hi |
|
|
|
rm $LOW |
|
rm $TOK |
|
rm $BPE |
|
rm $TRANS |
|
conda deactivate |
|
|