An intelligent Python library designed to detect and filter offensive language, ensuring respectful and constructive communication in any digital space.
Project description
cleanse-speech 🚀
Python🐍 3.9+ support.
pip install cleanse-speech
Usage
from cleanse_speech import DLFA
if __name__ == '__main__':
dfa = DLFA(words_resource=[
['你好'],
io.BytesIO(b'sensitive'),
])
print(dfa.contains_illegal('This is a 你好 word.'))
print(dfa.censor_all('This is a 你好 word.'))
print(dfa.extract_illegal_words('This is a 你好 word.'))
dfa.update_words(['sensitive', 'word', 'new'])
print(dfa.contains_illegal('This is a new sensitive word.'))
print(dfa.censor_all('This is a new sensitive word.'))
print(dfa.extract_illegal_words('This is a new sensitive word.'))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cleanse_speech-0.1.1.tar.gz
(40.7 kB
view hashes)
Built Distribution
Close
Hashes for cleanse_speech-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c6c4455d369825b1850be7510f835d4b790305116f6e33875b5437a3228e2c7 |
|
MD5 | aa1a03a3a24e619611dfd75068d7fa21 |
|
BLAKE2b-256 | 294f2b6760569c55a2b4a91ab229bb65f82be29faa76e01ba936d7b554e9661f |