julien-c HF staff commited on
Commit
a9ec196
1 Parent(s): 47ed910

Migrate model card from transformers-repo

Browse files

Read announcement at https://discuss.huggingface.co/t/announcement-all-model-cards-will-be-migrated-to-hf-co-model-repos/2755
Original file history: https://github.com/huggingface/transformers/commits/master/model_cards/allenai/wmt19-de-en-6-6-base/README.md

Files changed (1) hide show
  1. README.md +101 -0
README.md ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ language:
5
+ - de
6
+ - en
7
+ thumbnail:
8
+ tags:
9
+ - translation
10
+ - wmt19
11
+ - allenai
12
+ license: apache-2.0
13
+ datasets:
14
+ - wmt19
15
+ metrics:
16
+ - bleu
17
+ ---
18
+
19
+ # FSMT
20
+
21
+ ## Model description
22
+
23
+ This is a ported version of fairseq-based [wmt19 transformer](https://github.com/jungokasai/deep-shallow/) for de-en.
24
+
25
+ For more details, please, see [Deep Encoder, Shallow Decoder: Reevaluating the Speed-Quality Tradeoff in Machine Translation](https://arxiv.org/abs/2006.10369).
26
+
27
+ 2 models are available:
28
+
29
+ * [wmt19-de-en-6-6-big](https://huggingface.co/allenai/wmt19-de-en-6-6-big)
30
+ * [wmt19-de-en-6-6-base](https://huggingface.co/allenai/wmt19-de-en-6-6-base)
31
+
32
+
33
+ ## Intended uses & limitations
34
+
35
+ #### How to use
36
+
37
+ ```python
38
+ from transformers import FSMTForConditionalGeneration, FSMTTokenizer
39
+ mname = "allenai/wmt19-de-en-6-6-base"
40
+ tokenizer = FSMTTokenizer.from_pretrained(mname)
41
+ model = FSMTForConditionalGeneration.from_pretrained(mname)
42
+
43
+ input = "Maschinelles Lernen ist großartig, nicht wahr?"
44
+ input_ids = tokenizer.encode(input, return_tensors="pt")
45
+ outputs = model.generate(input_ids)
46
+ decoded = tokenizer.decode(outputs[0], skip_special_tokens=True)
47
+ print(decoded) # Machine learning is great, isn't it?
48
+
49
+ ```
50
+
51
+ #### Limitations and bias
52
+
53
+
54
+ ## Training data
55
+
56
+ Pretrained weights were left identical to the original model released by allenai. For more details, please, see the [paper](https://arxiv.org/abs/2006.10369).
57
+
58
+ ## Eval results
59
+
60
+ Here are the BLEU scores:
61
+
62
+ model | transformers
63
+ -------|---------
64
+ wmt19-de-en-6-6-base | 38.37
65
+
66
+ The score was calculated using this code:
67
+
68
+ ```bash
69
+ git clone https://github.com/huggingface/transformers
70
+ cd transformers
71
+ export PAIR=de-en
72
+ export DATA_DIR=data/$PAIR
73
+ export SAVE_DIR=data/$PAIR
74
+ export BS=8
75
+ export NUM_BEAMS=5
76
+ mkdir -p $DATA_DIR
77
+ sacrebleu -t wmt19 -l $PAIR --echo src > $DATA_DIR/val.source
78
+ sacrebleu -t wmt19 -l $PAIR --echo ref > $DATA_DIR/val.target
79
+ echo $PAIR
80
+ PYTHONPATH="src:examples/seq2seq" python examples/seq2seq/run_eval.py allenai/wmt19-de-en-6-6-base $DATA_DIR/val.source $SAVE_DIR/test_translations.txt --reference_path $DATA_DIR/val.target --score_path $SAVE_DIR/test_bleu.json --bs $BS --task translation --num_beams $NUM_BEAMS
81
+ ```
82
+
83
+ ## Data Sources
84
+
85
+ - [training, etc.](http://www.statmt.org/wmt19/)
86
+ - [test set](http://matrix.statmt.org/test_sets/newstest2019.tgz?1556572561)
87
+
88
+
89
+ ### BibTeX entry and citation info
90
+
91
+ ```
92
+ @misc{kasai2020deep,
93
+ title={Deep Encoder, Shallow Decoder: Reevaluating the Speed-Quality Tradeoff in Machine Translation},
94
+ author={Jungo Kasai and Nikolaos Pappas and Hao Peng and James Cross and Noah A. Smith},
95
+ year={2020},
96
+ eprint={2006.10369},
97
+ archivePrefix={arXiv},
98
+ primaryClass={cs.CL}
99
+ }
100
+ ```
101
+