How to use from the
Use from the
Transformers library
# 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")
Quick Links

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
Safetensors
Model size
0.1B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for hrrbb/emotion-bert

Finetuned
(7,255)
this model