Archisman Karmakar
commited on
Commit
·
e89edfa
1
Parent(s):
7329e7e
Update dashboard.py
Browse files- dashboard.py +50 -2
dashboard.py
CHANGED
@@ -44,9 +44,9 @@ def free_memory():
|
|
44 |
print(f"❌ Cache cleanup error: {e}")
|
45 |
|
46 |
|
47 |
-
def
|
48 |
st.write("""
|
49 |
-
#### Sample Example
|
50 |
""")
|
51 |
graph = """
|
52 |
digraph {
|
@@ -130,6 +130,52 @@ def create_sample_example2():
|
|
130 |
st.graphviz_chart(graph)
|
131 |
|
132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
def create_project_overview():
|
134 |
# st.divider()
|
135 |
st.markdown("## Project Overview")
|
@@ -200,9 +246,11 @@ def show_dashboard():
|
|
200 |
|
201 |
create_project_overview()
|
202 |
|
|
|
203 |
create_sample_example1()
|
204 |
|
205 |
create_sample_example2()
|
|
|
206 |
|
207 |
|
208 |
def __main__():
|
|
|
44 |
print(f"❌ Cache cleanup error: {e}")
|
45 |
|
46 |
|
47 |
+
def create_sample_example3():
|
48 |
st.write("""
|
49 |
+
#### Sample Example 3
|
50 |
""")
|
51 |
graph = """
|
52 |
digraph {
|
|
|
130 |
st.graphviz_chart(graph)
|
131 |
|
132 |
|
133 |
+
def create_sample_example1():
|
134 |
+
st.write("#### Sample Example 1")
|
135 |
+
|
136 |
+
graph = """
|
137 |
+
digraph {
|
138 |
+
// Global graph settings
|
139 |
+
graph [bgcolor="white", rankdir=TB, splines=true, nodesep=0.8, ranksep=0.8];
|
140 |
+
node [shape=box, style="rounded,filled", fontname="Helvetica", fontsize=9, margin="0.15,0.1"];
|
141 |
+
|
142 |
+
// Define nodes with custom colors
|
143 |
+
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"];
|
144 |
+
Output [label="Output:\\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"];
|
145 |
+
Sentiment [label="Sentiment:\\nNEGATIVE", fillcolor="#ecdeff", fontcolor="black"];
|
146 |
+
|
147 |
+
// Add the Emotion node
|
148 |
+
Emotion [label="Emotion", fillcolor="#ecdeff", fontcolor="black"];
|
149 |
+
|
150 |
+
// Emotion nodes with a uniform style
|
151 |
+
Anger [label="Anger: 0.14403291", fillcolor="#deffe1", fontcolor="black"];
|
152 |
+
Disgust [label="Disgust: 0.039282672", fillcolor="#deffe1", fontcolor="black"];
|
153 |
+
Fear [label="Fear: 0.014349542", fillcolor="#deffe1", fontcolor="black"];
|
154 |
+
Joy [label="Joy: 0.048965044", fillcolor="#deffe1", fontcolor="black"];
|
155 |
+
Neutral [label="Neutral: 0.494852662", fillcolor="#deffe1", fontcolor="black"];
|
156 |
+
Sadness [label="Sadness: 0.021111647", fillcolor="#deffe1", fontcolor="black"];
|
157 |
+
Surprise [label="Surprise: 0.237405464", fillcolor="#deffe1", fontcolor="black"];
|
158 |
+
|
159 |
+
// Define edges with a consistent style
|
160 |
+
edge [color="#7a7a7a", penwidth=3];
|
161 |
+
|
162 |
+
// Establish the tree structure
|
163 |
+
Input -> Output;
|
164 |
+
Input -> Sentiment;
|
165 |
+
Sentiment -> Emotion;
|
166 |
+
Emotion -> Anger;
|
167 |
+
Emotion -> Disgust;
|
168 |
+
Emotion -> Fear;
|
169 |
+
Emotion -> Joy;
|
170 |
+
Emotion -> Neutral;
|
171 |
+
Emotion -> Sadness;
|
172 |
+
Emotion -> Surprise;
|
173 |
+
}
|
174 |
+
"""
|
175 |
+
|
176 |
+
st.graphviz_chart(graph)
|
177 |
+
|
178 |
+
|
179 |
def create_project_overview():
|
180 |
# st.divider()
|
181 |
st.markdown("## Project Overview")
|
|
|
246 |
|
247 |
create_project_overview()
|
248 |
|
249 |
+
|
250 |
create_sample_example1()
|
251 |
|
252 |
create_sample_example2()
|
253 |
+
create_sample_example3()
|
254 |
|
255 |
|
256 |
def __main__():
|