Machine Learning Approaches for Sentiment Analysis on Balanced and Unbalanced Datasets

Sentiment analysis, sometimes referred to as opinion mining, is essential for understanding public opinion and attitudes toward various social topics and trends. This study aims to explore the effectiveness of machine learning (ML) models, namely support vector machine (SVM), long short-term memory (LSTM), and bidirectional encoder representations from transformers (BERT), in analyzing a dataset obtained from Kaggle, which contains 37,000 user reviews on the Instagram Threads app. After initial data cleaning and preprocessing, the dataset was partitioned into ${7 0 \%}$ for training and ${3 0 \%}$ for testing. Subsequently, the training set was used to create three datasets: a balanced dataset and two unbalanced datasets, one featuring $90 \%$ positive instances and the other featuring ${9 0 \%}$ negative instances. Subsequently, these datasets were used to train the three machine learning models mentioned above, resulting in nine different models. Evaluation metrics, including accuracy, precision, recall, and F1 score, were applied to assess model performance. The finetuned BERT model on the balanced dataset outperformed all the other models with an accuracy of $86 \%$, precision of $85 \%$, recall of $87 \%$, and F1-score of ${8 6 \%}$. Furthermore, these findings underscore the effectiveness of diverse ML techniques, particularly transformers, and the crucial role of data balancing in optimizing sentiment analysis tasks.

Authors

Institutions

Publication Details

Published
2024-08-23
DOI
https://doi.org/10.1109/iccsce61582.2024.10695972
Citations
3
Primary Topic
Sentiment Analysis and Opinion Mining
Type
article
Field-Weighted Citation Impact
1.04
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Machine Learning Approaches for Sentiment Analysis on Balanced and Unbalanced Datasets

Abdulla Alshamsi, Nazar Zaki, Abdelkader Nasreddine Belkacem, Ahmed F. Abdulhameed et al.
3 citations
Sentiment Analysis and Opinion Mining
1.04
article

Machine Learning Approaches for Sentiment Analysis on Balanced and Unbalanced Datasets

Abdulla Alshamsi, Nazar Zaki, Abdelkader Nasreddine Belkacem, Ahmed F. Abdulhameed, Ahmed M. ElMassry
article en
3 citations

Abstract

Sentiment analysis, sometimes referred to as opinion mining, is essential for understanding public opinion and attitudes toward various social topics and trends. This study aims to explore the effectiveness of machine learning (ML) models, namely support vector machine (SVM), long short-term memory (LSTM), and bidirectional encoder representations from transformers (BERT), in analyzing a dataset obtained from Kaggle, which contains 37,000 user reviews on the Instagram Threads app. After initial data cleaning and preprocessing, the dataset was partitioned into ${7 0 \%}$ for training and ${3 0 \%}$ for testing. Subsequently, the training set was used to create three datasets: a balanced dataset and two unbalanced datasets, one featuring $90 \%$ positive instances and the other featuring ${9 0 \%}$ negative instances. Subsequently, these datasets were used to train the three machine learning models mentioned above, resulting in nine different models. Evaluation metrics, including accuracy, precision, recall, and F1 score, were applied to assess model performance. The finetuned BERT model on the balanced dataset outperformed all the other models with an accuracy of $86 \%$, precision of $85 \%$, recall of $87 \%$, and F1-score of ${8 6 \%}$. Furthermore, these findings underscore the effectiveness of diverse ML techniques, particularly transformers, and the crucial role of data balancing in optimizing sentiment analysis tasks.

United Arab Emirates University (AE)
Openalex Percentile: Top 19%
Sentiment Analysis and Opinion Mining
1.04
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.