Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -85,26 +85,26 @@ if uploaded_file:
|
|
85 |
final_output = f"{summary[0]['summary_text']}\n\nContextual Observations:\n" + "\n".join(insights)
|
86 |
st.write(final_output)
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
with tab4:
|
97 |
-
st.subheader("π Emotional Trends Over Time")
|
98 |
-
|
99 |
-
session_dates = ["2024-04-01", "2024-04-08", "2024-04-15", "2024-04-22"]
|
100 |
-
anxiety_scores = [70, 65, 55, 40]
|
101 |
-
sadness_scores = [30, 20, 25, 15]
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
# Export Button
|
110 |
st.subheader("π₯ Export Session Report")
|
|
|
85 |
final_output = f"{summary[0]['summary_text']}\n\nContextual Observations:\n" + "\n".join(insights)
|
86 |
st.write(final_output)
|
87 |
|
88 |
+
with tab3:
|
89 |
+
st.subheader("π¬ Emotional Insights (Overall)")
|
90 |
+
if 'emotion_scores' in locals():
|
91 |
+
for emo in emotion_scores[0]:
|
92 |
+
st.write(f"{emo['label']}: {round(emo['score']*100, 2)}%")
|
93 |
+
else:
|
94 |
+
st.write("No emotional data to display.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
+
with tab4:
|
97 |
+
st.subheader("π Emotional Trends Over Time")
|
98 |
+
|
99 |
+
session_dates = ["2024-04-01", "2024-04-08", "2024-04-15", "2024-04-22"]
|
100 |
+
anxiety_scores = [70, 65, 55, 40]
|
101 |
+
sadness_scores = [30, 20, 25, 15]
|
102 |
+
|
103 |
+
fig = go.Figure()
|
104 |
+
fig.add_trace(go.Scatter(x=session_dates, y=anxiety_scores, mode='lines+markers', name='Anxiety'))
|
105 |
+
fig.add_trace(go.Scatter(x=session_dates, y=sadness_scores, mode='lines+markers', name='Sadness'))
|
106 |
+
fig.update_layout(title='Emotional Trends', xaxis_title='Date', yaxis_title='Score (%)')
|
107 |
+
st.plotly_chart(fig)
|
108 |
|
109 |
# Export Button
|
110 |
st.subheader("π₯ Export Session Report")
|