-
Notifications
You must be signed in to change notification settings - Fork 19
/
test_single-source.sh
27 lines (20 loc) · 995 Bytes
/
test_single-source.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# --------------------- REQUIRED: Modify for each dataset and/or experiment ---------------------
# Set test source file (test_tgt is optional, can be used to compute CER and WER of the predicted output)
test_src="sample_dataset/postcorrection/training/test_src1.txt"
# Set experiment parameters
expt_folder="my_expt_singlesource/"
dynet_mem=1000 # Memory in MB available for testing
params="--pretrain_dec --pretrain_s2s --pretrain_enc --pointer_gen --coverage --diag_loss 2"
trained_model_name="my_trained_model"
# ------------------------------END: Required experimental settings------------------------------
# Load the trained model and get the predicted output on the test set (add --dynet-gpu for using GPU)
python postcorrection/multisource_wrapper.py \
--dynet-mem $dynet_mem \
--dynet-autobatch 1 \
--test_src1 $test_src \
$params \
--single \
--vocab_folder $expt_folder/vocab \
--output_folder $expt_folder \
--load_model $expt_folder"/models/"$trained_model_name \
--testing