-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.sh
23 lines (15 loc) · 770 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
cd OpenNMT-py
python translate.py -model demo0-model_step_50000.pt -src ../Data/0.src.val --gpu 0 -output pred.txt -beam_size 10 -batch_size 20
sed -i 's/ //g' pred.txt
sed -i 's/▁/ /g' pred.txt
cp ../Data/0.tgt.val gold.txt
sed -i 's/ //g' gold.txt
sed -i 's/▁/ /g' gold.txt
sacrebleu -i pred.txt gold.txt --metrics chrf --echo both
# translate to fixed language
python translate.py -model demo0-model_step_50000.pt -src ../Data/0.src.val --gpu 0 -output pred.txt -beam_size 10 -batch_size 20 -trans_to tibt
python translate.py -model demo0-model_step_50000.pt -src ../Data/0.src.val --gpu 0 -output pred.txt -beam_size 10 -batch_size 20 -trans_to beng
# Server
mv demo0-model_step_50000.pt available_models/
python server.py
python test_sever.py