Downloads · 30 days
15
2% of all-time downloads
alexandrainst/da-offensive-detection-small
da-offensive-detection-small is a text classification model from alexandrainst. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of Maltehb/aelaectra-danish-electra-small-cased on a dataset consisting of approximately 5 million Facebook comments on DR's public Facebook pages. The labels have been automatically…
Downloads · 30 days
15
2% of all-time downloads
All-time downloads
731
Public
Parameters
13.7M
110 MB on disk
Likes
2
Public
Click a slice to open those files.
.bin55 MB · 50%
How the weights are stored.
F3213.7M · 100%
From the Hugging Face model README
This model is a fine-tuned version of Maltehb/aelaectra-danish-electra-small-cased on a dataset consisting of approximately 5 million Facebook comments on DR's public Facebook pages. The labels have been automatically generated using weak supervision, based on the Snorkel framework.
The model almost achieves SOTA results while being 20x smaller, on a test set consisting of 600 Facebook comments annotated using majority vote by three annotators, of which 35.8% were labelled as offensive:
| Model | Precision | Recall | F1-score | F2-score |
|---|---|---|---|---|
alexandrainst/da-offensive-detection-base | 74.81% | 89.77% | 81.61% | 86.32% |
alexandrainst/da-offensive-detection-small (this) | 74.13% | 89.30% | 81.01% | 85.79% |
A&ttack | 97.32% | 50.70% | 66.67% | 56.07% |
alexandrainst/da-hatespeech-detection-small | 86.43% | 56.28% | 68.17% | 60.50% |
Guscode/DKbert-hatespeech-detection | 75.41% | 42.79% | 54.60% | 46.84% |
You can use the model simply by running the following:
>>> from transformers import pipeline
>>> offensive_text_pipeline = pipeline(model="alexandrainst/da-offensive-detection-small")
>>> offensive_text_pipeline("Din store idiot")
[{'label': 'Offensive', 'score': 0.9997463822364807}]
Processing multiple documents at the same time can be done as follows:
>>> offensive_text_pipeline(["Din store idiot", "ej hvor godt :)"])
[{'label': 'Offensive', 'score': 0.9997463822364807}, {'label': 'Not offensive', 'score': 0.9996451139450073}]
The following hyperparameters were used during training: