Asier Gutiérrez Fandiño
commited on
Commit
•
182de50
1
Parent(s):
e0fec4c
Initial commit
Browse files- .gitattributes +1 -0
- README.md +50 -0
- config.json +33 -0
- pytorch_model.bin +3 -0
- tokenizer.json +0 -0
.gitattributes
CHANGED
@@ -25,3 +25,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
pytorch_model.bin filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- es
|
4 |
+
license: apache-2.0
|
5 |
+
tags:
|
6 |
+
- "national library of spain"
|
7 |
+
- "spanish"
|
8 |
+
- "bne"
|
9 |
+
datasets:
|
10 |
+
- "bne"
|
11 |
+
metrics:
|
12 |
+
- "ppl"
|
13 |
+
|
14 |
+
---
|
15 |
+
|
16 |
+
# GPT2-large trained with data from National Library of Spain (BNE)
|
17 |
+
|
18 |
+
## Model Description
|
19 |
+
GPT2-large-bne is a transformer-based model for the Spanish language. It is based on the [GPT-2](http://www.persagen.com/files/misc/radford2019language.pdf) 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.
|
20 |
+
|
21 |
+
## Training corpora and preprocessing
|
22 |
+
The [National Library of Spain (Biblioteca Nacional de España)](http://www.bne.es/en/Inicio/index.html) crawls all .es domains once a year. The training corpus consists of 59TB of WARC files from these crawls, carried out from 2009 to 2019.
|
23 |
+
|
24 |
+
To obtain a high-quality training corpus, the corpus has been preprocessed with a pipeline of operations, including among the others, sentence splitting, language detection, filtering of bad-formed sentences and deduplication of repetitive contents. During the process document boundaries are kept. This resulted into 2TB of Spanish clean corpus. Further global deduplication among the corpus is applied, resulting into 570GB of text.
|
25 |
+
|
26 |
+
Some of the statistics of the corpus:
|
27 |
+
|
28 |
+
| Corpora | Number of documents | Number of tokens | Size (GB) |
|
29 |
+
|---------|---------------------|------------------|-----------|
|
30 |
+
| BNE | 201,080,084 | 135,733,450,668 | 570GB |
|
31 |
+
|
32 |
+
## Tokenization and pre-training
|
33 |
+
The training corpus has been tokenized using a byte version of Byte-Pair Encoding (BPE) used in the original [GPT-2](http://www.persagen.com/files/misc/radford2019language.pdf) model with a vocabulary size of 50,262 tokens. The GPT2-large-bne pre-training consists of an autoregressive language model training that follows the approach of the GPT-2. The training lasted a total of 10 days with 32 computing nodes each one with 4 NVIDIA V100 GPUs of 16GB VRAM.
|
34 |
+
|
35 |
+
## Evaluation and results
|
36 |
+
For evaluation details visit our [GitHub repository](https://github.com/PlanTL-SANIDAD/lm-spanish).
|
37 |
+
|
38 |
+
## Citing
|
39 |
+
Check out our paper for all the details: https://arxiv.org/abs/2107.07253
|
40 |
+
|
41 |
+
```
|
42 |
+
@misc{gutierrezfandino2021spanish,
|
43 |
+
title={Spanish Language Models},
|
44 |
+
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},
|
45 |
+
year={2021},
|
46 |
+
eprint={2107.07253},
|
47 |
+
archivePrefix={arXiv},
|
48 |
+
primaryClass={cs.CL}
|
49 |
+
}
|
50 |
+
```
|
config.json
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"GPT2LMHeadModel"
|
4 |
+
],
|
5 |
+
"attn_pdrop": 0.0,
|
6 |
+
"bos_token_id": 2,
|
7 |
+
"embd_pdrop": 0.0,
|
8 |
+
"eos_token_id": 2,
|
9 |
+
"initializer_range": 0.02,
|
10 |
+
"layer_norm_epsilon": 1e-06,
|
11 |
+
"model_type": "gpt2",
|
12 |
+
"n_ctx": 512,
|
13 |
+
"n_embd": 1280,
|
14 |
+
"n_head": 20,
|
15 |
+
"n_layer": 36,
|
16 |
+
"n_positions": 512,
|
17 |
+
"pad_token_id": 1,
|
18 |
+
"resid_pdrop": 0.0,
|
19 |
+
"summary_activation": null,
|
20 |
+
"summary_first_dropout": 0.0,
|
21 |
+
"summary_proj_to_labels": true,
|
22 |
+
"summary_type": "cls_index",
|
23 |
+
"summary_use_proj": true,
|
24 |
+
"temperature": 1.0,
|
25 |
+
"task_specific_params": {
|
26 |
+
"text-generation": {
|
27 |
+
"do_sample": true,
|
28 |
+
"max_length": 50
|
29 |
+
}
|
30 |
+
},
|
31 |
+
"vocab_size": 50261,
|
32 |
+
"prefix": "</s>"
|
33 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:085c99e9ad69a6abc373654289b09d166379961b320c8ab1a521df53d3994a32
|
3 |
+
size 3131439441
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|