-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Дмитрий Филинов edited this page Feb 15, 2023
·
1 revision
Welcome to the toxicity-classification-module wiki!
Module for predicting toxicity messages in Russian and English
from toxicityclassifier import *
classifier = ToxicityClassificatorV1()
print(classifier.predict(text)) # (0 or 1, probability)
print(classifier.get_probability(text)) # probability
print(classifier.classify(text)) # 0 or 1
Weight for classification (if probability >= weight => 1 else 0)
classifier.weight = 0.5
Weight for language detection (English or Russian)
if the percentage of the Russian language >= language_weight, then the Russian model is used, otherwise the English one
classifier.language_weight = 0.5