mapama247 commited on
Commit
8cc05dd
1 Parent(s): ac524c0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +189 -0
README.md CHANGED
@@ -1,3 +1,192 @@
1
  ---
 
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language: ca
3
  license: apache-2.0
4
+ tags:
5
+ - "catalan"
6
+ - "masked-lm"
7
+ - "distilroberta"
8
+ widget:
9
+ - text: "El Català és una llengua molt <mask>."
10
+ - text: "Salvador Dalí va viure a <mask>."
11
+ - text: "La Costa Brava té les millors <mask> d'Espanya."
12
+ - text: "El cacaolat és un batut de <mask>."
13
+ - text: "<mask> és la capital de la Garrotxa."
14
+ - text: "Vaig al <mask> a buscar bolets."
15
+ - text: "Antoni Gaudí vas ser un <mask> molt important per la ciutat."
16
+ - text: "Catalunya és una referència en <mask> a nivell europeu."
17
  ---
18
+
19
+ # DistilRoBERTa-base-ca
20
+
21
+ ## Overview
22
+ - **Architecture:** DistilRoBERTa-base
23
+ - **Language:** Catalan
24
+ - **Task:** Fill-Mask
25
+ - **Data:** Crawling
26
+
27
+
28
+ ## Model description
29
+
30
+ This model is a distilled version of [projecte-aina/roberta-base-ca-v2](https://huggingface.co/projecte-aina/roberta-base-ca-v2). It follows the same training procedure as [DistilBERT](https://arxiv.org/abs/1910.01108), using the implementation of Knowledge Distillation from the paper's [official repository](https://github.com/huggingface/transformers/tree/main/examples/research_projects/distillation).
31
+
32
+ The resulting architecture consists of 6 layers, 768 dimensional embeddings and 12 attention heads. This adds up to a total of 82M parameters, which is considerably less than the 125M of standard RoBERTa-base models. This makes the model lighter and faster than the original, at the cost of a slightly lower performance.
33
+
34
+ We encourage users of this model to check out the [projecte-aina/roberta-base-ca-v2](https://huggingface.co/projecte-aina/roberta-base-ca-v2) model card to learn more details about the teacher model, as well as the training and evaluation data.
35
+
36
+ ## Intended uses and limitations
37
+
38
+ This model is ready-to-use only for masked language modeling (MLM) to perform the Fill-Mask task. However, it is intended to be fine-tuned on non-generative downstream tasks such as Question Answering, Text Classification or Named Entity Recognition.
39
+
40
+ ## How to use
41
+
42
+ Usage example where the model is passed to a fill-mask pipeline to predict the masked word (`<mask>`) from a given text.
43
+ ```python
44
+ from pprint import pprint
45
+ from transformers import pipeline
46
+ pipe = pipeline("fill-mask", model="projecte-aina/distilroberta-base-ca")
47
+ text = "El <mask> és el meu dia preferit de la setmana."
48
+ pprint(pipe(text))
49
+ ```
50
+ ```
51
+ [{'score': 0.2531125545501709,
52
+ 'sequence': ' El dilluns és el meu dia preferit de la setmana.',
53
+ 'token': 2885,
54
+ 'token_str': ' dilluns'},
55
+ {'score': 0.13626143336296082,
56
+ 'sequence': ' El divendres és el meu dia preferit de la setmana.',
57
+ 'token': 2539,
58
+ 'token_str': ' divendres'},
59
+ {'score': 0.11026635020971298,
60
+ 'sequence': ' El dijous és el meu dia preferit de la setmana.',
61
+ 'token': 2868,
62
+ 'token_str': ' dijous'},
63
+ {'score': 0.10040736198425293,
64
+ 'sequence': ' El dissabte és el meu dia preferit de la setmana.',
65
+ 'token': 2480,
66
+ 'token_str': ' dissabte'},
67
+ {'score': 0.09762872755527496,
68
+ 'sequence': ' El diumenge és el meu dia preferit de la setmana.',
69
+ 'token': 2587,
70
+ 'token_str': ' diumenge'}]
71
+ ```
72
+
73
+ ## Limitations and bias
74
+
75
+ At the time of submission, no measures have been taken to estimate the bias embedded in the model. However, we are well aware that our models may be biased since the corpora have been collected using crawling techniques on multiple web sources. We intend to conduct research in these areas in the future, and if completed, this model card will be updated.
76
+
77
+ ## Training
78
+
79
+ ### Training procedure
80
+
81
+ This model has been trained using a technique known as Knowledge Distillation, which is used to shrink networks to a reasonable size while minimizing the loss in performance.
82
+
83
+ It basically consists in distilling a large language model (the teacher) into a more lightweight, energy-efficient, and production-friendly model (the student).
84
+
85
+ So, in a “teacher-student learning” setup, a relatively small student model is trained to mimic the behavior of a larger teacher model. As a result, the student has lower inference time and the ability to run in commodity hardware.
86
+
87
+ ### Training data
88
+
89
+ The training corpus consists of several corpora gathered from web crawling and public corpora, as shown in the table below:
90
+
91
+ | Corpus | Size (GB) |
92
+ |--------------------------|------------|
93
+ | Catalan Crawling | 13.00 |
94
+ | RacoCatalá | 8.10 |
95
+ | Catalan Oscar | 4.00 |
96
+ | CaWaC | 3.60 |
97
+ | Cat. General Crawling | 2.50 |
98
+ | Wikipedia | 1.10 |
99
+ | DOGC | 0.78 |
100
+ | Padicat | 0.63 |
101
+ | ACN | 0.42 |
102
+ | Nació Digital | 0.42 |
103
+ | Cat. Government Crawling | 0.24 |
104
+ | Vilaweb | 0.06 |
105
+ | Catalan Open Subtitles | 0.02 |
106
+ | Tweets | 0.02 |
107
+
108
+ ## Evaluation
109
+
110
+ ### Evaluation benchmark
111
+
112
+ This model has been fine-tuned on the downstream tasks of the [Catalan Language Understanding Evaluation benchmark (CLUB)](https://club.aina.bsc.es/), which includes the following datasets:
113
+
114
+ | Dataset | Task| Total | Train | Dev | Test |
115
+ |:----------|:----|:--------|:-------|:------|:------|
116
+ | AnCora | NER | 13,581 | 10,628 | 1,427 | 1,526 |
117
+ | AnCora | POS | 16,678 | 13,123 | 1,709 | 1,846 |
118
+ | STS-ca | STS | 3,073 | 2,073 | 500 | 500 |
119
+ | TeCla | TC | 137,775 | 110,203| 13,786| 13,786|
120
+ | TE-ca | RTE | 21,163 | 16,930 | 2,116 | 2,117 |
121
+ | CatalanQA | QA | 21,427 | 17,135 | 2,157 | 2,135 |
122
+ | XQuAD-ca | QA | - | - | - | 1,189 |
123
+
124
+ ### Evaluation results
125
+
126
+ This is how it compares to its teacher when fine-tuned on the aforementioned downstream tasks:
127
+
128
+ | Model \ Task |NER (F1)|POS (F1)|STS-ca (Comb.)|TeCla (Acc.)|TEca (Acc.)|CatalanQA (F1/EM)| XQuAD-ca <sup>1</sup> (F1/EM) |
129
+ | ------------------------|:-------|:-------|:-------------|:-----------|:----------|:----------------|:------------------------------|
130
+ | RoBERTa-base-ca-v2 | 89.29 | 98.96 | 79.07 | 74.26 | 83.14 | 89.50/76.63 | 73.64/55.42 |
131
+ | DistilRoBERTa-base-ca | 87.88 | 98.83 | 77.26 | 73.20 | 76.00 | 84.07/70.77 | 62.93/45.08 |
132
+
133
+ <sup>1</sup> : Trained on CatalanQA, tested on XQuAD-ca.
134
+
135
+ ## Additional information
136
+
137
+ ### Authors
138
+
139
+ The Text Mining Unit (TeMU) from Barcelona Supercomputing Center ([bsc-temu@bsc.es](bsc-temu@bsc.es)).
140
+
141
+ ### Contact information
142
+
143
+ For further information, send an email to [aina@bsc.es](aina@bsc.es).
144
+
145
+ ### Copyright
146
+
147
+ Copyright by the Text Mining Unit at Barcelona Supercomputing Center.
148
+
149
+ ### Licensing information
150
+
151
+ This work is licensed under a [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
152
+
153
+ ### Funding
154
+
155
+ This work was funded by the [Departament de la Vicepresidència i de Polítiques Digitals i Territori de la Generalitat de Catalunya](https://politiquesdigitals.gencat.cat/ca/inici/index.html#googtrans(ca|en) within the framework of [Projecte AINA](https://politiquesdigitals.gencat.cat/ca/economia/catalonia-ai/aina).
156
+
157
+ ### Citation information
158
+
159
+ There is no publication for this specific model, but you can cite the paper where the teacher model was presented:
160
+ ```bibtex
161
+ @inproceedings{armengol-estape-etal-2021-multilingual,
162
+ title = "Are Multilingual Models the Best Choice for Moderately Under-resourced Languages? {A} Comprehensive Assessment for {C}atalan",
163
+ author = "Armengol-Estap{\'e}, Jordi and
164
+ Carrino, Casimiro Pio and
165
+ Rodriguez-Penagos, Carlos and
166
+ de Gibert Bonet, Ona and
167
+ Armentano-Oller, Carme and
168
+ Gonzalez-Agirre, Aitor and
169
+ Melero, Maite and
170
+ Villegas, Marta",
171
+ booktitle = "Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021",
172
+ month = aug,
173
+ year = "2021",
174
+ address = "Online",
175
+ publisher = "Association for Computational Linguistics",
176
+ url = "https://aclanthology.org/2021.findings-acl.437",
177
+ doi = "10.18653/v1/2021.findings-acl.437",
178
+ pages = "4933--4946",
179
+ }]
180
+ ```
181
+
182
+ ### Disclaimer
183
+
184
+ <details>
185
+ <summary>Click to expand</summary>
186
+
187
+ The models published in this repository are intended for a generalist purpose and are available to third parties. These models may have bias and/or any other undesirable distortions.
188
+
189
+ When third parties, deploy or provide systems and/or services to other parties using any of these models (or using systems based on these models) or become users of the models, they should note that it is their responsibility to mitigate the risks arising from their use and, in any event, to comply with applicable regulations, including regulations regarding the use of Artificial Intelligence.
190
+
191
+ In no event shall the owner and creator of the models (BSC) be liable for any results arising from the use made by third parties of these models.
192
+ </details>