Text Classification
Transformers
Safetensors
PyTorch
distilbert
hate-speech-detection
text-embeddings-inference
Instructions to use sathwika01/hate-speech-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sathwika01/hate-speech-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="sathwika01/hate-speech-classifier")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("sathwika01/hate-speech-classifier") model = AutoModelForSequenceClassification.from_pretrained("sathwika01/hate-speech-classifier") - Notebooks
- Google Colab
- Kaggle
| library_name: transformers | |
| tags: | |
| - text-classification | |
| - hate-speech-detection | |
| - distilbert | |
| - transformers | |
| - pytorch | |
| license: apache-2.0 | |
| datasets: | |
| - cardiffnlp/tweet_eval | |
| metrics: | |
| - f1 | |
| # Hate Speech Classifier — Fine-tuned DistilBERT | |
| ## Model Description | |
| A DistilBERT model fine-tuned for **binary hate speech detection** on the | |
| [TweetEval hate speech dataset](https://huggingface.co/datasets/cardiffnlp/tweet_eval). | |
| Classifies text as `hate` (1) or `non-hate` (0). | |
| - **Model type:** Text Classification (DistilBERT) | |
| - **Base model:** distilbert-base-uncased | |
| - **Language:** English | |
| - **Developed by:** Sathwika Raj Bandaru | |
| ## Training Details | |
| - **Dataset:** cardiffnlp/tweet_eval (hate subset) — 9,000 train / 1,000 validation / 2,970 test | |
| - **Epochs:** 3 | |
| - **Batch size:** 16 | |
| - **Max sequence length:** 128 | |
| ## Evaluation Results | |
| | Split | F1 (weighted) | | |
| |-------|--------------| | |
| | Validation | 0.771 | | |
| | Test | 0.376 | | |
| ## How to Use | |
| ```python | |
| from transformers import pipeline | |
| classifier = pipeline("text-classification", | |
| model="sathwika01/hate-speech-classifier") | |
| classifier("This is an example text") | |
| ``` | |
| ## Intended Use | |
| Research and educational purposes — detecting hateful content in social media text. |