Skip to content

Commit 99b4458

Browse files
committed
Inital OpenNMT-py
1 parent 4f441b0 commit 99b4458

File tree

3 files changed

+51
-2
lines changed

3 files changed

+51
-2
lines changed

scripts/defaultPreprocessor/Train.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ done
8282

8383
for set in valid train
8484
do
85-
for f in /tmp/${name}/tok/$set/*\.s
85+
for f in /tmp/${name}/sc/$set/*\.s
8686
do
8787
echo $f
8888
/opt/subword-nmt/apply_bpe.py -c /model/${name}/codec --vocabulary /model/${name}/voc.s --vocabulary-threshold 50 < $f > /data/${name}/$set/${f##*/}
@@ -91,7 +91,7 @@ done
9191

9292
for set in valid train
9393
do
94-
for f in /tmp/${name}/tok/$set/*\.t
94+
for f in /tmp/${name}/sc/$set/*\.t
9595
do
9696
echo $f
9797
/opt/subword-nmt/apply_bpe.py -c /model/${name}/codec --vocabulary /model/${name}/voc.t --vocabulary-threshold 50 < $f > /data/${name}/$set/${f##*/}

scripts/openNMT-py/Train.sh

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
input=$1
4+
name=$2
5+
6+
7+
mkdir -p /tmp/${name}/
8+
mkdir -p /model/${name}/
9+
10+
11+
12+
13+
for l in s t
14+
do
15+
for set in train valid
16+
do
17+
echo "" > /tmp/${name}/$set.$l
18+
for f in /data/${input}/${set}/*\.${l}
19+
do
20+
21+
cat $f >> /tmp/${name}/$set.$l
22+
done
23+
done
24+
done
25+
26+
27+
28+
python /opt/OpenNMT-py/preprocess.py \
29+
-train_src /tmp/${name}/train.s \
30+
-train_tgt /tmp/${name}/train.t \
31+
-valid_src /tmp/${name}/valid.s \
32+
-valid_tgt /tmp/${name}/vaild.t \
33+
-save_data /tmp/${name}/train \
34+
-src_langs s \
35+
-tgt_langs t
36+
37+
38+
python -u /opt/OpenNMT-py/train.py -data /tmp/${name}/train.train.pt \
39+
-save_model /model/${name}/model \
40+
-brnn \
41+
-rnn_size 512 \
42+
-word_vec_size 512 \
43+
-batch_size 128 \
44+
-max_generator_batches 16 \
45+
-optim adam \
46+
-dropout 0.2 \
47+
-epochs 10 \
48+
-learning_rate 0.001 \
49+
-gpus 0

systems/smallTED/Train.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)