cirimus commited on
Commit
cf7a0b7
·
verified ·
1 Parent(s): 119c285

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +76 -79
README.md CHANGED
@@ -17,7 +17,7 @@ metrics:
17
  - recall
18
  - matthews_correlation
19
  base_model:
20
- - answerdotai/ModernBERT-base
21
  widget:
22
  - text: I am thrilled to be a part of this amazing journey!
23
  - text: I feel so disappointed with the results.
@@ -30,13 +30,13 @@ library_name: transformers
30
 
31
  ### Overview
32
 
33
- This model was fine-tuned from [ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on the [GoEmotions](https://huggingface.co/datasets/google-research-datasets/go_emotions) dataset for multi-label classification. It predicts emotional states in text, with a total of 28 possible labels. Each input text can have one or more associated labels, reflecting the multi-label nature of the task.
34
 
35
  ---
36
 
37
  ### Model Details
38
 
39
- - **Base Model**: [ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base)
40
  - **Fine-Tuning Dataset**: [GoEmotions](https://huggingface.co/datasets/go_emotions)
41
  - **Number of Labels**: 28
42
  - **Problem Type**: Multi-label classification
@@ -57,7 +57,7 @@ import torch
57
  # Load the model
58
  classifier = pipeline(
59
  "text-classification",
60
- model="cirimus/modernbert-base-go-emotions",
61
  return_all_scores=True
62
  )
63
 
@@ -74,15 +74,13 @@ for pred in top_5:
74
 
75
  # Example output:
76
  # Top 5 emotions detected:
77
- # excitement: 0.937
78
- # joy: 0.915
79
- # desire: 0.022
80
- # love: 0.020
81
- # admiration: 0.017
82
  ```
83
 
84
-
85
-
86
  ### How the Model Was Created
87
 
88
  The model was fine-tuned for 3 epochs using the following hyperparameters:
@@ -90,7 +88,6 @@ The model was fine-tuned for 3 epochs using the following hyperparameters:
90
  - **Learning Rate**: `2e-5`
91
  - **Batch Size**: 16
92
  - **Weight Decay**: `0.01`
93
- - **Warmup Steps**: 500
94
  - **Optimizer**: AdamW
95
  - **Evaluation Metrics**: Precision, Recall, F1 Score (weighted), Accuracy
96
 
@@ -112,88 +109,88 @@ The model was evaluated on the test split of the GoEmotions dataset, using a thr
112
  Using the default threshold of 0.5.
113
 
114
  *Macro Averages (test)*
115
- - Accuracy: `0.970`
116
- - Precision: `0.665`
117
- - Recall: `0.389`
118
- - F1: `0.465`
119
- - MCC: `0.477`
120
 
121
  *Per-Label Results (test)*
122
 
123
  | Label | Accuracy | Precision | Recall | F1 | MCC | Support | Threshold |
124
  |----------------|----------|-----------|--------|-------|-------|---------|-----------|
125
- | admiration | 0.945 | 0.737 | 0.627 | 0.677 | 0.650 | 504 | 0.5 |
126
- | amusement | 0.980 | 0.794 | 0.803 | 0.798 | 0.788 | 264 | 0.5 |
127
- | anger | 0.968 | 0.680 | 0.258 | 0.374 | 0.406 | 198 | 0.5 |
128
- | annoyance | 0.940 | 0.468 | 0.159 | 0.238 | 0.249 | 320 | 0.5 |
129
- | approval | 0.942 | 0.614 | 0.276 | 0.381 | 0.387 | 351 | 0.5 |
130
- | caring | 0.976 | 0.524 | 0.244 | 0.333 | 0.347 | 135 | 0.5 |
131
- | confusion | 0.975 | 0.625 | 0.294 | 0.400 | 0.418 | 153 | 0.5 |
132
- | curiosity | 0.951 | 0.538 | 0.423 | 0.473 | 0.452 | 284 | 0.5 |
133
- | desire | 0.987 | 0.604 | 0.349 | 0.443 | 0.453 | 83 | 0.5 |
134
- | disappointment | 0.974 | 0.656 | 0.139 | 0.230 | 0.294 | 151 | 0.5 |
135
- | disapproval | 0.950 | 0.494 | 0.292 | 0.367 | 0.356 | 267 | 0.5 |
136
- | disgust | 0.980 | 0.674 | 0.252 | 0.367 | 0.405 | 123 | 0.5 |
137
- | embarrassment | 0.995 | 0.857 | 0.324 | 0.471 | 0.526 | 37 | 0.5 |
138
- | excitement | 0.984 | 0.692 | 0.262 | 0.380 | 0.420 | 103 | 0.5 |
139
- | fear | 0.992 | 0.796 | 0.551 | 0.652 | 0.659 | 78 | 0.5 |
140
- | gratitude | 0.990 | 0.957 | 0.892 | 0.924 | 0.919 | 352 | 0.5 |
141
  | grief | 0.999 | 0.000 | 0.000 | 0.000 | 0.000 | 6 | 0.5 |
142
- | joy | 0.978 | 0.652 | 0.571 | 0.609 | 0.600 | 161 | 0.5 |
143
- | love | 0.982 | 0.792 | 0.798 | 0.795 | 0.786 | 238 | 0.5 |
144
- | nervousness | 0.996 | 0.636 | 0.304 | 0.412 | 0.439 | 23 | 0.5 |
145
- | optimism | 0.975 | 0.743 | 0.403 | 0.523 | 0.536 | 186 | 0.5 |
146
- | pride | 0.998 | 0.857 | 0.375 | 0.522 | 0.566 | 16 | 0.5 |
147
- | realization | 0.973 | 0.514 | 0.124 | 0.200 | 0.244 | 145 | 0.5 |
148
- | relief | 0.998 | 1.000 | 0.091 | 0.167 | 0.301 | 11 | 0.5 |
149
- | remorse | 0.992 | 0.594 | 0.732 | 0.656 | 0.656 | 56 | 0.5 |
150
- | sadness | 0.979 | 0.759 | 0.385 | 0.511 | 0.532 | 156 | 0.5 |
151
- | surprise | 0.978 | 0.649 | 0.340 | 0.447 | 0.460 | 141 | 0.5 |
152
- | neutral | 0.794 | 0.715 | 0.623 | 0.666 | 0.520 | 1787 | 0.5 |
153
 
154
  **Optimal Results**:
155
 
156
  Using the best threshold for each label based on the training set (tuned on F1).
157
 
158
  *Macro Averages (test)*
159
- - Accuracy: `0.967`
160
- - Precision: `0.568`
161
- - Recall: `0.531`
162
- - F1: `0.541`
163
- - MCC: `0.526`
164
 
165
  *Per-Label Results (test)*
166
 
167
  | Label | Accuracy | Precision | Recall | F1 | MCC | Support | Threshold |
168
  |----------------|----------|-----------|--------|-------|-------|---------|-----------|
169
- | admiration | 0.946 | 0.700 | 0.726 | 0.713 | 0.683 | 504 | 0.30 |
170
- | amusement | 0.981 | 0.782 | 0.856 | 0.817 | 0.808 | 264 | 0.40 |
171
- | anger | 0.963 | 0.490 | 0.510 | 0.500 | 0.481 | 198 | 0.20 |
172
- | annoyance | 0.917 | 0.337 | 0.425 | 0.376 | 0.334 | 320 | 0.25 |
173
- | approval | 0.922 | 0.411 | 0.473 | 0.440 | 0.399 | 351 | 0.25 |
174
- | caring | 0.971 | 0.424 | 0.415 | 0.419 | 0.405 | 135 | 0.25 |
175
- | confusion | 0.970 | 0.468 | 0.484 | 0.476 | 0.460 | 153 | 0.30 |
176
- | curiosity | 0.947 | 0.493 | 0.630 | 0.553 | 0.530 | 284 | 0.35 |
177
- | desire | 0.988 | 0.708 | 0.410 | 0.519 | 0.533 | 83 | 0.45 |
178
- | disappointment | 0.963 | 0.321 | 0.291 | 0.306 | 0.287 | 151 | 0.25 |
179
- | disapproval | 0.943 | 0.429 | 0.464 | 0.446 | 0.417 | 267 | 0.30 |
180
- | disgust | 0.981 | 0.604 | 0.496 | 0.545 | 0.538 | 123 | 0.20 |
181
- | embarrassment | 0.995 | 0.789 | 0.405 | 0.536 | 0.564 | 37 | 0.30 |
182
- | excitement | 0.979 | 0.444 | 0.388 | 0.415 | 0.405 | 103 | 0.25 |
183
- | fear | 0.991 | 0.693 | 0.667 | 0.680 | 0.675 | 78 | 0.30 |
184
- | gratitude | 0.990 | 0.951 | 0.886 | 0.918 | 0.913 | 352 | 0.50 |
185
- | grief | 0.999 | 0.500 | 0.500 | 0.500 | 0.499 | 6 | 0.20 |
186
- | joy | 0.978 | 0.628 | 0.609 | 0.618 | 0.607 | 161 | 0.40 |
187
- | love | 0.982 | 0.789 | 0.819 | 0.804 | 0.795 | 238 | 0.45 |
188
- | nervousness | 0.995 | 0.375 | 0.391 | 0.383 | 0.380 | 23 | 0.25 |
189
- | optimism | 0.970 | 0.558 | 0.597 | 0.577 | 0.561 | 186 | 0.15 |
190
- | pride | 0.998 | 0.750 | 0.375 | 0.500 | 0.529 | 16 | 0.15 |
191
- | realization | 0.968 | 0.326 | 0.200 | 0.248 | 0.240 | 145 | 0.25 |
192
- | relief | 0.998 | 0.429 | 0.273 | 0.333 | 0.341 | 11 | 0.25 |
193
- | remorse | 0.993 | 0.611 | 0.786 | 0.688 | 0.689 | 56 | 0.55 |
194
- | sadness | 0.979 | 0.667 | 0.538 | 0.596 | 0.589 | 156 | 0.20 |
195
- | surprise | 0.978 | 0.585 | 0.511 | 0.545 | 0.535 | 141 | 0.30 |
196
- | neutral | 0.782 | 0.649 | 0.737 | 0.690 | 0.526 | 1787 | 0.40 |
197
 
198
 
199
  ---
@@ -222,7 +219,7 @@ The model is designed for emotion classification in English-language text, parti
222
 
223
  - **Hardware Used**: NVIDIA RTX4090
224
  - **Training Time**: <1 hour
225
- - **Carbon Emissions**: ~0.04 kg CO2 (calculated via [ML CO2 Impact Calculator](https://mlco2.github.io/impact)).
226
 
227
  ---
228
 
@@ -235,5 +232,5 @@ If you use this model, please cite it as follows:
235
  title = {Emotion Classification with ModernBERT},
236
  author = {Enric Junqu\'e de Fortuny},
237
  year = {2025},
238
- howpublished = {\url{https://huggingface.co/cirimus/modernbert-base-go-emotions}},
239
  }
 
17
  - recall
18
  - matthews_correlation
19
  base_model:
20
+ - answerdotai/ModernBERT-large
21
  widget:
22
  - text: I am thrilled to be a part of this amazing journey!
23
  - text: I feel so disappointed with the results.
 
30
 
31
  ### Overview
32
 
33
+ This model was fine-tuned from [ModernBERT-large](https://huggingface.co/answerdotai/ModernBERT-large) on the [GoEmotions](https://huggingface.co/datasets/google-research-datasets/go_emotions) dataset for multi-label classification. It predicts emotional states in text, with a total of 28 possible labels. Each input text can have one or more associated labels, reflecting the multi-label nature of the task.
34
 
35
  ---
36
 
37
  ### Model Details
38
 
39
+ - **Base Model**: [ModernBERT-large](https://huggingface.co/answerdotai/ModernBERT-large)
40
  - **Fine-Tuning Dataset**: [GoEmotions](https://huggingface.co/datasets/go_emotions)
41
  - **Number of Labels**: 28
42
  - **Problem Type**: Multi-label classification
 
57
  # Load the model
58
  classifier = pipeline(
59
  "text-classification",
60
+ model="cirimus/modernbert-large-go-emotions",
61
  return_all_scores=True
62
  )
63
 
 
74
 
75
  # Example output:
76
  # Top 5 emotions detected:
77
+ # joy: 0.784
78
+ # excitement: 0.735
79
+ # admiration: 0.013
80
+ # gratitude: 0.003
81
+ # amusement: 0.003
82
  ```
83
 
 
 
84
  ### How the Model Was Created
85
 
86
  The model was fine-tuned for 3 epochs using the following hyperparameters:
 
88
  - **Learning Rate**: `2e-5`
89
  - **Batch Size**: 16
90
  - **Weight Decay**: `0.01`
 
91
  - **Optimizer**: AdamW
92
  - **Evaluation Metrics**: Precision, Recall, F1 Score (weighted), Accuracy
93
 
 
109
  Using the default threshold of 0.5.
110
 
111
  *Macro Averages (test)*
112
+ - Accuracy: `0.971`
113
+ - Precision: `0.611`
114
+ - Recall: `0.410`
115
+ - F1: `0.472`
116
+ - MCC: `0.475`
117
 
118
  *Per-Label Results (test)*
119
 
120
  | Label | Accuracy | Precision | Recall | F1 | MCC | Support | Threshold |
121
  |----------------|----------|-----------|--------|-------|-------|---------|-----------|
122
+ | admiration | 0.946 | 0.739 | 0.653 | 0.693 | 0.666 | 504 | 0.5 |
123
+ | amusement | 0.982 | 0.817 | 0.814 | 0.816 | 0.807 | 264 | 0.5 |
124
+ | anger | 0.968 | 0.671 | 0.237 | 0.351 | 0.387 | 198 | 0.5 |
125
+ | annoyance | 0.938 | 0.449 | 0.191 | 0.268 | 0.265 | 320 | 0.5 |
126
+ | approval | 0.940 | 0.564 | 0.302 | 0.393 | 0.384 | 351 | 0.5 |
127
+ | caring | 0.977 | 0.581 | 0.319 | 0.411 | 0.420 | 135 | 0.5 |
128
+ | confusion | 0.973 | 0.553 | 0.307 | 0.395 | 0.400 | 153 | 0.5 |
129
+ | curiosity | 0.952 | 0.551 | 0.454 | 0.498 | 0.476 | 284 | 0.5 |
130
+ | desire | 0.988 | 0.702 | 0.398 | 0.508 | 0.523 | 83 | 0.5 |
131
+ | disappointment | 0.972 | 0.500 | 0.152 | 0.234 | 0.265 | 151 | 0.5 |
132
+ | disapproval | 0.951 | 0.503 | 0.315 | 0.387 | 0.374 | 267 | 0.5 |
133
+ | disgust | 0.981 | 0.685 | 0.301 | 0.418 | 0.446 | 123 | 0.5 |
134
+ | embarrassment | 0.995 | 0.800 | 0.324 | 0.462 | 0.507 | 37 | 0.5 |
135
+ | excitement | 0.983 | 0.649 | 0.233 | 0.343 | 0.382 | 103 | 0.5 |
136
+ | fear | 0.991 | 0.738 | 0.577 | 0.647 | 0.648 | 78 | 0.5 |
137
+ | gratitude | 0.990 | 0.955 | 0.895 | 0.924 | 0.919 | 352 | 0.5 |
138
  | grief | 0.999 | 0.000 | 0.000 | 0.000 | 0.000 | 6 | 0.5 |
139
+ | joy | 0.980 | 0.658 | 0.646 | 0.652 | 0.642 | 161 | 0.5 |
140
+ | love | 0.983 | 0.795 | 0.815 | 0.805 | 0.796 | 238 | 0.5 |
141
+ | nervousness | 0.996 | 0.556 | 0.435 | 0.488 | 0.490 | 23 | 0.5 |
142
+ | optimism | 0.973 | 0.702 | 0.392 | 0.503 | 0.513 | 186 | 0.5 |
143
+ | pride | 0.998 | 0.800 | 0.250 | 0.381 | 0.446 | 16 | 0.5 |
144
+ | realization | 0.972 | 0.405 | 0.117 | 0.182 | 0.207 | 145 | 0.5 |
145
+ | relief | 0.998 | 0.000 | 0.000 | 0.000 | 0.000 | 11 | 0.5 |
146
+ | remorse | 0.992 | 0.566 | 0.839 | 0.676 | 0.686 | 56 | 0.5 |
147
+ | sadness | 0.980 | 0.764 | 0.436 | 0.555 | 0.568 | 156 | 0.5 |
148
+ | surprise | 0.980 | 0.692 | 0.447 | 0.543 | 0.547 | 141 | 0.5 |
149
+ | neutral | 0.796 | 0.716 | 0.628 | 0.669 | 0.525 | 1787 | 0.5 |
150
 
151
  **Optimal Results**:
152
 
153
  Using the best threshold for each label based on the training set (tuned on F1).
154
 
155
  *Macro Averages (test)*
156
+ - Accuracy: `0.968`
157
+ - Precision: `0.591`
158
+ - Recall: `0.528`
159
+ - F1: `0.550`
160
+ - MCC: `0.536`
161
 
162
  *Per-Label Results (test)*
163
 
164
  | Label | Accuracy | Precision | Recall | F1 | MCC | Support | Threshold |
165
  |----------------|----------|-----------|--------|-------|-------|---------|-----------|
166
+ | admiration | 0.947 | 0.722 | 0.702 | 0.712 | 0.683 | 504 | 0.40 |
167
+ | amusement | 0.983 | 0.812 | 0.848 | 0.830 | 0.821 | 264 | 0.45 |
168
+ | anger | 0.966 | 0.548 | 0.460 | 0.500 | 0.485 | 198 | 0.25 |
169
+ | annoyance | 0.926 | 0.378 | 0.403 | 0.390 | 0.351 | 320 | 0.30 |
170
+ | approval | 0.928 | 0.445 | 0.470 | 0.457 | 0.419 | 351 | 0.30 |
171
+ | caring | 0.975 | 0.496 | 0.430 | 0.460 | 0.449 | 135 | 0.35 |
172
+ | confusion | 0.966 | 0.417 | 0.510 | 0.459 | 0.444 | 153 | 0.30 |
173
+ | curiosity | 0.950 | 0.522 | 0.588 | 0.553 | 0.528 | 284 | 0.40 |
174
+ | desire | 0.988 | 0.673 | 0.422 | 0.519 | 0.527 | 83 | 0.40 |
175
+ | disappointment | 0.964 | 0.338 | 0.305 | 0.321 | 0.303 | 151 | 0.30 |
176
+ | disapproval | 0.948 | 0.468 | 0.416 | 0.440 | 0.414 | 267 | 0.35 |
177
+ | disgust | 0.978 | 0.529 | 0.447 | 0.485 | 0.475 | 123 | 0.25 |
178
+ | embarrassment | 0.994 | 0.650 | 0.351 | 0.456 | 0.475 | 37 | 0.35 |
179
+ | excitement | 0.978 | 0.419 | 0.427 | 0.423 | 0.412 | 103 | 0.25 |
180
+ | fear | 0.990 | 0.662 | 0.628 | 0.645 | 0.640 | 78 | 0.40 |
181
+ | gratitude | 0.990 | 0.955 | 0.895 | 0.924 | 0.919 | 352 | 0.50 |
182
+ | grief | 0.999 | 0.750 | 0.500 | 0.600 | 0.612 | 6 | 0.35 |
183
+ | joy | 0.980 | 0.660 | 0.640 | 0.650 | 0.639 | 161 | 0.50 |
184
+ | love | 0.982 | 0.774 | 0.836 | 0.804 | 0.795 | 238 | 0.45 |
185
+ | nervousness | 0.995 | 0.435 | 0.435 | 0.435 | 0.432 | 23 | 0.45 |
186
+ | optimism | 0.972 | 0.597 | 0.565 | 0.580 | 0.566 | 186 | 0.25 |
187
+ | pride | 0.998 | 0.667 | 0.375 | 0.480 | 0.499 | 16 | 0.15 |
188
+ | realization | 0.962 | 0.273 | 0.248 | 0.260 | 0.241 | 145 | 0.25 |
189
+ | relief | 0.999 | 0.800 | 0.364 | 0.500 | 0.539 | 11 | 0.25 |
190
+ | remorse | 0.993 | 0.641 | 0.732 | 0.683 | 0.681 | 56 | 0.65 |
191
+ | sadness | 0.978 | 0.646 | 0.538 | 0.587 | 0.579 | 156 | 0.30 |
192
+ | surprise | 0.979 | 0.603 | 0.518 | 0.557 | 0.548 | 141 | 0.40 |
193
+ | neutral | 0.791 | 0.669 | 0.722 | 0.695 | 0.537 | 1787 | 0.40 |
194
 
195
 
196
  ---
 
219
 
220
  - **Hardware Used**: NVIDIA RTX4090
221
  - **Training Time**: <1 hour
222
+ - **Carbon Emissions**: ~0.06 kg CO2 (calculated via [ML CO2 Impact Calculator](https://mlco2.github.io/impact)).
223
 
224
  ---
225
 
 
232
  title = {Emotion Classification with ModernBERT},
233
  author = {Enric Junqu\'e de Fortuny},
234
  year = {2025},
235
+ howpublished = {\url{https://huggingface.co/cirimus/modernbert-large-go-emotions}},
236
  }