Detect. Filter. Protect.
- Effortless Profanity Management: Instantly identify and censor profanity with just one line of code.
- Multilingual Capability: Fluent in five languages, designed for easy expansion.
- Optimized for Content Moderation: Perfect for efficiently moderating and cleaning up text in various applications.
- Automated: Smart language detection for quick setup.
easily install safetext with pip:
pip install safetext
>>> from safetext import SafeText
>>> st = SafeText(language='en')
>>> results = st.check_profanity(text='Some text with <profanity-word>.')
>>> results
{'word': '<profanity-word>', 'index': 4, 'start': 15, 'end': 31}
>>> text = st.censor_profanity(text='Some text with <profanity-word>.')
>>> text
"Some text with ***."
- from text:
>>> from safetext import SafeText
>>> eng_text = "This story is about to take a dark turn."
>>> st = SafeText(language=None)
>>> st.set_language_from_text(eng_text)
>>> st.language
'en'
- from .srt (subtitle) file:
>>> from safetext import SafeText
>>> turkish_srt_file_path = "turkish.srt"
>>> st = SafeText(language=None)
>>> st.set_language_from_srt(turkish_srt_file_path)
>>> st.language
'tr'
safetext is proudly open-source, available under the MIT License.
for inquiries or support, reach out via email or visit our website SafeVideo.
join our mission in refining content moderation!
contribute by:
- adding new languages: create a folder with the ISO 639-1 code and include a
words.txt
. - enhancing word lists: improve detection accuracy.
- sharing feedback: your ideas can shape
safetext
.
see our contributing guidelines for more.
meet our awesome contributors who make safetext better every day!