Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
-
|
4 |
+
-
|
5 |
+
thumbnail:
|
6 |
+
tags:
|
7 |
+
-
|
8 |
+
-
|
9 |
+
-
|
10 |
+
license:
|
11 |
+
datasets:
|
12 |
+
-
|
13 |
+
-
|
14 |
+
metrics:
|
15 |
+
-
|
16 |
+
-
|
17 |
+
---
|
18 |
+
|
19 |
+
# Toxic language detection
|
20 |
+
|
21 |
+
## Model description
|
22 |
+
|
23 |
+
A toxic language detection model trained on tweeter data. The base model is Roberta-large. For more information,
|
24 |
+
including the **training data**, **limitations and bias**, please refer to the [paper](https://arxiv.org/pdf/2102.00086.pdf) and
|
25 |
+
Github [repo](https://github.com/XuhuiZhou/Toxic_Debias) for more details.
|
26 |
+
|
27 |
+
#### How to use
|
28 |
+
Note that LABEL_1 means toxic and LABEL_0 means non-toxic in the output.
|
29 |
+
|
30 |
+
```python
|
31 |
+
from transformers import pipeline
|
32 |
+
classifier = pipeline("text-classification",model='Xuhui/ToxDect-roberta-large', return_all_scores=True)
|
33 |
+
prediction = classifier("You are f**king stupid!", )
|
34 |
+
print(prediction)
|
35 |
+
|
36 |
+
"""
|
37 |
+
Output:
|
38 |
+
[[{'label': 'LABEL_0', 'score': 0.002632011892274022}, {'label': 'LABEL_1', 'score': 0.9973680377006531}]]
|
39 |
+
"""
|
40 |
+
```
|
41 |
+
|
42 |
+
## Training procedure
|
43 |
+
The random seed for this model is 22. For other details, please refer to the Github [repo](https://github.com/XuhuiZhou/Toxic_Debias) for more details.
|
44 |
+
|
45 |
+
### BibTeX entry and citation info
|
46 |
+
|
47 |
+
```bibtex
|
48 |
+
@inproceedings{zhou-etal-2020-debiasing,
|
49 |
+
title = {Challenges in Automated Debiasing for Toxic Language Detection},
|
50 |
+
author = {Zhou, Xuhui and Sap, Maarten and Swayamdipta, Swabha and Choi, Yejin and Smith, Noah A.},
|
51 |
+
booktitle = {EACL},
|
52 |
+
abbr = {EACL},
|
53 |
+
html = {https://www.aclweb.org/anthology/2021.eacl-main.274.pdf},
|
54 |
+
code = {https://github.com/XuhuiZhou/Toxic_Debias},
|
55 |
+
year = {2021},
|
56 |
+
bibtex_show = {true},
|
57 |
+
selected = {true}
|
58 |
+
}
|
59 |
+
```
|