initial commit
Browse files- .gitattributes +1 -0
- README.md +143 -0
- config.json +58 -0
- pytorch_model.bin +3 -0
- tokenizer.json +0 -0
.gitattributes
CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
pytorch_model.bin filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,3 +1,146 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
|
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
|
3 |
+
language:
|
4 |
+
|
5 |
+
- es
|
6 |
+
|
7 |
license: apache-2.0
|
8 |
+
|
9 |
+
tags:
|
10 |
+
|
11 |
+
- "español"
|
12 |
+
|
13 |
+
- "text classification"
|
14 |
+
|
15 |
+
- "WikiCAT_esv2"
|
16 |
+
datasets:
|
17 |
+
- "projecte-aina/WikiCAT_esv2"
|
18 |
+
|
19 |
+
metrics:
|
20 |
+
|
21 |
+
- f1-macro
|
22 |
+
|
23 |
+
model-index:
|
24 |
+
- name: roberta-base-es-wikicat-es
|
25 |
+
results:
|
26 |
+
- task:
|
27 |
+
type: text-classification
|
28 |
+
dataset:
|
29 |
+
type: projecte-aina/WikiCAT_esv2
|
30 |
+
name: WikiCAT_esv2
|
31 |
+
metrics:
|
32 |
+
- name: F1-macro
|
33 |
+
type: f1
|
34 |
+
value: 0.76632
|
35 |
+
- name: Accuracy
|
36 |
+
type: accuracy
|
37 |
+
value: 0.79347
|
38 |
+
|
39 |
+
widget:
|
40 |
+
- text: "Sedna es el cuerpo menor del sistema solar número 90377; concretamente es un objeto transneptuniano."
|
41 |
+
- text: "El Descendimiento es un óleo realizado hacia 1435 por el pintor flamenco Rogier van der Weyden."
|
42 |
+
|
43 |
---
|
44 |
+
|
45 |
+
# Spanish BERTa-v2 (roberta-base-es) finetuned for Text Classification.
|
46 |
+
|
47 |
+
## Table of Contents
|
48 |
+
<details>
|
49 |
+
<summary>Click to expand</summary>
|
50 |
+
|
51 |
+
- [Model description](#model-description)
|
52 |
+
- [Intended uses and limitations](#intended-uses-and-limitations)
|
53 |
+
- [How to use](#how-to-use)
|
54 |
+
- [Limitations and bias](#limitations-and-bias)
|
55 |
+
- [Training](#training)
|
56 |
+
- [Training data](#training-data)
|
57 |
+
- [Training procedure](#training-procedure)
|
58 |
+
- [Evaluation](#evaluation)
|
59 |
+
- [Variable and metrics](#variable-and-metrics)
|
60 |
+
- [Evaluation results](#evaluation-results)
|
61 |
+
- [Additional information](#additional-information)
|
62 |
+
- [Author](#author)
|
63 |
+
- [Contact information](#contact-information)
|
64 |
+
- [Copyright](#copyright)
|
65 |
+
- [Licensing information](#licensing-information)
|
66 |
+
- [Funding](#funding)
|
67 |
+
- [Disclaimer](#disclaimer)
|
68 |
+
|
69 |
+
</details>
|
70 |
+
|
71 |
+
## Model description
|
72 |
+
|
73 |
+
The **roberta-base-es-wikicat-es** is a Text Classification model for the Catalan language fine-tuned from the [roberta-base-bne](https://huggingface.co/PlanTL-GOB-ES/roberta-base-bne) model, a [RoBERTa](https://arxiv.org/abs/1907.11692) base model pre-trained on a medium-size corpus collected from publicly available corpora and crawlers (check the roberta-base-bne model card for more details).
|
74 |
+
|
75 |
+
## Intended uses and limitations
|
76 |
+
|
77 |
+
**roberta-base-es-wikicat-es** model can be used to classify texts. The model is limited by its training dataset and may not generalize well for all use cases.
|
78 |
+
|
79 |
+
## How to use
|
80 |
+
|
81 |
+
Here is how to use this model:
|
82 |
+
|
83 |
+
```python
|
84 |
+
from transformers import pipeline
|
85 |
+
from pprint import pprint
|
86 |
+
nlp = pipeline("text-classification", model="roberta-base-es-wikicat-es")
|
87 |
+
example = "Sedna es el cuerpo menor del sistema solar número 90377; concretamente es un objeto transneptuniano."
|
88 |
+
tc_results = nlp(example)
|
89 |
+
pprint(tc_results)
|
90 |
+
```
|
91 |
+
|
92 |
+
## Limitations and bias
|
93 |
+
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.
|
94 |
+
|
95 |
+
## Training
|
96 |
+
|
97 |
+
### Training data
|
98 |
+
We used the TC dataset in Spanish called [WikiCAT_esv2](https://huggingface.co/datasets/PlanTL-GOB-ES/WikiCAT_esv2) for training and evaluation.
|
99 |
+
|
100 |
+
### Training procedure
|
101 |
+
The model was trained with a batch size of 16 and three learning rates (1e-5, 3e-5, 5e-5) for 5 epochs. We then selected the best learning rate (2e-5) and checkpoint (epoch 3) using the downstream task metric in the corresponding development set.
|
102 |
+
|
103 |
+
## Evaluation
|
104 |
+
|
105 |
+
### Variable and metrics
|
106 |
+
|
107 |
+
This model was finetuned maximizing F1 (macro) score.
|
108 |
+
|
109 |
+
### Evaluation results
|
110 |
+
We evaluated the _roberta-base-es-wikicat-es_ on the WikiCAT_esv2 dev set:
|
111 |
+
| Model | WikiCAT_ca (F1)|
|
112 |
+
| ------------|:-------------|
|
113 |
+
| rroberta-base-es-wikicat-es | 0.76632 |
|
114 |
+
|
115 |
+
For more details, check the fine-tuning and evaluation scripts in the official [GitHub repository](https://github.com/projecte-aina/club).
|
116 |
+
|
117 |
+
|
118 |
+
## Additional information
|
119 |
+
|
120 |
+
### Author
|
121 |
+
Text Mining Unit (TeMU) at the Barcelona Supercomputing Center (bsc-temu@bsc.es)
|
122 |
+
|
123 |
+
### Contact information
|
124 |
+
For further information, send an email to aina@bsc.es
|
125 |
+
|
126 |
+
### Copyright
|
127 |
+
Copyright (c) 2022 Text Mining Unit at Barcelona Supercomputing Center
|
128 |
+
|
129 |
+
### Licensing information
|
130 |
+
[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
131 |
+
|
132 |
+
### Funding
|
133 |
+
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).
|
134 |
+
|
135 |
+
|
136 |
+
## Disclaimer
|
137 |
+
|
138 |
+
<details>
|
139 |
+
<summary>Click to expand</summary>
|
140 |
+
|
141 |
+
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.
|
142 |
+
|
143 |
+
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.
|
144 |
+
|
145 |
+
In no event shall the owner and creator of the models (BSC – Barcelona Supercomputing Center) be liable for any results arising from the use made by third parties of these models.
|
146 |
+
|
config.json
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/gpfs/projects/bsc88/projects/catalan_evaluation/models_es/roberta-base-bne",
|
3 |
+
"architectures": [
|
4 |
+
"RobertaForSequenceClassification"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.0,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"classifier_dropout": null,
|
9 |
+
"eos_token_id": 2,
|
10 |
+
"finetuning_task": "wikicat_tecla",
|
11 |
+
"gradient_checkpointing": false,
|
12 |
+
"hidden_act": "gelu",
|
13 |
+
"hidden_dropout_prob": 0.0,
|
14 |
+
"hidden_size": 768,
|
15 |
+
"id2label": {
|
16 |
+
"0": "Religi\u00f3n",
|
17 |
+
"1": "Entretenimiento",
|
18 |
+
"2": "M\u00fasica",
|
19 |
+
"3": "Ciencia_y_Tecnolog\u00eda",
|
20 |
+
"4": "Pol\u00edtica",
|
21 |
+
"5": "Econom\u00eda",
|
22 |
+
"6": "Matem\u00e1ticas",
|
23 |
+
"7": "Humanidades",
|
24 |
+
"8": "Deporte",
|
25 |
+
"9": "Derecho",
|
26 |
+
"10": "Historia",
|
27 |
+
"11": "Filosof\u00eda"
|
28 |
+
},
|
29 |
+
"initializer_range": 0.02,
|
30 |
+
"intermediate_size": 3072,
|
31 |
+
"label2id": {
|
32 |
+
"Ciencia_y_Tecnolog\u00eda": 3,
|
33 |
+
"Deporte": 8,
|
34 |
+
"Derecho": 9,
|
35 |
+
"Econom\u00eda": 5,
|
36 |
+
"Entretenimiento": 1,
|
37 |
+
"Filosof\u00eda": 11,
|
38 |
+
"Historia": 10,
|
39 |
+
"Humanidades": 7,
|
40 |
+
"Matem\u00e1ticas": 6,
|
41 |
+
"M\u00fasica": 2,
|
42 |
+
"Pol\u00edtica": 4,
|
43 |
+
"Religi\u00f3n": 0
|
44 |
+
},
|
45 |
+
"layer_norm_eps": 1e-05,
|
46 |
+
"max_position_embeddings": 514,
|
47 |
+
"model_type": "roberta",
|
48 |
+
"num_attention_heads": 12,
|
49 |
+
"num_hidden_layers": 12,
|
50 |
+
"pad_token_id": 1,
|
51 |
+
"position_embedding_type": "absolute",
|
52 |
+
"problem_type": "single_label_classification",
|
53 |
+
"torch_dtype": "float32",
|
54 |
+
"transformers_version": "4.17.0",
|
55 |
+
"type_vocab_size": 1,
|
56 |
+
"use_cache": true,
|
57 |
+
"vocab_size": 50262
|
58 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:436d8ef05a35d5bb7ce8941231eeaed88b406f139d1e8ae0b3ec09a0cb457fc1
|
3 |
+
size 498696557
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|