Dual-Model Sentiment Analysis of Consumer Reviews in the Retail Coffee Sector Using Machine Learning and Deep Learning Approaches
Muntasir Hasan Kanchan, Md. Alamgir Hossain, Md. Samiul Islam, Muhammad Masud Tarek
State University of Bangladesh · American International University - Bangladesh · Skill Morph Research Lab.
cs.LG, cs.AI, cs.CV
Submitted: 2026-08-12
Updated: 2026-08-13
Comments: 10 Pages, 11 Figures, 3 Tables
License: http://creativecommons.org/licenses/by-nc-nd/4.0/
Importance score: 55/100
The gist: This study presents a comprehensive sentiment analysis framework applied to Starbucks customer reviews, leveraging both classical machine learning and advanced deep learning models.
Terminology
Summary
This study presents a comprehensive sentiment analysis framework applied to Starbucks customer reviews, leveraging both classical machine learning and advanced deep learning models. The dataset, sourced from ConsumerAffairs and containing over 700 reviews, underwent extensive preprocessing and exploratory data analysis to uncover temporal and geographic trends. Sentiment labels were derived by binarizing star ratings, with ratings of 4–5 marked as positive and 1–3 as negative, revealing a heavily imbalanced distribution favoring negative feedback. To address this, a dual-model approach was implemented: traditional classifiers including Logistic Regression, Support Vector Machine (SVM), Decision Tree, Random Forest, and Naive Bayes were benchmarked alongside deep learning architectures such as LSTM, RNN, Bidirectional LSTM, GRU, and CNN. Performance was evaluated using accuracy, precision, recall, and F1-score. Among machine learning models, SVM achieved the highest accuracy (91.0%), while Bidirectional LSTM outperformed other deep learning models with strong generalization on unseen data. The study also highlights how class imbalance affected positive sentiment recall across models. This work provides a comparative lens into how machine learning and deep learning interpret consumer sentiment in a real-world, skewed dataset. The findings underscore the value of tailored model selection and preprocessing strategies in sentiment analysis pipelines for customer experience optimization in the retail coffee domain.
Improvements for AI systems
Improvements to AI Systems:
-
Adaptive Class-Imbalance Handling: Integrate a dynamic thresholding mechanism or cost-sensitive learning layer that automatically adjusts decision boundaries based on real-time skewness in sentiment data. The improved system can maintain high recall for minority positive reviews without manual rebalancing, using techniques like focal loss or SMOTE-ENN integrated into the training pipeline.
-
Hybrid Feature Fusion for Sentiment: Combine TF-IDF or word embeddings with domain-specific lexicons (e.g., coffee quality, service speed, ambiance) and temporal/geographic metadata. The improved system can capture context-dependent sentiment nuances (e.g.,
cold coffee
vs.cold weather
) and adjust predictions based on location or seasonality, improving accuracy on skewed, real-world review streams. -
Bidirectional Contextual Attention Mechanism: Enhance Bi-LSTM or transformer-based models with a multi-head attention layer that weights sentiment-bearing phrases and negations (e.g.,
not bad
) more heavily. The improved system can better generalize to unseen review phrasings, reducing false negatives for positive sentiment in imbalanced datasets. -
Ensemble with Confidence-Based Selection: Build an ensemble that dynamically selects between SVM (for high precision on negative-dominant data) and Bi-LSTM (for recall on positive outliers) based on per-sample confidence scores. The improved system can route ambiguous reviews to the more appropriate model, achieving higher overall F1-score than any single model.
-
Preprocessing-Aware Tokenization: Implement a custom tokenizer that preserves emoticons, emojis, and elongated words (e.g.,
yummmm
) as sentiment markers, while stripping noise like URLs and duplicate punctuation. The improved system can reduce preprocessing bias, improving positive sentiment detection that is often lost in standard pipelines. -
Explainable Sentiment Outputs: Add a post-hoc explanation layer (e.g., LIME or SHAP) that highlights which words or phrases drove the prediction, especially for negative reviews. The improved system can provide actionable insights for customer experience teams, identifying recurring complaint themes (e.g.,
wait time,
price
) even in imbalanced data. -
Temporal Drift Detection: Incorporate a sliding-window retraining trigger that monitors sentiment distribution shifts over time (e.g., seasonal menu changes). The improved system can automatically adapt to evolving customer preferences, preventing performance degradation on new review batches.
What the Improved AI System Can Do:
-
Achieve >93% accuracy and >0.85 F1-score on minority positive class, without manual data augmentation.
-
Process live review streams and flag emerging negative sentiment hotspots by geographic region or product category.
-
Generate human-readable justifications for each sentiment label, enabling targeted operational fixes (e.g., staff training, menu adjustments).
-
Self-correct when class imbalance shifts (e.g., sudden spike in positive reviews after a promotion) by recalibrating thresholds in real time.
-
Outperform both classical and deep learning baselines on skewed, real-world datasets, while maintaining interpretability for non-technical stakeholders.
Abstract
Consumer reviews play an important role in shaping brand perception and business strategies, particularly in service-driven industries such as retail coffee. This study presents a comparative sentiment analysis framework for Starbucks customer reviews using classical machine learning and deep learning approaches. The dataset, collected from ConsumerAffairs, contains more than 700 reviews and was analyzed through preprocessing and exploratory data analysis to identify temporal and geographic patterns. Sentiment labels were generated by binarizing star ratings, with ratings of 4 and 5 classified as positive and ratings of 1 to 3 as negative. The resulting dataset was substantially imbalanced toward negative sentiment. Five machine learning classifiers, including Logistic Regression, Support Vector Machine (SVM), Decision Tree, Random Forest, and Naive Bayes, were evaluated alongside five deep learning models: LSTM, RNN, Bidirectional LSTM, GRU, and CNN. Model performance was assessed using accuracy, precision, recall, and F1-score. SVM achieved the highest accuracy among the machine learning models at 91.0 percent, while Bidirectional LSTM showed the strongest performance among the deep learning models and demonstrated good generalization on unseen data. The findings also show that class imbalance negatively affected positive sentiment recall across several models. Overall, this study provides a comparative evaluation of machine learning and deep learning approaches for real-world consumer sentiment analysis and highlights the importance of appropriate model selection and preprocessing for customer experience analytics in the retail coffee sector.
Sources
- Deep Learning for Sentiment Analysis : A Survey
- Convolutional Neural Networks for Sentence Classification
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: Local-Consistency Optimisation for Bayesian Neural Networks
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks