|
BASE="output-translation/flores" |
|
|
|
|
|
INP="input-files/flores/hin.devtest" |
|
|
|
LOW=$BASE"/test-low.hi" |
|
TOK=$BASE"/test-tok.hi" |
|
BPEI=$BASE"/test-hyp-i.hi" |
|
BPE=$BASE"/test-hyp.hi" |
|
TRANS=$BASE"/test.en" |
|
|
|
|
|
OUT=$BASE"/test-flores.en" |
|
|
|
MODEL="hi-en/model.pt" |
|
CODES="hi-en/bpe-codes/bpe-codes.hi" |
|
|
|
python3 tools/indic_nlp_library/indicnlp/normalize/indic_normalize.py $INP $LOW hi |
|
|
|
python3 tools/indic_nlp_library/indicnlp/tokenize/indic_tokenize.py $LOW $TOK hi |
|
|
|
python3 apply_bpe.py -c $CODES < $TOK > $BPEI |
|
|
|
python3 merge_bpe_word.py $BPEI $TOK $BPE |
|
|
|
CUDA_VISIBLE_DEVICES=0 python3 /home/development/akashb/web-service/OpenNMT-py/translate.py --gpu 0 --model $MODEL --src $BPE --output $TRANS |
|
|
|
|
|
|
|
sed -r -i 's/(@@ )|(@@ ?$)//g; s/ ▁//g' $TRANS |
|
|
|
tools/mosesdecoder/scripts/tokenizer/detokenizer.perl < $TRANS > $OUT |
|
|
|
rm $LOW |
|
|
|
rm $BPE |
|
rm $BPEI |
|
rm $TRANS |
|
|