Last active
March 29, 2022 07:48
-
-
Save pemagrg1/08a84755538df01fa81a18730aa22250 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Github Source: https://github.com/unitaryai/detoxify | |
saving a glimpse of https://www.section.io/engineering-education/building-a-toxicity-classifier/ | |
Toxicity detection using Detoxify | |
pip install detoxify | |
""" | |
from detoxify import Detoxify | |
predictor = Detoxify('multilingual') | |
print(predictor.predict('Why are you so fat?')) | |
""" | |
OUTPUT: {'identity_attack': 0.0020285994, | |
'insult': 0.8864248, | |
'obscene': 0.0039239605, | |
'severe_toxicity': 9.833861e-05, | |
'sexual_explicit': 0.0007071728, | |
'threat': 0.00047757424, | |
'toxicity': 0.9415722} | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment