Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Cafe Analytics Dashboard – Sentiment Analysis using DistilBERT

This project analyzes real-world customer sentiment for a café by combining Google Reviews and Twitter mentions using NLP (DistilBERT) and interactive Plotly dashboards.

It helps businesses understand customer perception, track menu item popularity, and monitor brand reputation over time.

⚠️ Note: For testing and demonstration purposes, this project uses The Rameshwaram Cafe as an example café. The data and analysis shown are intended only for educational and non-commercial testing.


🚀 Features

Multi-source data collection

  • Scrapes Google Maps reviews using the SerpAPI
  • Fetches Twitter mentions using the Twitter API v2

Transformer-based Sentiment Analysis

  • Uses distilbert-base-uncased-finetuned-sst-2-english for accurate and fast text classification
  • Classifies reviews into Positive, Negative, or Neutral sentiments

Interactive Visual Dashboard (in Colab)

  • Beautiful Plotly charts for:
    • Sentiment distribution (Donut chart)
    • Menu item mentions
    • Confidence scores
    • Platform comparison
    • Rating histogram
    • Sentiment timeline

Comprehensive Reporting

  • Aggregated metrics (total reviews, average rating, top items)
  • Displays recent negative reviews with confidence scores

🧠 Tech Stack

Category Technology
Language Python
Deep Learning PyTorch, Transformers (DistilBERT)
APIs Twitter API v2, Google Maps Reviews API (SerpAPI)
Visualization Plotly
Data Handling Pandas
Environment Google Colab

⚙️ Setup Instructions (in Google Colab)

  1. Clone or upload the notebook file (CafeAnalytics.ipynb) to your Colab workspace.

  2. Install dependencies:

    !pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
    !pip install transformers==4.35.0 tweepy==4.14.0 plotly==5.18.0 python-dotenv==1.0.0 google-search-results==2.4.2 pytz==2023.3 accelerate==0.24.0
  3. Add API Keys (Secrets in Colab):

    • Click the 🔑 “Secrets” icon in the left sidebar in Colab
    • Add the following:
      • TWITTER_BEARER_TOKEN
      • SERPAPI_KEY
  4. Run the notebook
    The notebook will:

    • Fetch reviews and tweets
    • Perform sentiment analysis using DistilBERT
    • Generate an interactive dashboard directly in Colab

🧩 Configuration

Inside the main() function, update the following fields for your café or business:

PLACE_ID = 'ChIJmdq205oXrjsRrn9q3VqwI9g'   # Google Place ID
CAFE_NAME = 'The Rameshwaram Cafe'         # Used only for testing purposes
MENU_ITEMS = ['ghee podi idli', 'garlic roast masala', 'kesaribath', 'Masala Dosa']

🧪 Note: The Rameshwaram Cafe is used here purely for testing and demonstration. This project is not affiliated with or representative of the actual business.

You can get your Place ID from Google Place ID Finder.


📊 Dashboard Preview

The dashboard includes:

  • Reviews by Platform (Google vs Twitter)
  • Sentiment Analysis (DistilBERT)
  • Model Confidence by Sentiment
  • Most Mentioned Menu Items
  • Sentiment Over Time (Stacked Area Chart)
  • Rating Distribution (Google Reviews)
  • Recent Negative Reviews (with confidence)

🧾 Example Output

When executed successfully, you’ll see:

✅ Analyzer initialized successfully!
📥 Collecting and analyzing reviews from multiple platforms...
✅ Analysis complete! Dashboard displayed above.

and a fully interactive dashboard will appear in the notebook.


📈 Use Cases

  • Brand reputation analysis
  • Product feedback insights
  • Menu optimization based on sentiment trends
  • Marketing strategy evaluation using customer voice

🛠️ Future Enhancements

  • Integration with YouTube / Reddit comments
  • Geospatial visualization of reviews
  • Automated weekly sentiment trend reports
  • Fine-tuning a domain-specific BERT model for café reviews

👨‍💻 Author

Kishore A
📍 Project: Cafe Analytics Dashboard
💬 “Turning customer feedback into actionable insights with AI.”

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages