😊 BERT-Emotions Emotion Classifier

🎯 Overview

A lightweight, Emotions-powered emotion classification model fine-tuned for short text sentiment/emotion detection using BERT architecture.

Each input text is tagged with one of 13 rich emotional categories, mapped to expressive emotions 🎭. This model is ideal for chatbot understanding, social media sentiment, and mental health analysis based on short messages.


πŸ’« Supported Emotions

Emotion Emoji
Sadness 😒
Anger 😠
Love ❀️
Surprise 😲
Fear 😱
Happiness πŸ˜„
Neutral 😐
Disgust 🀒
Shame πŸ™ˆ
Guilt πŸ˜”
Confusion πŸ˜•
Desire πŸ”₯
Sarcasm 😏

πŸš€ Use Cases

  • 🧠 Chatbot emotion understanding
  • 🎭 Social media sentiment tagging
  • πŸ” Mental health context detection
  • πŸ’¬ Smart replies and reactions
  • πŸ“Š Emotional tone analysis in text

πŸ› οΈ Usage

πŸ” Basic Inference Example

A minimal example to predict the emotion behind a simple sentence.

from transformers import pipeline

# Load the fine-tuned BERT Mini sentiment analysis model
sentiment_analysis = pipeline("text-classification", model="boltuix/bert-emotions")

# Analyze sentiment
result = sentiment_analysis("i love you")
print(result)

βœ… Output

[{'label': 'love', 'score': 0.8442274928092957}]

This means the model predicts the emotion as Love ❀️ with 84.42% confidence.


πŸ” Extended Example with Emoji Mapping

An enhanced version to map model output to human-readable emotion with emojis.

from transformers import pipeline

# Load the fine-tuned BERT-Emotions model
sentiment_analysis = pipeline("text-classification", model="boltuix/bert-emotion")

# Define label-to-emoji mapping
label_to_emoji = {
    "Sadness": "😒",
    "Anger": "😠",
    "Love": "❀️",
    "Surprise": "😲",
    "Fear": "😱",
    "Happiness": "πŸ˜„",
    "Neutral": "😐",
    "Disgust": "🀒",
    "Shame": "πŸ™ˆ",
    "Guilt": "πŸ˜”",
    "Confusion": "πŸ˜•",
    "Desire": "πŸ”₯",
    "Sarcasm": "😏"
}

# Input text
text = "i love you"

# Analyze emotion
result = sentiment_analysis(text)[0]
label = result["label"].capitalize()
emoji = label_to_emoji.get(label, "❓")

# Output
print(f"Text: {text}")
print(f"Predicted Emotion: {label} {emoji}")
print(f"Confidence: {result['score']:.2%}")

βœ… Output

Text: i love you
Predicted Emotion: Love ❀️
Confidence: 84.42%

This version enhances readability and gives an expressive emoji for the predicted emotion.


βš™οΈ Model Details

  • 🧠 Base: BERT (uncased)
  • πŸ”’ Classes: 13 emotions
  • πŸ—£οΈ Language: English
  • 🏷️ Output: Single-label classification
  • πŸ§ͺ Evaluation: Accuracy, F1, Precision, Recall

πŸ“¦ Model Card Info

  • Name: BERT-Emotions
  • Author: Boltuix
  • License: Apache-2.0
  • Version: v1.0
  • Tags: emotion, emoji, emotions, text-classification
  • Status: Public + Inference-ready

✍️ Contact

Downloads last month
68
Safetensors
Model size
11.2M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for boltuix/bert-emotion

Finetuned
boltuix/bert-lite
Finetuned
(1)
this model