Abstract
Radiotherapy (RT) toxicities can impair survival and quality-of-life, yet remain under-studied. Real-world evidence holds potential to improve our understanding of toxicities, but toxicity information is often only in clinical notes. We developed natural language processing (NLP) models to identify the presence and severity of esophagitis from notes of patients treated with thoracic RT. We fine-tuned statistical and pre-trained BERT-based models for three esophagitis classification tasks: Task 1) presence of esophagitis, Task 2) severe esophagitis or not, and Task 3) no esophagitis vs. grade 1 vs. grade 2-3. Transferability was tested on 345 notes from patients with esophageal cancer undergoing RT. Fine-tuning PubmedBERT yielded the best performance. The best macro-F1 was 0.92, 0.82, and 0.74 for Task 1, 2, and 3, respectively. Selecting the most informative note sections during fine-tuning improved macro-F1 by over 2% for all tasks. Silver-labeled data improved the macro-F1 by over 3% across all tasks. For the esophageal cancer notes, the best macro-F1 was 0.73, 0.74, and 0.65 for Task 1, 2, and 3, respectively, without additional fine-tuning. To our knowledge, this is the first effort to automatically extract esophagitis toxicity severity according to CTCAE guidelines from clinic notes. The promising performance provides proof-of-concept for NLP-based automated detailed toxicity monitoring in expanded domains.
Introduction
Radiotherapy (RT) is a cornerstone of lung cancer treatment, but it frequently induces esophagitis—an inflammation of the esophagus that causes significant pain, malnutrition, and potential treatment interruptions. While clinical trials rigorously track these toxicities, real-world data (RWD) is often missing or incomplete. Most toxicity information is trapped in unstructured clinical notes, and standard ICD-10 codes are often insufficient for capturing the nuance of treatment side effects. This study presents an automated NLP pipeline designed to extract esophagitis presence and severity (Grades 0–3) according to the Common Terminology Criteria for Adverse Events (CTCAE) guidelines.
Methodology
The researchers developed a specialized NLP pipeline centered on transformer-based models. The core of the approach involves three primary classification tasks:
- Task 1 (Detection): Identifying the presence vs. absence of esophagitis.
- Task 2 (Severity Classification): Distinguishing between mild (Grade ≤1) and clinically significant (Grade >1) cases.
- Task 3 (Finer-Grained Grading): A three-way classification (None vs. Grade 1 vs. Grade 2-3).
A key innovation was sectionization. Using a customized medspaCy tool, the models were trained on specific, high-yield sections of clinical notes—such as "Assessment and Plan" and "Interval History"—rather than the entire document. This reduced noise and improved performance.
Datasets and Data Augmentation
The study utilized three distinct datasets to train and validate the models:
- Gold-Labeled Dataset: 1,524 clinical notes from 124 lung cancer patients, manually annotated by experts.
- Silver-Labeled Dataset: 2,420 notes where toxicity grades were extracted from structured EHR fields. Although "noisier" than manual annotations, these provided a larger volume of data for pre-training.
- Cross-Domain Validation Set: 345 notes from 75 esophageal cancer patients to test the model's generalizability.
Key Results
The study compared several models, including TF-IDF baselines and various BERT variants (ClinicalBERT, BioBERT, PubMedBERT). PubMedBERT emerged as the top performer, likely due to its pre-training on biomedical literature.
- High Accuracy: The model achieved a macro-F1 of 0.92 for Task 1 and 0.82 for Task 2.
- The Power of Silver Labels: Incorporating silver-labeled data boosted macro-F1 scores by over 3% across all tasks, demonstrating that imperfect EHR data can effectively augment small, high-quality datasets.
- NLP vs. ICD-10: The NLP model significantly outperformed traditional coding. In the test set, it identified all 12 patients with esophagitis, whereas ICD-10 codes only captured 4.
- Sectional Advantage: Focusing on specific note sections improved macro-F1 by over 2% compared to using full-text notes.
Discussion and Conclusion
This work provides a proof-of-concept for the automated extraction of detailed toxicity data from clinical notes. While the model showed a performance drop on the esophageal cancer dataset—partly due to the difficulty of distinguishing toxicity from tumor-related symptoms—it still demonstrated strong generalizability.
Limitations include a lack of severe (Grade 4-5) cases in the training data and the reliance on a single institution's records. Future work will focus on expanding to other toxicities and refining causal attribution to distinguish radiation-induced effects from other clinical factors. Ultimately, this pipeline offers a scalable method for generating high-quality real-world evidence to improve patient care in oncology.
Summary updated