Related Experiment Video
Updated: Sep 16, 2026

Implementation of a Real-Time Psychosis Risk Detection and Alerting System Based on Electronic Health Records using CogStack
Published on: May 15, 2020
Temporal Analysis of Patient-Centered Sentiment in Clinical Notes for Patients With Mental Health Conditions:
AbdulRahman Morsy1, Carson J Peters2, Leslie Miller3
1Department of Computer Science, School of Engineering and Applied Sciences, George Washington University, Washington, DC, United States.
Background:
Clinical notes offer rich, longitudinal insights into patient health trajectories. However, existing clinical sentiment analysis primarily evaluates overall note tone rather than the patient's distinct perspective. This gap is particularly critical in mental health care, where patient-perspective sentiment closely correlates with severe clinical outcomes, including mortality.
Objective:
This study aimed to characterize temporal sentiment trajectories and changes in mental health clinical notes. We are specifically interested in the problem from the patient perspective, as this can differ from the overall and the provider-perspective sentiment. Furthermore, we examine its association with postdischarge mortality to check if there is any correlation. Using large language models (LLMs) and lexicon-based methods, we compared and highlighted the strengths and weaknesses of both approaches.
Methods:
We conducted a retrospective analysis of 16,447 clinical notes from 6,382 patients from the Medical Information Mart for Intensive Care IV (MIMIC-IV) database, focusing on the Brief Hospital Course and Discharge Instructions sections for patients with ICD-10 (International Classification of Diseases, Tenth Revision) mental health diagnoses. Sentiment was labeled from 3 perspectives (patient, physician, and general) using 2 LLMs (DeepSeek-7B and Mistral-7B) and compared to lexicon-based tools (ClinSent-lexicon, TextBlob, and VADER [Valence Aware Dictionary and sEntiment Reasoner]). Temporal trends were quantified at the patient level using Kendall τ. Associations between sentiment patterns and mortality were assessed using independent-samples (Welch) t tests. Model performance was evaluated on a manually annotated subset (n=165) using precision, recall, and F1-score.
Results:
Temporal sentiment trajectories showed substantial directional change among patients with multiple hospital admissions, with greater fluctuations in Discharge Instructions compared to Brief Hospital Course notes. Patient-perspective sentiment was more balanced, while physician and general perspectives were predominantly neutral. LLMs showed better alignment with patient-centered annotations than lexicon-based methods. Discharge-note sentiment trajectories were significantly more negative among patients who died within 30-90 days of discharge than among survivors across both LLMs.
Conclusions:
Temporal sentiment analysis revealed 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.