MEDEC-MS / README.md
mkieffer's picture
Update README.md
b7427f3 verified
---
dataset_info:
features:
- name: text_id
dtype: string
- name: text
dtype: string
- name: sentences
dtype: string
- name: error_flag
dtype: bool
- name: error_type
dtype: string
- name: error_sentence_id
dtype: int8
- name: error_sentence
dtype: string
- name: corrected_sentence
dtype: string
- name: corrected_text
dtype: string
splits:
- name: train
num_bytes: 4733960
num_examples: 2189
- name: test
num_bytes: 1300714
num_examples: 597
- name: validation
num_bytes: 1234271
num_examples: 574
download_size: 2940360
dataset_size: 7268945
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
- split: test
path: data/test-*
- split: validation
path: data/validation-*
license: cc-by-4.0
task_categories:
- text-generation
- question-answering
- text-classification
tags:
- medical
- clinical
---
# MEDEC-MS
HuggingFace upload of the MEDEC-MS dataset with fixes. If used, please cite the original authors using the citation below.
## Dataset Details
### Dataset Description
The dataset contains three splits: **train**, **validation**, **test**.
### Dataset Sources
- **Repository:** https://github.com/abachaa/MEDEC
- **Paper:** https://arxiv.org/pdf/2412.19260
### Corrections to the original dataset:
- **Added pipes to delimit sentence IDs and sentences in the `sentences` column, as specified in [Prompt #1](https://arxiv.org/pdf/2412.19260#page=5).**
- **Removed non-standard characters.**
For example, the original `ms-train-19` `text` column had
```txt
...“something crawling on my hand.” The...
```
which is corrected in this dataset to be
```
..."something crawling on my hand." The...
```
- **Fixed many broken sentences in the original dataset.**
For example, the original `ms-test-15` row had a malformed `sentences` column:
```txt
5 Her temperature is 37.5 C
6 (99.5 F ); pulse is 75/min; respiratory rate is 13/min, and blood pressure is
7 115/70 mm
8 Hg.
9 A maculopapular rash is observed over the trunk and limbs.
```
which is corrected in this dataset to be
```txt
5 | Her temperature is 37.5C (99.5 F); pulse is 75/min; respiratory rate is 13/min, and blood pressure is 115/70 mm Hg.
6 | A maculopapular rash is observed over the trunk and limbs.
```
- **Ensured that the `error_sentence` and `corrected_sentence` column contain the full sentences.**
For example, `ms-test-551` originally had
```txt
error_sentence: "Prazosin is prescribed as his temperature is 99.3 F (37.4 C), blood pressure is 165/118"
corrected_sentence: "Phenoxybenzamine is prescribed as his temperature is 99.3 F (37.4 C), blood pressure is 165/118"
```
with `sentences`
```txt
0 A 45-year-old-man presents to the physician with complaints of intermittent episodes of severe headaches and palpitations.
1 During these episodes, he notices that he sweats profusely and becomes pale in complexion.
2 He describes the episodes as coming and going within the past 2 months.
3 Prazosin is prescribed as his temperature is 99.3 F (37.4 C), blood pressure is 165/118
4 mmHg, pulse is
5 126/min, respirations are 18/min, and oxygen saturation is 90% on room air.
```
which is corrected in this dataset to include the full sentences
```txt
error_sentence: "Prazosin is prescribed as his temperature is 99.3 F (37.4 C), blood pressure is 165/118 mmHg, pulse is 126/min, respirations are 18/min, and oxygen saturation is 90% on room air."
corrected_sentence: "Phenoxybenzamine is prescribed as his temperature is 99.3 F (37.4 C), blood pressure is 165/118 mmHg, pulse is 126/min, respirations are 18/min, and oxygen saturation is 90% on room air."
```
and
```txt
0 | A 45-year-old-man presents to the physician with complaints of intermittent episodes of severe headaches and palpitations.
1 | During these episodes, he notices that he sweats profusely and becomes pale in complexion.
2 | He describes the episodes as coming and going within the past 2 months.
3 | Prazosin is prescribed as his temperature is 99.3 F (37.4 C), blood pressure is 165/118 mmHg, pulse is 126/min, respirations are 18/min, and oxygen saturation is 90% on room air.
```
As you can see, the original `sentences` column had incorrect sentence splits, which the `error_sentence` and `corrected_sentence` at least conformed to. But if you want to specifically test for sentence extraction, especially in the case of raw, unmarked text, we feel it's important to respect sentence boundaries.
### Direct Use
```python
import json
from datasets import load_dataset
if __name__ == "__main__":
# load all data
dataset = load_dataset("mkieffer/MEDEC")
# load only train split
dataset_train = load_dataset("mkieffer/MEDEC", split="train")
# load only test split
dataset_test = load_dataset("mkieffer/MEDEC", split="test")
# load only validation split
dataset_val = load_dataset("mkieffer/MEDEC", split="validation")
print("\nfull dataset:\n", dataset)
print("\ntrain split:\n", dataset_train)
print("\test split:\n", dataset_test)
print("\validation split:\n", dataset_val)
print("\ntrain sample:\n", json.dumps(dataset_train[0], indent=2))
print("\test sample:\n", json.dumps(dataset_test[0], indent=2))
print("\validation sample:\n", json.dumps(dataset_val[0], indent=2))
```
## Citation
```bibtex
@inproceedings{medec,
author = {Asma {Ben Abacha} and Wen{-}wai Yim and Yujuan Fu and Zhaoyi Sun and Meliha Yetisgen and Fei Xia and Thomas Lin},
title = {MEDEC: A Benchmark for Medical Error Detection and Correction in Clinical Notes},
booktitle = {Findings of the Association for Computational Linguistics, ACL 2025, Vienna, Austria, July 27 - August 1, 2025},
pages = {22539--22550},
publisher = {Association for Computational Linguistics},
year = {2025},
url = {https://aclanthology.org/2025.findings-acl.1159/}
}
```