Archisman Karmakar commited on
Commit
0c00668
·
1 Parent(s): 3fb5a9f

Update dashboard.py

Browse files
Files changed (1) hide show
  1. dashboard.py +23 -17
dashboard.py CHANGED
@@ -51,12 +51,12 @@ def create_sample_example3():
51
  graph = """
52
  digraph {
53
  // Global graph settings with explicit DPI
54
- graph [bgcolor="white", rankdir=TB, splines=true, nodesep=0.8, ranksep=0.8];
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"];
@@ -75,15 +75,17 @@ def create_sample_example3():
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;
@@ -107,8 +109,8 @@ def create_sample_example2():
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"];
@@ -127,15 +129,17 @@ def create_sample_example2():
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;
@@ -153,15 +157,15 @@ def create_sample_example1():
153
 
154
  graph = """
155
  digraph G {
156
- rankdir=LR;
157
  bgcolor="white";
158
  nodesep=0.8;
159
  ranksep=0.8;
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"];
@@ -177,15 +181,17 @@ def create_sample_example1():
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;
 
51
  graph = """
52
  digraph {
53
  // Global graph settings with explicit DPI
54
+ graph [bgcolor="white", rankdir=LR, splines=true, nodesep=0.8, ranksep=0.8];
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"];
 
75
  // edge [color="#7a7a7a", penwidth=3];
76
 
77
  // Define edges
78
+ "Input Text" -> Sentiment;
79
+ "Input Text" -> "Normalized Text";
80
  Sentiment -> Negative;
81
  Sentiment -> Neutral;
82
  Sentiment -> Positive;
83
 
84
+ Negative -> Emotion;
85
  Positive -> Emotion [penwidth=0.2];
86
  Neutral -> Emotion [penwidth=0.2];
87
+ Sentiment -> Emotion;
88
+ "Input Text" -> Emotion;
89
  Emotion -> Anger;
90
  Emotion -> Disgust;
91
  Emotion -> Fear;
 
109
  node [shape=box, style="rounded,filled", fontname="Helvetica", fontsize=9, margin="0.15,0.1"];
110
 
111
  // Define nodes with custom colors
112
+ "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"];
113
+ "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"];
114
  Sentiment [label="Sentiment", fillcolor="#fde6ff", fontcolor="black"];
115
  Negative [label="Negative: 0.9999861717224121", fillcolor="#e8e6ff", fontcolor="black"];
116
  Neutral [label="Neutral: 6.885089078423334e-06", fillcolor="#e8e6ff", fontcolor="black"];
 
129
  // edge [color="#7a7a7a", penwidth=3];
130
 
131
  // Define edges
132
+ "Input Text" -> Sentiment;
133
+ "Input Text" -> "Normalized Text";
134
  Sentiment -> Negative;
135
  Sentiment -> Neutral;
136
  Sentiment -> Positive;
137
 
138
+ Negative -> Emotion;
139
  Positive -> Emotion [penwidth=0.2];
140
  Neutral -> Emotion [penwidth=0.2];
141
+ Sentiment -> Emotion;
142
+ "Input Text" -> Emotion;
143
  Emotion -> Anger;
144
  Emotion -> Disgust;
145
  Emotion -> Fear;
 
157
 
158
  graph = """
159
  digraph G {
160
+ rankdir=TD;
161
  bgcolor="white";
162
  nodesep=0.8;
163
  ranksep=0.8;
164
  node [shape=box, style="rounded,filled", fontname="Helvetica", fontsize=9, margin="0.15,0.1"];
165
 
166
  // Define nodes with colors
167
+ "Input Text" [label="Input Text:\ni don't know for real y he's sooo sad", fillcolor="#ffe6de", fontcolor="black"];
168
+ "Normalized Text" [label="Normalized Text:\ni do not know for real why he's so sad", fillcolor="#e6f4d7", fontcolor="black"];
169
  Sentiment [label="Sentiment", fillcolor="#fde6ff", fontcolor="black"];
170
  Negative [label="Negative: 0.995874803543091", fillcolor="#e8e6ff", fontcolor="black"];
171
  Neutral [label="Neutral: 6.232635259628296e-05", fillcolor="#e8e6ff", fontcolor="black"];
 
181
  Surprise [label="Surprise: 0.02158345977962017", fillcolor="#deffe1", fontcolor="black"];
182
 
183
  // Define edges
184
+ "Input Text" -> Sentiment;
185
+ "Input Text" -> "Normalized Text";
186
  Sentiment -> Negative;
187
  Sentiment -> Neutral;
188
  Sentiment -> Positive;
189
 
190
+ Negative -> Emotion;
191
  Positive -> Emotion [penwidth=0.2];
192
  Neutral -> Emotion [penwidth=0.2];
193
+ Sentiment -> Emotion;
194
+ "Input Text" -> Emotion;
195
  Emotion -> Anger;
196
  Emotion -> Disgust;
197
  Emotion -> Fear;