Datasets:
|
Download README.md from josephofthebread/MedCalc-Bench-Verified-PII: direct link, hf CLI and curl.
- Browser
- Download file 7.03 kB
-
https://huggingface.co/datasets/josephofthebread/MedCalc-Bench-Verified-PII/resolve/main/README.md
- Command line
-
hf download hf://datasets/josephofthebread/MedCalc-Bench-Verified-PII/README.md
-
curl -L -o README.md https://huggingface.co/datasets/josephofthebread/MedCalc-Bench-Verified-PII/resolve/main/README.md
7.03 kB
| license: cc-by-sa-4.0 | |
| task_categories: | |
| - text-generation | |
| - token-classification | |
| language: | |
| - en | |
| tags: | |
| - medical | |
| - privacy | |
| - memorization | |
| - personal-information | |
| - synthetic | |
| - clinical-notes | |
| size_categories: | |
| - 10K<n<100K | |
| pretty_name: MedCalc-Bench-Verified-PII | |
| configs: | |
| - config_name: luna_terra | |
| data_files: | |
| - split: train | |
| path: luna_terra/train.parquet | |
| - split: test | |
| path: luna_terra/test.parquet | |
| - config_name: gpt_oss | |
| data_files: | |
| - split: train | |
| path: gpt_oss/train.parquet | |
| - split: test | |
| path: gpt_oss/test.parquet | |
| # MedCalc-Bench-Verified-PII | |
| [MedCalc-Bench-Verified](https://huggingface.co/datasets/nsk7153/MedCalc-Bench-Verified) with a made-up identity written into each patient note: the patient's name, date of birth, medical record number and home address. It is built to measure whether a model fine-tuned on the notes memorizes the patient's identity, and whether text sanitization removes it. | |
| The dataset keeps MedCalc-Bench-Verified's `train` and `test` splits, rows, order and columns (revision [`58fc3de`](https://huggingface.co/datasets/nsk7153/MedCalc-Bench-Verified/tree/58fc3de568bfc53a68f32327e58f60dc6eaa17f8)). Only `Patient Note` changes: it holds the note with the identity written in. Each detail is added with the smallest possible edit, so the medical content, questions and answers are unchanged. Two columns are added: `Pasted Details` and `Extraction Answers`. | |
| ## Configs | |
| | Config | Name, date of birth, record number | Address | Extraction answers | | |
| |---|---|---|---| | |
| | `luna_terra` | `gpt-6-luna` | `gpt-6.1-terra` | `gpt-6-luna` | | |
| | `gpt_oss` | `gpt-oss-120b` | `gpt-oss-120b` | `gpt-oss-120b` | | |
| Both configs cover the same 9,901 unique notes. The identity values are drawn per note with the same seed, so they mostly coincide: names differ in 127 notes and addresses in 277, where the two extraction models disagree; dates of birth and record numbers are identical. The configs differ in how the details were written into the text. 9,776 notes have all four details; 125 have none, because the patient is an animal (39) or the calculator values point to no single person (86). A note shared by several MedCalc rows has the same identity in each. | |
| ## Columns | |
| All MedCalc-Bench-Verified columns, plus: | |
| | Column | Meaning | | |
| |---|---| | |
| | `Pasted Details` | The edits that wrote the identity into `Patient Note`. Each edit has `Details` (`name`, `address`, `dob`, `mrn`), `Values` (the exact values), `Start` and `End` (its text in `Patient Note`), `Original` (the text it replaced, empty for an insertion) and `Sources` (the model that wrote it, or `claude-sonnet-agent`). An edit lists two details when one was written inside the other. Empty for notes without an identity | | |
| | `Extraction Answers` | JSON string with the answers to the 24 questions that shaped the identity (target person, sex, age, origin, places, tense, ...), with quotes from the note | | |
| ## Use | |
| ```python | |
| from datasets import load_dataset | |
| ds = load_dataset("josephofthebread/MedCalc-Bench-Verified-PII", "gpt_oss", split="test") | |
| row = ds[0] | |
| print(row["Patient Note"][:400]) | |
| def remove(row, details): | |
| note = row["Patient Note"] | |
| for edit in sorted(row["Pasted Details"], key=lambda e: -e["Start"]): | |
| if set(edit["Details"]) & set(details): | |
| note = note[: edit["Start"]] + edit["Original"] + note[edit["End"] :] | |
| return note | |
| original = remove(row, ["name", "address", "dob", "mrn"]) | |
| no_address = remove(row, ["address"]) | |
| ``` | |
| Removing all details always gives back MedCalc's note exactly. Removing only some gives clean text when the edits of the removed details do not touch the kept ones; this holds for every subset in 9,137 notes of `luna_terra` and 8,279 of `gpt_oss`. | |
| ## How it was built | |
| 1. **Extraction.** A model answers 24 questions about each note: which person the calculator values belong to, and the patient's sex, age, origin, places of residence and care, and more. | |
| 2. **Identity.** The name comes from Faker or Wikidata name lists, in a locale that fits the patient's origin or country. The date of birth fits the patient's age on a made-up presentation date. The record number has 6 to 10 random digits. The address is a real street, with a real house number or one inside the street's range, in the place where the note says the patient lives or was treated; otherwise in the United States. | |
| 3. **Pasting.** One model call per detail, each on the note left by the previous call, with a placement and introducing words chosen by code. Automatic checks reject any edit that changes other text, attaches the detail to someone else, or breaks the sentence; a rejected detail is asked again up to five or seven times. The few details still missing were written by Claude Sonnet agents and passed the same checks. | |
| ## Quality | |
| One human annotator; reviewer agents read the samples first and flagged possible problems. | |
| **Extraction answers** are judged by paste compatibility: right when details built from them do not contradict the note. On 60 notes × 24 questions, `gpt-oss-120b` was right on 1,428 of 1,440 (99.2%) and `gpt-6-luna` on 1,430 of 1,440 (99.3%). | |
| **Pasted details**, on 40 notes per config (20 random, 20 hard), 160 details each. A detail is rejected when its date of birth contradicts the note or when it is a bracket placed right after another bracket. | |
| | | Accepted | 95% interval | | |
| |---|---|---| | |
| | `luna_terra` | 154 of 160 (96.25%) | 92.1% to 98.3% | | |
| | `gpt_oss` | 152 of 160 (95.0%) | 90.4% to 97.4% | | |
| Most rejected dates come from notes whose year could not be fixed, so the birth date was computed from a default year and can conflict with clues such as COVID-19 testing. | |
| ## License | |
| CC BY-SA 4.0, as required by MedCalc-Bench-Verified. | |
| ## Citation | |
| ```bibtex | |
| @misc{medcalcbenchverifiedpii2026, | |
| title = {{MedCalc-Bench-Verified-PII}: Synthetic Patient Identities Written into Clinical Notes}, | |
| author = {Scherbakov, Dmitry and Rakhimov, Damir}, | |
| year = {2026}, | |
| howpublished = {\url{https://huggingface.co/datasets/josephofthebread/MedCalc-Bench-Verified-PII}} | |
| } | |
| @misc{medcalcbenchverified, | |
| title = {{MedCalc-Bench Verified}}, | |
| author = {Khandekar, Nikhil}, | |
| howpublished = {\url{https://huggingface.co/datasets/nsk7153/MedCalc-Bench-Verified}}, | |
| note = {Revision 58fc3de568bfc53a68f32327e58f60dc6eaa17f8} | |
| } | |
| @inproceedings{khandekar2024medcalcbench, | |
| title = {{MedCalc-Bench}: Evaluating Large Language Models for Medical Calculations}, | |
| author = {Khandekar, Nikhil and Jin, Qiao and Xiong, Guangzhi and Dunn, Soren and Applebaum, Serina S. and Anwar, Zain and Sarfo-Gyamfi, Maame and Safranek, Conrad W. and Anwar, Abid A. and Zhang, Andrew and Gilson, Aidan and Singer, Maxwell B. and Dave, Amisha and Taylor, Andrew and Zhang, Aidong and Chen, Qingyu and Lu, Zhiyong}, | |
| booktitle = {Advances in Neural Information Processing Systems (Datasets and Benchmarks Track)}, | |
| year = {2024} | |
| } | |
| ``` | |