S919 Large Language Models Combined With a Single Diagnostic Code Detect Eosinophilic Esophagitis in Electronic Health Records With High Accuracy

Introduction: Large-scale epidemiologic research for eosinophilic esophagitis (EoE) is hampered by variable accuracy of International Classification of Diseases (ICD) codes and case identification algorithms. We aimed to develop and validate a natural language processing (NLP) pipeline using large language models (LLMs) to identify EoE features and diagnosis from unstructured text, comparing performance with ICD codes and ICD + LLM combination. Methods: We identified gastrointestinal pathology reports with any mention of “eosinophil” paired with preceding GI clinic notes. Three hundred randomly selected patients were divided into training (N = 200, 56 with EoE) and testing (N = 100, 36 with EoE) sets. Manual chart review was used to assign an EoE reference standard. LLM prompt development used a human-in-the-loop approach with iterative refinements. Training concluded once the LLM-assigned diagnosis exceeded the F1 score (harmonic mean of precision and recall) of ICD codes. Using the test set, we compared performance of ICD codes, LLM-derived diagnostic features, LLM-assigned diagnosis, and a combined LLM + ICD. Performance metrics included sensitivity (recall), PPV (precision), and F1 score. Nonparametric bootstrap resampling (1,000 replicates) was used to estimate 95% confidence intervals (CIs) with statistical significance based on whether they excluded zero. Results: In the training set, LLM-derived diagnostic features demonstrated the highest sensitivity (0.98; 95% CI 0.95, 1.00), while LLM-assigned diagnosis had the highest PPV (0.92; 95% CI 0.84-1.0) and specificity (0.97; 95% CI 0.95,1.00). Comparably high F1 scores were achieved with LLM-derived features (0.89; 95% CI 0.83, 0.95) and ICD + LLM diagnosis (0.88; 95% CI 0.81, 0.95). In the independent test set, ICD codes alone showed a sensitivity of 0.86 (95% CI 0.75, 0.97), PPV of 0.97 (95% CI 0.91, 1.0), and an F1 of 0.91 (95% CI 0.84, 1.0). Combining ICD and LLM-assigned diagnosis yielded a 3-point improvement in F1 score (95% CI -0.01, 0.07; P = 0.2) compared to ICD alone. This combination method significantly improved sensitivity (0.92 [0.83,1.00]; P = 0.008) and F1 score (0.94 [0.89,1.00]; P = 0.047) relative to LLM-assigned diagnosis. Conclusion: Combining the LLM-assigned diagnosis with a single diagnostic code reduced false negatives and modestly improved the F1 score compared to either method alone, suggesting a scalable approach for improving EoE case identification in real-world data.

Authors

Publication Details

Journal
The American Journal of Gastroenterology
Published
2025-10-01
DOI
https://doi.org/10.14309/01.ajg.0001131136.29079.1a
Primary Topic
Eosinophilic Esophagitis
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

S919 Large Language Models Combined With a Single Diagnostic Code Detect Eosinophilic Esophagitis in Electronic Health Records With High Accuracy

Evan S. Dellon, Corey J. Ketchem, Ashley Batugo, Kristle Lee Lynch et al.
The American Journal of Gastroenterology
Eosinophilic Esophagitis
article

S919 Large Language Models Combined With a Single Diagnostic Code Detect Eosinophilic Esophagitis in Electronic Health Records With High Accuracy

Evan S. Dellon, Corey J. Ketchem, Ashley Batugo, Kristle Lee Lynch, Gary W. Falk, Danielle L. Mowery, Agnes Wang, Uğurcan Vurgun, Sunil Thomas, James C. Lewis
article en

Abstract

Introduction: Large-scale epidemiologic research for eosinophilic esophagitis (EoE) is hampered by variable accuracy of International Classification of Diseases (ICD) codes and case identification algorithms. We aimed to develop and validate a natural language processing (NLP) pipeline using large language models (LLMs) to identify EoE features and diagnosis from unstructured text, comparing performance with ICD codes and ICD + LLM combination. Methods: We identified gastrointestinal pathology reports with any mention of “eosinophil” paired with preceding GI clinic notes. Three hundred randomly selected patients were divided into training (N = 200, 56 with EoE) and testing (N = 100, 36 with EoE) sets. Manual chart review was used to assign an EoE reference standard. LLM prompt development used a human-in-the-loop approach with iterative refinements. Training concluded once the LLM-assigned diagnosis exceeded the F1 score (harmonic mean of precision and recall) of ICD codes. Using the test set, we compared performance of ICD codes, LLM-derived diagnostic features, LLM-assigned diagnosis, and a combined LLM + ICD. Performance metrics included sensitivity (recall), PPV (precision), and F1 score. Nonparametric bootstrap resampling (1,000 replicates) was used to estimate 95% confidence intervals (CIs) with statistical significance based on whether they excluded zero. Results: In the training set, LLM-derived diagnostic features demonstrated the highest sensitivity (0.98; 95% CI 0.95, 1.00), while LLM-assigned diagnosis had the highest PPV (0.92; 95% CI 0.84-1.0) and specificity (0.97; 95% CI 0.95,1.00). Comparably high F1 scores were achieved with LLM-derived features (0.89; 95% CI 0.83, 0.95) and ICD + LLM diagnosis (0.88; 95% CI 0.81, 0.95). In the independent test set, ICD codes alone showed a sensitivity of 0.86 (95% CI 0.75, 0.97), PPV of 0.97 (95% CI 0.91, 1.0), and an F1 of 0.91 (95% CI 0.84, 1.0). Combining ICD and LLM-assigned diagnosis yielded a 3-point improvement in F1 score (95% CI -0.01, 0.07; P = 0.2) compared to ICD alone. This combination method significantly improved sensitivity (0.92 [0.83,1.00]; P = 0.008) and F1 score (0.94 [0.89,1.00]; P = 0.047) relative to LLM-assigned diagnosis. Conclusion: Combining the LLM-assigned diagnosis with a single diagnostic code reduced false negatives and modestly improved the F1 score compared to either method alone, suggesting a scalable approach for improving EoE case identification in real-world data.

The American Journal of GastroenterologyVol. 120(10S2)
Openalex Percentile: Top 48%
Eosinophilic Esophagitis
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.