|
BASE="output-translation" |
|
|
|
|
|
INP="input-files/eng.devtest" |
|
|
|
LOW=$BASE"/test-low.en" |
|
TOK=$BASE"/test-tok.en" |
|
BPE=$BASE"/test-hyp.en" |
|
TRANS=$BASE"/test.mr" |
|
|
|
|
|
OUT=$BASE"/flores.mr" |
|
|
|
MODEL="en-mr/model.pt" |
|
CODES="en-mr/bpe-codes/bpe-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 -gpu 0 |
|
|
|
sed -r -i 's/(@@ )|(@@ ?$)//g' $TRANS |
|
|
|
sed -r -i 's/ &apos;//g' $TRANS |
|
|
|
python3 tools/indic_nlp_library/indicnlp/tokenize/indic_detokenize.py $TRANS $OUT mr |
|
|
|
|
|
|
|
|
|
|
|
|