{"data":{"kind":"file","path":"README.md","version_id":"moxhz9qcc5b3e79xmimnl4ms","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":3949,"modified_at":"2026-02-05T22:58:35.529000","content_hash":"b5c1fb1bbc6b3965976bd47bff2074bf84a0662800dfa9c92499ad49cbfbdc5e"},"entries":[],"content":"# OpenMed MEDEC Environment\n\nMedical error detection environment using [MEDEC](https://github.com/abachaa/MEDEC) - the first publicly available benchmark for medical error detection and correction in clinical notes.\n\n**Published December 2024**\n\n## Task Description\n\nGiven a clinical case presentation, detect if there is a medical error and classify the type of error. This tests clinical reasoning and the ability to identify inaccuracies in medical documentation.\n\n## Error Types (5 Classes)\n\n| Error Type | Description |\n|------------|-------------|\n| **Diagnosis** | The provided diagnosis is inaccurate |\n| **Management** | The next step in management is inaccurate |\n| **Treatment** | The recommended treatment is inaccurate |\n| **Pharmacotherapy** | The recommended medication/drug is inaccurate |\n| **CausalOrganism** | The indicated pathogen/organism is inaccurate |\n\n## Dataset\n\n- **Source**: [mkieffer/MEDEC-MS](https://huggingface.co/datasets/mkieffer/MEDEC-MS)\n- **Train**: 2,190 clinical texts\n- **Validation**: 574 clinical texts\n- **Test**: 597 clinical texts\n- **Total**: 3,361 clinical case presentations\n- **License**: CC-BY-4.0\n\n## Reward Structure\n\n| Component | Weight | Description |\n|-----------|--------|-------------|\n| Detection Accuracy | 45% | Binary error detection (error vs no error) |\n| Error Type | 25% | Correct classification of error type |\n| Format | 15% | Proper `\\boxed{}` and `<think>` usage |\n| Thinking | 15% | Quality of clinical reasoning |\n\n### Why These Rewards Work\n\n- **Detection Accuracy (45%)**: Verifiable binary classification\n- **Error Type (25%)**: Verifiable 5-class classification when error present\n- **Format (15%)**: Structured output for reliable parsing\n- **Thinking (15%)**: Rewards clinical reasoning process\n\n## Example\n\n**Input:**\n```\nAnalyze the following clinical case for medical errors:\n\nA 45-year-old woman presents with severe headache, neck stiffness, and fever.\nLumbar puncture shows elevated WBC with neutrophil predominance, high protein,\nand low glucose. Blood cultures are pending. The attending physician diagnoses\nbacterial meningitis and identifies the causal organism as Escherichia coli.\nEmpiric antibiotic therapy with ceftriaxone and vancomycin is initiated.\n\nDetermine if there is a medical error in this case, and if so, identify the type of error.\n```\n\n**Expected Output:**\n```\n<think>\nThe case presents classic signs of bacterial meningitis: severe headache, neck\nstiffness, fever, and CSF findings (elevated WBC with neutrophils, high protein,\nlow glucose).\n\nThe empiric antibiotic choice (ceftriaxone + vancomycin) is appropriate for\ncommunity-acquired bacterial meningitis in adults.\n\nHowever, the identified causal organism is E. coli. In adults, the most common\ncauses of bacterial meningitis are:\n- Streptococcus pneumoniae (most common)\n- Neisseria meningitidis\n- Listeria monocytogenes (in elderly/immunocompromised)\n\nE. coli meningitis is primarily seen in neonates, not adults. This appears to\nbe an error in pathogen identification.\n</think>\n\\boxed{error: causalOrganism}\n```\n\n## Usage\n\n```python\nfrom OpenMed_MEDEC import load_environment\n\nenv = load_environment()\n```\n\n## Why MEDEC for Medical RL?\n\n1. **Clinical safety**: Error detection is critical for patient safety\n2. **Verifiable answers**: Binary detection + 5-class type classification\n3. **Recent benchmark**: Published December 2024, state-of-the-art challenge\n4. **Real clinical notes**: Based on actual hospital system data\n5. **Expert validation**: Used in MEDIQA-CORR 2024 shared task\n\n## Citation\n\n```bibtex\n@article{ben2024medec,\n  title={MEDEC: A Benchmark for Medical Error Detection and Correction in Clinical Notes},\n  author={Ben Abacha, Asma and Yim, Wen-wai and Fu, Yujuan and Sun, Zhaoyi and Mrabti, Meliha Yetisgen and Shivade, Chaitanya and others},\n  journal={arXiv preprint arXiv:2412.19260},\n  year={2024}\n}\n```\n\n## License\n\nCC-BY-4.0 (following MEDEC dataset terms)\n","encoding":"utf-8","truncated":false,"total_bytes":3949},"status":null}