Spaces:
Sleeping
Sleeping
SudhanshuBlaze
commited on
Commit
•
b1a7b97
1
Parent(s):
55a9445
fix emotions color map for gauge plot
Browse files- EDxHuggingface.py +29 -28
EDxHuggingface.py
CHANGED
@@ -29,36 +29,37 @@ def query(payload):
|
|
29 |
|
30 |
# Define color map for each emotion category
|
31 |
color_map = {
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
}
|
61 |
|
|
|
62 |
# Labels for Hate Speech Classification
|
63 |
label_hs = {"LABEL_0": "Acceptable", "LABEL_1": "inappropriate", "LABEL_2": "Offensive", "LABEL_3": "Violent"}
|
64 |
|
|
|
29 |
|
30 |
# Define color map for each emotion category
|
31 |
color_map = {
|
32 |
+
'admiration': ['#1f77b4', '#98df8a', '#2ca02c', '#d62728'],
|
33 |
+
'amusement': ['#ff7f0e', '#98df8a', '#2ca02c', '#d62728'],
|
34 |
+
'anger': ['#ffbb78', '#ff7f0e', '#d62728', '#bcbd22'],
|
35 |
+
'annoyance': ['#ffbb78', '#ff7f0e', '#d62728', '#bcbd22'],
|
36 |
+
'approval': ['#1f77b4', '#98df8a', '#2ca02c', '#d62728'],
|
37 |
+
'caring': ['#98df8a', '#2ca02c', '#FF69B4', '#d62728'],
|
38 |
+
'confusion': ['#ffbb78', '#ff7f0e', '#9467bd', '#d62728'],
|
39 |
+
'curiosity': ['#ffbb78', '#ff7f0e', '#9467bd', '#d62728'],
|
40 |
+
'desire': ['#2ca02c', '#ff7f0e', '#98df8a', '#d62728'],
|
41 |
+
'disappointment': ['#ffbb78', '#ff7f0e', '#d62728', '#bcbd22'],
|
42 |
+
'disapproval': ['#ffbb78', '#ff7f0e', '#d62728', '#bcbd22'],
|
43 |
+
'disgust': ['#ffbb78', '#ff7f0e', '#d62728', '#bcbd22'],
|
44 |
+
'embarrassment': ['#ffbb78', '#ff7f0e', '#9467bd', '#d62728'],
|
45 |
+
'excitement': ['#ff7f0e', '#2ca02c', '#98df8a', '#d62728'],
|
46 |
+
'fear': ['#ffbb78', '#ff7f0e', '#d62728', '#bcbd22'],
|
47 |
+
'gratitude': ['#98df8a', '#2ca02c', '#1f77b4', '#d62728'],
|
48 |
+
'grief': ['#ffbb78', '#d62728', '#bcbd22', '#ff7f0e'],
|
49 |
+
'joy': ['#ff7f0e', '#98df8a', '#2ca02c', '#d62728'],
|
50 |
+
'love': ['#FF69B4', '#98df8a', '#2ca02c', '#d62728'],
|
51 |
+
'nervousness': ['#ffbb78', '#ff7f0e', '#9467bd', '#d62728'],
|
52 |
+
'optimism': ['#98df8a', '#2ca02c', '#1f77b4', '#d62728'],
|
53 |
+
'pride': ['#98df8a', '#ff7f0e', '#1f77b4', '#d62728'],
|
54 |
+
'realization': ['#9467bd', '#ff7f0e', '#ffbb78', '#d62728'],
|
55 |
+
'relief': ['#1f77b4', '#98df8a', '#2ca02c', '#d62728'],
|
56 |
+
'remorse': ['#ffbb78', '#ff7f0e', '#d62728', '#bcbd22'],
|
57 |
+
'sadness': ['#ffbb78', '#ff7f0e', '#d62728', '#bcbd22'],
|
58 |
+
'surprise': ['#ff7f0e', '#ffbb78', '#9467bd', '#d62728'],
|
59 |
+
'neutral': ['#2ca02c', '#98df8a', '#1f77b4', '#d62728']
|
60 |
}
|
61 |
|
62 |
+
|
63 |
# Labels for Hate Speech Classification
|
64 |
label_hs = {"LABEL_0": "Acceptable", "LABEL_1": "inappropriate", "LABEL_2": "Offensive", "LABEL_3": "Violent"}
|
65 |
|