skillfed

alt-profanity-check

A fast, robust library to check for offensive language in strings. Dropdown replacement of "profanity-check".

alt-profanity-check v1.9.0 324.9K downloads/30d#7,591 on PyPI92
Permissive license Active released

What it is and what it does

Alt-profanity-check is a maintained fork providing fast offensive-language detection for Python applications. It uses a linear SVM model trained on 200k labeled text samples from hate-speech and toxic-comment datasets, combined with scikit-learn's CountVectorizer and LinearSVC to classify input strings as offensive or clean. The package returns either binary predictions (0 or 1) or probability scores, making it suitable for content moderation pipelines.

The library trades some accuracy for speed compared to more sophisticated NLP approaches, but avoids the brittleness of hard-coded word blacklists. It depends on scikit-learn and joblib, and the maintainer aligns package versions with scikit-learn releases to ensure model compatibility. The package is actively maintained and requires Python 3.11 or newer; older Python versions require pinning to specific package versions.

Use it for:

  • Filter user-generated comments or forum posts in real time to flag potentially offensive content for review.
  • Pre-screen chat messages or social media content in moderation workflows before human review.
  • Detect toxic language in customer support tickets or feedback to route sensitive cases appropriately.
  • Classify text datasets for research on hate speech or offensive language patterns.
  • Implement content policies in multiplayer games or collaborative platforms by scoring text submissions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Detects offensive or profane language in text strings using a machine-learning model trained on labeled datasets, returning binary classifications or probability scores.

Yes, if you need fast, model-based profanity detection and can target Python 3.11+. The package is actively maintained, has no known vulnerabilities, and offers better accuracy than blacklist-based alternatives with minimal install friction. The main trade-off is the strict Python version requirement and scikit-learn version pinning; treat predictions as heuristics, not ground truth, and test on your specific use case before deploying.

Install

alt-profanity-check on PyPI

pip

pip install alt-profanity-check

uv

uv add alt-profanity-check

poetry

poetry add alt-profanity-check

Installing alt-profanity-check

Before you install

Low friction: pure Python wheel with only scikit-learn and joblib as runtime dependencies. Actively maintained with a release 64 days ago; requires Python 3.11 or newer, which may constrain adoption on older codebases.

License in practice

MIT license (permissive); you can use, modify, and distribute this package freely with minimal legal restrictions.

Quickstart

pip install alt-profanity-check

from alt-profanity-check import predict, predict_prob

predict(['fuck you'])
# [1]

predict_prob(['go to hell, you scum'])
# [0.7618861]

Requires Python 3.11 or newer; scikit-learn version must match the package version (e.g., alt-profanity-check 1.9.0 expects scikit-learn 1.9.0).

Verify before relying

  • Whether the package's scikit-learn version pinning strategy is enforced strictly or merely recommended.
  • Current accuracy metrics on modern datasets; the description cites benchmarks from December 2018.
  • Whether the command-line interface is available in the current version.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 2 — scikit-learn, joblib
Maintenance actively maintained — 64 days since the last release
Last repo commit
First released
Downloads 324,852/month — #7,591 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: alt_profanity_check-1.9.0-py3-none-any.whl

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

profanity detection libraryoffensive language classifiertext content moderationprofanity check pythonhate speech detectiontoxic comment classifierbad word detector
content-moderationtext-classificationmachine-learning

More Linguistic packages