Build content moderation API with transformers
Task
Implement AI-powered content moderation service
Requirements
- Use HuggingFace transformers for text classification
- Multi-label classification (toxic, spam, harassment, etc.)
- Support multiple languages (EN, ES, FR, DE)
- Real-time inference with <200ms latency
- Explainability via attention weights
Models to Evaluate
- RoBERTa-large for toxicity
- DistilBERT for speed
- Multilingual BERT for i18n
API Design
-
POST /api/v1/moderate- Analyze text content -
POST /api/v1/moderate/batch- Batch processing - Response includes labels + confidence scores
Integration
- Android and iOS apps will call this API
- Must handle high throughput (1000s req/min)
Estimated effort
1.5-2 weeks