- Updated: August 22, 2026
- 6 min read
Dual-Model Sentiment Analysis of Consumer Reviews in the Retail Coffee Sector Using Machine Learning and Deep Learning Approaches
Direct Answer
The paper introduces a side‑by‑side benchmark that pits classic machine‑learning classifiers against modern deep‑learning architectures for extracting sentiment from Starbucks consumer reviews. By revealing which models survive the real‑world challenges of noisy, imbalanced data, the study gives businesses a data‑driven shortcut to choosing the right AI tool for coffee‑retail sentiment analytics.
Background: Why This Problem Is Hard
Consumer reviews are a goldmine for retail coffee chains, yet turning free‑form text into reliable sentiment signals remains a bottleneck. Three factors make the task especially tricky:
- Lexical variability. Reviewers mix slang, emojis, and domain‑specific jargon (“flat latte”, “over‑extracted”) that traditional bag‑of‑words pipelines often miss.
- Class imbalance. In the dataset examined, negative opinions dominate, skewing model learning and inflating false‑positive rates for positive sentiment.
- Temporal and geographic drift. Preferences shift across seasons and locations, so a model trained on last‑year data can quickly become stale.
Existing solutions typically fall into two camps. Classical approaches—Logistic Regression, SVM, Random Forest—are fast and interpretable but struggle with long‑range dependencies. Deep models—LSTM, GRU, CNN—capture context but demand more data, compute, and careful regularization. The literature lacks a head‑to‑head, industry‑scale comparison that quantifies these trade‑offs on a real coffee‑retail corpus.
What the Researchers Propose
The authors present a “dual‑model” evaluation framework that treats classical machine‑learning pipelines and deep‑learning networks as parallel contenders. The framework consists of three logical layers:
- Data ingestion & preprocessing. Raw reviews from ConsumerAffairs are cleaned, tokenized, and transformed into both sparse vectors (TF‑IDF) for the classical models and dense embeddings for the neural nets.
- Model families. Five traditional classifiers (Logistic Regression, SVM, Decision Tree, Random Forest, Naïve Bayes) are trained on the sparse representation, while five deep architectures (LSTM, RNN, Bidirectional LSTM, GRU, CNN) learn directly from the embeddings.
- Evaluation suite. Accuracy, precision, recall, and F1‑score are computed on a held‑out test set, with special attention to how class imbalance affects recall for the minority (positive) class.
This modular design lets practitioners swap components—e.g., replace TF‑IDF with a transformer‑based encoder—without redesigning the whole pipeline.
How It Works in Practice
The end‑to‑end workflow can be visualized as a four‑stage pipeline:
- Collection. Reviews are scraped via the ConsumerAffairs API, preserving timestamps and geographic tags.
- Cleaning & labeling. Non‑ASCII characters, HTML tags, and duplicate entries are stripped. Star ratings are binarized: 4‑5 → positive, 1‑3 → negative.
- Feature extraction. For classical models, a TF‑IDF matrix (unigrams + bigrams) is built. For deep models, each token is mapped to a 300‑dimensional word2vec vector, then padded to a uniform sequence length.
- Training & validation. Each algorithm receives the same training split (80 %) and is tuned via grid search (class weight adjustments for imbalance). The test split (20 %) remains untouched for final reporting.
What sets this approach apart is the disciplined parity between the two model families. By holding the data and evaluation metrics constant, the study isolates algorithmic performance from data‑quality confounds, delivering a clean “apples‑to‑apples” comparison.
Evaluation & Results
The researchers evaluated the models on three practical scenarios:
- Overall accuracy. How often does the model predict the correct sentiment?
- Positive‑class recall. Can the model reliably surface the relatively scarce positive reviews?
- Generalization. Does performance hold when the test set contains reviews from months not seen during training?
Key findings include:
- The Support Vector Machine topped the classical suite with a 91 % accuracy, largely thanks to its margin‑maximizing property that copes well with high‑dimensional TF‑IDF features.
- Among deep networks, the Bidirectional LSTM achieved the highest F1‑score, demonstrating superior ability to capture context from both past and future tokens.
- All models suffered a dip in positive‑class recall (averaging 62 %) because the negative class dominated the training distribution.
- When the test set was shifted temporally, the Bidirectional LSTM’s performance degraded by only 3 %, whereas the Random Forest dropped by 9 %, indicating better robustness to temporal drift.
These results suggest that, for a modestly sized but noisy dataset, a well‑tuned SVM can rival deep models on raw accuracy, while a Bidirectional LSTM offers a more balanced trade‑off between precision and recall, especially when future‑looking context matters.
Why This Matters for AI Systems and Agents
For AI practitioners building customer‑experience agents, the study provides a decision matrix that aligns model complexity with business constraints:
- Latency‑sensitive bots. Classical models like SVM require milliseconds per inference, making them ideal for real‑time chat assistants that must respond instantly.
- Deep‑insight analytics. Bidirectional LSTMs, though heavier, can be scheduled as batch jobs to enrich dashboards with nuanced sentiment trends, feeding downstream recommendation agents.
- Resource budgeting. Companies can start with an SVM prototype on the UBOS platform overview and later migrate to a deep model as data volume grows, preserving code reuse thanks to the modular pipeline.
Moreover, the explicit focus on class imbalance equips data scientists with concrete mitigation strategies—class weighting, synthetic oversampling, or focal loss—that can be baked into any sentiment‑analysis microservice.
What Comes Next
While the benchmark is thorough, several avenues remain open:
- Transformer encoders. Replacing static word2vec embeddings with BERT or RoBERTa could further close the gap between accuracy and recall, especially for rare positive expressions.
- Multilingual expansion. Extending the corpus to include non‑English reviews would test model portability across linguistic boundaries.
- Active learning loops. Integrating a human‑in‑the‑loop feedback mechanism—e.g., via the ChatGPT and Telegram integration—could continuously correct misclassifications and adapt to evolving slang.
- Explainability dashboards. Pairing model outputs with SHAP or LIME visualizations would give marketing managers actionable insights into why a review is flagged negative, supporting faster issue resolution.
Addressing these challenges will push sentiment analysis from a static reporting tool toward an adaptive, agent‑driven component of the coffee‑retail tech stack.
Call to Action
If you’re a marketing manager or data scientist looking to turn coffee‑shop chatter into strategic advantage, start by replicating the dual‑model pipeline on your own review data. Leverage the Enterprise AI platform by UBOS for scalable training, and consider integrating the resulting sentiment scores into your existing AI marketing agents for automated campaign optimization.
For the full methodological details, read the original arXiv paper. Ready to accelerate your sentiment analytics? Explore our UBOS templates for quick start and get your coffee‑retail AI project off the ground today.
Andrii Bidochko
CTO UBOS
Andrii Bidochko is an AI entrepreneur and researcher focused on AI agents, reinforcement learning, and autonomous systems. He writes about the technologies shaping the future of machine intelligence, from frontier models and agent architectures to real-world AI applications.