Archisman Karmakar
commited on
Commit
·
3fb5a9f
1
Parent(s):
0407419
Update dashboard.py
Browse files- dashboard.py +69 -51
dashboard.py
CHANGED
|
@@ -55,31 +55,40 @@ def create_sample_example3():
|
|
| 55 |
node [shape=box, style="rounded,filled", fontname="Helvetica", fontsize=9, margin="0.15,0.1"];
|
| 56 |
|
| 57 |
// Define nodes with custom colors
|
| 58 |
-
Input [label="Input:\nbruh, floods in Kerala, rescue ops non-stop 🚁", fillcolor="#ffe6de", fontcolor="#000000"];
|
| 59 |
-
|
| 60 |
-
Sentiment [label="Sentiment
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
// Emotion nodes with a uniform style
|
| 63 |
Anger [label="Anger: 0.080178231", fillcolor="#deffe1", fontcolor="black"];
|
| 64 |
Disgust [label="Disgust: 0.015257259", fillcolor="#deffe1", fontcolor="black"];
|
| 65 |
Fear [label="Fear: 0.601871967", fillcolor="#deffe1", fontcolor="black"];
|
| 66 |
Joy [label="Joy: 0.00410547", fillcolor="#deffe1", fontcolor="black"];
|
| 67 |
-
|
| 68 |
Sadness [label="Sadness: 0.245294735", fillcolor="#deffe1", fontcolor="black"];
|
| 69 |
Surprise [label="Surprise: 0.019189769", fillcolor="#deffe1", fontcolor="black"];
|
| 70 |
|
| 71 |
// Define edges with a consistent style
|
| 72 |
-
edge [color="#7a7a7a", penwidth=3];
|
| 73 |
|
| 74 |
-
//
|
| 75 |
-
Input ->
|
| 76 |
-
Input -> Sentiment;
|
| 77 |
-
Sentiment ->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
Emotion -> Anger;
|
| 79 |
Emotion -> Disgust;
|
| 80 |
Emotion -> Fear;
|
| 81 |
Emotion -> Joy;
|
| 82 |
-
Emotion ->
|
| 83 |
Emotion -> Sadness;
|
| 84 |
Emotion -> Surprise;
|
| 85 |
}
|
|
@@ -98,31 +107,40 @@ def create_sample_example2():
|
|
| 98 |
node [shape=box, style="rounded,filled", fontname="Helvetica", fontsize=9, margin="0.15,0.1"];
|
| 99 |
|
| 100 |
// Define nodes with custom colors
|
| 101 |
-
Input [label="Input:\nu rlly think all that talk means u tough? lol, when I step up, u ain't gon say sh*t", fillcolor="#ffe6de", fontcolor="black"];
|
| 102 |
-
|
| 103 |
-
Sentiment [label="Sentiment
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
// Emotion nodes with a uniform style
|
| 106 |
Anger [label="Anger: 0.14403291", fillcolor="#deffe1", fontcolor="black"];
|
| 107 |
Disgust [label="Disgust: 0.039282672", fillcolor="#deffe1", fontcolor="black"];
|
| 108 |
Fear [label="Fear: 0.014349542", fillcolor="#deffe1", fontcolor="black"];
|
| 109 |
Joy [label="Joy: 0.048965044", fillcolor="#deffe1", fontcolor="black"];
|
| 110 |
-
|
| 111 |
Sadness [label="Sadness: 0.021111647", fillcolor="#deffe1", fontcolor="black"];
|
| 112 |
Surprise [label="Surprise: 0.237405464", fillcolor="#deffe1", fontcolor="black"];
|
| 113 |
|
| 114 |
// Define edges with a consistent style
|
| 115 |
-
edge [color="#7a7a7a", penwidth=3];
|
| 116 |
|
| 117 |
-
//
|
| 118 |
-
Input ->
|
| 119 |
-
Input -> Sentiment;
|
| 120 |
-
Sentiment ->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
Emotion -> Anger;
|
| 122 |
Emotion -> Disgust;
|
| 123 |
Emotion -> Fear;
|
| 124 |
Emotion -> Joy;
|
| 125 |
-
Emotion ->
|
| 126 |
Emotion -> Sadness;
|
| 127 |
Emotion -> Surprise;
|
| 128 |
}
|
|
@@ -142,39 +160,39 @@ def create_sample_example1():
|
|
| 142 |
node [shape=box, style="rounded,filled", fontname="Helvetica", fontsize=9, margin="0.15,0.1"];
|
| 143 |
|
| 144 |
// Define nodes with colors
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
|
| 161 |
// Define edges
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
}
|
| 179 |
"""
|
| 180 |
|
|
|
|
| 55 |
node [shape=box, style="rounded,filled", fontname="Helvetica", fontsize=9, margin="0.15,0.1"];
|
| 56 |
|
| 57 |
// Define nodes with custom colors
|
| 58 |
+
Input Text [label="Input Text:\nbruh, floods in Kerala, rescue ops non-stop 🚁", fillcolor="#ffe6de", fontcolor="#000000"];
|
| 59 |
+
Normalized Text [label="Normalized Text:\nBrother, the floods in Kerala are severe,\nand rescue operations are ongoing continuously.", fillcolor="#ffe6de", fontcolor="#000000"];
|
| 60 |
+
Sentiment [label="Sentiment", fillcolor="#fde6ff", fontcolor="black"];
|
| 61 |
+
Negative [label="Negative: 4.4367719965521246e-05", fillcolor="#e8e6ff", fontcolor="black"];
|
| 62 |
+
Neutral [label="Neutral: 0.9998886585235596", fillcolor="#e8e6ff", fontcolor="black"];
|
| 63 |
+
Positive [label="Positive: 7.097498746588826e-05", fillcolor="#e8e6ff", fontcolor="black"];
|
| 64 |
|
| 65 |
// Emotion nodes with a uniform style
|
| 66 |
Anger [label="Anger: 0.080178231", fillcolor="#deffe1", fontcolor="black"];
|
| 67 |
Disgust [label="Disgust: 0.015257259", fillcolor="#deffe1", fontcolor="black"];
|
| 68 |
Fear [label="Fear: 0.601871967", fillcolor="#deffe1", fontcolor="black"];
|
| 69 |
Joy [label="Joy: 0.00410547", fillcolor="#deffe1", fontcolor="black"];
|
| 70 |
+
Neutral_e [label="Neutral: 0.0341026", fillcolor="#deffe1", fontcolor="black"];
|
| 71 |
Sadness [label="Sadness: 0.245294735", fillcolor="#deffe1", fontcolor="black"];
|
| 72 |
Surprise [label="Surprise: 0.019189769", fillcolor="#deffe1", fontcolor="black"];
|
| 73 |
|
| 74 |
// Define edges with a consistent style
|
| 75 |
+
// edge [color="#7a7a7a", penwidth=3];
|
| 76 |
|
| 77 |
+
// Define edges
|
| 78 |
+
Input Text -> Normalized Text;
|
| 79 |
+
Input Text -> Sentiment";
|
| 80 |
+
Sentiment -> Negative;
|
| 81 |
+
Sentiment -> Neutral;
|
| 82 |
+
Sentiment -> Positive;
|
| 83 |
+
|
| 84 |
+
Neagtive -> Emotion;
|
| 85 |
+
Positive -> Emotion [penwidth=0.2];
|
| 86 |
+
Neutral -> Emotion [penwidth=0.2];
|
| 87 |
Emotion -> Anger;
|
| 88 |
Emotion -> Disgust;
|
| 89 |
Emotion -> Fear;
|
| 90 |
Emotion -> Joy;
|
| 91 |
+
Emotion -> Neutral_e;
|
| 92 |
Emotion -> Sadness;
|
| 93 |
Emotion -> Surprise;
|
| 94 |
}
|
|
|
|
| 107 |
node [shape=box, style="rounded,filled", fontname="Helvetica", fontsize=9, margin="0.15,0.1"];
|
| 108 |
|
| 109 |
// Define nodes with custom colors
|
| 110 |
+
Input Text [label="Input Text:\nu rlly think all that talk means u tough? lol, when I step up, u ain't gon say sh*t", fillcolor="#ffe6de", fontcolor="black"];
|
| 111 |
+
Normalized Text [label="Normalized Text:\nyou really think all that talk makes you tough [lol](laughed out loud) when i step up you are not going to say anything", fillcolor="#ffe6de", fontcolor="black"];
|
| 112 |
+
Sentiment [label="Sentiment", fillcolor="#fde6ff", fontcolor="black"];
|
| 113 |
+
Negative [label="Negative: 0.9999861717224121", fillcolor="#e8e6ff", fontcolor="black"];
|
| 114 |
+
Neutral [label="Neutral: 6.885089078423334e-06", fillcolor="#e8e6ff", fontcolor="black"];
|
| 115 |
+
Positive [label="Positive: 1.1117132999061141e-05", fillcolor="#e8e6ff", fontcolor="black"];
|
| 116 |
|
| 117 |
// Emotion nodes with a uniform style
|
| 118 |
Anger [label="Anger: 0.14403291", fillcolor="#deffe1", fontcolor="black"];
|
| 119 |
Disgust [label="Disgust: 0.039282672", fillcolor="#deffe1", fontcolor="black"];
|
| 120 |
Fear [label="Fear: 0.014349542", fillcolor="#deffe1", fontcolor="black"];
|
| 121 |
Joy [label="Joy: 0.048965044", fillcolor="#deffe1", fontcolor="black"];
|
| 122 |
+
Neutral_e [label="Neutral: 0.494852662", fillcolor="#deffe1", fontcolor="black"];
|
| 123 |
Sadness [label="Sadness: 0.021111647", fillcolor="#deffe1", fontcolor="black"];
|
| 124 |
Surprise [label="Surprise: 0.237405464", fillcolor="#deffe1", fontcolor="black"];
|
| 125 |
|
| 126 |
// Define edges with a consistent style
|
| 127 |
+
// edge [color="#7a7a7a", penwidth=3];
|
| 128 |
|
| 129 |
+
// Define edges
|
| 130 |
+
Input Text -> Normalized Text;
|
| 131 |
+
Input Text -> Sentiment";
|
| 132 |
+
Sentiment -> Negative;
|
| 133 |
+
Sentiment -> Neutral;
|
| 134 |
+
Sentiment -> Positive;
|
| 135 |
+
|
| 136 |
+
Neagtive -> Emotion;
|
| 137 |
+
Positive -> Emotion [penwidth=0.2];
|
| 138 |
+
Neutral -> Emotion [penwidth=0.2];
|
| 139 |
Emotion -> Anger;
|
| 140 |
Emotion -> Disgust;
|
| 141 |
Emotion -> Fear;
|
| 142 |
Emotion -> Joy;
|
| 143 |
+
Emotion -> Neutral_e;
|
| 144 |
Emotion -> Sadness;
|
| 145 |
Emotion -> Surprise;
|
| 146 |
}
|
|
|
|
| 160 |
node [shape=box, style="rounded,filled", fontname="Helvetica", fontsize=9, margin="0.15,0.1"];
|
| 161 |
|
| 162 |
// Define nodes with colors
|
| 163 |
+
Input Text [label="Input Text:\ni don't know for real y he's sooo sad", fillcolor="#ffe6de", fontcolor="black"];
|
| 164 |
+
Normalized Text [label="Normalized Text:\ni do not know for real why he's so sad", fillcolor="#e6f4d7", fontcolor="black"];
|
| 165 |
+
Sentiment [label="Sentiment", fillcolor="#fde6ff", fontcolor="black"];
|
| 166 |
+
Negative [label="Negative: 0.995874803543091", fillcolor="#e8e6ff", fontcolor="black"];
|
| 167 |
+
Neutral [label="Neutral: 6.232635259628296e-05", fillcolor="#e8e6ff", fontcolor="black"];
|
| 168 |
+
Positive [label="Positive: 2.0964847564697266e-05", fillcolor="#e8e6ff", fontcolor="black"];
|
| 169 |
+
|
| 170 |
+
Emotion [label="Emotion", fillcolor="#fdf5e6", fontcolor="black"];
|
| 171 |
+
Anger [label="Anger: 0.0", fillcolor="#deffe1", fontcolor="black"];
|
| 172 |
+
Disgust [label="Disgust: 0.0", fillcolor="#deffe1", fontcolor="black"];
|
| 173 |
+
Fear [label="Fear: 0.010283803842246056", fillcolor="#deffe1", fontcolor="black"];
|
| 174 |
+
Joy [label="Joy: 0.0", fillcolor="#deffe1", fontcolor="black"];
|
| 175 |
+
Neutral_e [label="Neutral: 0.021935827255129814", fillcolor="#deffe1", fontcolor="black"];
|
| 176 |
+
Sadness [label="Sadness: 1.0", fillcolor="#deffe1", fontcolor="black"];
|
| 177 |
+
Surprise [label="Surprise: 0.02158345977962017", fillcolor="#deffe1", fontcolor="black"];
|
| 178 |
|
| 179 |
// Define edges
|
| 180 |
+
Input Text -> Normalized Text;
|
| 181 |
+
Input Text -> Sentiment";
|
| 182 |
+
Sentiment -> Negative;
|
| 183 |
+
Sentiment -> Neutral;
|
| 184 |
+
Sentiment -> Positive;
|
| 185 |
+
|
| 186 |
+
Neagtive -> Emotion;
|
| 187 |
+
Positive -> Emotion [penwidth=0.2];
|
| 188 |
+
Neutral -> Emotion [penwidth=0.2];
|
| 189 |
+
Emotion -> Anger;
|
| 190 |
+
Emotion -> Disgust;
|
| 191 |
+
Emotion -> Fear;
|
| 192 |
+
Emotion -> Joy;
|
| 193 |
+
Emotion -> Neutral_e;
|
| 194 |
+
Emotion -> Sadness;
|
| 195 |
+
Emotion -> Surprise;
|
| 196 |
}
|
| 197 |
"""
|
| 198 |
|