ValX Functions
Detect profanity
Args:
text_data (list): A list of strings representing the text data to analyze.
language (str, optional): The language used to detect profanity. Defaults to 'English'. Available languages include: All, Arabic, AR, Czech, CS, Danish, DA, German, DE, English, EN, Esperanto, EO, Persian, Finnish, FI, Filipino, FIL, French, FR, French (CA), FR-CA-U-SD-CAQC, Hindi, HI, Hungarian, HU, Italian, IT, Japanese, JA, Kabyle, KAB, Korean, KO, Dutch, NL, Norwegian, NO, Polish, PL, Portuguese, PT, Russian, RU, Spanish, ES, Swedish, SV, Thai, TH, Klingon, TLH, Turkish, TR, Chinese, ZH. If set to `None` and `custom_words_list` is provided, only the custom list will be used.
custom_words_list (list[str], optional): A Python list of custom profanity words to detect. Defaults to `None`. If provided, these words will be used in addition to the selected language's wordlist, or exclusively if `language` is `None`.
Returns:
list: A list of dictionaries where each dictionary represents a detected instance of profanity.
Raises:
ValueError: If `language` is set to `None` and `custom_words_list` is not provided or is empty.
Each dictionary contains the following keys:
- "Line" (int): The line number where the profanity was detected.
- "Column" (int): The column number (position in the line) where the profanity starts.
- "Word" (str): The detected profanity word.
- "Language" (str): Indicates the source of the profanity detection (e.g., "English", "Custom", or "Custom + English" if a custom list is combined with a language).Remove profanity
Detect sensitive information
Remove sensitive information
Load custom profanity from file
Detect hate speech or offensive language
Remove hate speech or offensive language
Last updated