Model Details
Model Description
This model is fine-tuned on the DistilBERT base model (distilbert-base-uncased) to classify text into five distinct emotions. It is trained on the Emotion Dataset using the Hugging Face Trainer API, leveraging the powerful DistilBERT architecture.
The five emotion classes predicted by the model are as follows:
-> Label 0 - Happiness
-> Label 1 - Love
-> Label 2 - Neutral
-> Label 3 - Sadness
-> Label 4 - Worry
DistilBERT, a smaller and faster version of the BERT architecture, was used for this model due to its computational efficiency and performance. DistilBERT is pretrained using a teacher-student training approach where the BERT base model acts as the teacher, allowing DistilBERT to retain much of BERT's accuracy while being lighter and faster.
This fine-tuned model is ideal for applications requiring emotion detection in textual data, such as:
Sentiment analysis
Social media monitoring
Chatbots and virtual assistants
Customer feedback analysis
The model is trained using transfer learning to adapt the general language understanding capabilities of DistilBERT to the specific task of multi-class emotion classification.
Uses
The model can be used for analyzing the emotional tone of conversations, tweets, or other textual data.
It is suitable for production use in systems where inference speed and lightweight architecture are crucial.
Feel free to modify further based on any additional details you'd like to emphasize!
How to Get Started with the Model
Use the code below to get started with the model.
1#importing pipeline
2from transformers import pipeline
3
4#initializing my model
5model = pipeline(task="sentiment-analysis",
6 model="SagarVidya/distilbert-emotion-model_v4")
7
8#prediction - Prompt 1
9
10prediction1 = model("You are the light of my life; every moment with you feels magical.")
11
12print("Sentiment of the 1st prompt: " + str(prediction1))
13
14
15#prediction - Prompt 2
16
17prediction2 = model("""
18
19After years of building a life together, I never thought I’d have to say goodbye to you.
20The house feels so empty now, the silence heavier than I ever imagined.
21Every corner holds a memory of us, and yet, you're not here to share it.
22How do I move forward when my heart is still clinging to the past we promised we’d never leave behind?
23
24""")
25print("Sentiment of the 2nd prompt: " + str(prediction2))
26
27RESULT
28
29Sentiment of the 1st prompt: [{'label': 'LABEL_1', 'score': 0.8571325540542603}] ##Love
30Sentiment of the 2nd prompt: [{'label': 'LABEL_3', 'score': 0.974511981010437}] ##Sadness
31
Model Card Authors [optional]
Vidya Sagar (Fine-tuning and Documentation)
- Original Pretrained Model by Hugging Face: DistilBERT
Model Card Contact