"Profanity" (Built-in Classifier)

Determine whether a given text contains profanity.



  • This classifier attempts to detect if the text contains offensive language.
  • The current version only works for the English language.


open allclose all

Basic Examples  (2)

Use the "Profanity" built-in classifier to return True if a text contains strong language and False otherwise:

Classify multiple examples:

Obtain the probabilities for the possible classes:

Obtain a ClassifierFunction for this classifier:

Apply the classifier to a list of texts:

Scope  (1)

Load the ClassifierFunction corresponding to the built-in classifier:

Obtain the possible classes:

Options  (3)

ClassPriors  (1)

Use a custom ClassPriors to restrict the possible outputs:

IndeterminateThreshold  (1)

Use a custom IndeterminateThreshold:

UtilityFunction  (1)

Obtain the utility function of the classifier:

Modify this utility function to penalize True being misclassified as False:

Classify a text using this new utility: