Skip to content
beginnertext

MedNLI: Clinical Natural Language Inference

Natural language inference for clinical text. Annotators determine whether a clinical hypothesis is entailed by, contradicted by, or neutral with respect to a premise sentence from clinical notes. Based on the MedNLI dataset derived from MIMIC-III clinical notes.

About this dataset

MedNLI is a clinical natural language inference benchmark introduced by Alexey Romanov and Chaitanya Shivade in "Lessons from Natural Language Inference in the Clinical Domain" (EMNLP 2018). The task asks whether a hypothesis sentence is entailed by, contradicts, or is neutral to a premise drawn from a real clinical note. It exists because general-domain NLI models trained on datasets like SNLI transfer poorly to medicine, where terminology and implicit clinical knowledge change what counts as a valid inference.

The premise sentences come from MIMIC-III clinical notes. To limit privacy risk the authors worked only with notes from deceased patients, and clinicians selected the Past Medical History section as the most informative source of inferences. Practicing physicians then wrote one entailed, one contradictory, and one neutral hypothesis for each premise, producing the three-way labeled pairs.

The released dataset contains 14,049 premise-hypothesis pairs, split into 11,232 training, 1,395 development, and 1,422 test pairs. Because the hypotheses were authored by clinicians rather than crowd workers, the labels reflect expert medical judgment. The data is distributed through PhysioNet under a credentialed license tied to MIMIC-III.

The Potato config below reproduces this task with a three-way radio scheme (entailment, contradiction, neutral) plus a confidence radio (high/medium/low) and an optional free-text reasoning field, showing each premise and hypothesis with the clinical department. It is useful for training annotators on clinical inference or for collecting expert judgments on model-generated hypotheses.

Total premise-hypothesis pairs
14,049
Train / dev / test split
11,232 / 1,395 / 1,422
Label set
entailment, contradiction, neutral (3-way)
Premise source
MIMIC-III notes (Past Medical History)
Annotators
Practicing clinicians (physicians)
Venue
EMNLP 2018 (pp. 1586-1596)
Submit

Configuration Fileconfig.yaml

This Potato config reproduces the annotation task. Save it as config.yaml and run potato start config.yaml to try it.

yaml
# MedNLI: Clinical Natural Language Inference
# Based on Romanov & Shivade, EMNLP 2018
# Paper: https://aclanthology.org/D18-1187/
# Dataset: https://physionet.org/content/mednli/1.0.0/
#
# Task: Natural language inference for clinical text
# Annotators determine whether a clinical hypothesis is entailed by,
# contradicted by, or neutral with respect to a premise from clinical notes.
#
# Annotation workflow:
# 1. Read the premise (a sentence from a clinical note)
# 2. Read the hypothesis (a clinical statement)
# 3. Determine the relationship: entailment, contradiction, or neutral
# 4. Indicate your confidence level
# 5. Optionally explain your reasoning

annotation_task_name: "MedNLI: Clinical Natural Language Inference"
task_dir: "."

data_files:
  - sample-data.json
item_properties:
  id_key: "id"
  text_key: "premise"

output_annotation_dir: "annotation_output/"
output_annotation_format: "json"

annotation_task_name: "MedNLI Clinical Inference"

annotation_instructions: |
  You are performing natural language inference (NLI) on clinical text from medical records.

  **Instructions:**
  1. Read the **Premise** — a sentence extracted from a real clinical note.
  2. Read the **Hypothesis** — a clinical statement that may or may not follow from the premise.
  3. Determine the **relationship** between the premise and hypothesis:

  **Label Definitions:**
  - **Entailment (E):** The hypothesis is definitely true given the premise. The premise provides sufficient evidence to conclude the hypothesis is correct.
    - *Example:* Premise: "Patient has a heart rate of 120 bpm." -> Hypothesis: "Patient is tachycardic." = Entailment
  - **Contradiction (C):** The hypothesis is definitely false given the premise. The premise provides evidence that directly contradicts the hypothesis.
    - *Example:* Premise: "No evidence of fracture on X-ray." -> Hypothesis: "The X-ray shows a broken bone." = Contradiction
  - **Neutral (N):** The hypothesis might be true or false — the premise does not provide enough information to determine either way.
    - *Example:* Premise: "Patient presents with chest pain." -> Hypothesis: "Patient has coronary artery disease." = Neutral

  **Important Notes:**
  - Base your judgment only on the information in the premise.
  - Clinical knowledge may be needed to interpret medical terminology.
  - If the premise is ambiguous, choose "neutral" unless the relationship is clear.

annotation_schemes:
  - annotation_type: radio
    name: nli_label
    description: "What is the relationship between the premise and hypothesis?"
    labels:
      - name: "entailment"
        tooltip: "The hypothesis is definitely true given the premise — the premise provides sufficient evidence to conclude the hypothesis"
      - name: "contradiction"
        tooltip: "The hypothesis is definitely false given the premise — the premise provides evidence that directly contradicts the hypothesis"
      - name: "neutral"
        tooltip: "The hypothesis might or might not be true — the premise does not provide enough information to determine the relationship"
    keyboard_shortcuts:
      "entailment": "e"
      "contradiction": "c"
      "neutral": "n"

  - annotation_type: radio
    name: confidence
    description: "How confident are you in your label?"
    labels:
      - name: "high"
        tooltip: "Very confident — the relationship is clear and unambiguous"
      - name: "medium"
        tooltip: "Moderately confident — the relationship seems likely but there is some ambiguity"
      - name: "low"
        tooltip: "Low confidence — the relationship is difficult to determine, possibly requiring specialist knowledge"
    keyboard_shortcuts:
      "high": "h"
      "medium": "m"
      "low": "l"

  - annotation_type: text
    name: reasoning
    description: "Optional: Briefly explain your reasoning for the chosen label"

html_layout: |
  <div style="margin-bottom: 14px; padding: 14px; background: #e8eaf6; border-radius: 6px; border-left: 4px solid #3f51b5;">
    <div style="font-size: 0.85em; color: #666; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px;">Department: {{clinical_department}}</div>
  </div>
  <div style="margin-bottom: 12px; padding: 14px; background: #fff8e1; border-radius: 6px; border-left: 4px solid #f9a825;">
    <strong style="color: #f57f17;">Premise (from clinical note):</strong>
    <p style="margin: 8px 0 0 0; font-size: 1.05em; line-height: 1.6;">{{premise}}</p>
  </div>
  <div style="margin-bottom: 12px; padding: 14px; background: #e0f2f1; border-radius: 6px; border-left: 4px solid #00897b;">
    <strong style="color: #00695c;">Hypothesis:</strong>
    <p style="margin: 8px 0 0 0; font-size: 1.05em; line-height: 1.6;">{{hypothesis}}</p>
  </div>

allow_all_users: true
instances_per_annotator: 100
annotation_per_instance: 3
allow_skip: true
skip_reason_required: false

Sample Datasample-data.json

json
[
  {
    "id": "mednli_001",
    "premise": "The patient was started on a heparin drip for anticoagulation given the new diagnosis of atrial fibrillation with rapid ventricular response.",
    "hypothesis": "The patient has an irregular heart rhythm.",
    "clinical_department": "cardiology"
  },
  {
    "id": "mednli_002",
    "premise": "Chest X-ray showed bilateral infiltrates with air bronchograms consistent with pneumonia, and the patient was febrile to 39.2 degrees Celsius.",
    "hypothesis": "The patient has a normal body temperature.",
    "clinical_department": "pulmonology"
  }
]

// ... and 8 more items

Get This Design

View on GitHub

Clone or download from the repository

Quick start:

git clone https://github.com/davidjurgens/potato-showcase.git
cd potato-showcase/text/domain-specific/mednli-clinical-inference
potato start config.yaml

Dataset & paper

Romanov & Shivade, EMNLP 2018

Citation (BibTeX)

bibtex
@inproceedings{romanov-shivade-2018-lessons,
    title = "Lessons from Natural Language Inference in the Clinical Domain",
    author = "Romanov, Alexey and Shivade, Chaitanya",
    booktitle = "Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing",
    year = "2018",
    address = "Brussels, Belgium",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/D18-1187",
    doi = "10.18653/v1/D18-1187",
    pages = "1586--1596"
}

Details

Annotation Types

radiotext

Domain

Clinical NLPNatural Language InferenceMedical Text

Use Cases

Natural Language InferenceClinical Text UnderstandingMedical Reasoning

Tags

clinical-nlpnatural-language-inferencemednlimedicalemnlp2018nli

Found an issue or want to improve this design?

Open an Issue