Skip to content

Manu839/Youtube-sentiment-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

<<<<<<< HEAD

πŸŽ₯ YouTube Sentiment Intelligence Platform

=======

A full-stack, creator-focused analytics platform that analyzes YouTube video comments to understand audience sentiment, engagement quality, and behavioral trends.

Built with a modern React + Tailwind SaaS UI and a Python Flask analytics backend, this project goes beyond basic sentiment analysis by adding spam detection, audience mood scoring, sentiment timelines, and creator insights β€” all powered by VADER (NLTK) and real YouTube data.


πŸš€ Key Features

πŸ”— Video Analysis

  • Submit any public YouTube video link
  • Fetch comments using YouTube Data API v3
  • Cache comments in MongoDB for reuse and performance

πŸ€– Sentiment Intelligence (VADER)

  • Classifies comments as Positive / Neutral / Negative
  • Uses compound sentiment scores for weighted analysis
  • Fully explainable logic (no black-box ML models)

🧹 Spam & Bot Detection

  • Detects:
    • Duplicate comments
    • Emoji spam
    • Link-based spam
  • Spam comments are excluded from analytics

πŸ“Š Creator-Focused Insights

  • Audience Mood Score (weighted by likes)
  • Top Positive Comments (what viewers loved)
  • Comments Needing Attention (negative / critical feedback)
  • Spam Percentage per video

πŸ“ˆ Sentiment Over Time

  • Tracks sentiment day-by-day
  • Detects sentiment shifts and spikes
  • Useful for identifying reactions to viral moments

πŸ“Š Visual Analytics

  • Sentiment distribution:
    • Bar Chart
    • Pie Chart
  • Clean, professional dashboards

πŸ‘€ Channel & Video Metadata

  • Channel name, description, subscribers
  • Video views, likes, and comment count

🎨 UI & UX

  • Dark, premium SaaS-style interface
  • Animated gradients & glassmorphism
  • Creator dashboards:
    • Home
    • Analyze
    • Insights
    • Sentiment Timeline
  • Fully responsive (desktop & mobile)

Results

4 3 2 1 6 5 backend

🧱 Tech Stack

πŸ–₯ Frontend

  • React.js
  • Tailwind CSS
  • Vite
  • React Router

πŸ”₯ Backend

  • Python 3.10+
  • Flask + Flask-CORS
  • NLTK (VADER SentimentIntensityAnalyzer)
  • Google YouTube Data API v3
  • MongoDB (PyMongo)
  • Pandas & NumPy
  • Plotly (chart generation)

βš™οΈ Setup Instructions

πŸ”§ Prerequisites

  • Node.js v18+
  • Python 3.10+
  • MongoDB (local or Atlas)
  • Google Developer Account
  • YouTube Data API key

πŸ“ Clone the Repository

git clone https://github.com/Manu839/Youtube-sentiment-analysis.git
cd yt-sentiment-analysis

πŸ“¦ Backend Setup (Flask)

πŸ”Ή Navigate to backend directory:

cd backend
python -m venv env
source env/bin/activate   # Or: env\Scripts\activate on Windows
pip install -r requirements.txt

πŸ”Ή Set your API Key

  • DEVELOPER_KEY=YOUR_YOUTUBE_API_KEY_HERE
  • MONGO_URI=mongodb://localhost:27017 # Or your MongoDB Atlas URI
  • MONGO_DB=yt_sentiment

πŸ”Ή Run the Flask server

python app.py

🌐 Frontend Setup (React + Vite)

πŸ”Ή Navigate to frontend directory:

cd frontend
npm install
npm run dev

Frontend runs at: http://localhost:5173

πŸ› Troubleshooting

  • 403 commentsDisabled β†’ Video has comments disabled

  • 500 errors β†’ Check API key & quota limits

  • Insights not showing β†’ Analyze a video first

  • CORS issues β†’ Ensure Flask-CORS is enabled

  • MongoDB errors β†’ Confirm MongoDB is running

React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Expanding the ESLint configuration

If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint in your project.

About

A full-stack app for YouTube sentiment analysis using React, Flask, and the YouTube API. Paste any video link, and see viewer sentiment visualized with charts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors