You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.
from typing import Dict
from dostoevsky.models import FastTextToxicModel
from dostoevsky.tokenization import RegexTokenizer
tokenizer = RegexTokenizer()
toxic_model = FastTextToxicModel(tokenizer=tokenizer)
messages = [ 'привет', 'я люблю тебя!!', 'малолетние дебилы' ]
results = toxic_model.predict(messages, k=2)
for message, sentiment in zip(messages, results):
print(message, '->', sentiment)
Output:
привет -> {'normal': 0.9972950220108032, 'toxic': 0.0026416745968163013} я люблю тебя!! -> {'toxic': 1.0000100135803223, 'normal': 1.0000003385357559e-05} малолетние дебилы -> {'toxic': 1.0000100135803223, 'normal': 1.0000003385357559e-05}
я люблю тебя!! has same toxic value with малолетние дебилы
The text was updated successfully, but these errors were encountered: