mifiguemi/onco-camembert

Python

0

19 commits

updated Mar 22, 2026

See the code

README

FRACCO

This repository provides FRACCO (French Annotated Corpus for Clinical Oncology), a gold-standard dataset of synthetic French clinical cases annotated with labels corresponding to ICD-O-3 categories. It also includes example code for fine-tuning and evaluating named entity recognition (NER) models.

Repository structure

data/
├─ brat_raw/         Manually annotated corpus in BRAT standoff format (.txt + .ann)
├─ brat_processed/   Preprocessed version for fine-tuning 
├─ csv/              BIO-formatted annotations in CSV
└─ tsv/              BIO-formatted annotations in TSV

0_train.py           Train BERT-based models
1_inference.py       Run inference and export predictions in BRAT format
utils.py             Data processing and helper functions
requirements.txt     Python dependencies

Dataset statistics

brat_raw/

  • Manually annotated corpus in BRAT standoff format. Contains both entity annotations and their corresponding ICD-O-3 code.
  • Total entities: 71,346
  • Total texts: 1,301 synthetic French clinical cases. Provided as .txt files, each paired with an .ann file containing the annotations.

Entity distribution in brat_raw/

LabelCount (n, %)Unique ICD-O codes
Expression_CIM25,738 (36.1%)~1,500 combinations
Morphologie25,697 (36.0%)~350 codes
Topographie18,864 (26.4%)~300 codes
Différenciation1,047 (1.5%)4 codes

brat_processed/

  • Preprocessed version of the corpus prepared for fine-tuning workflows.
    Overlapping expression_CIM annotations are removed and discontinuous entities are split into contiguous spans. This version includes only entity spans, (no ICD-O-3 codes).
  • Total entities: 46,468
  • Total texts: 1,301 synthetic French clinical cases, following the same .txt/.ann file structure and filename prefixes as brat_raw/.
  • The same annotations are also provided in the csv/ and tsv/ directories in BIO format, which correspond directly to the processed version and can be used for training NER models without handling BRAT files.

Entity distribution in brat_processed/

LabelCount (n, %)
Morphologie26,480 (57.0%)
Topographie18,939 (40.8%)
Différenciation1,049 (2.2%)

Fine-tuning

Installation

Create a Python environment (Python ≥3.9 recommended) and install dependencies:

pip install -r requirements.txt
python -m spacy download fr_core_news_sm

Training and inference

To fine-tune a model, run :

python 0_train.py --model <model name>

By default:

  • Checkpoints and logs for each run are written to runs/checkpoints/<model>_<timestamp>/
  • Trained models and configs are saved under models/<model>/seed_<n>/
  • Validation and test metrics are stored as metrics_val.json and metrics_test.json in each seed_<n>/ folder

To apply a trained model to the processed corpus and output BRAT-style annotations, run :

python 1_inference.py --model <model name>

Predictions will be written in inference/<model_name>/ as .txt and .ann files and can be viewed with the BRAT annotation tool.

Available options for --model:

  • camembert-bio
  • camembert-base
  • bert-base-multilingual
  • fr-albert
  • xlm-roberta

All hyperparameters (batch size, learning rate, epochs, etc.) were kept constant across experiments.
The published baselines can be reproduced by selecting different values for --model.
Hyperparameters can be edited within 0_train.py.

Citation

https://arxiv.org/abs/2510.13873

mifiguemi/onco-camembert

Python

0

19 commits

updated Mar 22, 2026

See the code

README

FRACCO

This repository provides FRACCO (French Annotated Corpus for Clinical Oncology), a gold-standard dataset of synthetic French clinical cases annotated with labels corresponding to ICD-O-3 categories. It also includes example code for fine-tuning and evaluating named entity recognition (NER) models.

Repository structure

data/
├─ brat_raw/         Manually annotated corpus in BRAT standoff format (.txt + .ann)
├─ brat_processed/   Preprocessed version for fine-tuning 
├─ csv/              BIO-formatted annotations in CSV
└─ tsv/              BIO-formatted annotations in TSV

0_train.py           Train BERT-based models
1_inference.py       Run inference and export predictions in BRAT format
utils.py             Data processing and helper functions
requirements.txt     Python dependencies

Dataset statistics

brat_raw/

  • Manually annotated corpus in BRAT standoff format. Contains both entity annotations and their corresponding ICD-O-3 code.
  • Total entities: 71,346
  • Total texts: 1,301 synthetic French clinical cases. Provided as .txt files, each paired with an .ann file containing the annotations.

Entity distribution in brat_raw/

LabelCount (n, %)Unique ICD-O codes
Expression_CIM25,738 (36.1%)~1,500 combinations
Morphologie25,697 (36.0%)~350 codes
Topographie18,864 (26.4%)~300 codes
Différenciation1,047 (1.5%)4 codes

brat_processed/

  • Preprocessed version of the corpus prepared for fine-tuning workflows.
    Overlapping expression_CIM annotations are removed and discontinuous entities are split into contiguous spans. This version includes only entity spans, (no ICD-O-3 codes).
  • Total entities: 46,468
  • Total texts: 1,301 synthetic French clinical cases, following the same .txt/.ann file structure and filename prefixes as brat_raw/.
  • The same annotations are also provided in the csv/ and tsv/ directories in BIO format, which correspond directly to the processed version and can be used for training NER models without handling BRAT files.

Entity distribution in brat_processed/

LabelCount (n, %)
Morphologie26,480 (57.0%)
Topographie18,939 (40.8%)
Différenciation1,049 (2.2%)

Fine-tuning

Installation

Create a Python environment (Python ≥3.9 recommended) and install dependencies:

pip install -r requirements.txt
python -m spacy download fr_core_news_sm

Training and inference

To fine-tune a model, run :

python 0_train.py --model <model name>

By default:

  • Checkpoints and logs for each run are written to runs/checkpoints/<model>_<timestamp>/
  • Trained models and configs are saved under models/<model>/seed_<n>/
  • Validation and test metrics are stored as metrics_val.json and metrics_test.json in each seed_<n>/ folder

To apply a trained model to the processed corpus and output BRAT-style annotations, run :

python 1_inference.py --model <model name>

Predictions will be written in inference/<model_name>/ as .txt and .ann files and can be viewed with the BRAT annotation tool.

Available options for --model:

  • camembert-bio
  • camembert-base
  • bert-base-multilingual
  • fr-albert
  • xlm-roberta

All hyperparameters (batch size, learning rate, epochs, etc.) were kept constant across experiments.
The published baselines can be reproduced by selecting different values for --model.
Hyperparameters can be edited within 0_train.py.

Citation

https://arxiv.org/abs/2510.13873