ALIA MrBERT-es Snomed Dental NER Model (Context 8192)
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.
🦷 Domain: Spanish dental and dentistry clinical texts.
📐 Architecture: ModernBERT adapted for Token Classification.
📏 Long context: Up to 8,192 tokens, allowing processing of entire clinical reports or patient histories without truncation.
🏷️ Labels: Specially trained to identify clinical entities corresponding to approximately 400 unique SNOMED CT codes (e.g., anatomical structures, pathologies, treatments, and devices).
🔗 Downstream Task: Designed as the foundational extraction layer (NER) for subsequent medical entity linking and terminology mapping.
Architecture
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)
Training
Training Data
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.
Final Training Hyperparameters
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
Intended Use
Direct Use
This model is designed for token extraction and Named Entity Recognition (NER) in the Spanish dentistry domain. Primary use cases include:
Clinical Entity Extraction: Identifying dental conditions, anatomical sites, and procedures in clinical notes.
Pre-annotation for Entity Linking: Automatically extracting candidate spans to be resolved to SNOMED CT codes.
Dental Record Structuring: Structuring unstructured dental text into tabular or graph representations.
Out-of-Scope Use
General-domain Named Entity Recognition.
Non-Spanish clinical texts.
Use as a text-generation model (this is an encoder-only model).
Automatic clinical diagnosis or treatment planning without human expert review.
How to Use
With HuggingFace pipeline
python
1from transformers import pipeline
23# Load the token classification pipeline4ner_pipeline = pipeline(5"token-classification",6 model="SINAI/ALIA-MrBERT-es-snomed-dental-ner-ctx8192",7 aggregation_strategy="simple"8)910# Example text from a dentistry clinical note11clinical_text ="El paciente presenta una caries severa en el canino inferior y una brecha edéntula en el primer molar."1213# Run inference14entities = ner_pipeline(clinical_text)15for entity in entities:16print(f"Entity: {entity['word']} | Class: {entity['entity_group']} | Score: {entity['score']:.4f}")
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.
Metrics
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)
Limitations and Biases
Known Limitations
Domain Specificity: The model is highly specialized in dental and oral medicine terminology. Performance will degrade significantly if applied to other medical specialties (e.g., cardiology, oncology) or general text.
Language Constraint: The model is fine-tuned specifically for Spanish clinical narratives.
Ambiguous Terms: Certain abbreviations or short words common in clinical jargon might be misclassified if context is insufficient.
Biases
The training distribution reflects the clinical practices, vocabulary, and dialects of the training data providers. Performance may vary across different Spanish-speaking regions or distinct clinical writing styles.
If you use this model in your research, please cite:
bibtex
1@misc{ALIA-MrBERT-es-snomed-dental-ner-ctx8192,
2 title = {ALIA MrBERT-es Snomed Dental NER Model},
3 author = {SINAI Research Group, Universidad de Jaén},
4 year = {2026},
5 publisher = {HuggingFace},
6 howpublished = {\url{https://huggingface.co/SINAI/ALIA-MrBERT-es-snomed-dental-ner-ctx8192}}
7}
Please also cite the base model:
bibtex
1@misc{tamayo2026mrbertmodernmultilingualencoders,
2 title={MrBERT: Modern Multilingual Encoders via Vocabulary, Domain, and Dimensional Adaptation},
3 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},
4 year={2026},
5 eprint={2602.21379},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2602.21379},
9}
Funding
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.
Acknowledgments
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.