# A few wmt seq2seq dataset-related scripts

**URL:** <https://discuss.huggingface.co/t/a-few-wmt-seq2seq-dataset-related-scripts/687>\
**Category:** Beginners\
**Created:** [August 12, 2020, 2:34am UTC](https://discuss.huggingface.co/t/a-few-wmt-seq2seq-dataset-related-scripts/687 "2020-08-12T02:34:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stas](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/stas/32/19289_2.png) [@stas](https://discuss.huggingface.co/u/stas)\
**Post date:** [August 12, 2020, 2:34am UTC](https://discuss.huggingface.co/t/a-few-wmt-seq2seq-dataset-related-scripts/687/1 "2020-08-12T02:34:59Z")

</div>

Here are a couple of new wmt dataset seq2seq related scripts:

### 1.

If you need to test your transformers code performance against [fairseq](https://github.com/pytorch/fairseq/), the latter requires a different format for the dataset.

I wrote a little script to convert from a dataset format used by transformers summarization-like tasks (seq2seq) (i.e. train.source, train.target, val.source, val.target, test.source, test.targett) to what fairseq expects for [MBART: Multilingual Denoising Pre-training for Neural Machine Translation](https://github.com/pytorch/fairseq/blob/master/examples/mbart/README.md#finetune-on-en-ro).

You can use [this sample dataset](https://github.com/huggingface/transformers/tree/master/examples/seq2seq/test_data/wmt_en_ro). But also see the next item below.

For more details, please see: [https://github.com/stas00/nlp-helpers/tree/master/fairseq/wmt/](https://github.com/stas00/nlp-helpers/tree/master/fairseq/wmt/)

### 2.

Related, @sshleifer and I have just added a script to download wmt data for any year and language pair and save it in seq2seq format.

You will find it here: [https://github.com/huggingface/transformers/blob/master/examples/seq2seq/download\_wmt.py](https://github.com/huggingface/transformers/blob/master/examples/seq2seq/download_wmt.py)

This script’s output is as good as `huggingface/nlp` is. e.g. for `wmt19-ru-en` the current incarnation of the `nlp` module is missing the test data and has [other problems](https://github.com/huggingface/nlp/issues/488).

Thanks to the tip by @sshleifer, I was able to get the missing files with:

```auto
pip install sacrebleu
sacrebleu -t wmt19 -l ru-en --echo src > test.source
sacrebleu -t wmt19 -l ru-en --echo ref > test.target

```

Enjoy.
