Ban Topics Scanner
The Ban Topics Scanner employs Zero-Shot classification to identify and restrict specific topics in prompts. It helps maintain appropriate content boundaries and prevents potentially sensitive or controversial discussions.

Topic detection workflow using Zero-Shot classification
Implementation Guide
Key Features
- Zero-Shot topic classification
- Configurable topic restrictions
- Adjustable confidence thresholds
- Multi-topic detection
- Real-time content analysis
Common Restricted Topics
- Violence and extremism
- Religious controversies
- Political conflicts
- Adult content
- Discriminatory content
- Harmful misinformation
Configuration Options
- topics: List of topics to restrict
- threshold: Classification confidence threshold (default: 0.5)
- models: Zero-Shot classification models from HuggingFace
Topic Configuration Best Practices
- Use specific, well-defined topics
- Consider topic variations and synonyms
- Test with diverse input samples
- Monitor classification accuracy
- Regular topic list updates
Output Format
- sanitized_prompt: The analyzed text
- is_valid: Boolean indicating if restricted topics were detected
- risk_score: Topic detection confidence score (0-1)
Use Cases
- Educational platforms
- Customer service chatbots
- Content moderation systems
- Public forums
- Professional communication tools
Note: Topic classification accuracy depends on the quality of topic definitions. Refer to the model's training dataset for optimal topic formulation.
Tip: Experiment with longer, more descriptive topic phrases to improve classification accuracy. Regularly review and update topic lists based on user interactions and emerging needs.