Instructions to use fasherr/toxicity_rubert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fasherr/toxicity_rubert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="fasherr/toxicity_rubert")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("fasherr/toxicity_rubert") model = AutoModelForSequenceClassification.from_pretrained("fasherr/toxicity_rubert") - Notebooks
- Google Colab
- Kaggle
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("fasherr/toxicity_rubert")
model = AutoModelForSequenceClassification.from_pretrained("fasherr/toxicity_rubert")Quick Links
A model for toxicity classification in Russian texts.
Fine-tuned based on the DeepPavlov/rubert-base-cased-conversational model.
It's a binary classifier designed to detect toxicity in text.
- Label 0 (NEUTRAL): Neutral text
- Label 1 (TOXIC): Toxic text / Insults / Threats
Dataset
This model was trained on two datasets:
Russian Language Toxic Comments
Usage
from transformers import pipeline
classifier = pipeline("text-classification", model="fasherr/toxicity_rubert")
text_1 = "Ты сегодня прекрасно выглядишь!"
text_2 = "Ты очень плохой человек"
print(classifier(text_1))
# [{'label': 'NEUTRAL', 'score': 0.99...}]
print(classifier(text_2))
#[{'label': 'TOXIC', 'score': 1}]
Eval results
| Category | Accuracy | Precision | Recall | F1-Score | AUC-ROC | Support |
|---|---|---|---|---|---|---|
| Overall | 97.93% | 96.37% | 96.86% | 96.61% | 0.9962 | 26271 |
| Neutral | - | 98.88% | 98.57% | 98.72% | - | 21347 |
| Toxic | - | 93.87% | 95.15% | 94.50% | - | 4924 |
- Downloads last month
- 31
Model tree for fasherr/toxicity_rubert
Base model
DeepPavlov/rubert-base-cased-conversational
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="fasherr/toxicity_rubert")