Natural Language Processing Algorithm Accurately Classifies Diverticulitis-Related Complications and Predicts
Wenjie Ma1, Yilun Wu1, Prasanna K Challa1
1Clinical and Translational Epidemiology Unit, Massachusetts General Hospital and Harvard Medical School, Boston, Massachusetts; Division of Gastroenterology, Massachusetts General Hospital and Harvard Medical School, Boston, Massachusetts.
Background & Aims:
Diagnostic codes lack the precision to identify specific complications of diverticulitis, limiting their utility in large-scale, real-world data. We developed a natural language processing (NLP) algorithm to classify diverticulitis and associated features using computed tomography (CT) reports.
Methods:
Using data from Mass General Brigham Research Patient Data Registry (1979-2024), we identified patients with a diagnosis code for diverticular disease (International Classification of Diseases [ICD]-9: 562; ICD-10: K57) and a prior abdominopelvic CT report. We developed and validated our NLP algorithm to detect diverticulitis and associated features. We subsequently investigated the associations between NLP-defined severity at first diagnosis (ie, uncomplicated, mild, severe, or chronic complications) and risk of severe diverticulitis recurrence using a Cox proportional hazards regression model. We assessed the predictive value of NLP-detected features using random forest models.
Results:
The NLP algorithm achieved positive and negative predictive values of 82.8% to 99.9%, outperforming both ICD codes and a generalist large language model. Among 16,349 patients with NLP-detected diverticulitis, 3192 developed severe recurrence over 76,736 person-years. Compared with uncomplicated diverticulitis, the multivariable-adjusted hazard ratio (HR) for severe recurrence was 1.39 (95% confidence interval [CI], 1.14-1.69) for mild complications, 3.02 (95% CI, 2.80-3.27) for severe complications, and 5.41 (95% CI, 4.78-6.13) for chronic complications. NLP-detected features significantly improved the prediction of severe diverticulitis recurrence compared with codified variables.
Conclusions:
Our NLP algorithm accurately classifies diverticulitis features, facilitating the construction of large and high-quality electronic health record-based cohorts. Severity at initial diagnosis predicts risk of severe recurrence, supporting the use of artificial intelligence for risk stratification and long-term management.
Related Concept Videos
Appendicitis-II: Diagnostic Studies and Management
Diagnosing Appendicitis
It requires a multifaceted approach, starting with a detailed physical examination to pinpoint the location and nature of the pain and identify any associated symptoms. Laboratory tests play a crucial role. A complete Blood Count (CBC) typically reveals leukocytosis (an increased number of...
Classification of Illness
An illness is a response to a disease in which the person's level of functioning is changed compared with a previous level. The general classification of illness includes acute and chronic.
Acute illness is severe...
Chronic Bowel Disorders: Introduction
Irritable Bowel Syndrome (IBS) is a common disorder affecting the gastrointestinal tract. The distinctive feature is recurrent abdominal pain associated with altered bowel movements, manifesting as constipation, diarrhea, or fluctuating between both. The...
