tankoooo commited on
Commit
8a4a6af
·
verified ·
1 Parent(s): e28e1e1

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +61 -0
README.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: ru
3
+ license: mit
4
+ tags:
5
+ - text-classification
6
+ - toxicity
7
+ - russian
8
+ - finetuned
9
+ base_model: ai-forever/ru-en-RoSBERTa
10
+ pipeline_tag: text-classification
11
+ ---
12
+
13
+ # Toxicity Classifier for Russian Texts
14
+
15
+ ## Описание
16
+ Модель для бинарной классификации токсичности русскоязычных текстов.
17
+
18
+ ## Задача
19
+ - Класс 0: Нетоксичный текст
20
+ - Класс 1: Токсичный текст
21
+
22
+ ## Метрики на тестовой выборке
23
+
24
+ | Метрика | Значение |
25
+ |---------|----------|
26
+ | Accuracy | 0.0000 |
27
+ | F1-Score | 0.0000 |
28
+ | Precision | 0.0000 |
29
+ | Recall | 0.0000 |
30
+ | ROC-AUC | 0.0000 |
31
+ | MCC | 0.0000 |
32
+
33
+ ## Использование
34
+
35
+ ```python
36
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
37
+ import torch
38
+
39
+ model_name = 'tankoooo/toxicity-classifier-ru'
40
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
41
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
42
+
43
+ def predict_toxicity(text):
44
+ inputs = tokenizer(text, return_tensors='pt', max_length=128, truncation=True, padding=True)
45
+ with torch.no_grad():
46
+ outputs = model(**inputs)
47
+ probs = torch.softmax(outputs.logits, dim=-1)
48
+ return probs[0][1].item()
49
+
50
+ # Пример
51
+ print(predict_toxicity('Здравствуйте, чем могу помочь?'))
52
+ ```
53
+
54
+ ## Датасет
55
+ Модель обучена на датасете: [tankoooo/toxicity-classification-ru](https://huggingface.co/datasets/tankoooo/toxicity-classification-ru)
56
+
57
+ ## Автор
58
+ tankoooo
59
+
60
+ ## Лицензия
61
+ MIT