SudhanshuBlaze commited on
Commit
b1a7b97
1 Parent(s): 55a9445

fix emotions color map for gauge plot

Browse files
Files changed (1) hide show
  1. 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
- 'admiration': ['#1f77b4', '#aec7e8', '#ff7f0e', '#d62728'],
33
- 'amusement': ['#ff7f0e', '#ffbb78', '#2ca02c', '#d62728'],
34
- 'anger': ['#d62728', '#ff9896', '#2ca02c', '#bcbd22'],
35
- 'annoyance': ['#d62728', '#ff9896', '#2ca02c', '#bcbd22'],
36
- 'approval': ['#1f77b4', '#aec7e8', '#ff7f0e', '#d62728'],
37
- 'caring': ['#1f77b4', '#aec7e8', '#ff7f0e', '#d62728'],
38
- 'confusion': ['#9467bd', '#c5b0d5', '#ff7f0e', '#d62728'],
39
- 'curiosity': ['#9467bd', '#c5b0d5', '#ff7f0e', '#d62728'],
40
- 'desire': ['#ff7f0e', '#ffbb78', '#2ca02c', '#d62728'],
41
- 'disappointment': ['#d62728', '#ff9896', '#2ca02c', '#bcbd22'],
42
- 'disapproval': ['#d62728', '#ff9896', '#2ca02c', '#bcbd22'],
43
- 'disgust': ['#d62728', '#ff9896', '#2ca02c', '#bcbd22'],
44
- 'embarrassment': ['#9467bd', '#c5b0d5', '#ff7f0e', '#d62728'],
45
- 'excitement': ['#ff7f0e', '#ffbb78', '#2ca02c', '#d62728'],
46
- 'fear': ['#d62728', '#ff9896', '#2ca02c', '#bcbd22'],
47
- 'gratitude': ['#1f77b4', '#aec7e8', '#ff7f0e', '#d62728'],
48
- 'grief': ['#d62728', '#ff9896', '#2ca02c', '#bcbd22'],
49
- 'joy': ['#ff7f0e', '#ffbb78', '#2ca02c', '#d62728'],
50
- 'love': ['#1f77b4', '#aec7e8', '#ff7f0e', '#d62728'],
51
- 'nervousness': ['#9467bd', '#c5b0d5', '#ff7f0e', '#d62728'],
52
- 'optimism': ['#1f77b4', '#aec7e8', '#ff7f0e', '#d62728'],
53
- 'pride': ['#1f77b4', '#aec7e8', '#ff7f0e', '#d62728'],
54
- 'realization': ['#9467bd', '#c5b0d5', '#ff7f0e', '#d62728'],
55
- 'relief': ['#1f77b4', '#aec7e8', '#ff7f0e', '#d62728'],
56
- 'remorse': ['#d62728', '#ff9896', '#2ca02c', '#bcbd22'],
57
- 'sadness': ['#d62728', '#ff9896', '#2ca02c', '#bcbd22'],
58
- 'surprise': ['#9467bd', '#c5b0d5', '#ff7f0e', '#d62728'],
59
- 'neutral': ['#1f77b4', '#aec7e8', '#ff7f0e', '#d62728']
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