Home

Awesome

Spanish Language Models 💃🏻

A repository part of the MarIA project.

Corpora 📃

CorporaNumber of documentsNumber of tokensSize (GB)
BNE201,080,084135,733,450,668570GB

Models 🤖

See results achieved on several tasks below. Vegeu els resultats obtinguts en diverses tasques més avall.

Usage example ⚗️

For the RoBERTa-base

from transformers import AutoModelForMaskedLM
from transformers import AutoTokenizer, FillMaskPipeline
from pprint import pprint
tokenizer_hf = AutoTokenizer.from_pretrained('PlanTL-GOB-ES/roberta-base-bne')
model = AutoModelForMaskedLM.from_pretrained('PlanTL-GOB-ES/roberta-base-bne')
model.eval()
pipeline = FillMaskPipeline(model, tokenizer_hf)
text = f"¡Hola <mask>!"
res_hf = pipeline(text)
pprint([r['token_str'] for r in res_hf])

For the RoBERTa-large

from transformers import AutoModelForMaskedLM
from transformers import AutoTokenizer, FillMaskPipeline
from pprint import pprint
tokenizer_hf = AutoTokenizer.from_pretrained('PlanTL-GOB-ES/roberta-large-bne')
model = AutoModelForMaskedLM.from_pretrained('PlanTL-GOB-ES/roberta-large-bne')
model.eval()
pipeline = FillMaskPipeline(model, tokenizer_hf)
text = f"¡Hola <mask>!"
res_hf = pipeline(text)
pprint([r['token_str'] for r in res_hf])

Fine-tunned models 🧗🏼‍♀️🏇🏼🤽🏼‍♀️🏌🏼‍♂️🏄🏼‍♀️

For a complete list, refer to https://huggingface.co/PlanTL-GOB-ES

Other Spanish Language Models 👩‍👧‍👦

Domain-specific language models:

Word embeddings 🔤

spaCy models

Datasets 🗂️

For a complete list, refer to https://huggingface.co/PlanTL-GOB-ES

EvalES: The Spanish Evaluation Benchmark 🏆

The EvalES benchmark consists of 10 tasks: Named Entity Recognition and Classification (CoNLL-NERC and CAPITEL-NERC), Part-of-Speech Tagging (UD-POS and CAPITEL-POS ), Text Classification (MLDoc), Paraphrase Identification (PAWS-X), Semantic Textual Similarity (STS), Question Answering (SQAC), Textual Entailment (XNLI) and Massive.

Results ✅

DatasetMetricRoBERTa-bRoBERTa-lBETO*mBERTBERTIN**Electricidad***
MLDocF10.96640.97020.9714🔥0.96170.96680.9565
CoNLL-NERCF10.8851🔥0.88230.87590.86910.88350.7954
CAPITEL-NERCF10.89600.9051🔥0.87720.88100.88560.8035
PAWS-XF10.90200.9150🔥0.89300.90000.89650.9045
UD-POSF10.9907🔥0.99040.99000.98860.98980.9818
CAPITEL-POSF10.98460.9856🔥0.98360.98390.98470.9816
SQACF10.79230.8202🔥0.79230.75620.76780.7383
STSCombined0.8533🔥0.84110.81590.81640.79450.8063
XNLIAccuracy0.80160.8263🔥0.81300.78760.78900.7878
MassiveAccuracy0.86050.87220.8732🔥0.85040.85000.8517

* A model based on BERT architecture.

** A model based on RoBERTa architecture.

*** A model based on Electra architecture.

For more information, refer to https://benchmark.plantl.bsc.es/

Demos

Cite 📣

@article{gutierrezfandino2022,
	author = {Asier Gutiérrez-Fandiño and Jordi Armengol-Estapé and Marc Pàmies and Joan Llop-Palao and Joaquin Silveira-Ocampo and Casimiro Pio Carrino and Carme Armentano-Oller and Carlos Rodriguez-Penagos and Aitor Gonzalez-Agirre and Marta Villegas},
	title = {MarIA: Spanish Language Models},
	journal = {Procesamiento del Lenguaje Natural},
	volume = {68},
	number = {0},
	year = {2022},
	issn = {1989-7553},
	url = {http://journal.sepln.org/sepln/ojs/ojs/index.php/pln/article/view/6405},
	pages = {39--60}
}

Contact 📧

📋 We are interested in (1) extending our corpora to make larger models (2) train/evaluate the model in other tasks.

For questions regarding this work, contact plantl-gob-es@bsc.es

Disclaimer

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.

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.

In no event shall the owner of the models (SEDIA – State Secretariat for digitalization and artificial intelligence) nor the creator (BSC – Barcelona Supercomputing Center) be liable for any results arising from the use made by third parties of these models.

Los modelos publicados en este repositorio tienen una finalidad generalista y están a disposición de terceros. Estos modelos pueden tener sesgos y/u otro tipo de distorsiones indeseables.

Cuando terceros desplieguen o proporcionen sistemas y/o servicios a otras partes usando alguno de estos modelos (o utilizando sistemas basados en estos modelos) o se conviertan en usuarios de los modelos, deben tener en cuenta que es su responsabilidad mitigar los riesgos derivados de su uso y, en todo caso, cumplir con la normativa aplicable, incluyendo la normativa en materia de uso de inteligencia artificial.

En ningún caso el propietario de los modelos (SEDIA – Secretaría de Estado de Digitalización e Inteligencia Artificial) ni el creador (BSC – Barcelona Supercomputing Center) serán responsables de los resultados derivados del uso que hagan terceros de estos modelos.