Scripts for training and evaluation of low-resource NMT

70 views
Skip to first unread message

Andar

unread,
Oct 30, 2019, 3:41:04 AM10/30/19
to Nematus Support
Dear all,

I need to train and evaluate an NMT model for a low-resource language with NEMATUS. Could you help me find the scripts for training and evaluation of experiments done in Revisiting Low-Resource Neural Machine Translation: A Case Study (https://arxiv.org/abs/1905.11901)?

Regards,
Andar

Rico Sennrich

unread,
Oct 30, 2019, 4:20:10 AM10/30/19
to nematus...@googlegroups.com
Hi Andar,

You can start with the scripts in http://data.statmt.org/wmt17_systems/training/

You can then skip steps 2-3 (data download and preprocessing, and use the data from here instead: http://data.statmt.org/rsennrich/iwslt14_lowresource/), and start with step 4: just modify scripts/train.sh with the config options you want to test.

scripts/evaluate.sh uses multi-bleu-detok.perl . In the paper, we report results with https://github.com/mjpost/sacreBLEU , but both should give the same results.

best wishes,
Rico
--
You received this message because you are subscribed to the Google Groups "Nematus Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nematus-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nematus-support/7074fd0a-958b-45b6-9ea8-7d9b290ef03e%40googlegroups.com.


Andar

unread,
Nov 1, 2019, 3:19:13 AM11/1/19
to Nematus Support
Hi Rico,

Thank you for your reply. Sadly, I couldn't replicate the experiment as Nematus requires Python 3.5.2 and Tensorflow 1.12. By this time, it is too difficult to install both even with anaconda. Is there any alternative?

Best,
Andar


On Wednesday, October 30, 2019 at 11:20:10 AM UTC+3, Rico Sennrich wrote:
Hi Andar,

You can start with the scripts in http://data.statmt.org/wmt17_systems/training/

You can then skip steps 2-3 (data download and preprocessing, and use the data from here instead: http://data.statmt.org/rsennrich/iwslt14_lowresource/), and start with step 4: just modify scripts/train.sh with the config options you want to test.

scripts/evaluate.sh uses multi-bleu-detok.perl . In the paper, we report results with https://github.com/mjpost/sacreBLEU , but both should give the same results.

best wishes,
Rico

On 30/10/2019 08:41, Andar wrote:
Dear all,

I need to train and evaluate an NMT model for a low-resource language with NEMATUS. Could you help me find the scripts for training and evaluation of experiments done in Revisiting Low-Resource Neural Machine Translation: A Case Study (https://arxiv.org/abs/1905.11901)?

Regards,
Andar
--
You received this message because you are subscribed to the Google Groups "Nematus Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nematus...@googlegroups.com.

Rico Sennrich

unread,
Nov 3, 2019, 1:23:56 PM11/3/19
to nematus...@googlegroups.com
Hi Andar,

apologies if the README was confusing. In fact, any newer Tensorflow version of the 1.X branch should be fine (just tested with TF 1.12, 1.13, 1.14 and 1.15), as well as newer Python versions.

best wishes,
Rico
To unsubscribe from this group and stop receiving emails from it, send an email to nematus-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nematus-support/324bfd90-f20b-44cb-95bf-cba6decd8d84%40googlegroups.com.


Andar

unread,
Nov 5, 2019, 3:26:26 AM11/5/19
to Nematus Support
Dear Rico,

Thanks a lot for your reply. I was running the attached bash scripts, train-lr.sh and validate-lr.sh. I still get the attached error message. I was using Tensorflow 1.14.0 and Python 3.6.9. Could you give me your comments?

Best,
Andar
train-lr.sh
validate-lr.sh
error_msg_nematus.txt

Rico Sennrich

unread,
Nov 5, 2019, 3:38:01 AM11/5/19
to nematus...@googlegroups.com
Hello Andar,

I said you can skip preprocessing, but you'll actually need to execute the last step in the preprocessing script (building the network dictionary). Just run the following (either for both the source or target side, or, if you want to use tied embeddings, for the concatenation of both:

nematus/data_build_dictionary {corpus_name}

This will create files {corpus_name}.json, which you then pass to the "--dictionaries" argument when you call the Nematus training script.

best wishes,
Rico
To unsubscribe from this group and stop receiving emails from it, send an email to nematus-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nematus-support/b773719c-f967-46d9-83db-593fe781b5c2%40googlegroups.com.

Andar

unread,
Nov 6, 2019, 12:41:05 AM11/6/19
to Nematus Support
Dear Rico,

Thank you so much. It works perfectly. One more question. How can I set the BiDeep RNN architecture in the bash script? There are only two choices, rnn and transformer, for model_type.

Best,
Andar

Rico Sennrich

unread,
Nov 13, 2019, 8:40:14 AM11/13/19
to nematus...@googlegroups.com
Hi Andar,

the BiDeep architecture is an RNN architecture, and the result of enabling two kinds of depth: stack depth and deep transition depth.

--rnn_enc_depth and --rnn_dec_depth control the number of layers (stack depth),
--rnn_enc_transition_depth, --rnn_dec_base_transition_depth and --rnn_dec_high_transition_depth control the number of GRU transitions per layer (deep transition depth).

best wishes,
Rico
To unsubscribe from this group and stop receiving emails from it, send an email to nematus-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nematus-support/8aee6152-f199-46dd-bd29-a6ab069e8b9b%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages