Instructions to use hrrbb/emotion-bert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hrrbb/emotion-bert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="hrrbb/emotion-bert")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("hrrbb/emotion-bert") model = AutoModelForSequenceClassification.from_pretrained("hrrbb/emotion-bert", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Emotion BERT β Islamic Guidance Emotion Classifier
A fine-tuned BERT model for detecting emotions in English text, built as part of RUHI β an AI-powered Islamic guidance platform that recommends Quranic verses, Hadith, and Duas based on a user's emotional state.
Emotion Classes
| Label | Description |
|---|---|
neutral |
No strong emotion |
sadness |
Sorrow or unhappiness |
fear_anxiety |
Fear, stress, or nervousness |
happiness_gratitude |
Joy, thankfulness, contentment |
anger |
Irritation or rage |
regret_repentance |
Guilt or seeking forgiveness |
Model Details
- Base model:
bert-base-uncased - Task: Multi-label emotion classification (6 labels)
- Framework: Hugging Face Transformers (PyTorch)
- Input: English text (max 128 tokens)
- Output: Probability score for each emotion
Usage
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="hrrbb/emotion-bert",
top_k=None,
function_to_apply="sigmoid"
)
text = "I feel so lost and overwhelmed."
for r in classifier(text):
print(f"{r['label']}: {r['score']:.4f}")
- Downloads last month
- 27
Model tree for hrrbb/emotion-bert
Base model
google-bert/bert-base-uncased