Downloads · 30 days
9
17% of all-time downloads
SINAI/ALIA-MrBERT-es-snomed-dental-ner-ctx8192
ALIA-MrBERT-es-snomed-dental-ner-ctx8192 is a token classification model from SINAI. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as apache-2.0.
This repository contains ALIA-MrBERT-es-snomed-dental-ner-ctx8192, a Spanish dentistry domain Named Entity Recognition (NER) model. It is built upon MrBERT-es, a bilingual (Spanish-English) foundational language model…
Downloads · 30 days
9
17% of all-time downloads
All-time downloads
52
Public
Parameters
150M
602 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors601 MB · 99%
From the Hugging Face model README
This repository contains ALIA-MrBERT-es-snomed-dental-ner-ctx8192, a Spanish dentistry domain Named Entity Recognition (NER) model. It is built upon MrBERT-es, a bilingual (Spanish-English) foundational language model based on the ModernBERT architecture, and fine-tuned on dentistry-specific clinical data.
The model is trained to recognize clinical entities corresponding to approximately 400 unique SNOMED CT codes, serving as the extraction phase (NER) of a clinical entity linking/normalization pipeline in dentistry.
[!WARNING] DISCLAIMER: This model is a domain-specific proof-of-concept designed to demonstrate entity recognition capabilities in the Spanish dentistry domain. While optimized for identifying dental clinical terms, results should be verified by qualified dental professionals and clinical experts. The model should not be used for automated diagnostic decisions without human expert validation.
ModernBERT (architecture)
↓
MrBERT-es (BSC-LT)
Bilingual ES/EN encoder
150M parameters
↓
ALIA-MrBERT-es-snomed-dental-ner-ctx8192 (UJA)
Dentistry Named Entity Recognition fine-tuning
~400 SNOMED CT clinical codes
This model utilizes the ModernBERT architecture, extended with a token classification linear layer on top of the hidden states:
| Base Architecture | ModernBERT |
| Total Parameters | ~150M |
| Hidden size | 768 |
| Intermediate size | 1,152 |
| Attention heads | 12 |
| Hidden layers | 22 |
| Context length | 8,192 tokens |
| Vocabulary size | 51,200 |
| Precision | bfloat16 |
| Positional encoding | RoPE |
| Activation function | GeLU |
| Attention type | Mixed (global every 3 layers + sliding window) |
| Classification Head | Token Classification (Linear + Softmax) |
The model was fine-tuned on a specialized dentistry corpus containing clinical dialogues, patient summaries, and dental reports. The training set is annotated at the token level using BIO-tagging formats for dental medical entities.
The entity classes map to approximately 400 distinct SNOMED CT concepts, including:
The model was trained using supervised fine-tuning (SFT) for token classification. The loss function optimized during training is Cross-Entropy Loss at the token level, ignoring padding tokens.
| Hyperparameter | Value | Description |
|---|---|---|
| Learning Rate | 3×10⁻⁵ | Nominal learning rate for token classification |
| Batch Size | 32 | Global batch size |
| Warmup Ratio | 0.1 | Linear LR warmup at the start of training |
| Weight Decay | 0.01 | L2 regularization |
| Optimizer | AdamW | Standard HuggingFace Trainer optimizer |
| Precision | bf16 | Bfloat16 for Ampere+ architectures |
| Max Sequence Length | 8,192 | Maximum tokens processed |
| Loss Function | CrossEntropyLoss | Token-level classification loss |
This model is designed for token extraction and Named Entity Recognition (NER) in the Spanish dentistry domain. Primary use cases include:
pipelinefrom transformers import pipeline
# Load the token classification pipeline
ner_pipeline = pipeline(
"token-classification",
model="SINAI/ALIA-MrBERT-es-snomed-dental-ner-ctx8192",
aggregation_strategy="simple"
)
# Example text from a dentistry clinical note
clinical_text = "El paciente presenta una caries severa en el canino inferior y una brecha edéntula en el primer molar."
# Run inference
entities = ner_pipeline(clinical_text)
for entity in entities:
print(f"Entity: {entity['word']} | Class: {entity['entity_group']} | Score: {entity['score']:.4f}")
transformers (Manual Inference)import torch
from transformers import AutoTokenizer, AutoModelForTokenClassification
model_name = "SINAI/ALIA-MrBERT-es-snomed-dental-ner-ctx8192"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForTokenClassification.from_pretrained(model_name)
text = "Paciente acude por apiñamiento dental y requiere reconstrucción de corona."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=8192)
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.argmax(outputs.logits, dim=-1)
tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
for token, prediction in zip(tokens, predictions[0].tolist()):
if prediction != 0: # Assuming 0 is the 'O' (Outside) label
label = model.config.id2label[prediction]
print(f"Token: {token:12} -> Label: {label}")
The model was evaluated using a train/test split containing 80% training and 20% testing data, representing a total of 6,022 entities in the test set.
The Named Entity Recognition (NER) span-level performance on the test set is as follows:
| Metric | Value |
|---|---|
| Precision (Spans) | 96.61% (5,818 / 6,022) |
If you use this model in your research, please cite:
@misc{ALIA-MrBERT-es-snomed-dental-ner-ctx8192,
title = {ALIA MrBERT-es Snomed Dental NER Model},
author = {SINAI Research Group, Universidad de Jaén},
year = {2026},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/SINAI/ALIA-MrBERT-es-snomed-dental-ner-ctx8192}}
}
Please also cite the base model:
@misc{tamayo2026mrbertmodernmultilingualencoders,
title={MrBERT: Modern Multilingual Encoders via Vocabulary, Domain, and Dimensional Adaptation},
author={Daniel Tamayo and Iñaki Lacunza and Paula Rivera-Hidalgo and Severino Da Dalt and Javier Aula-Blasco and Aitor Gonzalez-Agirre and Marta Villegas},
year={2026},
eprint={2602.21379},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2602.21379},
}
This work is funded by the Ministerio para la Transformación Digital y de la Función Pública - Funded by EU – NextGenerationEU within the framework of the project ALIA.
This dataset has been generated thanks to CEATIC (Centro de Estudios Avanzados en Tecnologías de la Información y de la Comunicación) – UJA (Universidad de Jaén) which provided the needed computational resources on its clusters.
Contact: ALIA Project - SINAI Research Group - Universidad de Jaén
More Information: SINAI Research Group | ALIA-UJA Project