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")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("fasherr/toxicity_rubert") model = AutoModelForSequenceClassification.from_pretrained("fasherr/toxicity_rubert", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from fasherr/toxicity_rubert: direct link, hf CLI and curl.
- Browser
- Download file 1.53 kB
-
https://huggingface.co/fasherr/toxicity_rubert/resolve/main/README.md
- Command line
-
hf download hf://fasherr/toxicity_rubert/README.md
-
curl -L -o README.md https://huggingface.co/fasherr/toxicity_rubert/resolve/main/README.md
1.53 kB
| language: ru | |
| library_name: transformers | |
| pipeline_tag: text-classification | |
| tags: | |
| - toxicity | |
| - safetensors | |
| base_model: | |
| - DeepPavlov/rubert-base-cased-conversational | |
| A model for toxicity classification in Russian texts. | |
| Fine-tuned based on the [DeepPavlov/rubert-base-cased-conversational](https://huggingface.co/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: | |
| [Toxic Russian Comments](https://www.kaggle.com/datasets/alexandersemiletov/toxic-russian-comments) | |
| [Russian Language Toxic Comments](https://www.kaggle.com/datasets/blackmoon/russian-language-toxic-comments) | |
| **Usage** | |
| ```python | |
| 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 | |