Classifying Unstructured Clinical Notes via Automatic Weak Supervision

Chufan Gao, Mononito Goswami, Jieshi Chen, Artur Dubrawski

Abstract

Healthcare providers usually record detailed notes of the clinical care delivered to each patient for clinical, research, and billing purposes. Due to the unstructured nature of these narratives, processing them often requires manual effort or large-scale labeled datasets. This paper introduces KeyClass, a framework that automates the classification of unstructured clinical notes without requiring human-labeled documents, leveraging pre-trained language models and data programming.

Introduction

In modern healthcare, "ICD coding"—the process of assigning standardized diagnostic codes to patient records—is a critical but labor-intensive task. Traditionally, specialized medical coders manually review unstructured clinical narratives to assign the correct codes. While machine learning offers a path toward automation, standard supervised models are notoriously "data-hungry," requiring thousands of manually annotated examples to achieve high accuracy.

Furthermore, medical coding systems are dynamic; transitions from ICD-9 to ICD-10 or ICD-11, along with hospital-specific variations, make static supervised models brittle and difficult to scale. KeyClass addresses this by asking: Can we build a reliable classifier using only the official descriptions of the codes themselves?

The KeyClass Framework

KeyClass is a multi-stage pipeline designed to move from raw, unlabeled text to a robust classifier using weak supervision.

The KeyClass pipeline: from class descriptions and unlabeled text to a trained downstream classifier.

The process consists of four primary steps:

  1. Keyword Mining: The system analyzes unlabeled clinical notes to extract frequent n-grams (phrases).
  2. Semantic Alignment: Using a pre-trained language model (such as BlueBERT for clinical text), KeyClass calculates the semantic distance between extracted keywords and official class descriptions. Keywords that align closely with a category (e.g., "pneumonia" for respiratory diseases) are used to create "Labeling Functions" (LFs).
  3. Data Programming: Utilizing the Snorkel framework, these LFs act as "noisy voters." The system mathematically estimates the reliability of each voter and aggregates them to produce probabilistic labels for the unlabeled data.
  4. Downstream Training and Self-Training: A final classifier (a Multi-Layer Perceptron) is trained on the most confident probabilistic labels. This model then undergoes a "self-training" phase, iteratively refining its predictions to improve generalization beyond simple keyword matching.

Leveraging Official Descriptions

The core innovation of KeyClass lies in its ability to use existing domain knowledge—specifically, the textual descriptions provided by coding standards—as a source of supervision.

Sample ICD-9 category descriptions used by KeyClass to align keywords and generate labeling functions.

By encoding these descriptions (as shown in the table above) and comparing them to keywords found in the text, the model bridges the gap between formal medical terminology and the varied language used in real-world clinical notes. This approach makes the model inherently interpretable, as users can see which keywords triggered specific classifications.

Results and Evaluation

The framework was primarily evaluated on the MIMIC-III database, a gold-standard dataset of de-identified clinical notes. The task involved assigning notes to 19 top-level ICD-9 categories.

  • Performance: KeyClass achieved an F1 score of 0.625. In comparison, the state-of-the-art supervised model FasTag, which requires thousands of manual labels, achieved 0.678. KeyClass reached within 5 points of the gold standard with zero manual labeling.
  • Generalization: Beyond clinical notes, KeyClass outperformed previous weakly supervised methods (like LOTClass and WeSTClass) on general benchmarks including AGNews (news), DBPedia (Wikipedia), and sentiment analysis datasets (IMDb, AMAZON).
  • Efficiency: The modular nature of the framework allows for rapid deployment across different domains by simply swapping the language model encoder or the category descriptions.

Discussion and Limitations

While KeyClass demonstrates significant potential, it faces challenges with the "long tail" of medical data. Rare diseases (low-support categories appearing in <1% of data) remain difficult for both weakly supervised and fully supervised models to classify accurately. Currently, the authors suggest KeyClass is best utilized as an auditing tool to identify human errors in legacy records rather than a fully autonomous replacement for human coders.

Future research will focus on extending the framework to multi-label classification problems and improving performance on rare, low-resource categories.

Summary updated

BibTeX
@inproceedings{gao2022classifying,
  author = {Chufan Gao and Mononito Goswami and Jieshi Chen and Artur Dubrawski},
  title = {{Classifying Unstructured Clinical Notes via Automatic Weak Supervision}},
  booktitle = {MLHC},
  year = {2022},
  url = {https://openreview.net/forum?id=e-xd5nG2q1},
}
Figure