Skip to content

Latest commit

 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💬 Sentiment Watchdog Dashboard

Monitor and visualize real-time customer sentiment using AI-powered emotion detection. This Streamlit-based dashboard enables customer support teams to analyze text input, detect emotions, and gain insights with visualizations like emotion count bar charts, word clouds, and heatmaps.

🚀 Features

  1. 🔍 Real-Time Emotion Analysis — Enter customer messages and get instant emotion predictions using a backend API.

  2. 📊 Emotion Count Bar Chart — View distribution of emotions across all messages.

  3. ☁️ Word Cloud — Visualize the most frequently used words in all collected messages.

  4. 🔥 Emotion Heatmap — Analyze emotion trends by hour of the day.

🛠️ Tech Stack

  1. Frontend: Streamlit

  2. Backend: FastAPI

  3. Visualization: Plotly, seaborn, matplotlib, wordcloud

  4. Database: SQLite (via SQLAlchemy)

  5. ML Model: Pre-trained emotion classifier (e.g., from transformers)

📂 Project Structure

sentiment-watchdog/
│
├── backend/
│   ├── init_db.py            # Database initialization script
│   ├── app.py                # FastAPI server
│   ├── db.py                 # SQLite database schema & functions
│   ├── slack_alert.py        # Slack notification logic
│   ├── live_stream.py        # Simulated/live message stream
│   ├── check_logs.py         # Log analysis & trigger evaluation
│
├── models/                   # Models folder (new)
│   ├── sentiment_model.py    # Emotion detection logic
│   ├── sqlalchemy_model.py   # SQLAlchemy ORM models
│
├── dashboard/
│   ├── dashboard.py          # Streamlit frontend
│
├── data/
│   └── sentiment.db          # SQLite database file
│
├── requirements.txt          # Python dependencies
├── .env                      # Environment variables (API keys, secrets)
├── sample_tickets.json       # Sample input data for testing
└── README.md

💻 How to Run

  1. Clone the Repository

bash

git clone https://github.com/your-username/sentiment-watchdog.git
cd sentiment-watchdog
  1. Set Up Virtual Environment

bash

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
  1. Start the Backend API

bash

cd backend
uvicorn main:app --reload

Backend will be available at http://127.0.0.1:8000.
  1. Launch the Dashboard

bash

cd ../dashboard
streamlit run dashboard.py

Dashboard will open in your browser.

📥 Sample Input

You can test with various user inputs like:

json

{
    "message": "I’m absolutely thrilled with the service!"
}

json

{
    "message": "This is the worst experience I’ve ever had."
}

📌 Notes

  1. Ensure sentiment.db is created and accessible. If not, check db.py for correct path.

  2. Emotion labels typically include: joy, sadness, anger, fear, love, surprise, etc.

  3. Backend must be running before using the Streamlit dashboard.

🙌 Credits

Created by [Suhas P R].

Built using Streamlit, FastAPI, and HuggingFace Transformers.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages