Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
model-index:
|
3 |
+
- name: twitter-roberta-base-hate-latest
|
4 |
+
results: []
|
5 |
+
pipeline_tag: text-classification
|
6 |
+
language:
|
7 |
+
- en
|
8 |
+
---
|
9 |
+
# cardiffnlp/twitter-roberta-base-hate-multiclass-latest
|
10 |
+
|
11 |
+
This model is a fine-tuned version of [cardiffnlp/twitter-roberta-base-2022-154m](https://huggingface.co/cardiffnlp/twitter-roberta-base-2022-154m) for multiclass hate-speech classification. A combination of 13 different hate-speech datasets in the English language were used to fine-tune the model.
|
12 |
+
|
13 |
+
## Classes available
|
14 |
+
```
|
15 |
+
{
|
16 |
+
"sexism": 0,
|
17 |
+
"racism": 1,
|
18 |
+
"disability": 2,
|
19 |
+
"sexual_orientation": 3,
|
20 |
+
"religion": 4,
|
21 |
+
"other": 5,
|
22 |
+
"not-hate":6
|
23 |
+
}
|
24 |
+
```
|
25 |
+
|
26 |
+
## Following metrics are achieved
|
27 |
+
* Accuracy: 0.9419
|
28 |
+
* Macro-F1: 0.5752
|
29 |
+
* Weighted-F1: 0.9390
|
30 |
+
|
31 |
+
### Usage
|
32 |
+
Install tweetnlp via pip.
|
33 |
+
```shell
|
34 |
+
pip install tweetnlp
|
35 |
+
```
|
36 |
+
Load the model in python.
|
37 |
+
```python
|
38 |
+
import tweetnlp
|
39 |
+
model = tweetnlp.Classifier("cardiffnlp/twitter-roberta-base-hate-latest")
|
40 |
+
model.predict('Women are trash 2.')
|
41 |
+
>> {'label': 'sexism'}
|
42 |
+
model.predict('@user dear mongoloid respect sentiments & belief refrain totalitarianism. @user')
|
43 |
+
>> {'label': 'disability'}
|
44 |
+
|
45 |
+
```
|