-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathtrain_cws_wemb.sh
executable file
·30 lines (22 loc) · 999 Bytes
/
train_cws_wemb.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
28
29
30
#!/usr/bin/env bash
corpus=$1
export CUDA_VISIBLE_DEVICES=$2
if [ "${corpus}" != "pku" ] && [ "${corpus}" != "msr" ];then
echo "The first input must be pku or msr!"
exit
fi
chmod +x score.perl
model_root=model-wemb-${corpus}
if [ ! -d ${model_root} ];then
mkdir ${model_root}
fi
nohup python train.py --task cws \
--training_path data/datasets/sighan2005-${corpus}/train.txt \
--dev_path data/datasets/sighan2005-${corpus}/dev.txt \
--test_path data/datasets/sighan2005-${corpus}/test.txt \
--pre_trained_emb_path data/embeddings/news_tensite.w2v200 \
--pre_trained_word_emb_path data/embeddings/news_tensite.${corpus}.words.w2v50 \
--model_root ${model_root} \
--word_window 4 \
>>${model_root}/stdout.txt 2>>${model_root}/stderr.txt &
echo "Model and log are saved in ${model_root}."