Abstract
Extracting meaningful relationships between clinical concepts in Electronic Health Records (EHRs) is a critical step for automated medical data analysis. This study systematically evaluates three prominent Transformer architectures—BERT, RoBERTa, and XLNet—for the task of Clinical Relation Extraction (RE). By comparing various classification strategies, representation schemes, and pretraining domains, the researchers demonstrate that clinical-specific pretraining and optimized entity markers significantly improve performance. The study achieves new state-of-the-art results on the 2018 MADE1.0 benchmark and competitive results on the 2018 n2c2 dataset, suggesting that the clinical NLP community should transition toward more advanced architectures like RoBERTa and XLNet.
Introduction
Electronic Health Records (EHRs) contain vast amounts of unstructured data in the form of clinical notes, discharge summaries, and pathology reports. Clinical Relation Extraction (RE) is the process of identifying semantic links between medical entities within these texts, such as connecting a drug to its dosage or an adverse event to a specific medication. While general-purpose Natural Language Processing (NLP) has been transformed by the advent of Transformer models, their application to the clinical domain has historically been dominated by the standard BERT architecture. This research addresses the gap by exploring whether newer architectures like RoBERTa and XLNet, combined with domain-specific pretraining, can overcome common clinical RE challenges, such as class imbalance and cross-sentence relations.
Methodology
Architectures and Pretraining
The authors evaluated three primary architectures: BERT, RoBERTa, and XLNet. Each was tested in "Base" and "Large" configurations. Crucially, the study compared general-domain models (trained on Wikipedia and BooksCorpus) against "Clinical" versions pretrained on the MIMIC-III corpus, a large-scale database of de-identified clinical data.
Classification Strategies
Two distinct approaches to classification were tested:
- Multi-class Classification: A single model trained to predict the specific relation type (e.g., Strength, Frequency) or the absence of a relation.
- Binary (2-stage) Classification: A first-stage model determines if any relation exists between two entities. If a relation is detected, a second-stage rule-based pipeline assigns the specific type based on the categories of the entities involved.
Representation Schemes
To determine the best way to represent entity pairs for the classifier, the researchers tested four schemes. The most successful, Scheme 3, concatenated the representation of the [CLS] token (capturing global context) with the representations of four specific "entity markers" ([S1], [E1], [S2], [E2]) that denote the start and end of the two concepts being evaluated.
Cross-Sentence Handling
Because clinical relations often span multiple sentences, the study compared a Unified model (trained on all pairs regardless of distance) against Distance-Specific models (separate classifiers optimized for specific sentence-gap lengths, ranging from 0 to 4 sentences).
Datasets
The models were validated on two major clinical NLP benchmarks:
- 2018 MADE1.0: Focused on oncology notes, featuring 7 relation types including Medication-Dosage and Medication-Adverse Drug Event.
- 2018 n2c2: Focused on discharge summaries, featuring 8 relation types such as Drug-Strength, Drug-Form, and Drug-Reason.
Key Insights
The Necessity of Domain-Specific Pretraining
Clinical-specific models (Clinical-BERT, Clinical-RoBERTa, and Clinical-XLNet) consistently outperformed their general-domain counterparts. This confirms that the specialized vocabulary and linguistic structures found in medical narratives require domain-specific pretraining to achieve high accuracy.
Architectural Superiority
While BERT has been the industry standard, this study found that RoBERTa and XLNet generally provided superior performance. On the MADE1.0 dataset, RoBERTa-clinical achieved an F1-score of 0.8959, surpassing the previous state-of-the-art of 0.8684. On the n2c2 dataset, XLNet-clinical reached an F1-score of 0.9610, matching the top-tier performance of the original challenge.
The Efficacy of Binary Classification
The 2-stage binary strategy proved more effective than direct multi-class classification. By grouping all positive relations into a single category for the initial detection phase, the models were better able to handle the inherent data imbalance (where "no relation" pairs vastly outnumber valid relations).
Contextual Markers
The success of representation Scheme 3 indicates that models benefit from a combination of broad sentence-level context and precise positional information. Providing the model with explicit markers for entity boundaries allows it to focus on the relevant segments of the text more effectively.
Limitations and Future Work
A primary limitation of the successful 2-stage binary approach is the assumption of a one-to-one relationship mapping. In scenarios where two entities might share multiple distinct relations, this method would require further refinement. Additionally, while the models performed well on short-range relations, identifying long-distance relations (spanning 2 or more sentences) remains a challenge due to the increased noise and complexity of the text.
To support further research, the authors have open-sourced their methods and pretrained models, providing a foundation for the community to develop more robust clinical extraction pipelines.
Summary updated