Abstract
Unstructured clinical notes are vital components of Electronic Health Records (EHRs), yet their free-text nature makes automated information extraction challenging. We present a multi-task Transformer model designed to jointly identify section boundaries and classify section types. By leveraging weak supervision from rule-based systems and a multi-head architecture, the model demonstrates superior robustness compared to traditional methods. Notably, on out-of-distribution hospital datasets, the model achieves a 95% recall rate, significantly improving upon the 65% recall of baseline rule-based systems.
Introduction
Clinical notes contain rich, nuanced patient data often absent from structured EHR fields. However, the lack of standardized formatting makes this information difficult to navigate and process. Existing solutions typically rely on brittle rule-based systems that fail across different hospital environments or machine learning classifiers that require pre-partitioned text. This research introduces a unified approach that performs both segmentation and classification, bridging the gap between precision and generalizability.
Methodology
The core of the proposed system is a multi-task BERT-based model fine-tuned on medical literature (PubMed). The model processes text using a sliding window approach, incorporating the target sentence along with its immediate preceding and succeeding context.
As illustrated in Figure 1, the architecture employs three specialized "heads" trained simultaneously:
- Segmentation Head: A binary classifier identifying section headers.
- Section Type Head: A 19-way classifier mapping headers to standardized categories (e.g., Medications, Lab Results).
- Note Type Head: A 7-way classifier identifying the overall note category (e.g., Discharge Summary).
A significant innovation is the use of weak supervision. The model was trained on the large-scale MIMIC-III dataset using labels generated by a rule-based system. This allowed the Transformer to learn underlying semantic patterns, effectively "generalizing" the intent of the rules to handle variations in formatting and terminology.
Datasets and Evaluation
The model was trained on approximately 20,000 notes (3 million text spans) from the public MIMIC-III dataset. To evaluate robustness, it was tested on a private, held-out dataset from a different healthcare provider, representing an out-of-distribution (OOD) scenario with different note-taking "dialects."
Results and Discussion
The multi-task model demonstrated exceptional performance, particularly in its ability to generalize to unseen data formats. While rule-based baselines are highly precise, they are often brittle.
As shown in Figure 2, the rule-based baseline achieved only 65% recall on the OOD dataset. In contrast, the BERT-based model (target + context) reached a recall of 95%. Although precision was lower (70% vs. 98%), the dramatic increase in recall ensures that critical clinical information is much less likely to be missed.
Key insights from the study include:
- Contextual Importance: Including surrounding sentences ("Title + Context") significantly outperforms title-only classification by allowing the model to recognize headers through the nature of the following text.
- Generalizing Weak Labels: Training on noisy, rule-generated labels allowed the model to outperform the rules themselves by learning to ignore superficial formatting differences.
- Multi-task Benefits: Predicting the overall note type as a secondary task improved the accuracy of the primary section classification task.
Conclusion
The multi-task Transformer approach provides a robust solution for organizing unstructured clinical text. Future work will focus on addressing the precision-recall trade-off and reducing the computational overhead of Transformer models for real-time EHR integration.
Summary updated