Skip to main content

An intelligent Python library designed to detect and filter offensive language, ensuring respectful and constructive communication in any digital space.

Project description

cleanse-speech 🚀

PyPI version Downloads Downloads

Python🐍 3.9+ support.

A library for cleansing sensitive words in speech.

[!NOTE] This library is designed with the intent to promote a harmonious online environment by identifying and addressing offensive language. It is not intended to enforce strict censorship or infringe upon free speech. Our goal is to foster respectful communication and ensure that all users feel safe and included in online communities. By using this library, developers can help create spaces where open dialogue is encouraged while maintaining a level of decency and mutual respect.

Installation

pip install cleanse-speech

Usage

import io

from cleanse_speech import DLFA
from cleanse_speech import SpamShelf

if __name__ == '__main__':
    dfa = DLFA(words_resource=[
        ['你好'],
        io.BytesIO(b'sensitive'),
        SpamShelf.CN.ADVERTISEMENT,
    ])
    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.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.2.tar.gz (41.4 kB view details)

Uploaded Source

Built Distribution

cleanse_speech-0.1.2-py3-none-any.whl (43.4 kB view details)

Uploaded Python 3

File details

Details for the file cleanse_speech-0.1.2.tar.gz.

File metadata

  • Download URL: cleanse_speech-0.1.2.tar.gz
  • Upload date:
  • Size: 41.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.15.2 CPython/3.10.12 Linux/6.5.0-1018-azure

File hashes

Hashes for cleanse_speech-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e1712fba12eff2fed720eb1448773f69de4bd51d56720a8099277728a62f78c5
MD5 c7fb655c66d9e7df71303335e0855382
BLAKE2b-256 c048d629a98939b4fcc70ec209c905d9fc004f8a1ae45356ee1599a20a130645

See more details on using hashes here.

File details

Details for the file cleanse_speech-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cleanse_speech-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 43.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.15.2 CPython/3.10.12 Linux/6.5.0-1018-azure

File hashes

Hashes for cleanse_speech-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 88780af97bdf63ecd414bdc0602feb82987632a4fe1e5de56f112a73d6465d72
MD5 52d4d1ef6a458b76fb923f40865ea080
BLAKE2b-256 ed6e449ea7001c968f9b6573ccf7dad7aac2767c0629a4b14e7efc5d4f1049fc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page