Model Credentialed Access

SentimentICUModel: A Clinical Large Language Model for Clinical Sentiment Polarity Identification in ICU Clinical Notes

ORCID iD for Shahad Nagoor,  ,  ,  ,  ,  ,  ,  , 

Published Nov. 19, 2026 · Version 1.0.0
When using this resource, please cite:

Nagoor, S., Hederman, L., Koidl, K., Bukhari, F., Amasike, S. C., Bianchi, A., Lo, C., Patel, H., & Martin-Loeches, I. (2026). SentimentICUModel: A Clinical Large Language Model for Clinical Sentiment Polarity Identification in ICU Clinical Notes (version 1.0.0). PhysioNet. RRID:SCR_007345. https://doi.org/10.13026/wqp4-ac75

Additionally, please cite the original publication:

Nagoor, S., Hederman, L., Koidl, K., Bukhari, F., Amasike, S. C., Bianchi, A., Lo, C. Y.-C., Patel, H., & Martin-Loeches, I. (2026). Clinical sentiment analysis of ICU notes: A dataset and a comparison of lexicon and clinical language model methods. BMC Medical Informatics and Decision Making. https://doi.org/10.1186/s12911-026-03509-x https://link.springer.com/article/10.1186/s12911-026-03509-x#citeas

Please include the standard citation for PhysioNet:

Pollard, T., Moody, B. E., Lehman, L., Gow, B., Fernandes, C., Xie, C., Johnson, A., Mark, R. G., & Heldt, T. (2026). PhysioNet as a global platform for biomedical research. Nature Health. https://doi.org/10.1038/s44360-026-00096-z. Available from: https://pmc.ncbi.nlm.nih.gov/articles/PMC13641116/

Abstract

Research has shown that reliance on general-domain lexicons and tools are ineffective in capturing clinical sentiment from ICU clinical notes. However, general-domain methods are prevalent due to difficulty of accessing appropriate clinical data and limited time that specialized clinicians can provide to manually label such data, which is required for models’ development. As a result, clinical sentiment has been under-researched, and no effective model was found for classifying clinical sentiment. This resource addresses this gap by providing an effective model trained for distinguishing clinical sentiment in ICU clinical notes.

This model was trained on clinical notes extracted from MIMIC-III using specific labeling scheme and evaluated vs. clinicians labeling. It enables investigation of clinical sentiment polarity on Intensive Care Unit (ICU) clinical notes, and studying and improving different approaches to sentiment analysis in the clinical text.

The model can be used directly for: (1) further training and evaluating as an independent AI supervised learning model, and (2) developing a hybrid approach incorporating linguistic features or lexicons.

This model was initialized from ClinicalT5 provided in Physionet and trained for clinical sentiment classification. Because ClinicalT5 was trained on MIMIC-III and IV notes, and to avoid the potential leak of data, which can happen with encoder-decoder transformers, ClinicalT5 was only released by Physionet to credentialed users. Therefore, SentimentICUModel is released within Physionet under the same conditions.


Background

Capturing positivity or negativity about patients’ clinical status, also referred to as clinical sentiment, is an important factor in comprehending their progress in ICU stays but can be difficult and time-consuming especially for complicated cases [@deng2016]. Therefore, an automatic polarity identification for ICU notes will provide significant assistance in exploring their progress including onset of deterioration or sudden shifts in patient status and consequently support ICU clinicians’ decisions [@deng2014, @kennedy2023].

In developing this resource, we define clinical sentiment as note writers’ opinion about the patient’s condition and possibly prognosis, whether it is good, bad, neutral, or not mentioned. The specific labels are specified while questioning a patient progress through asking if the patient:

  • Is already improving or will get better?
  • Is deteriorating?
  • Is neither improving nor deteriorating?
  • OR that there is no indication of the note writer’s opinion

In training and evaluation, each note is labelled based on two classes of polarity (“Is already improving or will get better?” and “Is deteriorating?” from the above list). The model was trained to predict the two class labels (the labels are mapped to positive and negative in practice).

Because the language model truncates long notes, we extracted the assessment and plan segment of notes, as we found that this section of notes allows accurate classification of clinical sentiment. The model was trained on these segments.

The model was trained on a balanced-class dataset with 10766 positive and negative samples of physician notes. Further details on sampling and labeling are provided in the related publication.


Model Description

This model is initialized from Clinical-T5-Base which in turn was previously initialized from T5-Base [@raffel2022]. T5-Base is trained on multiple tasks including initial masked language model training (MLM) and other downstream tasks including sentiment analysis [@lehman2023]. We further trained ClinicalT5 on MLM using MIMIC-III and MIMIC-IV texts, exposing the model to clinical language. We additionally trained ClinicalT5 for clinical sentiment classification on samples from MIMIC-III clinical notes. MIMIC-IV notes contain discharge summaries and radiology reports which are less appropriate for the defined task.

This resource has six files. They are commonly used for models' training and evaluation, and follows the standard in transformers library [@wolf2020]. The following is a short description of each:

  • model_weights.safetensors: this is the model's weights.
  • config.json: contains general information about the model, e.g., the model architecture.
  • tokenizer_config.json: contains the configuration for the tokenizer specifying tokenization-related parameters.
  • tokenizer.json: used by the tokenizer and contains details to map words to indices.
  • special_tokens_map.json: contains special tokens in training.
  • added_tokens.json: contains additional tokens that were added to the vocabulary set.

For training or evaluation, to load the model exactly as it was trained, the above files should be placed in a folder, then the model and the tokenizer should be explicitly imported from the specified folder path. The transformers library will automatically read all the available configuration files.

The input to the model are clinical notes' texts and the output labels are 'positive' or 'negative'. The model's architecture for ClinicalT5 remains the same. Fine-tuning are performed with full-training using all layers for the task with no freezing or adjustment.


Technical Implementation

SentimentICUModel was trained for 8 epochs using two A100 GPUs, and batch size of 64. The learning rate was 1e-3, optimizer is AdamW and max token length was set to 512. Researchers can directly run the model on their data with no further training. However, further training or any subsequent or related tasks e.g., using various fine-tuning and prompting techniques, are also possible.

The training texts were processed as follows. Extra spaces were removed, special characters, such as ”[**” and ”**]” which were used to surround de-identified elements, were removed, ”w/” was expanded to ”with”, and ”pt” or ”Pt” were expanded to ”patient”. The symbol ”:” is removed from all headings in the notes as this particular character is used in T5 prompting mechanism. In addition, ”sst2 sentence: ” is added as a prefix for all input notes and </s> for end of text and labels. The prefix prompt was pre-defined for sentiment analysis tasks by authors/developers of T5 and was named based on the dataset used for the sentiment training i.e., the Stanford Sentiment Treebank (SST-2) dataset [@socher2013]. Additional pre-processing steps are handled by the tokenizer provided along with the model.

The model was evaluated against other language models (clinicalBERT [@alsentzer2019] and SciFive [@phan2021]) and a specialized lexicon [@kennedy2023], using overall accuracy, and recall, precision, F1-score for positive and negative classes, and applied to assessment and plan sections onward for physicians’ and nursing notes.

Overall, ClinicalT5 shows higher accuracy scores (up to 82%), compared to SciFive and clinicalBERT and all models significantly outperform Kennedy’s lexicon (p<0.05, [95% CI, −0.47, −0.28]). Models’ performance using physician notes (0.82, 0.76) were higher compared to nursing notes (0.71, 0.68). Further details on models' and methods performance and evaluation can be found in [@nagoor2026].


Installation and Requirements

It is recommended in practice to have a virtual environment for developing Python codes and experimentation. For this purpose, miniconda is a useful option. The environment requirements used to develop the model are listed in the requirements.txt file.

The model can be used in Python scripts as the following:

from transformers import T5ForConditionalGeneration, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("pathToModel")
model = T5ForConditionalGeneration.from_pretrained("pathToModel")

To tokenize an input note and generate a sentiment prediction using the model:

encoded_input = tokenizer(
note,
add_special_tokens=True,
max_length=max_len,
truncation=True,
padding="max_length",
return_attention_mask=True,
return_tensors="pt"
)

Where note is the input note to tokenize, and the following are used for adding special tokens required by the model, padding short texts and truncating sequences using the maximum allowed size, and returning the attention mask and tensors.

Nexr, the model can be used directly in evaluation mode and generate the classification as in the following example:

# Sample text
note = "The patient had a septic shock." # Tokenize
encoded_input = tokenizer(
note,
max_length=512,
truncation=True,
padding="max_length",
return_attention_mask=True,
return_tensors="pt"
) # Evaluation mode
model.eval() # Get model output
input_ids = encoded_input["input_ids"]
attention_mask = encoded_input["attention_mask"] with torch.no_grad():
outputs = model.generate(
input_ids=input_ids,
attention_mask=attention_mask,
max_length=512
) # Decode prediction
prediction = tokenizer.decode(
outputs[0],
skip_special_tokens=True,
clean_up_tokenization_spaces=True
) print("Input:", note)
print("Prediction:", prediction)

Expected output:

Input: The patient had a septic shock.
Prediction: negative

Usage Notes

ClinicalT5 was not fine-tuned for any task by [@lehman2023], and was not immediately ready for zero or few shot setting. We fine-tuned the model for clinical sentiment classification, so the model is prepared for this task enabling subsequent analysis of clinical sentiment classification.

This resource has been used in [@nagoor2024] for investigating clinical sentiment polarity on Intensive Care Unit (ICU) clinical notes using different approaches and different segments of notes. The contributions of that paper include:

  • A comparison between clinical sentiment classification of physician notes versus nursing notes.
  • A comparison between clinical sentiment classification of whole notes versus using only the part of notes from SOAP Assessment header onward.

The resource has also been used in [@nagoor2026] for a comparison of an existing recent ICU-specific lexicon, and clinical LLMs in clinical sentiment classification for ICU clinical notes.

The classification scope of the model is currently limited to two classes: positive and negative sentiment. Therefore, it is currently appropriate for binary sentiment classification. To expand the exploration of clinical sentiment in practice, we encourage investigation using neutral or no-sentiment class as shown in [@nagoor2026], by retraining the model on three-class data. Defining this neutral category, however, would require close collaboration with clinical experts to ensure it reflects meaningful distinctions in practice.

We encourage NLP researchers to use this resource in conjunction with the dataset (submitted to Physionet) for advancing supervised learning by e.g., further training using different learning strategies, different prompting techniques and different segments of clinical notes based on human evaluation. Such contributions support clinical linguistics, NLP applications and ultimately clinicians’ decisions and healthcare practices.


Release Notes

SentimentICUModel v1.0.0

The Initial release of the model. This version aims to enable developing and advancing ICU clinical classification and detection models and enables investigation of clinical sentiment polarity on Intensive Care Unit (ICU) clinical notes, and studying and improving different approaches to sentiment analysis in the clinical text.


Ethics

The model is derived from MIMIC-III dataset which was originally reviewed and exempt from informed consent based on a decision made by Beth Israel Deaconess Medical Center institutional review board. The data is protected and provided to credential users in Physionet. Therefore, and to avoid unethical leakage of data, the model follows the same ethics including access policy, license, and Data Use Agreement, and does not introduce any new protected health information.


Acknowledgements

This research was conducted at the ADAPT SFI Research Centre at Trinity College Dublin with the financial support of King AbdulAziz University.


Conflicts of Interest

The authors have no conflicts of interest to declare.


References

  1. @deng2016 Deng Y, Declerck T, Lendvai P, Denecke K. The Generation of a Corpus for Clinical Sentiment Analysis. In: Sack H, Rizzo G, Steinmetz N, Mladenić D, Auer S, Lange C, editors. The Semantic Web, Cham: Springer International Publishing; 2016, p. 311–24. https://doi.org/10.1007/978-3-319-47602-5_46.
  2. @deng2014 Deng Y, Stoehr M, Denecke K. Retrieving Attitudes: Sentiment Analysis from Clinical Narratives, 2014.
  3. @kennedy2023 Kennedy CJ, Chiu C, Chapman AC, Gologorskaya O, Farhan H, Han M, et al. Negativity and Positivity in the ICU: Exploratory Development of Automated Sentiment Capture in the Electronic Health Record. Crit Care Explor 2023;5:e0960. https://doi.org/10.1097/CCE.0000000000000960.
  4. @raffel2022 Raffel C, Shazeer N, Roberts A, Lee K, Narang S, Matena M, et al. Exploring the limits of transfer learning with a unified text-to-text transformer. J Mach Learn Res 2022;21:140:5485-140:5551.
  5. @lehman2023 Lehman E, Johnson A. Clinical-T5: Large Language Models Built Using MIMIC Clinical Text 2023. https://doi.org/10.13026/AW2E-HE88.
  6. @wolf2020 Wolf T, Debut L, Sanh V, Chaumond J, Delangue C, Moi A, et al. Transformers: State-of-the-Art Natural Language Processing. In: Liu Q, Schlangen D, editors. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, Online: Association for Computational Linguistics; 2020, p. 38–45. https://doi.org/10.18653/v1/2020.emnlp-demos.6.
  7. @socher2013 Socher R, Perelygin A, Wu J, Chuang J, Manning CD, Ng A, et al. Recursive Deep Models for Semantic Compositionality Over a Sentiment Treebank. Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, Seattle, Washington, USA: Association for Computational Linguistics; 2013, p. 1631–42. https://doi.org/10.18653/v1/D13-1170.
  8. @alsentzer2019 Alsentzer E, Murphy J, Boag W, Weng W-H, Jindi D, Naumann T, et al. Publicly Available Clinical. Proceedings of the 2nd Clinical Natural Language Processing Workshop 2019:72–8. https://doi.org/10.18653/v1/W19-1909.
  9. @phan2021 Phan LN, Anibal JT, Tran H, Chanana S, Bahadroglu E, Peltekian A, et al. SciFive: a text-to-text transformer model for biomedical literature 2021. https://doi.org/10.48550/arXiv.2106.03598.
  10. @nagoor2026 Nagoor S, Hederman L, Koidl K, Bukhari F, Amasike SC, Bianchi A, et al. Clinical sentiment analysis of ICU notes: a dataset and a comparison of lexicon and clinical language model methods. BMC Medical Informatics and Decision Making 2026. https://doi.org/10.1186/s12911-026-03509-x.
  11. @nagoor2024 Nagoor S, Hederman L, Koidl K, Martin-Loeches I. Distinguishing Clinical Sentiment in Intensive Care Unit Clinical Notes. 2024 IEEE 37th International Symposium on Computer-Based Medical Systems (CBMS) 2024:249–59. https://doi.org/10.1109/CBMS61543.2024.00049.
  12. @goldberger2000 Goldberger AL, Amaral LA, Glass L, Hausdorff JM, Ivanov PC, Mark RG, et al. PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals. Circulation 2000;101:E215-220. https://doi.org/10.1161/01.cir.101.23.e215.

Cited by

2 publications cite this project. The most recent are listed below.

View all 2 publications

Citation data from OpenAlex. Papers that use the project without citing it may be missing.


Files