How arunscode2002/youtube-virality-predictor works
This is a YouTube virality prediction service. A user submits a video URL through the dashboard or REST API; the API fetches video data, derives temporal and sentiment features, and returns a model-based or heuristic prediction. Separate collection and training paths build historical data and train models, while history and health endpoints expose service state. Edges reflect the excerpts, SOURCE INDEX references, and README; dashboard-to-API wiring is not shown in source excerpts, so that relationship is marked unverified.
Main entry points: train.py Training pipeline · main.py REST API · collector.py Snapshot collector · extractor.py Temporal features
Components 19
User Experience
- Web dashboard
dashboard/app.js - REST API
api/main.py - API schemas
api/schemas.py
Data Collection
- YouTube client
api/youtube_client.py - Snapshot collector
data/collector.py - Engagement database
data/database.py
Feature Analysis
- Temporal features
features/extractor.py - Comment sentiment
features/sentiment.py - Virality labels
features/labeler.py
Model Training
- Training pipeline
ml/train.py - Random forest
ml/random_forest.py - Gradient boosting
ml/gradient_boosting.py - LSTM model
ml/lstm_model.py - Model evaluation
ml/evaluate.py - Saved models
models
Service Platform
- Configuration
config/settings.py - Shared helpers
utils/helpers.py
Other components
- Video analyst
- YouTube Data API
Connections 27
- Video analyst → Web dashboard: submits video
README.md - Web dashboard → REST API: requests prediction
- REST API → API schemas: validates and responds
api/main.py - REST API → YouTube client: fetches video data
api/main.py - YouTube client → YouTube Data API: queries
api/youtube_client.py - REST API → Temporal features: extracts features
api/main.py - Temporal features → Comment sentiment: analyzes comments
features/extractor.py - REST API → Training pipeline: predicts with models
api/main.py - REST API → Engagement database: reads history
api/main.py - REST API → Snapshot collector: collects engagement
api/main.py - Snapshot collector → YouTube client: fetches statistics
data/collector.py - Snapshot collector → Engagement database: stores snapshots
data/collector.py - Training pipeline → Engagement database: loads training data
ml/train.py - Training pipeline → Snapshot collector: generates demo data
ml/train.py - Training pipeline → Temporal features: builds features
ml/train.py - Training pipeline → Virality labels: creates labels
ml/train.py - Virality labels → Temporal features: uses features
features/labeler.py - Training pipeline → Random forest: trains model
ml/train.py - Training pipeline → Gradient boosting: trains model
ml/train.py - Training pipeline → LSTM model: trains model
ml/train.py - Training pipeline → Saved models: saves model files
README.md - Model evaluation → Saved models: evaluates models
- REST API → Configuration: loads configuration
api/main.py - Snapshot collector → Configuration: reads collection settings
data/collector.py - Training pipeline → Configuration: reads model settings
ml/train.py - Temporal features → Shared helpers: uses utilities
features/extractor.py - YouTube client → Configuration: reads API key
api/youtube_client.py