Asier Gutiérrez Fandiño commited on
Commit
e62c699
1 Parent(s): 6f84de3

Initial commit

Browse files
README.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - es
4
+ license: apache-2.0
5
+ tags:
6
+ - "national library of spain"
7
+ - "spanish"
8
+ - "bne"
9
+ - "capitel"
10
+ - "ner"
11
+ datasets:
12
+ - "bne"
13
+ - "capitel"
14
+ metrics:
15
+ - "f1"
16
+ inference:
17
+ parameters:
18
+ aggregation_strategy: "first"
19
+
20
+ ---
21
+
22
+ # Spanish RoBERTa-base trained on BNE finetuned for CAPITEL Named Entity Recognition (NER) dataset.
23
+ RoBERTa-base-bne is a transformer-based masked language model for the Spanish language. It is based on the [RoBERTa](https://arxiv.org/abs/1907.11692) base model and has been pre-trained using the largest Spanish corpus known to date, with a total of 570GB of clean and deduplicated text processed for this work, compiled from the web crawlings performed by the [National Library of Spain (Biblioteca Nacional de España)](http://www.bne.es/en/Inicio/index.html) from 2009 to 2019.
24
+
25
+ Original pre-trained model can be found here: https://huggingface.co/BSC-TeMU/roberta-base-bne
26
+
27
+ ## Dataset
28
+ The dataset used is the one from the [CAPITEL competition at IberLEF 2020](https://sites.google.com/view/capitel2020) (sub-task 1).
29
+
30
+ **IMPORTANT ABOUT THIS MODEL:** We modified the dataset to make this model more robust to general Spanish input. In the Spanish language all the name entities are capitalized, as this dataset has been elaborated by experts, it is totally correct in terms of Spanish language. We randomly took some entities and we lower-cased some of them for the model to learn not only that the named entities are capitalized, but also the structure of a sentence that should contain a named entity. For instance: "My name is [placeholder]", this [placeholder] should be a named entity even though it is not written capitalized. The model trained on the original capitel dataset can be found here: https://huggingface.co/BSC-TeMU/roberta-base-bne-capitel-ner
31
+
32
+ Examples:
33
+
34
+ This model:
35
+ - "Me llamo asier y vivo en barcelona todo el año." → "Me llamo {as:S-PER}{ier:S-PER} y vivo en {barcelona:S-LOC} todo el año."
36
+ - "Hoy voy a visitar el parc güell tras salir del barcelona supercomputing center." → "Hoy voy a visitar el {par:B-LOC}{k:I-LOC} {gü:E-LOC}{ell:E-LOC} tras salir del {barcelona:B-ORG} {super:I-ORG}{com:I-ORG}{pu:I-ORG}{ting:I-ORG} {cen:E-ORG}{ter:E-ORG}."
37
+
38
+ Model trained on original data:
39
+ - "Me llamo asier y vivo en barcelona todo el año." → "Me llamo asier y vivo en barcelona todo el año." (nothing)
40
+ - "Hoy voy a visitar el parc güell tras salir del barcelona supercomputing center." → "Hoy voy a visitar el parc güell tras salir del barcelona supercomputing center." (nothing)
41
+
42
+ ## Evaluation and results
43
+ F1 Score: 0.8867
44
+
45
+ For evaluation details visit our [GitHub repository](https://github.com/PlanTL-SANIDAD/lm-spanish).
46
+
47
+
48
+ ## Citing
49
+ Check out our paper for all the details: https://arxiv.org/abs/2107.07253
50
+ ```
51
+ @misc{gutierrezfandino2021spanish,
52
+ title={Spanish Language Models},
53
+ author={Asier Gutiérrez-Fandiño and Jordi Armengol-Estapé and Marc Pàmies and Joan Llop-Palao and Joaquín Silveira-Ocampo and Casimiro Pio Carrino and Aitor Gonzalez-Agirre and Carme Armentano-Oller and Carlos Rodriguez-Penagos and Marta Villegas},
54
+ year={2021},
55
+ eprint={2107.07253},
56
+ archivePrefix={arXiv},
57
+ primaryClass={cs.CL}
58
+ }
59
+ ```
config.json ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "../models/bne-base",
3
+ "architectures": [
4
+ "RobertaForTokenClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.0,
7
+ "bos_token_id": 0,
8
+ "eos_token_id": 2,
9
+ "finetuning_task": "ner",
10
+ "gradient_checkpointing": false,
11
+ "hidden_act": "gelu",
12
+ "hidden_dropout_prob": 0.0,
13
+ "hidden_size": 768,
14
+ "id2label": {
15
+ "0": "B_OTH",
16
+ "1": "I_OTH",
17
+ "2": "E_OTH",
18
+ "3": "S_ORG",
19
+ "4": "S_OTH",
20
+ "5": "B_PER",
21
+ "6": "E_PER",
22
+ "7": "B_ORG",
23
+ "8": "E_ORG",
24
+ "9": "S_LOC",
25
+ "10": "S_PER",
26
+ "11": "B_LOC",
27
+ "12": "E_LOC",
28
+ "13": "I_PER",
29
+ "14": "I_ORG",
30
+ "15": "I_LOC",
31
+ "16": "O"
32
+ },
33
+ "initializer_range": 0.02,
34
+ "intermediate_size": 3072,
35
+ "label2id": {
36
+ "B_OTH": 0,
37
+ "I_OTH": 1,
38
+ "E_OTH": 2,
39
+ "S_ORG": 3,
40
+ "S_OTH": 4,
41
+ "B_PER": 5,
42
+ "E_PER": 6,
43
+ "B_ORG": 7,
44
+ "E_ORG": 8,
45
+ "S_LOC": 9,
46
+ "S_PER": 10,
47
+ "B_LOC": 11,
48
+ "E_LOC": 12,
49
+ "I_PER": 13,
50
+ "I_ORG": 14,
51
+ "I_LOC": 15,
52
+ "O": 16
53
+ },
54
+ "layer_norm_eps": 1e-05,
55
+ "max_position_embeddings": 514,
56
+ "model_type": "roberta",
57
+ "num_attention_heads": 12,
58
+ "num_hidden_layers": 12,
59
+ "pad_token_id": 1,
60
+ "position_embedding_type": "absolute",
61
+ "transformers_version": "4.6.1",
62
+ "type_vocab_size": 1,
63
+ "use_cache": true,
64
+ "vocab_size": 50262
65
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc88ec6c21f27e5bf9931374a71ead6ca1445b56a7499e9b3a5ecd7df022d658
3
+ size 496347953
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"bos_token": {"content": "<s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "eos_token": {"content": "</s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "unk_token": {"content": "<unk>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "sep_token": {"content": "</s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "pad_token": {"content": "<pad>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "cls_token": {"content": "<s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": true}}
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"unk_token": {"content": "<unk>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "bos_token": {"content": "<s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "eos_token": {"content": "</s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "add_prefix_space": true, "errors": "replace", "sep_token": {"content": "</s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "cls_token": {"content": "<s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "pad_token": {"content": "<pad>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "max_len": 512, "special_tokens_map_file": null, "name_or_path": "../models/bne-base"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff