Developing an AI-powered system to analyze YouTube video comment sentiment using NLP and machine learning models. Built a complete pipeline with a Flask API, Chrome extension, and MLOps tools like MLflow and DVC for experiment tracking and model versioning
Python
0
19 commits
updated Aug 12, 2026
A high-performance, full-stack application that goes far beyond simple sentiment analysis. It performs deep psychological profiling, abuse detection, and time-series analysis of YouTube comments using an ensemble of custom AI models, providing actionable, data-driven insights for content creators.
( you run the dashboard locally to see the stunning dark-mode UI!)
citizenlab/distilbert-base-multilingual-cased-toxicity to detect abuse, hate speech, and spam.>0.985) ensures enthusiastic internet slang ("this is a banger!") isn't falsely flagged as toxic.Backend (Inference & API):
XLM-RoBERTa, DistilBERT)Frontend (Dashboard):
# Clone the repository
git clone <your-repo-url>
cd sentiment-analyzer
# Create and activate environment
python -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # Linux/macOS
# Install dependencies
pip install -r requirements.txt
Create a .env file in the root directory:
YOUTUBE_API_KEY=your_youtube_api_key_here
(You can get a free API key from the Google Cloud Console by enabling the YouTube Data API v3).
Terminal 1 (Backend API):
uvicorn api:app --reload
Terminal 2 (Frontend Dashboard):
cd dashboard
npm install
npm run dev
Visit http://localhost:5173 in your browser to access the dashboard!
The application passes scraped comments through a robust multi-stage NLP pipeline:
DistilRoBERTa applies a sigmoid threshold (>0.3) across 28 distinct emotional axes.sentiment-analyzer/
βββ api.py # FastAPI routing, caching, and payload generation
βββ models.py # ML pipeline initialization and inference logic
βββ analysis.py # Pandas aggregations, timeline tracking, mixed sentiment
βββ fetcher.py # YouTube API integration and comment scraping
βββ suggestions.py # Heuristic engine for generating creator advice
βββ dashboard/ # React frontend (Vite)
β βββ src/
β β βββ components/ # Reusable UI elements (SentimentCards, CommentTable, etc.)
β β βββ index.css # Core design system and CSS tokens
β β βββ App.jsx # Main dashboard view
βββ fine-tuned-emotion-model/ # Exported weights for the 28-class GoEmotions model
βββ requirements.txt # Python dependencies
Every analysis run is automatically logged locally via MLflow to mlflow.db.
To view your historical performance data, run:
mlflow ui
Then open http://localhost:5000 to visualize how your content reception has evolved across multiple videos.
Contributions are always welcome! Whether it's adding a word-cloud visualization, refining the topic modeling heuristic, or expanding the AI suggestions logic, feel free to open a Pull Request.
Originally created by Teshan G.H.P | University of Ruhuna
Developing an AI-powered system to analyze YouTube video comment sentiment using NLP and machine learning models. Built a complete pipeline with a Flask API, Chrome extension, and MLOps tools like MLflow and DVC for experiment tracking and model versioning
Python
0
19 commits
updated Aug 12, 2026
A high-performance, full-stack application that goes far beyond simple sentiment analysis. It performs deep psychological profiling, abuse detection, and time-series analysis of YouTube comments using an ensemble of custom AI models, providing actionable, data-driven insights for content creators.
( you run the dashboard locally to see the stunning dark-mode UI!)
citizenlab/distilbert-base-multilingual-cased-toxicity to detect abuse, hate speech, and spam.>0.985) ensures enthusiastic internet slang ("this is a banger!") isn't falsely flagged as toxic.Backend (Inference & API):
XLM-RoBERTa, DistilBERT)Frontend (Dashboard):
# Clone the repository
git clone <your-repo-url>
cd sentiment-analyzer
# Create and activate environment
python -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # Linux/macOS
# Install dependencies
pip install -r requirements.txt
Create a .env file in the root directory:
YOUTUBE_API_KEY=your_youtube_api_key_here
(You can get a free API key from the Google Cloud Console by enabling the YouTube Data API v3).
Terminal 1 (Backend API):
uvicorn api:app --reload
Terminal 2 (Frontend Dashboard):
cd dashboard
npm install
npm run dev
Visit http://localhost:5173 in your browser to access the dashboard!
The application passes scraped comments through a robust multi-stage NLP pipeline:
DistilRoBERTa applies a sigmoid threshold (>0.3) across 28 distinct emotional axes.sentiment-analyzer/
βββ api.py # FastAPI routing, caching, and payload generation
βββ models.py # ML pipeline initialization and inference logic
βββ analysis.py # Pandas aggregations, timeline tracking, mixed sentiment
βββ fetcher.py # YouTube API integration and comment scraping
βββ suggestions.py # Heuristic engine for generating creator advice
βββ dashboard/ # React frontend (Vite)
β βββ src/
β β βββ components/ # Reusable UI elements (SentimentCards, CommentTable, etc.)
β β βββ index.css # Core design system and CSS tokens
β β βββ App.jsx # Main dashboard view
βββ fine-tuned-emotion-model/ # Exported weights for the 28-class GoEmotions model
βββ requirements.txt # Python dependencies
Every analysis run is automatically logged locally via MLflow to mlflow.db.
To view your historical performance data, run:
mlflow ui
Then open http://localhost:5000 to visualize how your content reception has evolved across multiple videos.
Contributions are always welcome! Whether it's adding a word-cloud visualization, refining the topic modeling heuristic, or expanding the AI suggestions logic, feel free to open a Pull Request.
Originally created by Teshan G.H.P | University of Ruhuna