detoxify
A python library for detecting toxic comments
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires transformers, torch, and sentencepiece as runtime dependencies; torch installation may require system-level setup depending on your platform (CPU vs GPU).
- 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 · maintenance · safety
permissive license (permissive) — 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.
last release 2024-02-01 (925 days) · last repo commit 2026-07-06 · 1,289 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 110,480 downloads/mo, #12,457 on PyPI
Alternatives
Verify before relying
pip install detoxify
from detoxify import Detoxify
results = Detoxify('original').predict('example text')
results = Detoxify('multilingual').predict(['example text', 'ejemplo de texto'])- 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.
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 on this page. Verify before relying on it.
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
detoxify on PyPI
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.
Requires transformers, torch, and sentencepiece as runtime dependencies; torch installation may require system-level setup depending on your platform (CPU vs GPU).
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'])
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 | permissive license permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagestransformerstorchsentencepiece |
| Maintenance | Actively maintained 925 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 110,480 / month, #12,457 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: detoxify-0.5.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “toxic comment detection”
- detoxifyDetoxify classifies text comments for toxic content using pre-trained…
- alt-profanity-checkDetects offensive or profane language in text strings using a…
- comment-parserExtracts comments from source code files across multiple programming…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also alt-profanity-check · setfit · Genderize · pytorch-pretrained-bert · model2vec · azure-ai-contentsafety · torchtext · fasttext · facenet-pytorch · bertopic