Datasets:
Upload folder using huggingface_hub
#1
by samwell - opened
- .gitattributes +1 -0
- README.md +222 -0
- test.jsonl +0 -0
- train.jsonl +3 -0
- val.jsonl +0 -0
.gitattributes
CHANGED
|
@@ -58,3 +58,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
train.jsonl filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- text-generation
|
| 5 |
+
- question-answering
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
tags:
|
| 9 |
+
- medical
|
| 10 |
+
- healthcare
|
| 11 |
+
- ncd
|
| 12 |
+
- diabetes
|
| 13 |
+
- hypertension
|
| 14 |
+
- clinical
|
| 15 |
+
- ehr
|
| 16 |
+
- synthetic
|
| 17 |
+
- instruction-tuning
|
| 18 |
+
- fine-tuning
|
| 19 |
+
- gemma
|
| 20 |
+
- llm
|
| 21 |
+
size_categories:
|
| 22 |
+
- 10K<n<100K
|
| 23 |
+
pretty_name: Synthea NCD Risk Assessment Instructions
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
# Synthea NCD Instructions
|
| 27 |
+
|
| 28 |
+
Synthetic EHR-based instruction-tuning dataset for training LLMs to predict non-communicable disease (NCD) risk, specifically **Type 2 Diabetes** and **Hypertension**.
|
| 29 |
+
|
| 30 |
+
## Quick Start
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
from datasets import load_dataset
|
| 34 |
+
|
| 35 |
+
dataset = load_dataset("samwell/synthea-ncd-instructions")
|
| 36 |
+
|
| 37 |
+
# View a sample
|
| 38 |
+
print(dataset["train"][0])
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## Dataset Description
|
| 42 |
+
|
| 43 |
+
This dataset contains instruction-tuning examples derived from synthetic patient records generated using [Synthea](https://github.com/synthetichealth/synthea). Each example presents a patient's clinical data and asks the model to assess their NCD risk.
|
| 44 |
+
|
| 45 |
+
### Why This Dataset?
|
| 46 |
+
|
| 47 |
+
- **NCD burden**: Diabetes and hypertension affect billions globally, especially in LMICs
|
| 48 |
+
- **Clinical decision support**: LLMs can help with risk stratification at scale
|
| 49 |
+
- **Open & reproducible**: Fully synthetic, no privacy concerns, Apache 2.0 licensed
|
| 50 |
+
- **Instruction-tuned format**: Ready for fine-tuning Gemma, Llama, Mistral, etc.
|
| 51 |
+
|
| 52 |
+
### Intended Use
|
| 53 |
+
|
| 54 |
+
- Fine-tuning LLMs for clinical decision support
|
| 55 |
+
- Training models for NCD risk stratification
|
| 56 |
+
- Research in medical AI and clinical NLP
|
| 57 |
+
- Educational purposes
|
| 58 |
+
- Prototyping healthcare AI applications
|
| 59 |
+
|
| 60 |
+
### Not Intended For
|
| 61 |
+
|
| 62 |
+
- Direct clinical use without validation
|
| 63 |
+
- Replacing clinical judgment
|
| 64 |
+
- Diagnosis or treatment decisions
|
| 65 |
+
- Production deployment without clinician review
|
| 66 |
+
|
| 67 |
+
## Dataset Structure
|
| 68 |
+
|
| 69 |
+
Each example contains:
|
| 70 |
+
|
| 71 |
+
| Field | Description |
|
| 72 |
+
|-------|-------------|
|
| 73 |
+
| `instruction` | Task description asking for NCD risk assessment |
|
| 74 |
+
| `input` | Patient record with demographics, vitals, labs, conditions, medications |
|
| 75 |
+
| `output` | Structured risk assessment with risk levels and recommendations |
|
| 76 |
+
|
| 77 |
+
### Example
|
| 78 |
+
|
| 79 |
+
```json
|
| 80 |
+
{
|
| 81 |
+
"instruction": "Based on the following patient record, assess the risk of Type 2 diabetes and hypertension. Provide risk levels (LOW, MODERATE, HIGH, or DIAGNOSED) with supporting factors, and clinical recommendations.",
|
| 82 |
+
"input": "Patient: 52yo Female\nVitals: BP 142/88 mmHg, BMI 29.4, Weight 78.2 kg\nLabs: Glucose 118 mg/dL, HbA1c 6.0%, Total Cholesterol 210 mg/dL\nActive conditions: Prediabetes\nMedications: None",
|
| 83 |
+
"output": "## Risk Assessment\n\n**Type 2 Diabetes: MODERATE**\n- Fasting glucose 118 mg/dL (prediabetes range 100-125)\n- HbA1c 6.0% (prediabetes range 5.7-6.4%)\n- BMI 29.4 (overweight)\n- History of prediabetes\n\n**Hypertension: HIGH**\n- BP 142/88 mmHg (Stage 1 hypertension)\n\n## Recommendations\n1. Lifestyle counseling: diet modification, increase physical activity\n2. Recheck glucose/HbA1c in 3-6 months\n3. Confirm elevated BP on 2 separate occasions\n4. Consider initiating antihypertensive therapy"
|
| 84 |
+
}
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
### Risk Levels
|
| 88 |
+
|
| 89 |
+
| Level | Description |
|
| 90 |
+
|-------|-------------|
|
| 91 |
+
| **LOW** | No significant risk factors identified |
|
| 92 |
+
| **MODERATE** | Some risk factors present, lifestyle modification recommended |
|
| 93 |
+
| **HIGH** | Multiple risk factors or abnormal values, further workup needed |
|
| 94 |
+
| **DIAGNOSED** | Patient has confirmed diagnosis in their record |
|
| 95 |
+
|
| 96 |
+
## Data Splits
|
| 97 |
+
|
| 98 |
+
| Split | Examples | Purpose |
|
| 99 |
+
|-------|----------|---------|
|
| 100 |
+
| train | ~40,000 | Model training |
|
| 101 |
+
| val | ~5,000 | Hyperparameter tuning |
|
| 102 |
+
| test | ~5,000 | Final evaluation |
|
| 103 |
+
|
| 104 |
+
## Clinical Parameters
|
| 105 |
+
|
| 106 |
+
### Observations Used
|
| 107 |
+
|
| 108 |
+
**Vitals:**
|
| 109 |
+
- Blood Pressure (systolic/diastolic)
|
| 110 |
+
- BMI
|
| 111 |
+
- Body Weight
|
| 112 |
+
- Heart Rate
|
| 113 |
+
|
| 114 |
+
**Labs:**
|
| 115 |
+
- Fasting Glucose
|
| 116 |
+
- HbA1c
|
| 117 |
+
- Total Cholesterol, HDL, LDL, Triglycerides
|
| 118 |
+
- Creatinine, eGFR
|
| 119 |
+
|
| 120 |
+
### Conditions Tracked
|
| 121 |
+
|
| 122 |
+
| Condition | SNOMED Code |
|
| 123 |
+
|-----------|-------------|
|
| 124 |
+
| Prediabetes | 714628002 |
|
| 125 |
+
| Type 2 Diabetes | 44054006 |
|
| 126 |
+
| Essential Hypertension | 59621000 |
|
| 127 |
+
| Diabetic Neuropathy | 368581000119106 |
|
| 128 |
+
| Diabetic Retinopathy | 1551000119108 |
|
| 129 |
+
| Diabetic Kidney Disease | 127013003 |
|
| 130 |
+
|
| 131 |
+
## Generation Process
|
| 132 |
+
|
| 133 |
+
1. **Synthea** generated synthetic patient populations with realistic disease progression
|
| 134 |
+
2. Patient records were filtered for those with relevant NCD observations
|
| 135 |
+
3. Risk assessments were generated using clinical guidelines:
|
| 136 |
+
- ADA criteria for diabetes/prediabetes
|
| 137 |
+
- ACC/AHA guidelines for hypertension
|
| 138 |
+
4. Data was formatted for instruction-tuning (Alpaca-style)
|
| 139 |
+
|
| 140 |
+
### Reproducibility
|
| 141 |
+
|
| 142 |
+
The generation scripts are available at: [github.com/HopeOS/training](https://github.com/hopeos/training)
|
| 143 |
+
|
| 144 |
+
```bash
|
| 145 |
+
# Generate synthetic patients
|
| 146 |
+
./run_synthea -p 50000 --exporter.csv.export=true
|
| 147 |
+
|
| 148 |
+
# Transform to instruction format
|
| 149 |
+
python synthea_to_instructions.py --input ./synthea/output/csv --output ./data
|
| 150 |
+
```
|
| 151 |
+
|
| 152 |
+
## Limitations
|
| 153 |
+
|
| 154 |
+
- **Synthetic data**: Does not capture all real-world clinical complexity
|
| 155 |
+
- **US-based demographics**: Synthea defaults to US population characteristics
|
| 156 |
+
- **Simplified risk model**: Does not include family history, lifestyle factors, or genetic risk
|
| 157 |
+
- **English only**: All text is in English
|
| 158 |
+
- **No longitudinal reasoning**: Each example is a snapshot, not a time-series
|
| 159 |
+
|
| 160 |
+
## Changelog
|
| 161 |
+
|
| 162 |
+
### v1.0.0 (April 2026)
|
| 163 |
+
- Initial release
|
| 164 |
+
- ~50,000 synthetic patients
|
| 165 |
+
- Diabetes and hypertension risk assessment
|
| 166 |
+
- Train/val/test splits (80/10/10)
|
| 167 |
+
|
| 168 |
+
## Roadmap
|
| 169 |
+
|
| 170 |
+
Planned improvements (contributions welcome!):
|
| 171 |
+
|
| 172 |
+
- [ ] **Ghana/African demographics**: Custom Synthea config for African population characteristics
|
| 173 |
+
- [ ] **Additional NCDs**: Chronic kidney disease, cardiovascular disease, obesity
|
| 174 |
+
- [ ] **Multilingual**: French, Twi, Hausa translations for West African context
|
| 175 |
+
- [ ] **Longitudinal examples**: Multi-visit patient trajectories
|
| 176 |
+
- [ ] **Family history**: Incorporate genetic risk factors
|
| 177 |
+
- [ ] **Lifestyle factors**: Diet, exercise, smoking, alcohol
|
| 178 |
+
- [ ] **Validated models**: Release fine-tuned Gemma/Llama checkpoints
|
| 179 |
+
|
| 180 |
+
## Contributing
|
| 181 |
+
|
| 182 |
+
We welcome contributions! Here's how you can help:
|
| 183 |
+
|
| 184 |
+
1. **Report issues**: Found an error in the data? [Open an issue](https://huggingface.co/datasets/samwell/synthea-ncd-instructions/discussions)
|
| 185 |
+
2. **Improve generation**: Submit PRs to the generation scripts
|
| 186 |
+
3. **Add demographics**: Help create Synthea configs for other regions
|
| 187 |
+
4. **Validate clinically**: Are you a clinician? Help us review the risk assessments
|
| 188 |
+
5. **Translate**: Help translate to other languages
|
| 189 |
+
|
| 190 |
+
## Citation
|
| 191 |
+
|
| 192 |
+
```bibtex
|
| 193 |
+
@dataset{synthea_ncd_instructions_2026,
|
| 194 |
+
title={Synthea NCD Instructions: A Synthetic Dataset for Clinical Risk Assessment},
|
| 195 |
+
author={samwell},
|
| 196 |
+
year={2026},
|
| 197 |
+
publisher={Hugging Face},
|
| 198 |
+
url={https://huggingface.co/datasets/samwell/synthea-ncd-instructions},
|
| 199 |
+
note={Living dataset - check for updates}
|
| 200 |
+
}
|
| 201 |
+
```
|
| 202 |
+
|
| 203 |
+
## License
|
| 204 |
+
|
| 205 |
+
Apache 2.0 - free to use, modify, and distribute with attribution.
|
| 206 |
+
|
| 207 |
+
## Acknowledgments
|
| 208 |
+
|
| 209 |
+
- [Synthea](https://github.com/synthetichealth/synthea) - Synthetic patient generation
|
| 210 |
+
- [Unsloth](https://github.com/unslothai/unsloth) - Efficient fine-tuning
|
| 211 |
+
- Clinical guidelines: ADA, ACC/AHA, WHO
|
| 212 |
+
- HopeOS team for the initial implementation
|
| 213 |
+
|
| 214 |
+
## Contact
|
| 215 |
+
|
| 216 |
+
- **Maintainer**: [@samwell](https://huggingface.co/samwell)
|
| 217 |
+
- **Discussions**: [Dataset discussions](https://huggingface.co/datasets/samwell/synthea-ncd-instructions/discussions)
|
| 218 |
+
- **Issues**: Report data quality issues in discussions
|
| 219 |
+
|
| 220 |
+
---
|
| 221 |
+
|
| 222 |
+
*Last updated: April 2026*
|
test.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
train.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:56cd0da1ef963a5208a84074174b674bc88bd83e3941700cb1e075dc8a6c5705
|
| 3 |
+
size 31884819
|
val.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|