CamemBERT-bio : a Tasty French Language Model Better for your Health
CamemBERT-bio is a state-of-the-art french biomedical language model built using continual-pretraining from camembert-base. It was trained on a french public biomedical corpus of 413M words containing scientific documments, drug leaflets and clinical cases extrated from theses and articles. It shows 2.54 points of F1 score improvement on average on 5 different biomedical named entity recognition tasks compared to camembert-base.
Absract
Clinical data in hospitals are increasingly accessible for research through clinical data warehouses, however these documents are unstructured. It is therefore necessary to extract information from medical reports to conduct clinical studies. Transfer learning with BERT-like models such as CamemBERT has allowed major advances, especially for named entity recognition. However, these models are trained for plain language and are less efficient on biomedical data. This is why we propose a new french public biomedical dataset on which we have continued the pre-training of CamemBERT. Thus, we introduce a first version of CamemBERT-bio, a specialized public model for the french biomedical domain that shows 2.54 points of F1 score improvement on average on different biomedical named entity recognition tasks.
- Developed by: Rian Touchent, Eric Villemonte de La Clergerie
- Logo by: Alix Chagué
- License: MIT
Usage
Model available at on huggingface 🤗
from transformers import CamembertTokenizer, CamembertForMaskedLM
tokenizer = CamembertTokenizer.from_pretrained("almanach/camembert-bio-base")
model = CamembertForMaskedLM.from_pretrained("almanach/camembert-bio-base")
Training Details
Training Data
Corpus | Details | Size |
---|---|---|
ISTEX | diverse scientific literature indexed on ISTEX | 276 M |
CLEAR | drug leaflets | 73 M |
E3C | various documents from journals, drug leaflets, and clinical cases | 64 M |
Total | 413 M |
Training Procedure
We used continual-pretraining from camembert-base. We trained the model using the Masked Language Modeling (MLM) objective with Whole Word Masking for 50k steps during 39 hours with 2 Tesla V100.
Evaluation
Fine-tuning
For fine-tuning, we utilized Optuna to select the hyperparameters. The learning rate was set to 5e-5, with a warmup ratio of 0.224 and a batch size of 16. The fine-tuning process was carried out for 2000 steps. For prediction, a simple linear layer was added on top of the model. Notably, none of the CamemBERT layers were frozen during the fine-tuning process.
Scoring
To evaluate the performance of the model, we used the seqeval tool in strict mode with the IOB2 scheme. For each evaluation, the best fine-tuned model on the validation set was selected to calculate the final score on the test set. To ensure reliability, we averaged over 10 evaluations with different seeds.
Results
Style | Dataset | Score | CamemBERT | CamemBERT-bio |
---|---|---|---|---|
Clinical | CAS1 | F1 | 70.50 | 73.03 |
P | 70.12 | 71.71 | ||
R | 70.89 | 74.42 | ||
CAS2 | F1 | 79.02 | 81.66 | |
P | 77.3 | 80.96 | ||
R | 80.83 | 82.37 | ||
E3C | F1 | 67.63 | 69.85 | |
P | 78.19 | 79.11 | ||
R | 59.61 | 62.56 | ||
Drug leaflets | EMEA | F1 | 74.14 | 76.71 |
P | 74.62 | 76.92 | ||
R | 73.68 | 76.52 | ||
Scientific | MEDLINE | F1 | 65.73 | 68.47 |
P | 64.94 | 67.77 | ||
R | 66.56 | 69.21 |
Environmental Impact estimation
- Hardware Type: 2 x Tesla V100
- Hours used: 39 hours
- Provider: INRIA clusters
- Compute Region: Paris, France
- Carbon Emitted: 0.84 kg CO2 eq.