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.0.tar.gz
(40.5 kB
view hashes)
Built Distribution
Close
Hashes for cleanse_speech-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b318d104df71e37695964c373c7eb9ab0ab08024acce03a18385c1f4417194f |
|
MD5 | 95fbf124fa5d52ce2c8e37e89c4e7bee |
|
BLAKE2b-256 | c7cd30e8161c5b651999e53cab812449342d0882318a6be1facc3736ea387ce9 |