Commit
·
d701327
1
Parent(s):
dd8a2fd
Update README.md
Browse files
README.md
CHANGED
@@ -22,6 +22,24 @@ The model almost achieves SOTA results while being 20x smaller, on a test set co
|
|
22 |
| [`Guscode/DKbert-hatespeech-detection`](https://huggingface.co/Guscode/DKbert-hatespeech-detection) | 75.41% | 42.79% | 54.60% | 46.84% |
|
23 |
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
## Training procedure
|
26 |
|
27 |
### Training hyperparameters
|
|
|
22 |
| [`Guscode/DKbert-hatespeech-detection`](https://huggingface.co/Guscode/DKbert-hatespeech-detection) | 75.41% | 42.79% | 54.60% | 46.84% |
|
23 |
|
24 |
|
25 |
+
## Using the model
|
26 |
+
|
27 |
+
You can use the model simply by running the following:
|
28 |
+
|
29 |
+
```python
|
30 |
+
>>> from transformers import pipeline
|
31 |
+
>>> offensive_text_pipeline = pipeline(model="electra-small-offensive-text-detection-da")
|
32 |
+
>>> offensive_text_pipeline("Din store idiot")
|
33 |
+
[{'label': 'offensive', 'score': 0.9874388575553894}]
|
34 |
+
```
|
35 |
+
|
36 |
+
Processing multiple documents at the same time can be done as follows:
|
37 |
+
|
38 |
+
```python
|
39 |
+
>>> offensive_text_pipeline(["Din store idiot", "ej hvor godt :)"])
|
40 |
+
[{'label': 'offensive', 'score': 0.9874388575553894}, {'label': 'not offensive', 'score': 0.999760091304779}]
|
41 |
+
```
|
42 |
+
|
43 |
## Training procedure
|
44 |
|
45 |
### Training hyperparameters
|