How abess96/youtube-sentiment-analysis works
Project type and purpose
• This is a machine-learning pipeline with an online inference component plus a browser extension front end.
• It ingests YouTube comment data, runs preprocessing, trains and registers models (via DVC), exposes a Flask API for live inference, and offers a Chrome plugin UI to call that API.
Top-level components
• Data Pipeline (DVC)
– dvc.yaml + dvc.lock define stages
– .dvc directory holds local config
• Core ML code (src/)
– data_ingestion.py
– data_preprocessing.py
– model_building.py
– model_evaluation.py
– register_model.py
• Experiment notebooks (notebooks/)
– EDA, feature engineering, modeling experiments
• Model artifact store/registry
– managed by DVC (and optionally remote storage)
• Flask service (flask_api/main.py)
– loads latest registered model
– accepts HTTP requests, returns sentiment predictions
• Chrome plugin front end (yt-chrome-plugin-frontend/)
– popup.html + popup.js + manifest.json
– UI for entering or scraping comments and calling Flask API
Relationships and data flows
• Offline pipeline:
Raw data → DVC stages: ingestion → preprocessing → training → evaluation → register_model → DVC stores versioned artifacts
• Runtime/inference:
Browser plugin ←→ Flask API ← loads model artifact from local DVC checkout (or remote)
• Dependencies:
– requirements.txt / setup.py list Python packages
– params.yaml holds configurable hyperparameters
Architectural patterns and principles
• Separation of concerns:
– Data pipeline separate from model training code
– API separate from training
– UI (Chrome extension) decoupled from API
• Versioned reproducibility via DVC
• Modular ML code under src/model and src/data
• Minimal runtime dependencies for production (Flask + model)