CoolFace
Modelpublic

abazoge/DrBERT-4096

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes24downloads
Model Card

DrLongformer

<span style="font-size:larger;">DrLongformer</span> is a French pretrained Longformer model based on Clinical-Longformer that was further pretrained on the NACHOS dataset (same dataset as DrBERT). This model allows up to 4,096 tokens as input. DrLongformer consistently outperforms medical BERT-based models across most downstream tasks regardless of sequence length, except on NER tasks. Evaluated downstream tasks cover named entity recognition (NER), question answering (MCQA), Semantic textual similarity (STS) and text classification tasks (CLS). For more details, please refer to our paper: [Adaptation of Biomedical and Clinical Pretrained Models to French Long Documents: A Comparative Study]().

Model pretraining

We explored multiple strategies for the adaptation of Longformer models to the French medical domain:

  • Further pretraining of English clinical Longformer on French medical data.
  • Converting a French medical BERT model to the Longformer architecture.
  • Pretraining a Longformer from scratch on French medical data.

All Pretraining scripts to reproduce the experiments are available in this Github repository: DrLongformer. For the from scratch and further pretraining strategies, the training scripts are the same as DrBERT, only the bash scripts are different and available in this repository.

All models were trained on the Jean Zay French supercomputer.

Model nameCorpusPretraining strategySequence LengthModel URL
DrLongformerNACHOS 7 GBFurther pretraining of Clinical-Longformer4096HuggingFace
DrBERT-4096NACHOS 7 GBConversion of DrBERT-7B to the Longformer architecture4096HuggingFace
DrLongformer-FS (from scratch)NACHOS 7 GBPretraining from scratch4096Not available

Model Usage

You can use DrLongformer directly from Hugging Face's Transformers:

python
# !pip install transformers
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer.from_pretrained("abazoge/DrLongformer")
model = AutoModelForMaskedLM.from_pretrained("abazoge/DrLongformer")

Citation

@misc{bazoge2024adaptation,
      title={Adaptation of Biomedical and Clinical Pretrained Models to French Long Documents: A Comparative Study}, 
      author={Adrien Bazoge and Emmanuel Morin and Beatrice Daille and Pierre-Antoine Gourraud},
      year={2024},
      eprint={2402.16689},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}