Spaces:
Configuration error
SafeStream AI β Intelligent Content Moderation
AI-powered content moderation using rule-based scoring and reinforcement learning for smarter, faster, and more adaptive decisions.
Features
- AI toxicity analysis β scores content across multiple harm categories
- RL-driven decision engine β outputs one of: Allow / Flag / Remove / Review
- Confidence scoring β quantified certainty on every moderation decision
- Category breakdown β per-content scores for toxicity, insult, threat, and obscene language
- Live moderation history β running log of past decisions in the dashboard
- Real-time stats β dashboard metrics updated on every request
- Modern UI β clean gradient-styled interface
Architecture
Frontend (HTML/CSS/JS) β FastAPI Backend (/moderate) β AI + RL Decision Logic β Structured Moderation Output
Tech Stack
| Layer | Technology |
|---|---|
| Frontend | HTML, CSS, JavaScript |
| Backend | FastAPI (Python) |
| Deployment | Hugging Face Spaces (Docker) |
| Model logic | Rule-based scoring + AI (extendable) |
Project Structure
. βββ app.py βββ requirements.txt βββ Dockerfile βββ templates/ β βββ index.html βββ static/ βββ styles.css βββ script.js βββ logo.jpeg
How It Works
- User submits text via the dashboard
- Frontend sends a POST request to /moderate
- Backend analyzes the content using AI scoring + RL logic
- Response includes a decision, confidence score, explanation, and category breakdown
- Dashboard updates in real time
API Reference
POST /moderate
Request body: json { "text": "Your content here" }
Response: json { "decision": "flag", "confidence": 0.85, "explanation": "Potentially harmful content detected", "ai_scores": { "toxicity": 0.8, "insult": 0.6, "threat": 0.7, "obscene": 0.5 } }
Decision values: allow Β· flag Β· remove Β· review
Running Locally
1. Clone the repository bash git clone cd safestream-ai
2. Install dependencies bash pip install -r requirements.txt
3. Start the server bash uvicorn app:app --reload
4. Open in browser
Deployment
This project is deployed on Hugging Face Spaces using Docker.
- Dockerfile handles container setup
- FastAPI app runs on port 7860
Roadmap
- Integrate real LLM (OpenAI / Anthropic / Perspective API)
- Train RL agent dynamically on moderation feedback
- Analytics dashboard with charts
- Multi-language moderation support
- User authentication and persistent moderation logs
- Real-time streaming moderation
- Webhook support for external integrations
Use Cases
- Social media platforms
- Community forums and Discord servers
- Live chat and messaging apps
- Online gaming platforms
- Content safety pipelines
Author
Built by Team Good Girls Guide to AI Β· Systems Β· Product
Inspiration
As online content grows exponentially, scalable and intelligent moderation becomes critical infrastructure. SafeStream AI explores how AI and reinforcement learning can work together to make moderation smarter, faster, and more adaptive β reducing both false positives and harmful content slipping through.