Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. IAM
  3. profanity-check

profanity-check

MITPython

A fast, robust Python library to detect offensive language in text using a machine learning model.

Visit WebsiteGitHubGitHub
656 stars123 forks0 contributors

What is profanity-check?

profanity-check is a Python library that detects profane or offensive language in text strings using a machine learning model. It solves the problem of inaccurate and slow profanity detection by training a linear SVM on a large dataset of labeled samples, providing fast and reliable predictions without relying on explicit blacklists.

Target Audience

Developers and data scientists building applications that require automated content moderation, such as social platforms, comment sections, or chat systems, where filtering offensive language is necessary.

Value Proposition

Developers choose profanity-check for its superior combination of speed and accuracy, leveraging a machine learning model that outperforms traditional wordlist-based libraries and slower, more complex alternatives.

Overview

A fast, robust Python library to check for offensive language in strings.

Use Cases

Best For

  • Moderating user comments on forums or social media platforms
  • Filtering offensive language in real-time chat applications
  • Screening text content in educational or collaborative tools
  • Enhancing content safety in automated customer support systems
  • Integrating profanity detection into Python-based web applications
  • Benchmarking or replacing slower libraries like profanity-filter

Not Ideal For

  • Detecting intentionally obfuscated profanity like 'f4ck' or 'b1tch'
  • Multilingual content moderation beyond English
  • High-stakes applications requiring zero-tolerance for moderation errors
  • Projects needing custom retraining or domain-specific profanity lists

Pros & Cons

Pros

High Test Accuracy

Achieves 95% test accuracy and balanced metrics like precision and recall, outperforming similar libraries such as profanity-filter, as shown in the README's comparison table.

Exceptional Speed

Processes predictions 300–4000 times faster than profanity-filter, with benchmarks showing 0.2 ms per prediction, making it ideal for real-time applications like chat moderation.

Contextual Detection

Uses a machine learning model without explicit blacklists, enabling it to detect phrases like 'You cocksucker' that wordlist-based libraries miss, as explained in the No Explicit Blacklist section.

Probability Scoring

Provides predict_prob() to output the probability a string is offensive, offering nuanced insights for fine-grained moderation decisions, as demonstrated in the usage examples.

Cons

Poor with Variants

Admits difficulty detecting less common variants like 'f4ck you' or 'you b1tch' due to their rarity in the training corpus, leading to potential misses, as noted in the Caveats section.

Limited Language Support

Trained exclusively on English datasets from sources like Kaggle, making it ineffective for profanity detection in other languages unless retrained, which isn't supported out-of-the-box.

Static Model

Offers no built-in retraining or customization options, so it cannot adapt to new slang or domain-specific terminology without manual intervention, relying solely on the pre-trained linear SVM.

Frequently Asked Questions

Quick Stats

Stars656
Forks123
Contributors0
Open Issues18
Last commit1 year ago
CreatedSince 2018

Tags

#profanity-filter#sklearn#python3#python#profanity-detection#bag-of-words#content-filtering#svm#scikit-learn#machine-learning#nlp

Built With

s
scikit-learn
P
Python
N
NumPy

Links & Resources

Website

Included in

IAM2.2k
Auto-fetched 1 day ago

Related Projects

List of Dirty, Naughty, Obscene, and Otherwise Bad WordsList of Dirty, Naughty, Obscene, and Otherwise Bad Words

List of Dirty, Naughty, Obscene, and Otherwise Bad Words

Stars3,394
Forks696
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub