Predicting Sentiments of Users about Medical Treatments using Pre-trained Large Language Models

Users of social media write their opinions about products, services, market, social life, health and any facet of the life in the form of texts in web-based or mobile applications. The other users use these comments to select the best services and products. In the area of the medication, the production of user generated texts has been increased, because of information explosion and technological advancements. Manual extraction of useful knowledge using the tremendous amount of textual data is impossible. Opinion mining and Sentiment Analysis (SA) is a crucial mechanism for extracting useful knowledge, including users’ opinions about medical systems, to help physicians with this information. Physicians will use the extracted information to know how patients feel about the course of treatment and other health related topics. This paper investigates the application of Large Language Models (LLMs) to predict polarity of patients' opinions. This study uses a dataset that includes patient reviews regarding their opinions about medications, prescriptions, and treatment. Three scenarios are considered in this paper: scenarios of two classes (positive, negative), three classes (positive, neutral, negative), and five classes (negative, slightly negative, neutral, slightly positive, positive). BERT and DistilBERT tokenization methods are used for word embedding. For training and fine tuning in clinical domains, one traditional ML based method, One Boosting based method, and three BERT-based methods, are utilized in model development. We found the best hyper-parameters for all models using Grid-CV method. The results reveal that the fine-tuned BERT model with corresponding word embedding representation, achieved the best results, with accuracy and F1-Score of 97.71% and 98% in two classes, 97.24% and 97% in three classes, and 80.35% and 80% in five classes, respectively. Due to the high accuracy, the proposed models can be used as an auxiliary tool in clinics and medical centers.

Authors

Publication Details

Journal
Journal of Information Systems Engineering & Management
Published
2025-03-27
DOI
https://doi.org/10.52783/jisem.v10i25s.4178
Primary Topic
Sentiment Analysis and Opinion Mining
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Predicting Sentiments of Users about Medical Treatments using Pre-trained Large Language Models

Ahmad Fauzi Hassan
Journal of Information Systems Engineering & Management
Sentiment Analysis and Opinion Mining
article

Predicting Sentiments of Users about Medical Treatments using Pre-trained Large Language Models

Ahmad Fauzi Hassan
article en

Abstract

Users of social media write their opinions about products, services, market, social life, health and any facet of the life in the form of texts in web-based or mobile applications. The other users use these comments to select the best services and products. In the area of the medication, the production of user generated texts has been increased, because of information explosion and technological advancements. Manual extraction of useful knowledge using the tremendous amount of textual data is impossible. Opinion mining and Sentiment Analysis (SA) is a crucial mechanism for extracting useful knowledge, including users’ opinions about medical systems, to help physicians with this information. Physicians will use the extracted information to know how patients feel about the course of treatment and other health related topics. This paper investigates the application of Large Language Models (LLMs) to predict polarity of patients' opinions. This study uses a dataset that includes patient reviews regarding their opinions about medications, prescriptions, and treatment. Three scenarios are considered in this paper: scenarios of two classes (positive, negative), three classes (positive, neutral, negative), and five classes (negative, slightly negative, neutral, slightly positive, positive). BERT and DistilBERT tokenization methods are used for word embedding. For training and fine tuning in clinical domains, one traditional ML based method, One Boosting based method, and three BERT-based methods, are utilized in model development. We found the best hyper-parameters for all models using Grid-CV method. The results reveal that the fine-tuned BERT model with corresponding word embedding representation, achieved the best results, with accuracy and F1-Score of 97.71% and 98% in two classes, 97.24% and 97% in three classes, and 80.35% and 80% in five classes, respectively. Due to the high accuracy, the proposed models can be used as an auxiliary tool in clinics and medical centers.

Journal of Information Systems Engineering & ManagementVol. 10(25s)
Openalex Percentile: Top 97%
Sentiment Analysis and Opinion Mining
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.