Skip to main content
JAMIA Open logoLink to JAMIA Open
. 2026 Oct 11;9(5):ooag163. doi: 10.1093/jamiaopen/ooag163

Automating chart review for identification of infected patients using natural language processing

Afia Z Khan 1, Kevin G Buell 2, George Karway 3, Kyle Carey 4, Nicole Dussault 5, Jay Dumanian 6, Sivasubramanium Bhavani 7, Emily R Gilbert 8, Christopher Winslow 9, Nirav Shah 10, Majid Afshar 11,12, Dana P Edelson 13, Matthew M Churpek 14,15,✉
PMCID: PMC13654191  PMID: 42861183

Abstract

Objective

Expert clinician chart review is the most accurate method to identify patients with infection but is laborious and costly. We aimed to develop and externally validate machine-learning models using structured and unstructured data to identify infection in hospitalized patients compared to chart review.

Materials and Methods

Adult inpatient encounters at 2 health systems (2006-2016) were manually annotated for suspected infection on admission. Data from one site were used to develop gradient-boosted machine-learning models. Structured features included labs, vital signs, and nursing assessments. Unstructured clinical notes were converted to concept unique identifiers (CUIs) using the clinical Text Analysis and Knowledge Extraction System. Unimodal and multimodal models were tuned to maximize the area under the receiver operating curve (AUROC) in the derivation site through cross-validation. Model discrimination and calibration were assessed in the external validation site.

Results

Of the 3014 included admissions, 677 (22.5%) were classified as having suspected infection on admission. A multimodal model combining n-gram TF-IDF and structured data demonstrated the best performance, significantly outperforming the structured data only model (AUROC 0.88 vs 0.82, P < .001, area under the precision-recall curve 0.71 vs 0.58, P < .001). The most important features came from unstructured data.

Discussion and Conclusion

Our results highlight the value of unstructured text data for developing models that accurately replicate chart reviews in identifying patients with infection. By expediting the annotation of infection cases, our models can facilitate epidemiological research and the curation of datasets necessary for developing clinical decision support systems for early sepsis detection.

Keywords: infections, sepsis, machine-learning, natural language processing, electronic health records

Introduction

Sepsis, a lethal syndrome characterized by a dysregulated host response to infection causing organ impairment, is a leading cause of mortality among hospitalized patients.1,2 Timely and accurate recognition of infection is essential to reduce mortality from sepsis, as delayed antibiotics worsen outcomes.3,4 It is also vital to avoid inappropriate antibiotic administration to patients without infection to prevent adverse effects and antimicrobial resistance.5,6 Despite its importance, accurate identification of infected patients is challenging for clinicians and algorithms alike.7–10 Methods commonly used in research have demonstrated varying levels of sensitivity, missing up to half of admissions with infection.11 In contrast, manual chart review with expert annotation is the gold standard but is onerous and costly. Thus, models that accurately replicate manual chart reviews for identifying infected patients can facilitate epidemiological research and the development of data-driven clinical decision support for early sepsis detection to prevent poor health outcomes.

One promising methodology to automate chart review for identifying infection is natural language processing (NLP) of clinical documentation. During routine clinical care, providers aggregate patient symptoms, histories, vital signs, and test results to identify infection and document their assessments in their notes. Clinician experts conducting retrospective chart reviews similarly use the same electronic health record (EHR) data and notes to assess the likelihood of infection. Thus, an NLP algorithm based on these components may be able to perform similarly to chart review. While some studies have implemented NLP to identify patients with sepsis or infection, they have frequently been limited by imperfect gold standards and lack of external validation.12–19 In contexts outside of sepsis and infection, studies attempting to replicate manual chart review have demonstrated impressive performance using clinical NLP.20–23 However, the performance of NLP in classifying patients with infection as determined by manual chart review is unknown.

Objective

In this study, we develop and externally validate NLP machine-learning models to identify suspected infection on admission among hospitalized patients, using manual chart review by clinical experts as the reference gold standard. We additionally investigate whether models using both text and structured data outperform models relying on any single data modality. Using clinical documentation and structured data with machine-learning and NLP, our goal was to develop a computable phenotype that replicates manual chart review in determining the likelihood of infection on admission.

Methods

Study population

All adult (age ≥18 years) inpatient encounters between 2006 and 2016 from 2 Illinois health systems—Loyola University Medical Center (LUMC) and University of Chicago Medicine (UCM)—were eligible for inclusion. A simple random sample of 1887 eligible encounters was chosen for manual chart review to confirm the presence of infection among encounters meeting at least 1 of 3 inclusion criteria: (1) blood culture order, (2) antibiotic administration, or (3) Angus billing codes for infection and in-hospital mortality.24,25 A proportional 1443 encounters not meeting these criteria were included without chart review and classified as not infected. Details of the chart review process have been published previously.11 In the current study, encounters were excluded if they did not have both clinical free text and structured data available. This study was approved by the University of Wisconsin Institutional Review Board with a waiver of informed consent (IRB- 2019-1124).

Data collection

Structured data and free-text clinical notes were de-identified at each institution and securely transferred to the University of Wisconsin-Madison. Structured data included patient demographic characteristics, prior Elixhauser comorbidities, vital signs, hospital locations, nursing assessments, and laboratory results. Structured data values from the first 24 hours of admission were included.

Free text clinical notes were de-identified and processed using Apache clinical Text Analysis and Knowledge Extraction System (cTAKES) to obtain Concept Unique Identifiers (CUIs).26 The cTAKES v4.0.0.1 pipeline was used as a starting point; details on implementation are available in a public repository.27 CUIs are codes corresponding to concepts from multiple biomedical knowledge bases, unified in a single vocabulary by the National Library of Medicine Unified Medical Language System (UMLS).28 These codified terms represent standardized medical concepts and do not contain protected health information, making them inherently de-identified and easier to share across institutions than free text. Additionally, CUIs map multiple related terms to a single medical concept, reducing the number of features necessary to represent a text. Each CUI corresponds to a “preferred text,” or textual description of the concept, permitting interpretation. Figure 1 shows an example of clinical free text mapped to CUIs and their preferred texts. CUIs from the first 24 hours of clinical documentation were included.

Figure 1.

Figure depicts an example mapping clinical free text to CUIs and their preferred texts, as well as how CUI preferred text can be represented as unigrams and bigrams.

Example of CUI parameterizations. This figure depicts an example mapping clinical free text to CUIs and their preferred texts, as well as how CUI preferred text can be represented as unigrams and bigrams.

Model predictors

Structured variable predictors used as machine-learning model inputs included age, vital signs, laboratory results (complete blood count, basic metabolic panel, liver function tests, venous and arterial blood gas, and coagulation), hospital location (emergency department, ward, intensive care unit, or operating room), Braden scores for pressure ulcer risk assessment, body mass index, and total urine output. For each admission, a single value per variable was retained: the first chronological laboratory value, body mass index, and Braden score; maximum or minimum values for vital signs; and the presence of any instance for hospital location and foley catheter use (see eTable S1 for the full list).

CUIs appearing in at least 5 training dataset encounters were used to construct predictor variables from unstructured data, thereby eliminating infrequently used CUIs. CUIs were represented using term frequency-inverse document frequency (TF-IDF). TF-IDF is a weighting scheme used in information retrieval and text mining to characterize the importance of terms within the document and ensure the terms are weighted fairly regardless of the document’s length. TF-IDF multiplies the term frequency by the corpus IDF, which assigns higher weight to terms that are frequent in a given document but relatively uncommon across the corpus, making them informative for differentiating texts. In prior literature, CUI TF-IDF has performed better than CUI one-hot encodings or CUI term frequency in different clinical contexts,29 so TF-IDF was used as the CUI parameterization in this study. In addition, unigrams and bigrams were constructed from the CUI “preferred text” after lower-casing, stemming, and stop word removal (Figure 1). CUI preferred text n-gram TF-IDF (henceforth entitled “n-gram TF-IDF”) was evaluated as an alternative parametrization. In total, 4 sets of features were used to fit XGBoost models, which were compared in the test set: structured data, CUI TF-IDF, n-gram TF-IDF, and structured + n-gram TF-IDF.

Outcome

The outcome of interest was the presence of suspected infection on admission, as determined by clinician chart review. Clinician experts followed a set of guidelines to rate encounters for likelihood of infection on a Likert scale. Encounters rated as “proven infection” (clinical concern for new or worsening infection confirmed by positive culture), “probable infection” (clinician belief in infection as the most likely explanation for patient symptoms, with no positive culture), or “possible infection” (equal clinical concern for infectious and noninfectious cause) within 24 hours of admission were classified as “suspected infection on admission.” All other encounters, namely those rated as “unlikely infection” (initial clinical concern subsequently disproven by a more likely noninfectious cause), “not infected” (no clinical concern for infection), or those with infection onset after 24 hours from admission, were classified as “not infected on admission.” Details about this process can be found in the previous publication.11

Model derivation

Extreme gradient boosting machine (XGBoost) models were trained on data from the derivation site (UCM). XGBoost is a tree boosting ensemble learner that sequentially builds trees to improve performance on previously incorrectly classified observations, using regularization and feature sampling to combat overfitting.30 Hyperparameters were tuned using Bayesian optimization and 5-fold cross-validation in the derivation data to maximize the area under the receiver operating characteristic curve (AUROC).31 Tuned hyperparameters included maximum tree depth, minimum sum of child instance weight, subsample ratio of training instances, subsample ratio of columns, step size shrinkage, and minimum loss reduction required to make a split. eTable S2 shows the hyperparameter search space.

Analysis plan

Statistical analysis

Demographic and hospitalization characteristics were compared between patients with or without suspected infection on admission, as determined by manual chart review. Additional variables compared between groups included the Systemic Inflammatory Response Syndrome (SIRS) criteria calculated using structured data available in the first 24 hours of admission, with 2 or more criteria indicating SIRS positivity.32 Wilcoxon rank sum tests and chi-squared tests were calculated for continuous and categorical data, respectively. Two-tailed P-values were used at a significance level of .05.

Model validation

Models were evaluated in the external validation site (LUMC). For CUI and n-gram TF-IDF, CUIs and unigrams or bigrams present in derivation but not external validation data were assigned values of 0. Additionally, IDF among the validation data was imputed from the derivation corpus, rather than being calculated in the validation corpus to avoid data leakage. This was intended to replicate a prospective case-by-case application of the model, where an entire corpus of test set observations would not be available. A secondary analysis was performed that used 4-fold cross-validation in the model derivation site to estimate the internal validity of the modeling approach and to compare to the external results.

Model discrimination was evaluated using the AUROC and the area under the precision-recall curve (AUPRC).33 The AUROC of different models was compared using the DeLong test.34 The AUPRC of different models was compared using 2000 bootstrap replicates. Additionally, model calibration, as measured by calibration slope, intercept, and Brier score, was used to evaluate models. Calibration measures how well model probability predictions correspond with observed incidence, with a perfectly calibrated model having an intercept of 0 and slope of 1. Better calibration is associated with a low Brier score, or mean squared error between observed outcomes and predicted probabilities.35

The model with the highest AUROC in the external validation site was selected for further analysis. Sensitivity, specificity, negative predictive value, and positive predictive value were reported at different threshold cutoffs in the predicted outcome probability. Furthermore, feature importance was calculated using the gain metric, which measures the improvement in accuracy from splits including this feature. To evaluate model performance across the entire spectrum of infection suspicion, we compared predicted probabilities across the 5 Likert categories assigned by manual reviewers. Model performance was also compared to the Sepsis-3 infection criteria (body fluid culture order within 24 hours after an antibiotic or antibiotic within 72 hours after a body fluid culture),36 and the criteria published by Rhee et al37 (blood culture order and at least 4 consecutive days of antibiotics, with the first day being a new intravenous antibiotic and occurring within 2 calendar days of the culture order).

All analyses were conducted in R version 4.1.2. Several packages were used for data pre-processing, model derivation and evaluation, including tidyverse,38 tidytext,39 SnowballC,40 XGBoost,41 ParBayesianOptimization,42 caret,43 rms,44 usefun,45 pROC,46 and precrec.47

Results

Patient population

The final study cohort consisted of 3014 patient encounters, including 1629 which were used for derivation (UCM) and 1385 for external validation (LUMC). Figure 2 depicts the flow diagram of patient inclusion that led to the final cohort. Compared to patients in the validation site, patients in the derivation site were younger (median age 57 vs 60, P < .001) and had a lower prevalence of diabetes, hypertension, chronic pulmonary disease, heart failure, and liver disease (P < .05 for all comparisons). They additionally were more likely to have SIRS (74.3% vs 49.3%, P < .001) and experienced longer lengths of stay (86 hours vs 67 hours, P < .001). Detailed comparisons across site are shown in eTable S3.

Figure 2.

For image description, please refer to the figure legend and surrounding text.

CONSORT diagram of study cohort, which shows how patients were selected for the study.

Of the 3014 encounters, 677 (22.5%) were judged to exhibit suspected infection on admission on manual chart review, whereas 2337 (77.5%) were not infected on admission. Table 1 compares patient and admission characteristics between the 2 groups. Patients with suspected infection on admission were older (median age 59 vs 58, P < .05), but there were no differences in racial or sex composition. There was a higher prevalence of several comorbidities in the infected group, including diabetes (25.7% vs 19.9%, P < .01), hypertension (49.2% vs 41.1%, P < .001), heart failure (20.5% vs 16.0%, P < .01), renal failure (22.3% vs 14.6%, P < .001), and liver disease (12.0% vs 8.4%, P < .01). Patients with suspected infection were more likely to meet at least 2 SIRS criteria within the first 24 hours of admission (82.9% vs 57.0%, P < .001). In-hospital mortality (7.2% vs 1.2%, P < .001) and length of stay (median 114 hours vs 67 hours, P < .001) were both higher in the infected group.

Table 1.

Patient and visit characteristics by suspected infection on admission.

Suspected infection on admission (N = 677) Not infected on admission (N = 2337) P value
Age, median [IQR], years 59 [45, 72] 58 [44, 69] .043
Female, n (%) 350 (51.7) 1294 (55.4) .1
Race, n (%) .062
White/Caucasian 315 (46.5) 1218 (52.1)
Black/African American 298 (44.0) 901 (38.6)
Asian/Mideast Indian 9 (1.3) 35 (1.5)
Other 55 (8.1) 183 (7.8)
Comorbidities, n (%)
Diabetes 174 (25.7) 464 (19.9) .001
Hypertension 333 (49.2) 960 (41.1) <.001
Solid tumor 142 (21.0) 417 (17.8) .073
Chronic pulmonary disease 119 (17.6) 338 (14.5) .054
Heart failure 139 (20.5) 373 (16.0) .006
Renal failure 151 (22.3) 341 (14.6) <.001
Liver disease 81 (12.0) 196 (8.4) .006
SIRS criteria in first 24 hours, n (%)
Tachycardia (HR > 90) 542 (80.1) 1410 (60.3) <.001
Tachypnea (RR > 20) or PaCO2 < 32 mm Hg 388 (57.3) 977 (41.8) <.001
  Tachypnea (RR > 20) 386 (57.0) 970 (41.5) <.001
  PaCO2 < 32 mm Hg 36 (5.3) 33 (1.4) .046
Temperature >38°C or <36°C 372 (54.9) 983 (42.1) <.001
  Temperature >38°C 167 (24.7) 83 (3.6) <.001
  Temperature <36°C 237 (35.0) 918 (39.3) .046
WBC > 12 or <4 or >10% bands 424 (63.8) 744 (36.1) <.001
  WBC > 12 322 (47.6) 559 (23.9) <.001
  WBC < 4 116 (17.1) 204 (8.7) <.001
  % Bands >10 55 (8.1) 16 (0.7) <.001
SIRS (2+ criteria) 561 (82.9) 1333 (57.0) <.001
Length of stay, hours, median [IQR] 114 [68, 206] 67 [29, 126] <.001
Mortality, n (%) 49 (7.2) 27 (1.2) <.001

Patient characteristics were compared between patients with suspected infection on admission and those who were not infected on admission, as determined by manual chart review. Proportions are reported in parentheses for categorical data relative to the column sample size (N). P-values are reported from Wilcoxon rank sum tests (numerical data) and chi-squared tests (categorical data) on non-missing values.

Abbreviations: HR, heart rate (beats/minute); RR, respiratory rate (breaths/minute); SIRS, systemic inflammatory response syndrome; WBC, White blood cell (thousands/μL).

In the first 24 hours of clinical documentation across admissions, 12 886 unique CUIs were identified in the derivation site and 13 470 CUIs in the external validation site, comprising a shared vocabulary of 18 377 CUIs across the 2 sites. This was reduced to 5333 CUIs after restricting to CUIs used in at least 5 training encounters. Mapping CUIs to their preferred text produced 7754 unigrams and bigrams. In addition, 58 EHR variables were used in models containing structured data.

Model performance

Table 2 shows the AUROC and AUPRC of the XGBoost models in the validation site. The highest discrimination was achieved by combining structured and n-gram TF-IDF variables, with an AUROC of 0.88 (95% CI, 0.86-0.91). The performance of this multimodal model was significantly higher than the structured variable only model (AUROC 0.82, P-value <.001) and the CUI TF-IDF model (AUROC 0.81, P-value .0003). The multimodal model also performed better than the n-gram TF-IDF model, but the difference was not statistically significant at the 5% level (AUROC 0.85, P-value .06). Comparing the 2 representations of CUI data, the model using n-gram TF-IDF as features appeared to perform better than that using CUI TF-IDF, with a higher AUROC (0.85 vs 0.81, not statistically significant with P-value .11) and AUPRC (0.71 vs 0.63, P-value <.001). The structured model had the lowest AUPRC (0.58), whereas AUPRC was highest in the combined n-gram TF-IDF and structured model (0.71) and n-gram TF-IDF model (0.71). Discrimination of the combined structured and n-gram TF-IDF model was similar during internal validation using 4-fold cross-validation (eTable S4).

Table 2.

Model performance in external validation site.

Data Number of features AUROC [95% CI] AUPRC [95% CI]
CUI TF-IDF 5333 0.81 [0.78, 0.84] 0.63 [0.58, 0.69]
N-Gram TF-IDF 7754 0.85 [0.82, 0.88] 0.71 [0.66, 0.76]
Structured 58 0.82 [0.80, 0.85] 0.58 [0.53, 0.64]
Structured + N-Gram TF-IDF 7812 0.88 [0.86, 0.91] 0.71 [0.66, 0.76]

Extreme gradient boosting machine tree-based decision models were fitted to 4 representations of admission data in the derivation site in order to predict suspected infection on admission. CUIs were extracted from the first 24 hours of clinical documentation and represented either by CUI TF-IDF or by TF-IDF of n-grams constructed from CUI preferred text (n-gram TF-IDF). Structured data were included from EHR values prior to 24 hours after admission. Results depict model performance in the external validation site, with the best-performing metrics shown in bold. The AUROC 95% CI was calculated using the DeLong method. The AUPRC 95%CI was calculated using 2000 bootstrap replicates.

Abbreviations: AUPRC, area under the precision-recall curve; AUROC, area under the receiver operating characteristic curve; CI, confidence interval; CUI, concept unique identifier; TF-IDF, term frequency-inverse document frequency.

Figure 3 displays ROC curves, which plot true positive rate (sensitivity) against false positive rate (1—specificity) at different probability thresholds, for all models in the validation site. Comparing ROC curves of the structured model and n-gram TF-IDF model in Figure 3, the n-gram TF-IDF model had a higher sensitivity for the same specificity than the structured data model at lower probability thresholds, but the opposite was true at higher probability thresholds. For a given specificity, the combined model with both n-gram TF-IDF and structured variable predictors had a higher sensitivity than either the n-gram TF-IDF or structured model individually. eFigure S1 depicts the PRC curves, which plot the positive predictive value (precision) against true positive rate (sensitivity). At most sensitivity levels, both the combined model and the n-gram TF-IDF model demonstrate higher precision than the other 2 models. In addition, the combined n-gram TF-IDF and structured model performance (sensitivity, specificity, positive predictive value, and negative predictive value) across different probability thresholds, as well as performance of the Sepsis-3 and Rhee criteria, is shown in eTable S5. A threshold of 0.2 correctly omits most (90%) non-infected patients, while retaining most (72%) infected patients with a positive predictive value of 66%. The Sepsis-3 infection criteria had a sensitivity of 70%, specificity of 93%, positive predictive value of 73%, and negative predictive value of 92%. In contrast, the Rhee criteria had a sensitivity of 54%, specificity of 97%, positive predictive value of 82%, and negative predictive value of 89%.

Figure 3.

For image description, please refer to the figure legend and surrounding text.

Model performance in external validation site. Extreme gradient boosting machine tree-based decision models were fitted to 4 representations of admission data in the derivation site in order to predict suspected infection on admission. Results depict model receiver operating characteristic curves in the external validation site.

Calibration results are shown in eTable S6. Slopes ranged from 0.93 (n-gram TF-IDF model) to 1.82 (structured only model). Intercepts were all higher than 0, indicating that on average predicted probabilities for infection across bins exceeded observed rates of infection. The lowest Brier score (0.11) demonstrating the best calibration was achieved by the model using both n-gram TF-IDF and structured data. eFigure S2 shows the distribution of predicted probabilities from the combined n-gram TF-IDF and structured model across the full Likert scale of infection likelihood, demonstrating a monotonic trend across values.

Feature importance

Figure 4 shows feature importance for the 20 most important variables in the best-performing XGBoost model that used structured and n-gram TF-IDF data. Most (15/20) variables are n-grams, many corresponding to bacterial (“cultur,” “abscess,” “blood cultur,” “infect”) and antibiotic (“cefepim,” “vancomycin,” “cipro”) mentions. Structured EHR variables in the top 20 include maximum temperature, first lactate, and first percentage values of neutrophils, lymphocytes, and monocytes.

Figure 4.

The 20 most important features are depicted from the best performing model, the XGBoost classifier using both structured EHR and n-gram TF-IDF data as predictor variables.

Feature importance: model with n-gram TF-IDF and structured EHR data. The 20 most important features are depicted from the best performing model, the XGBoost classifier using both structured EHR and n-gram TF-IDF data as predictor variables.

Discussion

In this study, we developed and externally validated prediction models that accurately discriminated between patients with and without suspected infection on admission when compared against expert manual chart review as the gold standard. We found that the best-performing model was a multimodal model using features from unstructured clinical note text data and structured data, which more accurately discriminated between infected and non-infected patients than a model using only structured data. The majority of important features in the multimodal model were derived from unstructured data, highlighting its utility for replicating chart reviews in identifying patients with infection. To our knowledge, this is the first study to test NLP approaches for identifying infected hospitalized patients as determined by expert chart review, supporting future development of clinical decision support tools to detect infection early and estimates of sepsis prevalence.

Prior research has sought to develop NLP and multimodal predictive models to identify patients with sepsis as defined by several criteria. First, Sepsis-3 defines suspected infection as having a body fluid culture within 24 hours after an antibiotic or antibiotic within 72 hours after a body fluid culture, and defines sepsis as suspected infection and a 2-point increase in the Sequential Organ Failure Assessment (SOFA) score.36 The Sepsis-3 definition has been used in several multimodal machine-learning models. For example, Liu et al13 developed a model combining GloVe embeddings and a recurrent neural network with structured features to predict Sepsis-3 definition onset early in Medical Information Mart for Intensive Care-III (MIMIC-III) data. In a similar approach, Amrollahi et al14 developed a model combining ClinicalBERT embeddings with structured features in MIMIC-III data. Second, the Rhee definition uses sustained antibiotic administration over 4 days (with the first dose being intravenous) and a blood culture order to identify serious infection, deemed sepsis if complicated by acute organ dysfunction.37 Delahanty et al15 trained a gradient boosting supervised machine learning classifier to predict the Rhee target, including structured data and chief complaint keywords as features. Third, ICD codes have frequently been used, including infection, sepsis, and organ failure billing codes identified by Angus.24,25 For example, Goh et al16 used ICD-10 codes for sepsis to train a multimodal model incorporating structured features and notes represented by topic modeling in Singapore ICU data. Consistent with many of these studies on sepsis13,14,16 as well as research in other clinical applications,29 we found that a multimodal model combining both structured and unstructured data performed better than that using any feature set alone.

Our study differs from past NLP research by using suspected infection as determined by expert chart review as the endpoint of interest, without requiring organ dysfunction. Infection is a desirable target outcome for clinical decision support to ensure early antibiotic initiation prior to patient deterioration. Additionally, chart review is a preferable gold standard because commonly used EHR-based infection definitions have varying levels of sensitivity and specificity. In our prior work from this cohort, the Sepsis-3 infection definition had the highest sensitivity (81%), followed by Angus (77%) and Rhee (52%), while Rhee was the most specific and Angus billing codes most accurately reflected infection prevalence.11 In the current study, we similarly found that the Sepsis-3 criteria were more sensitive than the Rhee criteria for detecting infection on admission (70% vs 54%), whereas the Rhee criteria were more specific (97% vs 93%). Our approach has the advantage of producing a range of probabilities with different performance characteristics, so that the balance of sensitivity vs specificity can be matched to the study’s scientific question. Furthermore, our models only used data from the first 24 hours of admission, whereas the Sepsis-3 and Rhee criteria include information from several days after admission. It is likely that including additional data could improve the performance of our models and will be the focus of future work. To our knowledge, few studies have used clinical free text to develop models that predict infection, and those that did used endpoints such as ICD-9 codes,17 antibiotic mentions in documentation,19 or blood cultures with IV antibiotics18 rather than chart review. Additionally, one study from our group has used this chart review cohort to predict infection on admission using structured data.48 The present study builds on this work by incorporating clinical free text.

While expert chart review is the gold standard, it can be expensive, time-consuming, and difficult to adapt for large-scale applications. A high-performing NLP model could expedite annotation by leveraging free text written by clinicians, potentially permitting better targeting of texts to expert annotators or, at times, automating chart review entirely. Our study demonstrates the feasibility of such an approach. Examining the most important features in the combined model shows that CUIs containing words pertaining to antibiotics, cultures, or infections exerted large influence on the model predictions. When providers believe their patients to be infected, they likely use language in their documentation which map to such medical concepts, allowing these patterns to be internalized during model training.

As other studies have done, our study maps the clinical note free text to medical concepts or CUIs and applies term-frequency inverse-document frequency weighting, which reduces the influence of overly frequent terms while highlighting those which are more informative.23,29 However, we found that model performance in the external validation site is improved by further mapping these concepts to their preferred text unigrams and bigrams to use as features for our models. This may be beneficial because variability in commonly used terminology across sites and clinicians could result in different CUIs being assigned to similar clinical concepts. By instead representing CUIs through their standardized preferred text, our model may capture overlapping textual elements across such related concepts, improving model generalizability. Subsequent research should investigate whether using preferred text as model inputs is preferable to using CUIs in other contexts.

Our paper has several additional strengths. We included patients outside of the ICU in our sample, in contrast with many other studies, such as those solely using MIMIC-III data. While sepsis patients often are admitted to the ICU, signs of infection and sepsis frequently occur in the emergency room or on the wards.8,49 Sepsis often presents differently in the ward than in ICU, such as increased prevalence of Gram-negative pathogens, differences in the infection site, and organ dysfunction originating in the kidneys and heart as opposed to lungs.50 Correctly and swiftly recognizing these cases is necessary for quality patient care.

Additionally, we externally validated our algorithm in a different health system than where it was developed. This finding is reassuring given significant differences between the 2 health systems in patient demographics, comorbidities, and hospitalization characteristics, as well as possible differences in hospital protocols which could impact structured data collection and clinical documentation styles.

Our work contributes to a larger literature about computable phenotyping, in which biomedical informaticists generate criteria that can be used to query large datasets to identify members of a patient cohort of interest.51 Researchers interested in measuring sepsis prevalence, developing models for early infection detection, retroactively assessing healthcare quality, and more have reason to desire extracting a cohort of patients with infection from the EHR. As we have described, identifying patients with infection is challenging, and simple algorithms may not be sensitive and specific enough to suffice. Our multimodal algorithm leveraging clinical free text and structured EHR data serves as an alternative method of achieving this purpose.

Our study had several limitations. First, some hospitals may not be equipped to run cTAKES on all clinical documentation, due to lack of computational resources or expertise, which would prevent use of this algorithm. Second, the feature sets were limited to summary measures of structured vitals, labs, and nursing documentation values as well as CUIs and their preferred text n-grams; notably, time-varying trends in structured values and the raw text of clinical notes were not used. There are also several additional settings in cTAKES, such the sectionizer and negation that were not used in this study. Incorporating these features may improve model performance. Furthermore, while models exhibited high discrimination, they were not well-calibrated in the external validation site, indicating that predicted probabilities did not align well with actual probabilities of infection. Methods to improve calibration would be needed before these models could be used prospectively. Finally, identifying infection is a difficult task, and it is possible that chart reviews included some mistakes. However, the annotators achieved high levels of inter-annotator agreement for identifying infection.11

Conclusion

We developed and externally validated prediction models leveraging clinical free text and structured EHR data to predict suspected infection on admission, using the reference standard of expert clinician review. We found that modeling CUIs using their preferred text, as opposed to the CUIs directly, improved model performance in the external validation site. We also found that a multimodal approach using CUIs and structured data together performed better than structured data alone. Our efforts have the potential to expedite manual annotation of infection cases, facilitating epidemiological sepsis research and expanding datasets for developing machine-learning models for early infection detection.

Supplementary Material

ooag163_Supplementary_Data

Acknowledgments

We would like to thank Madeline Oguss, MS, for administrative support throughout this study.

Contributor Information

Afia Z Khan, Pritzker School of Medicine, University of Chicago, Chicago, IL 60637, United States.

Kevin G Buell, Department of Medicine, University of Chicago, Chicago, IL 60637, United States.

George Karway, Department of Medicine, University of Wisconsin-Madison, Madison, WI 53792, United States.

Kyle Carey, Department of Medicine, University of Chicago, Chicago, IL 60637, United States.

Nicole Dussault, Department of Medicine, Duke University, Durham, NC 27710, United States.

Jay Dumanian, Department of Emergency Medicine, University of Washington, Seattle, WA 98195, United States.

Sivasubramanium Bhavani, Department of Medicine, Emory University, Atlanta, GA 30322, United States.

Emily R Gilbert, Department of Medicine, Loyola University, Chicago, IL 60153, United States.

Christopher Winslow, Department of Medicine, NorthShore University HealthSystem, Evanston, IL 60201, United States.

Nirav Shah, Department of Medicine, NorthShore University HealthSystem, Evanston, IL 60201, United States.

Majid Afshar, Department of Medicine, University of Wisconsin-Madison, Madison, WI 53792, United States; Department of Biostatistics and Medical Informatics, University of Wisconsin-Madison, Madison, WI 53792, United States.

Dana P Edelson, Department of Medicine, University of Chicago, Chicago, IL 60637, United States.

Matthew M Churpek, Department of Medicine, University of Wisconsin-Madison, Madison, WI 53792, United States; Department of Biostatistics and Medical Informatics, University of Wisconsin-Madison, Madison, WI 53792, United States.

Author contributions

Afia Z. Khan (Formal analysis, Investigation, Visualization, Writing—original draft, Writing—review & editing), Kevin G. Buell (Writing—review & editing), George Karway (Writing—review & editing), Kyle Carey (Data curation, Investigation, Writing—review & editing), Nicole Dussault (Writing—review & editing), Jay Dumanian (Writing—review & editing), Sivasubramanium Bhavani (Writing—review & editing), Emily R. Gilbert (Investigation, Writing—review & editing), Christopher Winslow (Writing—review & editing), Nirav Shah (Writing—review & editing), Majid Afshar (Conceptualization, Investigation, Writing—review & editing), Dana P. Edelson (Investigation, Writing—review & editing), and Matthew M. Churpek (Conceptualization, Funding acquisition, Investigation, Supervision, Writing—review & editing)

Supplementary material

Supplementary material is available at [JAMIA Open] online.

Funding

This work was supported by the National Institutes of Health (NIH) National Institute of General Medical Sciences grant number R35 GM145330 (M.M.C.) and the National Institute on Aging grant number T32 AG 74937 (A.K.).

Conflicts of interest

Drs M.M.C. and D.P.E. are inventors on a patent for patient risk evaluation (US11410777) and receive royalties from this intellectual property from the University of Chicago. Dr D.P.E. is employed by and has an equity stake in AgileMD, which markets and distributes eCART. eCART was not used in this study.

Data availability

The data used in this study were obtained from 2 hospital systems with IRB approval and cannot be shared publicly due to regulatory and legal restrictions outlined in the data use agreements.

References

  • 1. Singer M, Deutschman CS, Seymour CW, et al.  The third international consensus definitions for sepsis and septic shock (sepsis-3). JAMA. 2016;315:801-810. 10.1001/jama.2016.0287 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2. Liu V, Escobar GJ, Greene JD, et al.  Hospital deaths in patients with sepsis from 2 independent cohorts. JAMA. 2014;312:90-92. 10.1001/jama.2014.5804 [DOI] [PubMed] [Google Scholar]
  • 3. Liu VX, Fielding-Singh V, Greene JD, et al.  The timing of early antibiotics and hospital mortality in sepsis. Am J Respir Crit Care Med. 2017;196:856-863. 10.1164/rccm.201609-1848OC [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4. Zasowski EJ, Bassetti M, Blasi F, et al.  A systematic review of the effect of delayed appropriate antibiotic treatment on the outcomes of patients with severe bacterial infections. Chest. 2020;158:929-938. 10.1016/j.chest.2020.03.087 [DOI] [PubMed] [Google Scholar]
  • 5. Laxminarayan R, Matsoso P, Pant S, et al.  Access to effective antimicrobials: a worldwide challenge. Lancet. 2016;387:168-175. 10.1016/S0140-6736(15)00474-2 [DOI] [PubMed] [Google Scholar]
  • 6. Llor C, Bjerrum L.  Antimicrobial resistance: risk associated with antibiotic overuse and initiatives to reduce the problem. Ther Adv Drug Saf. 2014;5:229-241. 10.1177/2042098614554919 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7. Bhattacharjee P, Churpek MM, Snyder A, Howell MD, Edelson DP.  Detecting sepsis: are two opinions better than one?  J Hosp Med. 2017;12:256-258. 10.12788/jhm.2721 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8. Bhattacharjee P, Edelson DP, Churpek MM.  Identifying patients with sepsis on the hospital wards. Chest. 2017;151:898-907. 10.1016/j.chest.2016.06.020 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9. Jaimes F, Garcés J, Cuervo J, et al.  The systemic inflammatory response syndrome (SIRS) to identify infected patients in the emergency room. Intensive Care Med. 2003;29:1368-1371. 10.1007/s00134-003-1874-0 [DOI] [PubMed] [Google Scholar]
  • 10. Gando S, Shiraishi A, Abe T, et al. ; Japanese Association for Acute Medicine (JAAM) Sepsis Prognostication in Intensive Care Unit and Emergency Room (SPICE) (JAAM SPICE) Study Group. The SIRS criteria have better performance for predicting infection than qSOFA scores in the emergency department. Sci Rep. 2020;10:8095. 10.1038/s41598-020-64314-8 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11. Churpek MM, Dumanian J, Dussault N, et al.  Determining the electronic signature of infection in electronic health record data. Crit Care Med. 2021;49:e673-e682. 10.1097/CCM.0000000000004968 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12. Yan MY, Gustad LT, Nytrø Ø.  Sepsis prediction, early detection, and identification using clinical text for machine learning: a systematic review. J Am Med Inform Assoc. 2022;29:559-575. 10.1093/jamia/ocab236 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13. Liu R, Greenstein JL, Sarma SV, Winslow RL.  Natural language processing of clinical notes for improved early prediction of septic shock in the ICU. Annu Int Conf IEEE Eng Med Biol Soc. 2019;2019:6103-6108. 10.1109/EMBC.2019.8857819 [DOI] [PubMed] [Google Scholar]
  • 14. Amrollahi F, Shashikumar SP, Razmi F, Nemati S.  Contextual embeddings from clinical notes improves prediction of sepsis. AMIA Annu Symp Proc. 2020;2020:197-202. [PMC free article] [PubMed] [Google Scholar]
  • 15. Delahanty RJ, Alvarez J, Flynn LM, Sherwin RL, Jones SS.  Development and evaluation of a machine learning model for the early identification of patients at risk for sepsis. Ann Emerg Med. 2019;73:334-344. 10.1016/j.annemergmed.2018.11.036 [DOI] [PubMed] [Google Scholar]
  • 16. Goh KH, Wang L, Yeow AYK, et al.  Artificial intelligence in sepsis early prediction and diagnosis using unstructured data in healthcare. Nat Commun. 2021;12:711. 10.1038/s41467-021-20910-4 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17. Horng S, Sontag DA, Halpern Y, Jernite Y, Shapiro NI, Nathanson LA.  Creating an automated trigger for sepsis clinical decision support at emergency department triage using machine learning. PLoS One. 2017;12:e0174708. 10.1371/journal.pone.0174708 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18. Choi DH, Choi SW, Kim KH, Choi Y, Kim Y.  Early identification of suspected serious infection among patients afebrile at initial presentation using neural network models and natural language processing: a development and external validation study in the emergency department. Am J Emerg Med. 2024;80:67-76. 10.1016/j.ajem.2024.03.006 [DOI] [PubMed] [Google Scholar]
  • 19. Apostolova E, Velez T.  Toward automated early sepsis alerting: identifying infection patients from nursing notes. In: Cohen KB, Demner-Fushman D, Ananiadou S, Tsujii J, eds. BioNLP 2017. Association for Computational Linguistics; 2017:257-262. 10.18653/v1/W17-2332 [DOI] [Google Scholar]
  • 20. Chen Y, Hao L, Zou VZ, Hollander Z, Ng RT, Isaac KV.  Automated medical chart review for breast cancer outcomes research: a novel natural language processing extraction system. BMC Med Res Methodol. 2022;22:136. 10.1186/s12874-022-01583-z [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21. Wu ST, Sohn S, Ravikumar KE, et al.  Automated chart review for asthma cohort identification using natural language processing: an exploratory study. Ann Allergy Asthma Immunol. 2013;111:364-369. 10.1016/j.anai.2013.07.022 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22. Carrell DS, Halgrim S, Tran DT, et al.  Using natural language processing to improve efficiency of manual chart abstraction in research: the case of breast cancer recurrence. Am J Epidemiol. 2014;179:749-758. 10.1093/aje/kwt441 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23. Pan J, Zhang Z, Peters SR, et al.  Cerebrovascular disease case identification in inpatient electronic medical record data using natural language processing. Brain Inform. 2023;10:22. 10.1186/s40708-023-00203-w [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24. Angus DC, Linde-Zwirble WT, Lidicker J, Clermont G, Carcillo J, Pinsky MR.  Epidemiology of severe sepsis in the United States: analysis of incidence, outcome, and associated costs of care. Crit Care Med. 2001;29:1303-1310. 10.1097/00003246-200107000-00002 [DOI] [PubMed] [Google Scholar]
  • 25. Iwashyna TJ, Odden A, Rohde J, et al.  Identifying patients with severe sepsis using administrative claims: patient-level validation of the angus implementation of the international consensus conference definition of severe sepsis. Med Care. 2014;52:e39-e43. 10.1097/MLR.0b013e318268ac86 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26. Savova GK, Masanz JJ, Ogren PV, et al.  Mayo clinical text analysis and knowledge extraction system (cTAKES): architecture, component evaluation and applications. J Am Med Inform Assoc. 2010;17:507-513. 10.1136/jamia.2009.001560 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27. UW ICU Data Science Lab. ctakes_processing. GitLab. December 17, 2025. Accessed December 28, 2025. https://git.doit.wisc.edu/smph-public/dom/uw-icu-data-science-lab-public/ctakes_processing
  • 28. Bodenreider O.  The unified medical language system (UMLS): integrating biomedical terminology. Nucleic Acids Res.  2004;32:D267-D270. 10.1093/nar/gkh061 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 29. Karway GK, Koyner JL, Caskey J, et al.  Development and external validation of multimodal postoperative acute kidney injury risk machine learning models. JAMIA Open. 2023;6:ooad109. 10.1093/jamiaopen/ooad109 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30. Chen T, Guestrin C. XGBoost: A Scalable Tree Boosting System. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. KDD ’16. Association for Computing Machinery; 2016:785-794. 10.1145/2939672.2939785 [DOI]
  • 31. Snoek J, Larochelle H, Adams RP. Practical Bayesian Optimization of Machine Learning Algorithms. arXiv. arXiv 1206.2944. Preprint posted online August 29, 2012. 10.48550/arXiv.1206.2944, preprint: not peer reviewed. [DOI]
  • 32. Bone RC, Balk RA, Cerra FB, et al.  Definitions for sepsis and organ failure and guidelines for the use of innovative therapies in sepsis. Chest. 1992;101:1644-1655. 10.1378/chest.101.6.1644 [DOI] [PubMed] [Google Scholar]
  • 33.The relationship between Precision-Recall and ROC curves. Proceedings of the 23rd International Conference on Machine Learning. ACM Other Conferences. 10.1145/1143844.1143874 [DOI]
  • 34. DeLong ER, DeLong DM, Clarke-Pearson DL.  Comparing the areas under two or more correlated receiver operating characteristic curves: a nonparametric approach. Biometrics. 1988;44:837-845. [PubMed] [Google Scholar]
  • 35. Huang Y, Li W, Macheret F, Gabriel RA, Ohno-Machado L.  A tutorial on calibration measurements and calibration models for clinical prediction models. J Am Med Inform Assoc. 2020;27:621-633. 10.1093/jamia/ocz228 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36. Seymour CW, Liu VX, Iwashyna TJ, et al.  Assessment of clinical criteria for sepsis: for the third international consensus definitions for sepsis and septic shock (sepsis-3). JAMA. 2016;315:762-774. 10.1001/jama.2016.0288 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 37. Rhee C, Dantes R, Epstein L, et al.  Incidence and trends of sepsis in US hospitals using clinical vs claims data, 2009-2014. JAMA. 2017;318:1241-1249. 10.1001/jama.2017.13836 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 38. Wickham H, Averick M, Bryan J, et al.  Welcome to the tidyverse. J Open Source Softw. 2019;4:1686. 10.21105/joss.01686 [DOI] [Google Scholar]
  • 39. Silge J, Robinson D.  Tidytext: Text mining and analysis using tidy data principles in R. J Open Source Softw. 2016;1:37. 10.21105/joss.00037 [DOI] [Google Scholar]
  • 40. Bouchet-Valat M. SnowballC: Snowball Stemmers Based on the C “libstemmer” UTF-8 Library. Published online April 25, 2023. Accessed March 24, 2024. https://cran.r-project.org/web/packages/SnowballC/index.html
  • 41. Chen T, He T, Benesty M, et al. xgboost: Extreme Gradient Boosting. Published Online January 25, 2024. Accessed March 21, 2024. https://cran.r-project.org/web/packages/xgboost/index.html
  • 42. Wilson S. ParBayesianOptimization: Parallel Bayesian Optimization of Hyperparameters. Published Online October 18, 2022. Accessed March 24, 2024. https://cran.r-project.org/web/packages/ParBayesianOptimization/index.html
  • 43. Kuhn M.  Building predictive models in R using the caret package. J Stat Softw. 2008;28:1-26. 10.18637/jss.v028.i05 [DOI] [Google Scholar]
  • 44. Harrell FE, Jr. rms: regression modeling strategies. Published online March 11, 2024. Accessed March 24, 2024. https://cran.r-project.org/web/packages/rms/index.html
  • 45. Zobolas J. Usefun: A collection of useful functions by John. Accessed June 18, 2024. https://github.com/bblodfon/usefun
  • 46. Robin X, Turck N, Hainard A, et al.  pROC: an open-source package for R and S + to analyze and compare ROC curves. BMC Bioinformatics. 2011;12:77. 10.1186/1471-2105-12-77 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 47. Saito T, Rehmsmeier M.  Precrec: fast and accurate precision–recall and ROC curve calculations in R. Bioinformatics. 2017;33:145-147. 10.1093/bioinformatics/btw570 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 48. Bashiri FS, Caskey JR, Mayampurath A, et al.  Identifying infected patients using semi-supervised and transfer learning. J Am Med Inform Assoc. 2022;29:1696-1704. 10.1093/jamia/ocac109 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 49. Esteban A, Frutos-Vivar F, Ferguson ND, et al.  Sepsis incidence and outcome: Contrasting the intensive care unit with the hospital ward. Crit Care Med. 2007;35:1284-1289. 10.1097/01.CCM.0000260960.94300.DE [DOI] [PubMed] [Google Scholar]
  • 50. Rohde JM, Odden AJ, Bonham C, et al.  The epidemiology of acute organ system dysfunction from severe sepsis outside of the intensive care unit. J Hosp Med. 2013;8:243-247. 10.1002/jhm.2012 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 51. He T, Belouali A, Patricoski J, et al.  Trends and opportunities in computable clinical phenotyping: a scoping review. J Biomed Inform. 2023;140:104335. 10.1016/j.jbi.2023.104335 [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

ooag163_Supplementary_Data

Data Availability Statement

The data used in this study were obtained from 2 hospital systems with IRB approval and cannot be shared publicly due to regulatory and legal restrictions outlined in the data use agreements.


Articles from JAMIA Open are provided here courtesy of Oxford University Press

RESOURCES