saattrupdan
commited on
Commit
•
0e963f5
1
Parent(s):
3aacf18
Update README.md
Browse files
README.md
CHANGED
@@ -21,6 +21,24 @@ The model achieves SOTA on a test set consisting of 600 Facebook comments annota
|
|
21 |
| [`DaNLP/da-electra-hatespeech-detection`](https://huggingface.co/DaNLP/da-electra-hatespeech-detection) | 86.43% | 56.28% | 68.17% | 60.50% |
|
22 |
| [`Guscode/DKbert-hatespeech-detection`](https://huggingface.co/Guscode/DKbert-hatespeech-detection) | 75.41% | 42.79% | 54.60% | 46.84% |
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
## Training procedure
|
25 |
|
26 |
### Training hyperparameters
|
|
|
21 |
| [`DaNLP/da-electra-hatespeech-detection`](https://huggingface.co/DaNLP/da-electra-hatespeech-detection) | 86.43% | 56.28% | 68.17% | 60.50% |
|
22 |
| [`Guscode/DKbert-hatespeech-detection`](https://huggingface.co/Guscode/DKbert-hatespeech-detection) | 75.41% | 42.79% | 54.60% | 46.84% |
|
23 |
|
24 |
+
## Using the model
|
25 |
+
|
26 |
+
You can use the model simply by running the following:
|
27 |
+
|
28 |
+
```python
|
29 |
+
>>> from transformers import pipeline
|
30 |
+
>>> offensive_text_pipeline = pipeline(model="xlm-roberta-base-offensive-text-detection-da")
|
31 |
+
>>> offensive_text_pipeline("Din store idiot")
|
32 |
+
[{'label': 'offensive', 'score': 0.9874388575553894}]
|
33 |
+
```
|
34 |
+
|
35 |
+
Processing multiple documents at the same time can be done as follows:
|
36 |
+
|
37 |
+
```python
|
38 |
+
>>> offensive_text_pipeline(["Din store idiot", "ej hvor godt :)"])
|
39 |
+
[{'label': 'offensive', 'score': 0.9874388575553894}, {'label': 'not offensive', 'score': 0.999760091304779}]
|
40 |
+
```
|
41 |
+
|
42 |
## Training procedure
|
43 |
|
44 |
### Training hyperparameters
|