"Profanity(内置分类器)" (内置分类器)
"Profanity(内置分类器)" (内置分类器)
确定给定的文本是否包含亵渎内容.
类别
范例
打开所有单元 关闭所有单元基本范例 (2)
如果文本包含很重的言语,"Profanity" 内置分类器返回 True,否则为 False:
Classify["Profanity", Import["http://www.urbandictionary.com/random.php"]]Classify["Profanity", {"I love this movie", "I am so sad", "My phone broke again"}]Classify["Profanity", "This is a normal sentence", "Probabilities"]获取该分类器的 ClassifierFunction:
c = Classify["Profanity"]c[{"This is a regular sentense", "I am so sad", "My phone broke again"}]范围 (1)
加载对应的内置分类器的 ClassifierFunction:
c = Classify["Profanity"]Information[c, "Classes"]选项 (3)
ClassPriors (1)
使用自定义的 ClassPriors 限制可能的输出:
Classify["Profanity", "There is nothing good about the
fellas in this movie", ClassPriors -> <|True -> 0.5, False -> 0.5|>]IndeterminateThreshold (1)
使用自定义的 IndeterminateThreshold:
Classify["Profanity", "My car broke again", IndeterminateThreshold -> 0.99]UtilityFunction (1)
utility = Information[Classify["Profanity"], "UtilityFunction"]utility[True, False] = -1.;Classify["Profanity", Import["http://www.urbandictionary.com/random.php"], UtilityFunction -> utility]相关指南
-
▪
- 机器学习
历史
2018年引入 (11.3)