patrickvonplaten commited on
Commit
712f1ab
1 Parent(s): 49bb9f1

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +76 -0
README.md ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: multilingual
3
+ license: mit
4
+ ---
5
+
6
+ # XLM-RoBERTa-XL (xlarge-sized model)
7
+
8
+ XLM-RoBERTa-XL model pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. It was introduced in the paper [Larger-Scale Transformers for Multilingual Masked Language Modeling](https://arxiv.org/abs/2105.00572) by Naman Goyal, Jingfei Du, Myle Ott, Giri Anantharaman, Alexis Conneau and first released in [this repository](https://github.com/pytorch/fairseq/tree/master/examples/xlmr).
9
+
10
+ Disclaimer: The team releasing XLM-RoBERTa-XL did not write a model card for this model so this model card has been written by the Hugging Face team.
11
+
12
+ ## Model description
13
+
14
+ XLM-RoBERTa-XL is a extra large multilingual version of RoBERTa. It is pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages.
15
+
16
+ RoBERTa is a transformers model pretrained on a large corpus in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labeling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts.
17
+
18
+ More precisely, it was pretrained with the Masked language modeling (MLM) objective. Taking a sentence, the model randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the sentence.
19
+
20
+ This way, the model learns an inner representation of 100 languages that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard classifier using the features produced by the XLM-RoBERTa-XL model as inputs.
21
+
22
+ ## Intended uses & limitations
23
+
24
+ You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?search=xlm-roberta-xl) to look for fine-tuned versions on a task that interests you.
25
+
26
+ Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked) to make decisions, such as sequence classification, token classification or question answering. For tasks such as text generation, you should look at models like GPT2.
27
+
28
+ ## Usage
29
+
30
+ You can use this model directly with a pipeline for masked language modeling:
31
+
32
+ ```python
33
+ >>> from transformers import pipeline
34
+ >>> unmasker = pipeline('fill-mask', model='facebook/xlm-roberta-xl')
35
+ >>> unmasker("Hello I'm a <mask> model.")
36
+
37
+
38
+ ```
39
+
40
+ Here is how to use this model to get the features of a given text in PyTorch:
41
+
42
+ ```python
43
+ from transformers import AutoTokenizer, AutoModelForMaskedLM
44
+
45
+ tokenizer = AutoTokenizer.from_pretrained('facebook/xlm-roberta-xl')
46
+ model = AutoModelForMaskedLM.from_pretrained("facebook/xlm-roberta-xl")
47
+
48
+ # prepare input
49
+ text = "Replace me by any text you'd like."
50
+ encoded_input = tokenizer(text, return_tensors='pt')
51
+
52
+ # forward pass
53
+ output = model(**encoded_input)
54
+ ```
55
+
56
+ ### BibTeX entry and citation info
57
+
58
+ ```bibtex
59
+ @article{DBLP:journals/corr/abs-2105-00572,
60
+ author = {Naman Goyal and
61
+ Jingfei Du and
62
+ Myle Ott and
63
+ Giri Anantharaman and
64
+ Alexis Conneau},
65
+ title = {Larger-Scale Transformers for Multilingual Masked Language Modeling},
66
+ journal = {CoRR},
67
+ volume = {abs/2105.00572},
68
+ year = {2021},
69
+ url = {https://arxiv.org/abs/2105.00572},
70
+ eprinttype = {arXiv},
71
+ eprint = {2105.00572},
72
+ timestamp = {Wed, 12 May 2021 15:54:31 +0200},
73
+ biburl = {https://dblp.org/rec/journals/corr/abs-2105-00572.bib},
74
+ bibsource = {dblp computer science bibliography, https://dblp.org}
75
+ }
76
+ ```