lihachev9 commited on
Commit
1c9d986
1 Parent(s): b756ecb

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +103 -0
README.md ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ru
4
+ - en
5
+ - fr
6
+ - it
7
+ - pt
8
+
9
+ tags:
10
+ - formal or informal classification
11
+
12
+ licenses:
13
+ - cc-by-nc-sa
14
+ ---
15
+
16
+ XLMRoberta-based classifier trained on XFORMAL and add Russian.
17
+
18
+
19
+ all
20
+
21
+ | | precision | recall | f1-score | support |
22
+ |--------------|-----------|----------|----------|---------|
23
+ | 0 | 0.744912 | 0.927790 | 0.826354 | 108019 |
24
+ | 1 | 0.889088 | 0.645630 | 0.748048 | 96845 |
25
+ | accuracy | | | 0.794405 | 204864 |
26
+ | macro avg | 0.817000 | 0.786710 | 0.787201 | 204864 |
27
+ | weighted avg | 0.813068 | 0.794405 | 0.789337 | 204864 |
28
+
29
+
30
+ en
31
+
32
+ | | precision | recall | f1-score | support |
33
+ |--------------|-----------|----------|----------|----------|
34
+ | 0 | 0.744912 | 0.927790 | 0.826354 | 108019 |
35
+ | 1 | 0.889088 | 0.645630 | 0.748048 | 96845 |
36
+ | accuracy | | | 0.889088 | 0.645630 |
37
+ | macro avg | 0.817000 | 0.786710 | 0.787201 | 204864 |
38
+ | weighted avg | 0.813068 | 0.794405 | 0.789337 | 204864 |
39
+
40
+ fr
41
+
42
+ | | precision | recall | f1-score | support |
43
+ |--------------|-----------|----------|----------|---------|
44
+ | 0 | 0.746709 | 0.925738 | 0.826641 | 21505 |
45
+ | 1 | 0.887305 | 0.650592 | 0.750731 | 19327 |
46
+ | accuracy | | | 0.795504 | 40832 |
47
+ | macro avg | 0.817007 | 0.788165 | 0.788686 | 40832 |
48
+ | weighted avg | 0.813257 | 0.795504 | 0.790711 | 40832 |
49
+
50
+ it
51
+
52
+ | | precision | recall | f1-score | support |
53
+ |--------------|-----------|----------|----------|---------|
54
+ | 0 | 0.721282 | 0.914669 | 0.806545 | 21528 |
55
+ | 1 | 0.864887 | 0.607135 | 0.713445 | 19368 |
56
+ | accuracy | | | 0.769024 | 40896 |
57
+ | macro avg | 0.793084 | 0.760902 | 0.759995 | 40896 |
58
+ | weighted avg | 0.789292 | 0.769024 | 0.762454 | 40896 |
59
+
60
+ pt
61
+
62
+ | | precision | recall | f1-score | support |
63
+ |--------------|-----------|----------|----------|---------|
64
+ | 0 | 0.717546 | 0.908167 | 0.801681 | 21637 |
65
+ | 1 | 0.853628 | 0.599700 | 0.704481 | 19323 |
66
+ | accuracy | | | 0.762646 | 40960 |
67
+ | macro avg | 0.785587 | 0.753933 | 0.753081 | 40960 |
68
+ | weighted avg | 0.781743 | 0.762646 | 0.755826 | 40960 |
69
+
70
+ ru
71
+
72
+ | | precision | recall | f1-score | support |
73
+ |--------------|-----------|----------|----------|---------|
74
+ | 0 | 0.741333 | 0.926500 | 0.823638 | 21211 |
75
+ | 1 | 0.888667 | 0.644733 | 0.747298 | 19301 |
76
+ | accuracy | | | 0.792259 | 40512 |
77
+ | macro avg | 0.815000 | 0.785617 | 0.785468 | 40512 |
78
+ | weighted avg | 0.811527 | 0.792259 | 0.787267 | 40512 |
79
+
80
+ ## How to use
81
+ ```python
82
+ from transformers import XLMRobertaTokenizerFast, XLMRobertaForSequenceClassification
83
+
84
+ # load tokenizer and model weights
85
+ tokenizer = XLMRobertaTokenizerFast.from_pretrained('SkolkovoInstitute/xlmr_formality_classifier')
86
+ model = XLMRobertaForSequenceClassification.from_pretrained('SkolkovoInstitute/xlmr_formality_classifier')
87
+
88
+ # prepare the input
89
+ batch = tokenizer.encode('ты супер', return_tensors='pt')
90
+
91
+ # inference
92
+ model(batch)
93
+ ```
94
+
95
+
96
+ ## Licensing Information
97
+
98
+ [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].
99
+
100
+ [![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]
101
+
102
+ [cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
103
+ [cc-by-nc-sa-image]: https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png