A Deep Learning Approach to Sentiment Analysis of Hotel Reviews: Comparing BERT and LSTM Models

Background of study: Online reviews are crucial in shaping consumer decisions, particularly in the hospitality industry, but accurately extracting sentiment remains challenging due to language subjectivity, varied expression styles, and significant class imbalance where positive reviews outweigh negative and neutral ones. Traditional machine learning methods often fail to address these issues effectively, favoring the majority class.Aims and scope of paper: This study employs BERT and LSTM deep learning models to classify hotel reviews into positive, neutral, and negative sentiment categories. The primary aim is to compare their performance in sentiment analysis and managing imbalanced data, evaluating both with and without under-sampling.Methods: A 20,000-review dataset from TripAdvisor was pre-processed, including stop word/special character removal, tokenization, stemming, and lemmatization. Star ratings were categorized: 4-5 as positive, 3 as neutral, and 1-2 as negative. Random under-sampling was applied to the majority (positive) class to balance the dataset. BERT (bert-base-uncased) and LSTM models were trained with an 80:20 training-validation split, and evaluated using accuracy, precision, recall, and F1-score, with 5-fold cross-validation.Result: BERT without under-sampling achieved the highest overall accuracy of 0.86, with strong F1-scores for positive (0.93) and negative (0.79) sentiments. However, all models struggled with neutral sentiments (BERT F1-score: 0.43, LSTM: 0.25). Under-sampling improved neutral class recall (BERT: 0.79) but decreased overall accuracy (BERT: 0.73; LSTM: 0.67) and positive class precision.Conclusion: BERT generally outperforms LSTM for hotel review sentiment analysis, particularly with imbalanced data. While under-sampling helps address class imbalance by improving neutral recall, it incurs significant performance trade-offs, reducing overall accuracy and precision in majority classes due to information loss. Future work should explore advanced resampling (SMOTE, ADASYN) or transfer learning (RoBERTa, XLNet) for better balance and neutral sentiment classification.

Authors

Institutions

Publication Details

Journal
International Journal of Advances in Artificial Intelligence and Machine Learning
Published
2025-06-16
DOI
https://doi.org/10.58723/ijaaiml.v2i2.403
Citations
1
Primary Topic
Sentiment Analysis and Opinion Mining
Type
article
Field-Weighted Citation Impact
2.48
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Deep Learning Approach to Sentiment Analysis of Hotel Reviews: Comparing BERT and LSTM Models

Mustafa Musa Jaber, Gunawan Wang
1 citations
International Journal of Advances in Artificial Intelligence and Machine Learning
Sentiment Analysis and Opinion Mining
2.48
article

A Deep Learning Approach to Sentiment Analysis of Hotel Reviews: Comparing BERT and LSTM Models

Mustafa Musa Jaber, Gunawan Wang
article en
1 citations

Abstract

Background of study: Online reviews are crucial in shaping consumer decisions, particularly in the hospitality industry, but accurately extracting sentiment remains challenging due to language subjectivity, varied expression styles, and significant class imbalance where positive reviews outweigh negative and neutral ones. Traditional machine learning methods often fail to address these issues effectively, favoring the majority class.Aims and scope of paper: This study employs BERT and LSTM deep learning models to classify hotel reviews into positive, neutral, and negative sentiment categories. The primary aim is to compare their performance in sentiment analysis and managing imbalanced data, evaluating both with and without under-sampling.Methods: A 20,000-review dataset from TripAdvisor was pre-processed, including stop word/special character removal, tokenization, stemming, and lemmatization. Star ratings were categorized: 4-5 as positive, 3 as neutral, and 1-2 as negative. Random under-sampling was applied to the majority (positive) class to balance the dataset. BERT (bert-base-uncased) and LSTM models were trained with an 80:20 training-validation split, and evaluated using accuracy, precision, recall, and F1-score, with 5-fold cross-validation.Result: BERT without under-sampling achieved the highest overall accuracy of 0.86, with strong F1-scores for positive (0.93) and negative (0.79) sentiments. However, all models struggled with neutral sentiments (BERT F1-score: 0.43, LSTM: 0.25). Under-sampling improved neutral class recall (BERT: 0.79) but decreased overall accuracy (BERT: 0.73; LSTM: 0.67) and positive class precision.Conclusion: BERT generally outperforms LSTM for hotel review sentiment analysis, particularly with imbalanced data. While under-sampling helps address class imbalance by improving neutral recall, it incurs significant performance trade-offs, reducing overall accuracy and precision in majority classes due to information loss. Future work should explore advanced resampling (SMOTE, ADASYN) or transfer learning (RoBERTa, XLNet) for better balance and neutral sentiment classification.

International Journal of Advances in Artificial Intelligence and Machine LearningVol. 2(2)
Binus University (ID), Dijlah University College (IQ)
Openalex Percentile: Top 9%
Sentiment Analysis and Opinion Mining
2.48
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.