Update README.md
Browse files
README.md
CHANGED
@@ -22,3 +22,28 @@ The metrics obtained from test dataset is as follows
|
|
22 |
| macro avg | 0.96 | 0.96 | 0.96 | 26270 |
|
23 |
| weighted avg | 0.97 | 0.97 | 0.97 | 26270 |
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
| macro avg | 0.96 | 0.96 | 0.96 | 26270 |
|
23 |
| weighted avg | 0.97 | 0.97 | 0.97 | 26270 |
|
24 |
|
25 |
+
|
26 |
+
## How to use
|
27 |
+
```python
|
28 |
+
from transformers import BertTokenizer, BertForSequenceClassification
|
29 |
+
|
30 |
+
# load tokenizer and model weights
|
31 |
+
tokenizer = BertTokenizer.from_pretrained('SkolkovoInstitute/russian_toxicity_classifier')
|
32 |
+
model = BertForSequenceClassification.from_pretrained('SkolkovoInstitute/russian_toxicity_classifier')
|
33 |
+
|
34 |
+
# prepare the input
|
35 |
+
batch = tokenizer.encode('ты супер', return_tensors='pt')
|
36 |
+
|
37 |
+
# inference
|
38 |
+
model(batch)
|
39 |
+
```
|
40 |
+
|
41 |
+
|
42 |
+
## Licensing Information
|
43 |
+
|
44 |
+
[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].
|
45 |
+
|
46 |
+
[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]
|
47 |
+
|
48 |
+
[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
|
49 |
+
[cc-by-nc-sa-image]: https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png
|