Downloads · 30 days
9
13% of all-time downloads
wetey/distilbert-base-uncased-measuring-hate-speech
distilbert-base-uncased-measuring-hate-speech is a text classification model from wetey. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model is part of the work done in <!-- add paper name --. <br The full code can be found at https://github.com/wetey/cluster-errors
Downloads · 30 days
9
13% of all-time downloads
All-time downloads
72
Public
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
This model is part of the work done in <!-- add paper name -->. <br> The full code can be found at https://github.com/wetey/cluster-errors
Use the code below to get started with the model.
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="wetey/distilbert-base-uncased-measuring-hate-speech")
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("wetey/distilbert-base-uncased-measuring-hate-speech")
model = AutoModelForSequenceClassification.from_pretrained("wetey/distilbert-base-uncased-measuring-hate-speech")
The model was fine-tuned on the ucberkeley-dlab/measuring-hate-speech dataset. <br>
We converted the continuous hatespeech scores to categorical labels using the ranges suggested by the authors. The ranges are listed on the HuggingFace Dataset card. <br>
Examples with hatespeech scores that are lower than -1 are considered supportive, between -1 and 0.5 are neutral, and scores greater than 0.5 are hatespeech. <br>
We remove duplicate examples along with those that received fewer than three total annotations, and we drop the neutral class. <br>
After these steps, we were left with 12,289 examples with 7497 examples labeled as supportive and 4792 labeled as hatespeech. We use 85% of the dataset for fine-tuning and 15% for testing.
The exact fine-tuning procedure followed can be found here
evaluation_strategy = 'epoch'
logging_steps = 1,
num_train_epochs = 5,
learning_rate = 1e-5,
eval_accumulation_steps = 2
Test set used can be found here
accuracy: 89.3% <br>
precision: 89.4% <br>
recall: 89.3% <br>
f1-score: 89.3% <br>
| Label | Precision | Recall | F1-score |
|---|---|---|---|
| supportive | 92% | 91% | 91% |
| hatespeech | 86% | 87% | 86% |