|
42 | 42 | -src_vocab /tmp/onmt.vocab.src \
|
43 | 43 | -tgt_vocab /tmp/onmt.vocab.tgt \
|
44 | 44 | && rm -rf /tmp/sample
|
| 45 | + - name: Test vocabulary build with features |
| 46 | + run: | |
| 47 | + python onmt/bin/build_vocab.py \ |
| 48 | + -config data/features_data.yaml \ |
| 49 | + -save_data /tmp/onmt_feat \ |
| 50 | + -src_vocab /tmp/onmt_feat.vocab.src \ |
| 51 | + -tgt_vocab /tmp/onmt_feat.vocab.tgt \ |
| 52 | + -src_feats_vocab '{"feat0": "/tmp/onmt_feat.vocab.feat0"}' \ |
| 53 | + -n_sample -1 \ |
| 54 | + && rm -rf /tmp/sample |
45 | 55 | - name: Test field/transform dump
|
46 | 56 | run: |
|
47 | 57 | # The dumped fields are used later when testing tools
|
@@ -169,6 +179,26 @@ jobs:
|
169 | 179 | -state_dim 256 \
|
170 | 180 | -n_steps 10 \
|
171 | 181 | -n_node 64
|
| 182 | + - name: Testing training with features |
| 183 | + run: | |
| 184 | + python onmt/bin/train.py \ |
| 185 | + -config data/features_data.yaml \ |
| 186 | + -src_vocab /tmp/onmt_feat.vocab.src \ |
| 187 | + -tgt_vocab /tmp/onmt_feat.vocab.tgt \ |
| 188 | + -src_feats_vocab '{"feat0": "/tmp/onmt_feat.vocab.feat0"}' \ |
| 189 | + -src_vocab_size 1000 -tgt_vocab_size 1000 \ |
| 190 | + -rnn_size 2 -batch_size 10 \ |
| 191 | + -word_vec_size 5 -rnn_size 10 \ |
| 192 | + -report_every 5 -train_steps 10 \ |
| 193 | + -save_model /tmp/onmt.model \ |
| 194 | + -save_checkpoint_steps 10 |
| 195 | + - name: Testing translation with features |
| 196 | + run: | |
| 197 | + python translate.py \ |
| 198 | + -model /tmp/onmt.model_step_10.pt \ |
| 199 | + -src data/data_features/src-test.txt \ |
| 200 | + -src_feats "{'feat0': 'data/data_features/src-test.feat0'}" \ |
| 201 | + -verbose |
172 | 202 | - name: Test RNN translation
|
173 | 203 | run: |
|
174 | 204 | head data/src-test.txt > /tmp/src-test.txt
|
|
0 commit comments