Mango-Juice commited on
Commit
ab71a03
ยท
verified ยท
1 Parent(s): 8f410a1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +34 -18
README.md CHANGED
@@ -5,7 +5,6 @@ datasets:
5
  - IconicAI/DDD
6
  language:
7
  - en
8
- - ko
9
  metrics:
10
  - accuracy
11
  - f1
@@ -13,18 +12,35 @@ base_model:
13
  - Mango-Juice/trpg_mlm
14
  - microsoft/deberta-v3-large
15
  library_name: transformers
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  ---
 
17
  # GoEmotions Fine-tuned Model
18
 
19
- ์ด ๋ชจ๋ธ์€ GoEmotions ๋ฐ์ดํ„ฐ์…‹ ๋ฐ TRPG ๋ฌธ์žฅ์œผ๋กœ ํ›ˆ๋ จ๋œ ๋‹ค์ค‘ ๊ฐ์ • ๋ถ„๋ฅ˜ ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค.
20
 
21
- ## ๋ชจ๋ธ ์ •๋ณด
22
  - **Base Model**: Mango-Juice/trpg_mlm
23
  - **Task**: Multi-label Emotion Classification
24
- - **Labels**: 28๊ฐœ์˜ ๊ฐ์ • ๋ผ๋ฒจ
25
- - **Training**: 2์ฐจ ํŒŒ์ธํŠœ๋‹ ์™„๋ฃŒ (goEmotions ๋ฐ์ดํ„ฐ ๋ฐ TRPG ๋ฌธ์žฅ ๋ฐ์ดํ„ฐ)
26
 
27
- ## ๊ฐ์ • ๋ผ๋ฒจ ๋ชฉ๋ก
28
  - admiration
29
  - amusement
30
  - anger
@@ -54,17 +70,17 @@ library_name: transformers
54
  - surprise
55
  - neutral
56
 
57
- ## ์‚ฌ์šฉ ๋ฐฉ๋ฒ•
58
 
59
  ```python
60
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
61
  import torch
62
 
63
- # ๋ชจ๋ธ๊ณผ ํ† ํฌ๋‚˜์ด์ € ๋กœ๋“œ
64
  tokenizer = AutoTokenizer.from_pretrained("Mango-Juice/trpg_emotion_classification")
65
  model = AutoModelForSequenceClassification.from_pretrained("Mango-Juice/trpg_emotion_classification")
66
 
67
- # ์ถ”๋ก 
68
  def predict_emotions(text):
69
  inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=128)
70
  with torch.no_grad():
@@ -74,18 +90,18 @@ def predict_emotions(text):
74
  emotion_labels = ['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']
75
  return {emotion: float(prob) for emotion, prob in zip(emotion_labels, probs)}
76
 
77
- # ์˜ˆ์‹œ
78
  text = "I am so happy today!"
79
  emotions = predict_emotions(text)
80
  print(emotions)
81
  ```
82
 
83
- ## ์„ฑ๋Šฅ
84
- - Fine-tuning ์™„๋ฃŒ๋œ ๋ชจ๋ธ๋กœ ํ–ฅ์ƒ๋œ ๊ฐ์ • ๋ถ„๋ฅ˜ ์„ฑ๋Šฅ ์ œ๊ณต
85
- - ํฌ์†Œ ํด๋ž˜์Šค์— ๋Œ€ํ•œ ๋ฐ์ดํ„ฐ ์ฆ๊ฐ• ์ ์šฉ
86
 
87
- ## ํ›ˆ๋ จ ์„ธ๋ถ€์‚ฌํ•ญ
88
- - ๋ฐ์ดํ„ฐ ์ฆ๊ฐ•: ํŒŒ๋ผํ”„๋ ˆ์ด์ง• ๋ฐ ์—ญ๋ฒˆ์—ญ ๊ธฐ๋ฐ˜ ์˜ค๋ฒ„์ƒ˜ํ”Œ๋ง
89
- - ์†์‹ค ํ•จ์ˆ˜: Focal Loss with Label Smoothing
90
- - ์˜ตํ‹ฐ๋งˆ์ด์ €: AdamW
91
- - ์Šค์ผ€์ค„๋Ÿฌ: ReduceLROnPlateau
 
5
  - IconicAI/DDD
6
  language:
7
  - en
 
8
  metrics:
9
  - accuracy
10
  - f1
 
12
  - Mango-Juice/trpg_mlm
13
  - microsoft/deberta-v3-large
14
  library_name: transformers
15
+ model-index:
16
+ - name: trpg_emotion_classification
17
+ results:
18
+ - task:
19
+ type: text-classification
20
+ dataset:
21
+ name: IconicAI/DDD (custom subset manually labeled)
22
+ type: custom
23
+ split: test
24
+ config: csv
25
+ metrics:
26
+ - type: accuracy
27
+ value: 0.929
28
+ - type: f1
29
+ value: 0.476
30
+ name: f1 macro
31
  ---
32
+
33
  # GoEmotions Fine-tuned Model
34
 
35
+ This is a multi-label emotion classification model trained on the GoEmotions dataset and TRPG sentences.
36
 
37
+ ## Model Information
38
  - **Base Model**: Mango-Juice/trpg_mlm
39
  - **Task**: Multi-label Emotion Classification
40
+ - **Labels**: 28 emotion labels
41
+ - **Training**: Completed a two-stage fine-tuning process (1st stage: GoEmotions data, 2nd stage: TRPG sentence data)
42
 
43
+ ## Emotion Labels
44
  - admiration
45
  - amusement
46
  - anger
 
70
  - surprise
71
  - neutral
72
 
73
+ ## Usage
74
 
75
  ```python
76
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
77
  import torch
78
 
79
+ # Load model and tokenizer
80
  tokenizer = AutoTokenizer.from_pretrained("Mango-Juice/trpg_emotion_classification")
81
  model = AutoModelForSequenceClassification.from_pretrained("Mango-Juice/trpg_emotion_classification")
82
 
83
+ # Inference
84
  def predict_emotions(text):
85
  inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=128)
86
  with torch.no_grad():
 
90
  emotion_labels = ['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']
91
  return {emotion: float(prob) for emotion, prob in zip(emotion_labels, probs)}
92
 
93
+ # Example
94
  text = "I am so happy today!"
95
  emotions = predict_emotions(text)
96
  print(emotions)
97
  ```
98
 
99
+ ## Performance
100
+ - The fine-tuned model provides improved performance in emotion classification.
101
+ - Data augmentation was applied for minority classes.
102
 
103
+ ## Training Details
104
+ - **Data Augmentation**: Oversampling based on paraphrasing and back-translation.
105
+ - **Loss Function**: Focal Loss with Label Smoothing
106
+ - **Optimizer**: AdamW
107
+ - **Scheduler**: ReduceLROnPlateau