Classifying Unstructured Text in Electronic Health Records for Mental Health Prediction Models: Large Language Model Evaluation Study
Top Cited Papers
Open Access
- 21 January 2025
- journal article
- new technologies
- Published by JMIR Publications Inc. in JMIR Medical Informatics
- Vol. 13, e65454
Abstract
Background: Prediction models have demonstrated a range of applications across medicine, including using electronic health record (EHR) data to identify hospital readmission and mortality risk. Large language models (LLMs) can transform unstructured EHR text into structured features, which can then be integrated into statistical prediction models, ensuring that the results are both clinically meaningful and interpretable. Objective: This study aims to compare the classification decisions made by clinical experts with those generated by a state-of-the-art LLM, using terms extracted from a large EHR data set of individuals with mental health disorders seen in emergency departments (EDs). Methods: Using a dataset from the EHR systems of more than 50 health care provider organizations in the United States from 2016 to 2021, we extracted all clinical terms that appeared in at least 1000 records of individuals admitted to the ED for a mental health–related problem from a source population of over 6 million ED episodes. Two experienced mental health clinicians (one medically trained psychiatrist and one clinical psychologist) reached consensus on the classification of EHR terms and diagnostic codes into categories. We evaluated an LLM’s agreement with clinical judgment across three classification tasks as follows: (1) classify terms into “mental health” or “physical health”, (2) classify mental health terms into 1 of 42 prespecified categories, and (3) classify physical health terms into 1 of 19 prespecified broad categories. Results: There was high agreement between the LLM and clinical experts when categorizing 4553 terms as “mental health” or “physical health” (κ=0.77, 95% CI 0.75-0.80). However, there was still considerable variability in LLM-clinician agreement on the classification of mental health terms (κ=0.62, 95% CI 0.59‐0.66) and physical health terms (κ=0.69, 95% CI 0.67‐0.70). Conclusions: The LLM displayed high agreement with clinical experts when classifying EHR terms into certain mental health or physical health term categories. However, agreement with clinical experts varied considerably within both sets of mental and physical health term categories. Importantly, the use of LLMs presents an alternative to manual human coding, presenting great potential to create interpretable features for prediction models.Keywords
This publication has 27 references indexed in Scilit:
- Fine-Tuning GPT on Biomedical NLP Tasks: An Empirical Evaluation2024
- Assessing the Ability of GPT to Generate Illness Scripts: An Evaluation StudymedRxiv, 2023
- Natural Language Processing Applied to Clinical Documentation in Post-acute Care Settings: A Scoping ReviewJournal of the American Medical Directors Association, 2023
- ChatGPT outperforms crowd workers for text-annotation tasksProceedings of the National Academy of Sciences of the United States of America, 2023
- Predictive structured–unstructured interactions in EHR models: A case study of suicide predictionnpj Digital Medicine, 2022
- Emergency department safety assessment and follow-up evaluation 2: An implementation trial to improve suicide preventionContemporary Clinical Trials, 2020
- Use of electronic medical records in development and validation of risk prediction models of hospital readmission: systematic reviewBMJ, 2020
- Use of Electronic Health Data for Disease Prediction: A Comprehensive Literature ReviewIEEE/ACM Transactions on Computational Biology and Bioinformatics, 2019
- Validation of Prediction Models for Critical Care Outcomes Using Natural Language Processing of Electronic Health Record DataJAMA Network Open, 2018
- Scikit-Learn2016