--- id: detoxify version: "0.5.2" license: unclear license_treatment: permissive maintenance: active --- # detoxify — A python library for detecting toxic comments License: permissive · Maintenance: active · Downloads: 110.5K/mo ## What it is and what it does Detoxify is a Python library that wraps pre-trained transformer models to classify text comments for toxic content. It provides three model variants—original, unbiased, and multilingual—each trained on Jigsaw challenge datasets to detect different types of toxicity including threats, obscenity, insults, and identity-based attacks. The models return confidence scores for each toxicity category, allowing developers to programmatically flag harmful content. The package is built on transformers and PyTorch Lightning, with low installation friction via a pure Python wheel. It's designed for research and content moderation workflows rather than as a production-grade system; the documentation explicitly acknowledges limitations around bias (e.g., flagging swearing regardless of intent) and recommends fine-tuning on carefully constructed datasets for real-world deployment. The multilingual model supports seven languages with documented per-language performance metrics. Use it for: - Flag potentially harmful user comments in forums or social platforms for human review by moderators. - Rank or filter comments in a dataset by toxicity score to prioritize moderation efforts. - Build a content safety pipeline that rejects or quarantines submissions exceeding a toxicity threshold. - Analyze multilingual comment datasets across seven languages to identify toxic patterns by region or language. - Fine-tune the pre-trained models on domain-specific comment data (e.g., gaming, healthcare) to improve detection accuracy. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Detoxify classifies text comments for toxic content using pre-trained transformer models, returning confidence scores across categories like toxicity, obscenity, threats, and identity-based attacks. Yes, if you need to add toxicity classification to a Python application or research pipeline. The package is actively maintained, has no known vulnerabilities, and offers permissive licensing. However, treat it as a research tool or first-pass filter rather than a production content moderation system—the documentation warns of bias limitations and recommends careful validation and fine-tuning before deployment in high-stakes scenarios. ## Install pip install detoxify uv add detoxify poetry add detoxify ## Installing detoxify Before you install: Low friction install with a pure Python wheel. The package is actively maintained with a recent commit on 2026-07-06 and has been in active development since 2020-11-09, suggesting stable ongoing support. License in practice: Licensed under Apache Software License (permissive), meaning you can use, modify, and distribute the package freely with minimal restrictions, making it suitable for both commercial and research applications. Quickstart: pip install detoxify from detoxify import Detoxify results = Detoxify('original').predict('example text') results = Detoxify('multilingual').predict(['example text', 'ejemplo de texto']) Requires transformers, torch, and sentencepiece as runtime dependencies; torch installation may require system-level setup depending on your platform (CPU vs GPU). Verify before relying: - Whether the multilingual model covers languages beyond the documented seven (English, French, Spanish, Italian, Portuguese, Turkish, Russian). - Performance characteristics and latency for batch inference on large comment volumes. - How model predictions handle edge cases like sarcasm, code-switching, or domain-specific terminology. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 110.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags toxic comment detection, toxicity classification, hate speech detection, content moderation, multilingual toxicity, offensive language detection, comment toxicity scoring, content-moderation, nlp, transformer-models [View on SkillFed](https://skillfed.io/packages/detoxify) · [View on PyPI](https://pypi.org/project/detoxify/)