Glin-Profanity is a JavaScript/TypeScript and Python library for content moderation, designed to filter profanity and offensive language. It surpasses simple word-list filters by detecting various evasion techniques like leetspeak and Unicode homoglyphs. The library offers built-in dictionaries for 23 languages and optional ML toxicity detection through TensorFlow.js. It boasts impressive performance, processing millions of operations per second with LRU caching. Glin-Profanity can be used in Node.js, browsers, and Python environments. Installation is straightforward through npm or pip, with example code templates provided for various use cases. Key features include leetspeak and unicode normalization, multi-language support, and auto-replacement of profane words. The library supports severity-based moderation and provides a React hook for real-time input. It also integrates ML toxicity detection, analyzing content locally. Finally, the library is open source, and has a live demo, and extensive documentation.
dev.to
dev.to
Create attached notes ...
