A powerful web application and browser extension that analyzes the sentiment of YouTube comments in real-time.
Sentivibe is an AI-powered sentiment analysis tool built to instantly classify YouTube comments as positive, negative, or neutral. Designed for content creators, brand managers, and researchers, it fetches real-time comments and provides a visual dashboard of audience reactions directly under any YouTube video. By analyzing viewer feedback at scale, users can monitor their brand reputation, gauge video reception, and extract meaningful insights without manually reading thousands of comments.
- 🔄 Real-Time Comment Fetching: Directly pulls up to thousands of comments per video using the official YouTube Data API v3.
- 🧠 Smart Sentiment Classification: Accurately categorizes feedback into positive, negative, or neutral sentiments using a local transformer model with fallback logic.
- 📊 Visual Analytics Dashboard: Displays interactive charts showing overall sentiment distribution.
- 🏆 Top Comment Highlights: Automatically isolates and highlights the most positively and negatively engaging comments.
- 💾 Smart Caching Engine: Built-in SQLite cache to prevent redundant API calls and optimize YouTube API quota usage.
- 🧩 Seamless Extension Integration: Injects the sentiment UI natively into the YouTube viewing experience via a premium Chrome extension.
Backend
Machine Learning & NLP
Frontend / Extension
- Enter YouTube URL: The Chrome extension automatically detects the currently playing YouTube video.
- Fetch Comments via API: The backend communicates with the YouTube Data API v3 to retrieve comment threads (with pagination support).
- Run Sentiment Model: The backend processes the text using a tiered NLP approach (Local Transformer → HuggingFace Inference API → Sentiment Lexicon).
- Display Results: Processed data is sent back to the extension, which renders a sleek dashboard with sentiment charts and top comment highlights directly below the video player.
- Node.js (v16+)
- A Google Cloud Console account (to generate a YouTube Data API v3 key)
- Google Chrome browser (for the extension)
-
Clone the repository
git clone https://github.com/Monu01123/Sentivibe.git cd Sentivibe -
Backend Setup
cd Backend_ npm install -
Configure Environment Variables Create a
.envfile in theBackend_directory:# .env PORT=5000 YOUTUBE_API_KEY=your_youtube_api_key_here # Optional: For advanced cloud inference HF_API_KEY=your_huggingface_api_key_here TRANSFORMER_MODEL=Xenova/distilbert-base-uncased-finetuned-sst-2-english
-
Start the Server
npm start
-
Load the Chrome Extension
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right.
- Click "Load unpacked" and select the
extension_v2directory. - Open a YouTube video to see Sentivibe in action!
- Open Chrome and navigate to
Sentivibe utilizes a multi-layered fallback strategy for sentiment analysis to ensure 100% uptime and fast execution:
- Local Transformer (
@xenova/transformers): First, it attempts to run a localized, in-memory DistilBERT model. This guarantees high accuracy without relying on paid external APIs. - Hugging Face API: If local execution struggles with resource constraints, it falls back to the Hugging Face Inference API.
- Lexicon-based Analysis (
sentimentnpm package): For extremely rapid or offline fallback, an AFINN-based lexicon approach is used as the baseline classifier.
When the backend classifies comments, the JSON response looks like this:
{
"videoId": "dQw4w9WgXcQ",
"totalCommentsAnalyzed": 150,
"sentimentSummary": {
"positive": 65,
"negative": 15,
"neutral": 70
},
"topComments": {
"positive": "This is an absolute masterpiece! Loved every second of it.",
"negative": "The pacing was terrible and the audio quality is bad."
}
}Building this project provided several critical technical insights:
- API Integration & Quota Management: Learned how to effectively paginate through the YouTube Data API while implementing an SQLite caching layer to avoid rate limits and reduce redundant API calls.
- NLP & Sentiment Analysis: Gained deep knowledge of deploying machine learning models in a Node.js environment, especially working with WebAssembly-based local transformers versus cloud APIs.
- Data Visualization: Mastered techniques to clean and aggregate raw textual data into structured statistical models suitable for dynamic chart rendering in the DOM.
- Handling Large Comment Datasets: Navigated performance bottlenecks when parsing asynchronous streams of thousands of comments simultaneously, optimizing the Node event loop.
- Multilingual Support: Integrating translation APIs or polyglot models to analyze comments in multiple languages.
- Real-Time Streaming: Implementing WebSockets for live sentiment tracking during YouTube Premieres or Live Streams.
- Trend Analysis Over Time: Plotting how viewer sentiment shifts day-by-day after a video is published.
- Entity Recognition: Identifying which specific topics or people within the video are driving the positive or negative sentiment.
Monu
- LinkedIn: monu-meena
- GitHub: Monu01123
- Email: [monumeena0112@gmail.com]
If you liked this project, please consider leaving a ⭐ on this repository!