How ravikumarr1802/aiguardian works
AI Guardian is a Django moderation assistant: creators manage monitored videos and review comment statistics in a web dashboard, while comment-fetching commands retrieve YouTube comments, classify them, and store moderation outcomes. Human review and moderation actions can update comment status and feed the retraining queue; the dashboard also exposes per-video analytics and video management. The graph includes both web and command-line ingestion paths, reclassification, YouTube deletion, and model retraining. Some views and project configuration were only partially sampled, so unverified wiring is omitted.
Main entry points: views.py Dashboard and actions · fetch_all_comments.py Fetch all comments · youtube_service.py YouTube API client · models.py Video and comment records
Components 18
Web application
- Web routes
comments/urls.py - Dashboard and actions
comments/views.py - Dashboard views
comments/templates/comments - Video context
comments/context_processors.py
Comment moderation
- Fetch all comments
comments/management/commands/fetch_all_comments.py - Fetch video comments
comments/management/commands/fetch_comments.py - Reclassify video
comments/management/commands/reclassify_video.py - Delete comment command
comments/management/commands/delete_comment.py - Video and comment records
comments/models.py - Fallback video list
comments/video_config.py
Toxicity model
- Retraining queue
comments/retrain_queue.csv - Toxicity inference
toxicity_models/transformers/bert_infer.py - Model retraining
toxicity_models/retrain_model.py
External services
- YouTube API client
comments/youtube_service.py - YouTube
- Hugging Face model
Other components
- Content creator
- Command-line operator
Connections 29
- Content creator → Web routes: uses dashboard
README.md - Web routes → Dashboard and actions: routes requests
comments/urls.py - Dashboard and actions → Dashboard views: renders pages
comments/views.py - Dashboard and actions → Video and comment records: reads and updates
comments/views.py - Video context → Video and comment records: reads videos
comments/context_processors.py - Video context → Fallback video list: falls back to
comments/context_processors.py - Dashboard and actions → Fetch video comments: dispatches fetch
comments/views.py - Dashboard and actions → Retraining queue: appends labels
comments/views.py - Dashboard and actions → Model retraining: runs retraining
comments/views.py - Command-line operator → Fetch all comments: runs command
comments/management/commands/fetch_all_comments.py - Command-line operator → Fetch video comments: runs command
comments/management/commands/fetch_comments.py - Command-line operator → Reclassify video: runs command
comments/management/commands/reclassify_video.py - Command-line operator → Delete comment command: runs command
comments/management/commands/delete_comment.py - Fetch all comments → Video and comment records: stores comments
comments/management/commands/fetch_all_comments.py - Fetch all comments → Fallback video list: loads fallback list
comments/management/commands/fetch_all_comments.py - Fetch all comments → YouTube API client: gets API client
comments/management/commands/fetch_all_comments.py - Fetch all comments → Toxicity inference: classifies comments
comments/management/commands/fetch_all_comments.py - Fetch all comments → Retraining queue: queues reviews
comments/management/commands/fetch_all_comments.py - Fetch video comments → YouTube API client: gets API client
comments/management/commands/fetch_comments.py - Fetch video comments → Video and comment records: stores comments
comments/management/commands/fetch_comments.py - Fetch video comments → Toxicity inference: classifies comments
comments/management/commands/fetch_comments.py - Reclassify video → Video and comment records: reads and updates
comments/management/commands/reclassify_video.py - Reclassify video → Toxicity inference: reclassifies comments
comments/management/commands/reclassify_video.py - Reclassify video → YouTube API client: optionally gets client
comments/management/commands/reclassify_video.py - Delete comment command → YouTube API client: gets API client
comments/management/commands/delete_comment.py - Delete comment command → Video and comment records: marks deleted
comments/management/commands/delete_comment.py - Dashboard and actions → YouTube API client: deletes comments
comments/views.py - YouTube API client → YouTube: calls API
comments/youtube_service.py - Toxicity inference → Hugging Face model: loads classifier
toxicity_models/transformers/bert_infer.py