Instructions to use IMSyPP/hate_speech_en with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IMSyPP/hate_speech_en with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="IMSyPP/hate_speech_en")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("IMSyPP/hate_speech_en") model = AutoModelForSequenceClassification.from_pretrained("IMSyPP/hate_speech_en", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Create README.md
Browse files# English Hate Speech Classifier
This is a monolingual hate speech classifier for social media content in English language. The model was trained on a dataset of 103,190 YouTube comments and tested on a separately gathered test set of 20,554 YouTube comments. It is based on the BERT base pre-trained language model.
## Tokenizer
During training, the original tokenizer for BERT base language model was used. As such, it is recommended to use the same tokenizer during inference.
## Model output
The model classifies the input sentence into four distinct classes: appropriate, inappropriate, offensive and hateful.
The classes are encoded as follows:
* 0 - appropriate
* 1 - inappropriate
* 2 - offensive
* 3 - hateful