{"data":{"kind":"file","path":"README.md","version_id":"kd1mkalf8eos97s9eehv2uvs","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":2733,"modified_at":"2026-01-31T23:34:40.672000","content_hash":"0f01e7cabf0202197eb88bccca1687ad29baaadf4cbf43962a6fbe3856e844d2"},"entries":[],"content":"# OpenMed MedNLI Environment\n\nMedical Natural Language Inference (NLI) environment for RL fine-tuning using physician-annotated clinical data from MIMIC-III.\n\n## Task Description\n\nGiven a clinical premise (from a patient's medical history) and a hypothesis, determine the logical relationship:\n\n| Class | Label | Description |\n|-------|-------|-------------|\n| A | ENTAILMENT | The hypothesis can be logically inferred from the premise |\n| B | NEUTRAL | The hypothesis is neither supported nor contradicted by the premise |\n| C | CONTRADICTION | The hypothesis contradicts or is inconsistent with the premise |\n\n## Dataset\n\n- **Source**: [presencesw/mednli](https://huggingface.co/datasets/presencesw/mednli)\n- **Original**: [PhysioNet MedNLI](https://physionet.org/content/mednli/)\n- **Train**: 11,232 examples\n- **Validation**: 1,395 examples\n- **Test**: 1,422 examples\n- **Domain**: MIMIC-III clinical notes (Past Medical History sections)\n- **Annotators**: Physicians\n\n## Reward Structure\n\n| Component | Weight | Description |\n|-----------|--------|-------------|\n| Accuracy | 80% | Exact match on NLI classification (A-C) |\n| Thinking | 15% | Quality of clinical reasoning in `<think>` tags |\n| Format | 5% | Proper `\\boxed{}` answer format |\n\n## Example\n\n**Input:**\n```\nPremise (from patient's medical history):\n\"The patient has a history of type 2 diabetes mellitus, currently managed with metformin.\"\n\nHypothesis:\n\"The patient takes oral medication for blood sugar control.\"\n```\n\n**Expected Output:**\n```\n<think>\nThe premise states that the patient has type 2 diabetes mellitus managed with metformin.\nMetformin is an oral medication used to control blood sugar levels in diabetic patients.\nThe hypothesis claims the patient takes oral medication for blood sugar control.\nSince metformin is indeed an oral medication for blood sugar control, and the premise\nexplicitly states the patient is on metformin, the hypothesis can be directly inferred.\n</think>\n\\boxed{A}\n```\n\n## Usage\n\n```python\nfrom OpenMed_MedNLI import load_environment\n\nenv = load_environment()\n```\n\n## Citation\n\n```bibtex\n@inproceedings{romanov2018lessons,\n  title={Lessons from Natural Language Inference in the Clinical Domain},\n  author={Romanov, Alexey and Shivade, Chaitanya},\n  booktitle={Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing},\n  pages={1586--1596},\n  year={2018}\n}\n\n@misc{mednli-physionet,\n  title={MedNLI — A Natural Language Inference Dataset For The Clinical Domain},\n  author={Shivade, Chaitanya},\n  year={2017},\n  publisher={PhysioNet},\n  doi={10.13026/C2RS98},\n  url={https://physionet.org/content/mednli/}\n}\n```\n\n## License\n\nPhysioNet Credentialed Health Data License (derived from MIMIC-III)\n","encoding":"utf-8","truncated":false,"total_bytes":2733},"status":null}