Mnwa/russian-toxic
Viewer • Updated • 348k • 112 • 1
How to use dimkonn/russian-toxic-classifier with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="dimkonn/russian-toxic-classifier") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("dimkonn/russian-toxic-classifier")
model = AutoModelForSequenceClassification.from_pretrained("dimkonn/russian-toxic-classifier", device_map="auto")Модель бинарной классификации токсичности текстов на базе ai-forever/ru-en-RoSBERTa.
from transformers import pipeline
classifier = pipeline("text-classification", model="dimkonn/russian-toxic-classifier")
result = classifier("Вы что, совсем тупой?")
print(result)