nayeems94 commited on
Commit
65c0bdd
·
verified ·
1 Parent(s): 30d4cf5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +53 -3
README.md CHANGED
@@ -1,3 +1,53 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - goemotions
5
+ - emotion-detection
6
+ - text-classification
7
+ - bert
8
+ ---
9
+
10
+ # Fine-tuned GoEmotions Model
11
+
12
+ This repository contains a BERT-based model fine-tuned on the **GoEmotions** dataset to classify text into one of 28 emotions.
13
+
14
+ ## Model Details
15
+ - **Base Model**: BERT
16
+ - **Dataset**: GoEmotions (Google's dataset with 28 emotions + neutral)
17
+ - **Task**: Multi-class emotion detection
18
+ - **Fine-tuned by**: nayeemsam
19
+
20
+ ## Supported Emotions
21
+ The model predicts the following emotions:
22
+ - admiration, amusement, anger, annoyance, approval, caring, confusion, curiosity, desire, disappointment, disapproval, disgust, embarrassment, excitement, fear, gratitude, grief, joy, love, nervousness, optimism, pride, realization, relief, remorse, sadness, surprise, neutral
23
+
24
+ ## How to Use
25
+
26
+ ```python
27
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
28
+
29
+ # Load model and tokenizer
30
+ model = AutoModelForSequenceClassification.from_pretrained("nayeemsam/my-goemotions-finetuned")
31
+ tokenizer = AutoTokenizer.from_pretrained("nayeemsam/my-goemotions-finetuned")
32
+
33
+ # Example text
34
+ text = "I am feeling so frustrated and angry!"
35
+
36
+ # Tokenize
37
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, padding="max_length", max_length=128)
38
+
39
+ # Predict
40
+ outputs = model(**inputs)
41
+ logits = outputs.logits
42
+ predicted_class_id = logits.argmax(dim=-1).item()
43
+
44
+ # Emotion labels
45
+ id2label = {
46
+ 0: 'admiration', 1: 'amusement', 2: 'anger', 3: 'annoyance', 4: 'approval', 5: 'caring',
47
+ 6: 'confusion', 7: 'curiosity', 8: 'desire', 9: 'disappointment', 10: 'disapproval',
48
+ 11: 'disgust', 12: 'embarrassment', 13: 'excitement', 14: 'fear', 15: 'gratitude',
49
+ 16: 'grief', 17: 'joy', 18: 'love', 19: 'nervousness', 20: 'optimism', 21: 'pride',
50
+ 22: 'realization', 23: 'relief', 24: 'remorse', 25: 'sadness', 26: 'surprise', 27: 'neutral'
51
+ }
52
+
53
+ print(f"Predicted emotion: {id2label[predicted_class_id]}")