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: Mar 31, 2026
Date Accepted: Jul 21, 2026

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

Temporal Analysis of Patient-Centered Sentiment in Clinical Notes for Patients With Mental Health Conditions: Retrospective Cohort Study

Morsy A, Peters CJ, Miller L, Zirikly A

Temporal Analysis of Patient-Centered Sentiment in Clinical Notes for Patients With Mental Health Conditions: Retrospective Cohort Study

J Med Internet Res 2026;28:e96771

DOI: 10.2196/96771

PMID: 42735402

Warning: This is an author submission that is not peer-reviewed or edited. Preprints - unless they show as "accepted" - should not be relied on to guide clinical practice or health-related behavior and should not be reported in news media as established information.

Temporal Analysis of Patient-Centered Sentiment in Mental Health Clinical Narratives: A Retrospective Cohort Study

  • AbdulRahman Morsy; 
  • Carson J Peters; 
  • Leslie Miller; 
  • Aya Zirikly

ABSTRACT

Background:

Clinical notes contain rich longitudinal narratives that may reflect patient health trajectories. While sentiment analysis has been applied to clinical text, prior work has largely treated notes as independent observations and has not systematically examined how sentiment evolves over time or aligns with patient-perceived experience.

Objective:

This study aimed to characterize temporal sentiment trajectories in clinical notes, evaluate their alignment with patient-perceived sentiment, and examine associations with in-hospital mortality. We additionally compared large language models (LLMs) with lexicon-based methods for patient-centered sentiment detection.

Methods:

We conducted a retrospective analysis of approximately 13,500 clinical notes from 900 patients from the MIMIC-IV database, focusing on Brief Hospital Course and Discharge Instructions sections for patients with ICD-10 mental health diagnoses. Sentiment was labeled from three perspectives (patient, physician, general) using two LLMs (DeepSeek-7B and Mistral-7B) and compared to lexicon-based tools (ClinSent, TextBlob, VADER). Temporal trends were quantified at the patient level using Kendall’s τ. Associations between sentiment patterns and mortality were assessed using Chi-square tests. Model performance was evaluated on a manually annotated subset, using precision, recall, and F1.

Results:

Temporal sentiment trajectories exhibited weak monotonic trends overall, with greater fluctuations in discharge instructions compared to brief hospital course notes. Patient-aligned sentiment was more balanced, while physician- and general-aligned perspectives were predominantly neutral. LLMs showed better alignment with patient-centered annotations than lexicon-based methods. Associations with in-hospital mortality were explored, but no statistically significant relationships were observed, likely due to small subgroup sample sizes.

Conclusions:

Temporal sentiment analysis revealed subtle, section-dependent patterns in clinical narratives that partially reflected patient-perceived experience. LLM-based approaches improved alignment with patient-centered sentiment, although overall performance remained limited. These findings underscore the need for larger, more robust datasets and modeling strategies for clinical sentiment analysis.


 Citation

Please cite as:

Morsy A, Peters CJ, Miller L, Zirikly A

Temporal Analysis of Patient-Centered Sentiment in Clinical Notes for Patients With Mental Health Conditions: Retrospective Cohort Study

J Med Internet Res 2026;28:e96771

DOI: 10.2196/96771

PMID: 42735402

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.