Datasets:
File size: 16,306 Bytes
3d2f107 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | ---
pretty_name: FineMed-fr
language:
- fr
license:
- odc-by
- cc-by-sa-4.0
task_categories:
- fill-mask
- text-generation
size_categories:
- 10M<n<100M
tags:
- medical
- healthcare
- biomedical
- clinical
- french
- pretraining
- data-filtering
- fineweb-2
- finepdfs
- finewiki
configs:
- config_name: fineweb-2
default: true
data_files:
- split: train
path: data/fineweb-2/*.parquet
- config_name: finepdfs
data_files:
- split: train
path: data/finepdfs/*.parquet
- config_name: finewiki
data_files:
- split: train
path: data/finewiki/*.parquet
---
# FineMed-fr
<center>
<img src="assets/logo_finemed.png" width="100%" alt="FineMed-fr: A large-scale French medical corpus annotated along multiple quality axes">
</center>
<!-- arXiv ID pending: banner with Technical Report (and the citation below) hidden until the ID is assigned; uncomment these and replace the arXiv ID placeholder. -->
<!--
<p align="center">
<a href="https://huggingface.co/blog/bofenghuang/doctobert-fr-release">🤗 Blog</a> |
<a href="https://arxiv.org/abs/2606.XXXXX">📄 Technical Report</a> |
<a href="https://github.com/doctolib-lab/doctobert">💻 Code</a> |
<a href="https://huggingface.co/collections/doctolib-lab/finemed-fr">🌐 FineMed</a> |
<a href="https://huggingface.co/collections/doctolib-lab/doctobert-fr">🩺 DoctoBERT</a>
</p>
-->
<p align="center">
<a href="https://huggingface.co/blog/bofenghuang/doctobert-fr-release">🤗 Blog</a> |
<a href="https://github.com/doctolib-lab/doctobert">💻 Code</a> |
<a href="https://huggingface.co/collections/doctolib-lab/finemed-fr">🌐 FineMed</a> |
<a href="https://huggingface.co/collections/doctolib-lab/doctobert-fr">🩺 DoctoBERT</a>
</p>
## 📚 Introduction
**FineMed-fr** is a large, openly available corpus of French medical text for language-model pretraining: **21.1M documents** and **19.2B words** of real-world medical writing, annotated along several quality axes.
The corpus is drawn from three heterogeneous open-web sources ([FineWeb-2](https://huggingface.co/datasets/HuggingFaceFW/fineweb-2),
[FinePDFs](https://huggingface.co/datasets/HuggingFaceFW/finepdfs), and
[FineWiki](https://huggingface.co/datasets/HuggingFaceFW/finewiki)), which together provide the scale, source
diversity, and stylistic range that curated medical corpora often lack. We keep only the French medical
content, then label every surviving document along three axes:
- **Subdomain**: which of 15 medical subdomains the document belongs to, separating biomedical and
clinical writing (e.g. scientific papers, clinical guidelines) from consumer-facing material
(e.g. wellness blogs, commercial health pages).
- **Educational quality**: how instructive the document is for medical education, scored 0–5 on an
additive rubric adapted from [FineWeb-Edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu).
- **Medical-term density**: the richness of medical terminology, measured as the fraction of
characters that fall inside extracted medical-term spans.
We release the corpus unfiltered so you can set your own thresholds on the annotation columns to fit your task.
## 🆕 What's New
- **v1.0** (2026-06): first release.
## 🚀 How to Use
```python
from datasets import load_dataset
ds = load_dataset("doctolib-lab/finemed-fr", split="train") # fineweb-2 (default)
ds = load_dataset("doctolib-lab/finemed-fr", "finepdfs", split="train")
ds = load_dataset("doctolib-lab/finemed-fr", "finewiki", split="train")
```
Because the corpus is released unfiltered, downstream filtering is left to the user. For example, to retain only high-quality, term-dense documents:
```python
filtered = ds.filter(
lambda x: x["edu_quality_normalized_score"] >= 4 and x["medical_entity_density"] >= 0.10,
num_proc=8,
)
```
## 🔧 Curation Pipeline
The three source corpora have already undergone standard LLM-pretraining curation upstream (language ID,
heuristic quality filtering, deduplication), which we inherit as a quality baseline. Beyond this baseline,
we apply two further steps:
1. **Medical prefiltering.** Medical content constitutes only a small fraction of each source and is
further diluted by commercial pages. We run a [multilingual domain classifier](https://huggingface.co/nvidia/multilingual-domain-classifier)
(a DeBERTa-v3 covering 26 domains) over the first 512 tokens of each document and retain only those
whose top-1 predicted label is `Health`, reducing each source to 5.3% of FineWeb-2, 7.7% of FinePDFs,
and 1.5% of FineWiki (by document).
2. **Multi-axis annotation.** Every retained document is then labeled by three dedicated lightweight
annotators, each fine-tuned via two-stage knowledge distillation from LLM teachers (a smaller
teacher providing high-volume supervision, followed by a larger teacher providing high-quality
supervision):
- A [subdomain classifier](https://huggingface.co/doctolib-lab/finemed-subdomain-classifier-fr) takes the document text and URL as input and predicts one of 15 medical subdomains;
- An [educational-quality scorer](https://huggingface.co/doctolib-lab/finemed-edu-scorer-fr) takes the document text and regresses a 0–5 educational-quality score;
- A [medical-entity extractor](https://huggingface.co/doctolib-lab/finemed-entity-extractor-fr) identifies medical-term spans, whose character coverage defines the medical-term density.
Distilling each annotator from its LLM teachers, rather than applying an LLM directly across the full
corpus, reduces annotation cost by roughly an order of magnitude.
**Subdomain.** `health_domain_classification_best_class` is one of these 15 values:
| subdomain | description |
| --------- | ----------- |
| Clinical cases & vignettes | Single-patient narratives: presentation, evaluation, management, outcomes; case-based teaching. |
| Clinical guidelines & pathways | Non-patient-specific recommendations, algorithms, and standards; named guidelines or consensus statements. |
| Patient education & lifestyle | Consumer-facing explanations and how-to advice on prevention, self-care, symptoms, diet, fitness, mental well-being. |
| Wellness, supplements & CAM | Botanicals, vitamins, supplements, complementary or alternative therapies outside mainstream clinical guidance. |
| Public health, policy & programs | Population surveillance, epidemiology, screening, laws and regulation, financing and insurance, community guidance. |
| Commercial & promotional | Marketing or sales content: pricing, booking, calls-to-action, affiliate/SEO, comparative ads, testimonials. |
| Drugs, trials & regulation | Drug development and evaluation: clinical trials, approvals and labels, PK/PD, safety monitoring, pharmacovigilance. |
| Biomedical & mechanistic science | Experimental or preclinical research: labs, omics, pathways, cell/animal models, assays, mechanisms. |
| Medical devices, diagnostics & imaging | Device or modality descriptions and clinical use; diagnostics, wearables, sensors, imaging. |
| Health IT, telemedicine & operations | EHR/EMR, data standards, interoperability, analytics, telemedicine, workflow, staffing, procurement, logistics. |
| Occupational health & safety | Workplace hazards, exposures, PPE, training, and compliance with occupational regulations. |
| Health workforce education & training | Professional curricula, CME, certification, simulation, residency/fellowship information. |
| Health services & facilities | Neutral descriptions of care-delivery models, service lines, facility capabilities, long-term/residential care. |
| Other health | Health-related content that is unclear or insufficient to classify under the other subdomains. |
| Others | Not clearly health-related, too brief, or lacking detail (e.g. navigation/boilerplate). |
**Medical-term classes.** `medical_entities` groups the extracted terms under these 8 keys (taxonomy adapted from UMLS):
| class | covers |
| ----- | ------ |
| `disease` | disease, syndrome, infection, cancer, injury, symptom, clinical finding, mental disorder |
| `drug` | prescription medication, vaccine, therapeutic compound, drug class, contrast agent |
| `body_part` | organ, tissue, bone, muscle, blood vessel, nerve, cell, body fluid, anatomical region |
| `medical_procedure` | surgery, diagnostic test, medical examination, laboratory test, imaging procedure |
| `molecular_marker` | gene, protein, enzyme, receptor, genetic variant, biochemical analyte |
| `clinical_device` | surgical tool, implant, prosthetic, diagnostic scanner, monitoring equipment |
| `vital_function` | heart rate, blood pressure, respiratory rate, temperature, oxygen saturation |
| `living_beings` | bacterium, virus, fungus, parasite, pathogen, model organism |
**Educational quality.** `edu_quality_normalized_score` runs from 0 (not useful) to 5 (excellent) for
medical education; `edu_quality_score` is the raw value before rounding. The exact rubric used to prompt
the LLM annotators is in [`edu_quality_annotation_prompt.txt`](https://huggingface.co/datasets/doctolib-lab/finemed-fr/blob/main/assets/edu_quality_annotation_prompt.txt).
## 📊 Dataset Statistics
Each source is provided as a separate config. Per-source statistics:
| config | source | documents | words | median words/doc |
| ------------ | -------------------- | ---------: | ------: | ---------------: |
| `fineweb-2` | FineWeb-2 (fra_Latn) | 18,888,234 | 12.03 B | 346 |
| `finepdfs` | FinePDFs (fra_Latn) | 2,137,275 | 7.16 B | 766 |
| `finewiki` | FineWiki (frwiki) | 38,620 | 26.55 M | 283 |
| **total** | | 21,064,129 | 19.21 B | 369 |
<!-- Average annotation values per source:
| config | mean edu score | mean density |
| ----------- | -------------: | -----------: |
| `fineweb-2` | 2.01 | 0.080 |
| `finepdfs` | 2.76 | 0.069 |
| `finewiki` | 3.12 | 0.140 |
| **overall** | 2.09 | 0.079 | -->
Annotation values vary substantially across subdomains. Distribution of educational-quality scores across the 15 subdomains:

Distribution of medical-term density across the same subdomains:

Per-source versions of both plots are available in [assets/](https://huggingface.co/datasets/doctolib-lab/finemed-fr/tree/main/assets).
<!-- Domain composition of each source (% of documents; **Health** is the retained fraction):
| domain | FineWeb-2 | FinePDFs | FineWiki |
| ------ | --------: | -------: | -------: |
| Arts & Entertainment | 9.7% | 6.5% | 18.6% |
| Home & Garden | 6.5% | 2.4% | 0.2% |
| News | 6.1% | 4.3% | 5.8% |
| People & Society | 5.9% | 10.1% | 18.1% |
| Food & Drink | 5.6% | 5.0% | 1.7% |
| Sports | 5.5% | 4.8% | 13.0% |
| **Health** (retained) | **5.2%** | **7.8%** | **1.5%** |
| Travel & Transportation | 5.2% | 3.0% | 11.4% |
| Business & Industrial | 5.0% | 5.7% | 0.9% |
| Jobs & Education | 4.1% | 11.7% | 0.8% |
| Law & Government | 2.3% | 16.5% | 3.4% |
| Science | 1.1% | 4.0% | 7.3% |
| Others | 43.8% | 18.2% | 17.3% | -->
## 📋 Data Fields
All configs share these columns:
| column | type | description |
| ------ | ---- | ----------- |
| `text` | string | document text |
| `id` | string | source document id (matches the id in the source dataset) |
| `url` | string | source URL |
| `num_words` | int64 | whitespace word count |
| `domain_classification_best_class` / `_best_score` / `_scores` | string / double / list | prefilter domain classifier output (the medical subset is `Health`) |
| `health_domain_classification_best_class` / `_best_score` / `_scores` | string / double / list | 15-class medical-subdomain classifier output |
| `edu_quality_score` / `edu_quality_normalized_score` | double / int64 | educational-quality scorer (FineWeb-Edu rubric adapted to medicine); raw score and its 0–5 rounded form |
| `medical_entities` | struct | extracted medical terms grouped into 8 classes; each class is a deduplicated list of surface strings |
| `medical_entity_density` | float | fraction of characters covered by those terms, measured over the document's middle 512-token window (or the whole document when it is shorter than 512 tokens) |
Source-specific provenance columns:
- `fineweb-2`: `dump`, `date`, `file_path`, `language`, `language_score`, `language_script`, `minhash_cluster_size`, `top_langs`
- `finepdfs`: `dump`, `date`, `file_path`, `offset`, `token_count`, `language`, `page_average_lid`, `page_average_lid_score`, `full_doc_lid`, `full_doc_lid_score`, `per_page_languages`, `is_truncated`, `extractor`, `page_ends`
- `finewiki`: `wikiname`, `page_id`, `title`, `date_modified`, `in_language`, `wikidata_id`, `bytes_html`, `wikitext`, `version`, `infoboxes`, `has_math`
**Example record.** A full `fineweb-2` row (provenance columns differ for the other configs):
```json
{
"text": "Attention L'actualité thérapeutique sur le VIH évolue rapidement ... Pneumopathie bactérienne chez les patients infectés par le VIH ...",
"id": "<urn:uuid:2cc73ad5-d0ae-483c-8b59-78147734bcb8>",
"dump": "CC-MAIN-2014-10",
"url": "http://www.actions-traitements.org/spip.php?article1961",
"date": "2014-03-10T06:59:32Z",
"file_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-10/segments/.../CC-MAIN-...-00091-....warc.gz",
"language": "fra",
"language_score": 0.9974,
"language_script": "Latn",
"minhash_cluster_size": 7,
"top_langs": "{}",
"domain_classification_scores": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
"domain_classification_best_class": "Health",
"domain_classification_best_score": 1.0,
"num_words": 600,
"health_domain_classification_scores": [0.0092, 0.0349, 0.832, 0.0, 0.0267, 0.0, 0.0001, 0.0001, 0.0001, 0.0, 0.0001, 0.0, 0.0043, 0.0933, 0.0],
"health_domain_classification_best_class": "Clinical guidelines & pathways",
"health_domain_classification_best_score": 0.832,
"edu_quality_score": 4.75,
"edu_quality_normalized_score": 5,
"medical_entities": {
"disease": ["pneumonie", "méningites", "fièvre", "sida", "..."],
"drug": ["traitement antirétroviral"],
"body_part": [], "medical_procedure": [], "molecular_marker": [],
"clinical_device": [], "vital_function": [],
"living_beings": ["Streptococcus pneumoniae", "Klebsiella pneumoniae", "VIH", "..."]
},
"medical_entity_density": 0.242
}
```
*(a real FineWeb-2 row; `text`, `file_path`, and entity lists trimmed for display)*
<!--
## 📖 Citation
```bibtex
@misc{doctobert2026,
title = {Where Does the Signal Live? A Web Data Recipe for Medical Encoder Pretraining},
author = {Huang, Bofeng and Sun, Jacques and Bouchacourt, Diane and Barascud, Nicolas and Fogel, Fajwel},
year = {2026},
eprint = {2606.XXXXX},
archivePrefix = {arXiv},
primaryClass = {cs.CL}
}
```
-->
## ⚖️ Licensing
FineMed-fr inherits the licenses of its source datasets:
- `fineweb-2` and `finepdfs`: ODC-BY 1.0 (as in the upstream FineWeb releases)
- `finewiki`: CC BY-SA 4.0 (derived from Wikipedia)
## ⚠️ Considerations
FineMed-fr consists of public text from the web, PDFs, and Wikipedia, restricted to medical content.
As real-world web data, it may contain personal information, and medical pages may reference protected
health information. All such content was already publicly accessible, and we did not remove or mask it.
The corpus has not been clinically validated and does not constitute medical advice. Users handling
personal or health data should perform de-identification before use.
## 🏛️ Acknowledgments
This work was granted access to the HPC resources of IDRIS (Jean Zay) under the allocations 2025-AD011016291 and 2026-A0200617487 made by GENCI.
|