--- title: Hybrid Comment Moderation emoji: 💬 colorFrom: blue colorTo: green sdk: gradio sdk_version: "5.34.0" app_file: app.py pinned: false license: mit tags: - content-moderation - hybrid-ai - distilbert - qwen - cs541 --- # 💬 Hybrid Comment Moderation **CS541 AI Final Project — Stevens Institute of Technology** A two-stage content moderation pipeline that routes comments intelligently: 1. **Stage 1 — ML Classifier** (DistilBERT, CPU, ~7 ms): handles confident predictions instantly. 2. **Stage 2 — LLM Reviewer** (Qwen2.5-14B-Instruct, NF4, GPU, ~1–2 s): reviews only ambiguous comments. ## Tabs | Tab | Description | |:----|:------------| | 🔍 **Live Demo** | Type a comment, pick a strategy, see the verdict | | 📊 **Evaluation** | Pre-computed metrics on 100 balanced Civil Comments samples | | 🏗️ **Architecture** | Pipeline diagram and design rationale | ## Usage - **ML-only** works for everyone (CPU, no sign-in needed). - **Hybrid** and **LLM-only** require a free HuggingFace account for ZeroGPU access. - First LLM call loads the 14B model (~30–40 s); subsequent calls take ~1–2 s. ## Reference - Textbook: *Understanding Deep Learning* by Simon J.D. Prince - Dataset: [google/civil_comments](https://huggingface.co/datasets/google/civil_comments) - ML model: [martin-ha/toxic-comment-model](https://huggingface.co/martin-ha/toxic-comment-model) - LLM: [Qwen/Qwen2.5-14B-Instruct](https://huggingface.co/Qwen/Qwen2.5-14B-Instruct)