Downloads · 30 days
84
4% of all-time downloads
Sifal/ClinicalMosaic
ClinicalMosaic is a fill-mask model from Sifal. Use it when you need the model to fill a missing word. It is set up for transformers. The card lists the license as mit.
Clinical Mosaic is a transformer-based language model designed for clinical text, built on the Mosaic BERT architecture. The model is pretrained on 331,794 deidentified clinical notes from the MIMIC-IV-NOTES 2.2 datab…
Downloads · 30 days
84
4% of all-time downloads
All-time downloads
2.1K
Public
Parameters
137M
547 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors547 MB · 100%
From the Hugging Face model README
Clinical Mosaic is a transformer-based language model designed for clinical text, built on the Mosaic BERT architecture. The model is pretrained on 331,794 deidentified clinical notes from the MIMIC-IV-NOTES 2.2 database, with a sequence length of 512 tokens, while leveraging Attention with Linear Biases (ALiBi) to improve extrapolation beyond this limit without re-quiring learned positional embeddings.
Clinical Mosaic can be used directly as a clinical language model for:
The model can be integrated into larger systems for tasks such as patient trajectory prediction or decision support, provided that additional fine-tuning and rigorous validation are performed.
Clinical Mosaic was pre-trained on deidentified clinical notes from MIMIC-IV-NOTES 2.2—a dataset from a single U.S. institution. This may introduce biases related to local clinical practices and patient demographics. Although extensive care was taken to deidentify data and prevent PHI leakage, users must ensure that the model is not used to inadvertently reidentify sensitive information. When applying the model to new populations or clinical settings, performance may vary, so further fine-tuning and bias audits are recommended.
Install the Hugging Face Transformers library and load the model as follows:
# Load model directly
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("Sifal/ClinicalMosaic", trust_remote_code=True)
ClincalMosaic = AutoModel.from_pretrained("Sifal/ClinicalMosaic", trust_remote_code=True)
# Example usage
clinical_text = "..."
inputs = tokenizer(clinical_text, return_tensors="pt")
last_layer_embeddings = ClincalMosaic(**inputs, output_all_encoded_layers=False)
from transformers import AutoModelForSequenceClassification, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('Sifal/ClinicalMosaic')
ClassifierClincalMosaic = AutoModelForSequenceClassification.from_pretrained(
'Sifal/ClinicalMosaic',
torch_dtype='auto',
trust_remote_code=True,
device_map="auto"
)
# Example usage
clinical_text = "..."
inputs = tokenizer(clinical_text, return_tensors="pt")
logits = ClassifierClincalMosaic(**inputs).logits
Further instructions and example scripts are provided in the model’s repository.
The model was evaluated on the MedNLI dataset, which comprises 14,049 clinical premise-hypothesis pairs derived from MIMIC-III notes.
Evaluation disaggregated performance across clinical language understanding, with a focus on natural language inference.
Clinical Mosaic outperformed comparable models:
These results indicate improved clinical reasoning and language understanding.
The model demonstrates robust performance on clinical natural language inference tasks and serves as a strong foundation for further clinical NLP applications.
The project leading to this publication has received funding from the Excellence Initiative of Aix Marseille Université - A*Midex, a French “Investissements d’Avenir programme” AMX-21-IET-017.
We would like to thank LIS | Laboratoire d'Informatique et Systèmes, Aix-Marseille University for providing the GPU resources necessary for pretraining and conducting extensive experiments. Additionally, we acknowledge CEDRE | CEntre de formation et de soutien aux Données de la REcherche, Programme 2 du projet France 2030 IDeAL for supporting early-stage experiments and hosting part of the computational infrastructure.
BibTeX:
@misc{klioui2025patienttrajectorypredictionintegrating,
title={Patient Trajectory Prediction: Integrating Clinical Notes with Transformers},
author={Sifal Klioui and Sana Sellami and Youssef Trardi},
year={2025},
eprint={2502.18009},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2502.18009},
}
@article{RNTI/papers/1002990,
author = {Sifal Klioui and Sana Sellami and Youssef Trardi},
title = {Prédiction de la trajectoire du patient : Intégration des notes cliniques aux transformers},
journal = {Revue des Nouvelles Technologies de l'Information},
volume = {Extraction et Gestion des Connaissances, RNTI-E-41},
year = {2025},
pages = {135-146}
}
For further details, please refer to the model’s repository and supplementary documentation.
For questions or further information, please contact [[email protected]].