"Profanity" (Built-in Classifier)
-
See Also
- Classify
- NetModel
- TextCases
- TextSentences
- WolframLanguageData
-
- Classifiers
- Sentiment
- Spam
- FacebookTopic
-
- Methods
- NaiveBayes
- Related Guides
"Profanity" (Built-in Classifier)
Determine whether a given text contains profanity.
Classes
Examples
open all close allBasic Examples (2)
Use the "Profanity" built-in classifier to return True if a text contains strong language and False otherwise:
Classify["Profanity", Import["http://www.urbandictionary.com/random.php"]]Classify["Profanity", {"I love this movie", "I am so sad", "My phone broke again"}]Obtain the probabilities for the possible classes:
Classify["Profanity", "This is a normal sentence", "Probabilities"]Obtain a ClassifierFunction for this classifier:
c = Classify["Profanity"]Apply the classifier to a list of texts:
c[{"This is a regular sentense", "I am so sad", "My phone broke again"}]Scope (1)
Load the ClassifierFunction corresponding to the built-in classifier:
c = Classify["Profanity"]Information[c, "Classes"]Options (3)
ClassPriors (1)
Use a custom ClassPriors to restrict the possible outputs:
Classify["Profanity", "There is nothing good about the
fellas in this movie", ClassPriors -> <|True -> 0.5, False -> 0.5|>]IndeterminateThreshold (1)
Use a custom IndeterminateThreshold:
Classify["Profanity", "My car broke again", IndeterminateThreshold -> 0.99]UtilityFunction (1)
Obtain the utility function of the classifier:
utility = Information[Classify["Profanity"], "UtilityFunction"]Modify this utility function to penalize True being misclassified as False:
utility[True, False] = -1.;Classify a text using this new utility:
Classify["Profanity", Import["http://www.urbandictionary.com/random.php"], UtilityFunction -> utility]See Also
Classify NetModel TextCases TextSentences WolframLanguageData
Classifiers: Sentiment Spam FacebookTopic
Methods: NaiveBayes
Related Guides
History
Introduced in 2018 (11.3)