Spaces:
Sleeping
Sleeping
Commit ·
505ce41
1
Parent(s): bc9a84f
Add Module 2 reports
Browse files- reports/module_2_emotion_classification/README.md +5 -4
- reports/module_2_emotion_classification/explanation_examples.json +122 -0
- reports/module_2_emotion_classification/metrics_summary.json +30 -0
- reports/module_2_emotion_classification/test_classification_report.csv +10 -0
- reports/module_2_emotion_classification/test_classification_report.txt +12 -0
reports/module_2_emotion_classification/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
# Module 2 Reports
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
- `metrics_summary.json`
|
| 8 |
- `test_classification_report.txt`
|
| 9 |
- `test_classification_report.csv`
|
| 10 |
-
- `
|
| 11 |
-
|
|
|
|
|
|
| 1 |
# Module 2 Reports
|
| 2 |
|
| 3 |
+
These files summarize the DistilBERT emotion classifier trained in `notebooks/module_2_emotion_training.ipynb`.
|
| 4 |
|
| 5 |
+
Included reports:
|
| 6 |
|
| 7 |
- `metrics_summary.json`
|
| 8 |
- `test_classification_report.txt`
|
| 9 |
- `test_classification_report.csv`
|
| 10 |
+
- `explanation_examples.json` when explanation outputs are available in the notebook
|
| 11 |
+
|
| 12 |
+
The notebook also generates `test_confusion_matrix.csv` during a full Colab run. The exact matrix is not reconstructed here unless that generated CSV is copied back from Colab, because the matrix values were not printed in the saved notebook output.
|
reports/module_2_emotion_classification/explanation_examples.json
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"text": "I feel anxious and overwhelmed and I cannot sleep.",
|
| 4 |
+
"prediction": {
|
| 5 |
+
"emotion": "fear",
|
| 6 |
+
"confidence": 0.9993083477020264
|
| 7 |
+
},
|
| 8 |
+
"top_evidence": [
|
| 9 |
+
{
|
| 10 |
+
"word": "anxious",
|
| 11 |
+
"impact": 0.4232
|
| 12 |
+
},
|
| 13 |
+
{
|
| 14 |
+
"word": "feel",
|
| 15 |
+
"impact": 0.0002
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"word": "overwhelmed",
|
| 19 |
+
"impact": 0.0001
|
| 20 |
+
},
|
| 21 |
+
{
|
| 22 |
+
"word": "I",
|
| 23 |
+
"impact": -0.0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"word": "and",
|
| 27 |
+
"impact": -0.0
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"word": "and",
|
| 31 |
+
"impact": -0.0
|
| 32 |
+
}
|
| 33 |
+
]
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"text": "I finally feel hopeful and proud of myself.",
|
| 37 |
+
"prediction": {
|
| 38 |
+
"emotion": "joy",
|
| 39 |
+
"confidence": 0.9997496008872986
|
| 40 |
+
},
|
| 41 |
+
"top_evidence": [
|
| 42 |
+
{
|
| 43 |
+
"word": "I",
|
| 44 |
+
"impact": -0.0
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"word": "finally",
|
| 48 |
+
"impact": 0.0
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"word": "feel",
|
| 52 |
+
"impact": -0.0
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
"word": "hopeful",
|
| 56 |
+
"impact": 0.0
|
| 57 |
+
},
|
| 58 |
+
{
|
| 59 |
+
"word": "and",
|
| 60 |
+
"impact": 0.0
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"word": "proud",
|
| 64 |
+
"impact": 0.0
|
| 65 |
+
}
|
| 66 |
+
]
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"text": "I am really sad because no one listens to me.",
|
| 70 |
+
"prediction": {
|
| 71 |
+
"emotion": "sadness",
|
| 72 |
+
"confidence": 0.9994388222694397
|
| 73 |
+
},
|
| 74 |
+
"top_evidence": [
|
| 75 |
+
{
|
| 76 |
+
"word": "sad",
|
| 77 |
+
"impact": 0.9994
|
| 78 |
+
},
|
| 79 |
+
{
|
| 80 |
+
"word": "really",
|
| 81 |
+
"impact": 0.0077
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"word": "I",
|
| 85 |
+
"impact": 0.0002
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"word": "me.",
|
| 89 |
+
"impact": 0.0001
|
| 90 |
+
},
|
| 91 |
+
{
|
| 92 |
+
"word": "am",
|
| 93 |
+
"impact": 0.0
|
| 94 |
+
},
|
| 95 |
+
{
|
| 96 |
+
"word": "to",
|
| 97 |
+
"impact": -0.0
|
| 98 |
+
}
|
| 99 |
+
]
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"text": "Amazing we won!",
|
| 103 |
+
"prediction": {
|
| 104 |
+
"emotion": "surprise",
|
| 105 |
+
"confidence": 0.8034693598747253
|
| 106 |
+
},
|
| 107 |
+
"top_evidence": [
|
| 108 |
+
{
|
| 109 |
+
"word": "Amazing",
|
| 110 |
+
"impact": 0.8035
|
| 111 |
+
},
|
| 112 |
+
{
|
| 113 |
+
"word": "we",
|
| 114 |
+
"impact": 0.8035
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"word": "won!",
|
| 118 |
+
"impact": -0.1771
|
| 119 |
+
}
|
| 120 |
+
]
|
| 121 |
+
}
|
| 122 |
+
]
|
reports/module_2_emotion_classification/metrics_summary.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"base_model": "distilbert-base-uncased",
|
| 3 |
+
"dataset": "dair-ai/emotion",
|
| 4 |
+
"labels": [
|
| 5 |
+
"sadness",
|
| 6 |
+
"joy",
|
| 7 |
+
"love",
|
| 8 |
+
"anger",
|
| 9 |
+
"fear",
|
| 10 |
+
"surprise"
|
| 11 |
+
],
|
| 12 |
+
"training": {
|
| 13 |
+
"epochs": 5,
|
| 14 |
+
"learning_rate": 2e-05,
|
| 15 |
+
"train_batch_size": 16,
|
| 16 |
+
"eval_batch_size": 32,
|
| 17 |
+
"best_model_metric": "macro_f1"
|
| 18 |
+
},
|
| 19 |
+
"validation_metrics": {
|
| 20 |
+
"eval_loss": 0.1850450038909912,
|
| 21 |
+
"accuracy": 0.944,
|
| 22 |
+
"macro_f1": 0.9217609879676768
|
| 23 |
+
},
|
| 24 |
+
"test_metrics": {
|
| 25 |
+
"accuracy": 0.924,
|
| 26 |
+
"macro_f1": 0.8747072046581201
|
| 27 |
+
},
|
| 28 |
+
"explainability_method": "word removal: compare predicted confidence before and after removing each word",
|
| 29 |
+
"source": "Reconstructed from saved notebook outputs in notebooks/module_2_emotion_training.ipynb"
|
| 30 |
+
}
|
reports/module_2_emotion_classification/test_classification_report.csv
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
label,precision,recall,f1-score,support
|
| 2 |
+
sadness,0.97,0.96,0.97,581
|
| 3 |
+
joy,0.95,0.94,0.94,695
|
| 4 |
+
love,0.81,0.82,0.82,159
|
| 5 |
+
anger,0.91,0.93,0.92,275
|
| 6 |
+
fear,0.88,0.92,0.90,224
|
| 7 |
+
surprise,0.77,0.65,0.70,66
|
| 8 |
+
accuracy,,,0.92,2000
|
| 9 |
+
macro avg,0.88,0.87,0.87,2000
|
| 10 |
+
weighted avg,0.92,0.92,0.92,2000
|
reports/module_2_emotion_classification/test_classification_report.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
precision recall f1-score support
|
| 2 |
+
|
| 3 |
+
sadness 0.97 0.96 0.97 581
|
| 4 |
+
joy 0.95 0.94 0.94 695
|
| 5 |
+
love 0.81 0.82 0.82 159
|
| 6 |
+
anger 0.91 0.93 0.92 275
|
| 7 |
+
fear 0.88 0.92 0.90 224
|
| 8 |
+
surprise 0.77 0.65 0.70 66
|
| 9 |
+
|
| 10 |
+
accuracy 0.92 2000
|
| 11 |
+
macro avg 0.88 0.87 0.87 2000
|
| 12 |
+
weighted avg 0.92 0.92 0.92 2000
|