All models

Multi-Modal Foundation · PlanTL-GOB-ES

bsc-bio-es

A Spanish biomedical masked language model for masked word prediction and clinical text mining fine-tuning.

What bsc-bio-es is

bsc-bio-es is a biomedical masked language model for the Spanish language developed by the Text Mining Unit (TeMU) at the Barcelona Supercomputing Center (BSC). It was created within the framework of the Plan-TL project funded by the Spanish State Secretariat for Digitalization and Artificial Intelligence (SEDIA). The model was trained from scratch to address the scarcity of dedicated large-scale language models tailored specifically to Spanish biomedical text.

Out of the box, the model is prepared for masked language modelling (the fill-mask task). It is primarily designed as a foundational representation for fine-tuning on downstream clinical and biomedical natural language processing tasks, including named entity recognition and document classification across clinical case reports and scientific literature.

How it works

bsc-bio-es is built upon the RoBERTa base architecture and follows the masked language modelling pre-training approach at the subword level using original RoBERTa hyperparameters. The text was tokenised using a byte-level Byte-Pair Encoding (BPE) tokenizer with a vocabulary size of 52,000 tokens. Pre-training was executed over 48 hours using 16 NVIDIA V100 GPUs (16 GB DDRAM each), the Adam optimizer, a peak learning rate of 0.0005, and an effective batch size of 2,048 sentences.

The pre-training dataset consists of approximately 963 million tokens of biomedical text in Spanish collected from crawlers and public repositories. The data underwent a rigorous pipeline involving multi-format parsing, sentence splitting, language detection, removal of ill-formed sentences, and document-level and cross-corpus deduplication while retaining document boundaries.

Key facts

Model architecture
RoBERTa-base
Language
Spanish (es)
Vocabulary size
52,000 tokens (byte-level BPE)
Training data size
Approximately 963 million tokens
Hardware used
16 NVIDIA V100 GPUs (16 GB DDRAM)
Training duration
48 hours
Input format
Tokenised Spanish text
Primary pipeline tag
fill-mask

What you can use it for

Fill-Mask Language Modelling
Predicting masked tokens directly in Spanish biomedical or clinical sentences without further task-specific training.
Chemical and Drug Entity Recognition
Fine-tuning with a token classification layer to detect drug and chemical mentions in Spanish medical documents, as demonstrated on the PharmaCoNER benchmark (F1 score of 0.8907).
Tumour Morphology Extraction
Fine-tuning to recognise tumour morphology descriptions in clinical texts, evaluated on the CANTEMIST shared task (F1 score of 0.8220).
Hospital Discharge Report Variable Extraction
Extracting clinical variables and stroke-related mentions across diverse medical records, evaluated on the ICTUSnet dataset (F1 score of 0.8727).
Biomedical Text Classification
Serving as a pre-trained base model for downstream classification of Spanish medical publications, case reports, and patents.

Run it here

We list this model but cannot run it yet: its first test run here did not return a result, so it is tried again in a week.

Everything on this page still applies. Running it needs a loader for this repository, not a bigger machine.

Strengths and limits

Good at

  • Outperformed general Spanish language models (roberta-base-bne, mBERT) and continually pre-trained medical models (XLM-R-Galén, BETO-Galén, mBERT-Galén) across PharmaCoNER, CANTEMIST, and ICTUSnet benchmarks.
  • Pre-trained from scratch on a large, curated Spanish biomedical corpus of 963 million tokens using domain-specific text rather than relying solely on translated or general-purpose data.
  • Employs a custom 52,000-token BPE vocabulary adapted for Spanish biomedical terminology.

Watch out for

  • For research use only: it is not a medical device and must not be used for diagnosis, treatment or any clinical decision.
  • Ready-to-use out of the box only for the fill-mask task, requiring additional fine-tuning for downstream classification or entity extraction.
  • Model biases have not been formally estimated and could arise from web crawling sources used to compile the corpora.
  • Pre-training corpus was restricted to Spanish biomedical literature, web sources, and clinical case publications, rather than comprehensive electronic health records.

Inputs and outputs

You provide

  • Sequence with a mask

    Use the model's mask token, commonly [MASK] or <mask>.

You get back

  • Labels with confidence scores, highest first.

Licence

Check the licence before commercial use · apache-2.0

The apache-2.0 licence carries terms worth reading before you depend on it.

Questions

Can I use bsc-bio-es commercially?

Check the licence before commercial use. The apache-2.0 licence carries terms worth reading before you depend on it.

Can bsc-bio-es be used for tasks other than fill-mask out of the box?

No. The base model is trained solely for masked language modelling. To perform tasks like named entity recognition or text classification, it must be fine-tuned with task-specific heads.

What corpora were used to train bsc-bio-es?

It was pre-trained on a concatenated Spanish biomedical dataset of approximately 963 million tokens.

How does bsc-bio-es compare to multilingual or continually trained medical models?

In benchmark evaluations across three Spanish clinical named entity recognition tasks (PharmaCoNER, CANTEMIST, and ICTUSnet), bsc-bio-es achieved higher F1 scores than multilingual models like mBERT, English BioBERT, and continually pre-trained models including XLM-R-Galén and BETO-Galén.

How to cite it

Carrino, Casimiro Pio and Llop, Joan and Pàmies, Marc and Gutiérrez-Fandiño, Asier and Armengol-Estapé, Jordi and Silveira-Ocampo, Joaquín and Valencia, Alfonso and Gonzalez-Agirre, Aitor and Villegas, Marta. Pretrained Biomedical Language Models for Clinical NLP in Spanish. Proceedings of the 21st Workshop on Biomedical Language Processing, 2022, pp. 193–199. doi:10.18653/v1/2022.bionlp-1.19.

Written from bsc-bio-es's own documentation (model card). Statements citing a figure that does not appear there are removed before publication. Licence and running details come from our registry.