Maintenance Notice

Due to necessary scheduled maintenance, the JMIR Publications website will be unavailable from Wednesday, July 01, 2020 at 8:00 PM to 10:00 PM EST. We apologize in advance for any inconvenience this may cause you.

Who will be affected?

Accepted for/Published in: Journal of Medical Internet Research

Date Submitted: Apr 16, 2026
Date Accepted: Aug 5, 2026

The final, peer-reviewed published version of this preprint can be found here:

The Performance of Large Language Models in Extracting Intestinal Symptoms From Electronic Health Records: Retrospective Observational Study

Zhang X, Wang Q, Liu B, Sang X, Wei S

The Performance of Large Language Models in Extracting Intestinal Symptoms From Electronic Health Records: Retrospective Observational Study

J Med Internet Res 2026;28:e98580

DOI: 10.2196/98580

PMID: 42647073

The Performance of Large Language Models in Extracting Intestinal Symptoms from Electronic Health Records: A Retrospective Observational Study

  • Xinyue Zhang; 
  • Quanyu Wang; 
  • Beibei Liu; 
  • Xinyi Sang; 
  • Sheng Wei

ABSTRACT

Background:

Unstructured electronic health records (EHRs) hinder intestinal infection monitoring. Large language models (LLMs) enable automated symptom extraction. However, their clinical validation is limited by a lack of systematic multi‑model comparisons, unclear prompting strategies, and privacy risks of cloud‑based models (e.g., data leakage, cross‑border transfer).

Objective:

To systematically evaluate the performance of locally deployed open-source LLMs across four model families in extracting intestinal symptoms from unstructured EHR chief complaints under different prompting strategies.

Methods:

From a city‑wide healthcare information platform in Wuhan, China, we randomly selected 1,000 chief complaints from outpatient records of intestinal clinics, infectious disease departments, pediatrics, and fever clinics. Six symptoms related to intestinal infectious diseases (IIDs), including diarrhea/bloody/mucoid stools, vomiting, abdominal pain, fever, nausea, and rash were manually annotated as a gold-standard dataset. Twelve locally deployed open-source LLMs across four families, namely Gemma3 (1b, 4b, 12b), Qwen3 (1.7b, 8b, 14b), Deepseek-r1 (1.5b, 7b, 14b), and Llama (Llama2-Chinese: 7b, 13b; Llama3.1: 8b) were evaluated on the symptom extraction task using the gold-standard dataset. Three prompting strategies (norole, zeroshot, fewshot) were tested. Performance metrics included accuracy, precision, recall, F1-score, specificity, balanced accuracy, and inference time. Statistical comparisons employed Friedman tests for global differences, followed by Wilcoxon signed-rank and Mann-Whitney U tests with Bonferroni and FDR corrections for pairwise comparisons.

Results:

Among four families, Qwen3 models showed higher F1‑scores and balanced accuracy, with Qwen3‑1.7b achieving a macro‑averaged F1‑score of 0.85 under zeroshot prompting and Qwen3‑8b reaching 0.89 under norole prompting, while Gemma3 demonstrated robust performance in the small to medium scale. Symptom-wise, models agreed more on frequent symptoms such as diarrhea and fever, whereas greater variability was observed for rarer symptoms like rash and nausea. The effect of prompting strategy varied across models, with no single strategy consistently outperforming the others. Although some pairwise differences reached statistical significance (P <.05), the absolute gains in F1-score were small.

Conclusions:

This study provides a systematic comparison of several open-source LLMs on a structured intestinal symptom extraction task. Among LLM families, Qwen3 models offer a favorable balance between accuracy and efficiency, making them suitable for resource-constrained scenarios.


 Citation

Please cite as:

Zhang X, Wang Q, Liu B, Sang X, Wei S

The Performance of Large Language Models in Extracting Intestinal Symptoms From Electronic Health Records: Retrospective Observational Study

J Med Internet Res 2026;28:e98580

DOI: 10.2196/98580

PMID: 42647073

Download PDF


Request queued. Please wait while the file is being generated. It may take some time.

© The authors. All rights reserved. This is a privileged document currently under peer-review/community review (or an accepted/rejected manuscript). Authors have provided JMIR Publications with an exclusive license to publish this preprint on it's website for review and ahead-of-print citation purposes only. While the final peer-reviewed paper may be licensed under a cc-by license on publication, at this stage authors and publisher expressively prohibit redistribution of this draft paper other than for review purposes.