Downloads · 30 days
3
13% of all-time downloads
MartynaKopyta/BERT_hate_offensive_tweets
BERT_hate_offensive_tweets is a text classification model from MartynaKopyta. 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.
BERT base uncased trained on the data that can be found here: MartynaKopyta/hateoffensivetweets to classify tweets as 0 - hate, 1 - offensive or 2 - neither.
Downloads · 30 days
3
13% of all-time downloads
All-time downloads
24
Public
Parameters
109M
876 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
BERT base uncased trained on the data that can be found here: MartynaKopyta/hate_offensive_tweets to classify tweets as 0 - hate, 1 - offensive or 2 - neither.
You can find the notebook used for training in my GitHub repo: MartynaKopyta/BERT_FINE-TUNING.
The dataset was not big enough for BERT to learn to classify 3 classes accurately, it is right 3/4 times.
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model = AutoModelForSequenceClassification.from_pretrained('MartynaKopyta/BERT_hate_offensive_tweets')
tokenizer = AutoTokenizer.from_pretrained('MartynaKopyta/BERT_hate_offensive_tweets')
Accuracy: 0.779373368146214
Classification Report:
precision recall f1-score support
0 0.74 0.68 0.71 1532
1 0.85 0.88 0.87 1532
2 0.74 0.78 0.76 1532
accuracy 0.78 4596
macro avg 0.78 0.78 0.78 4596
weighted avg 0.78 0.78 0.78 4596
Confusion Matrix:
[[1043 96 393]
[ 169 1343 20]
[ 204 132 1196]]
MCC: 0.670