Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,34 +34,34 @@ if uploaded_file:
|
|
34 |
st.error(f"β Processing failed: {e}")
|
35 |
tab1, tab2, tab3, tab4 = st.tabs(["π Transcript", "π Summary", "π¬ Emotions", "π Trends"])
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
with tab4:
|
54 |
-
st.subheader("π Emotional Trends Over Time")
|
55 |
-
|
56 |
-
session_dates = ["2024-04-01", "2024-04-08", "2024-04-15", "2024-04-22"]
|
57 |
-
anxiety_scores = [70, 65, 55, 40]
|
58 |
-
sadness_scores = [30, 20, 25, 15]
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
# Export Button
|
67 |
st.subheader("π₯ Export Session Report")
|
|
|
34 |
st.error(f"β Processing failed: {e}")
|
35 |
tab1, tab2, tab3, tab4 = st.tabs(["π Transcript", "π Summary", "π¬ Emotions", "π Trends"])
|
36 |
|
37 |
+
with tab1:
|
38 |
+
st.subheader("π Speaker-Simulated Transcript")
|
39 |
+
st.markdown(diarized_transcript, unsafe_allow_html=True)
|
40 |
+
|
41 |
+
with tab2:
|
42 |
+
st.subheader("π Contextual Summary")
|
43 |
+
st.write(summary[0]["summary_text"])
|
44 |
+
|
45 |
+
with tab3:
|
46 |
+
st.subheader("π¬ Emotional Insights (Overall)")
|
47 |
+
if 'emotion_scores' in locals():
|
48 |
+
for emo in emotion_scores[0]:
|
49 |
+
st.write(f"{emo['label']}: {round(emo['score']*100, 2)}%")
|
50 |
+
else:
|
51 |
+
st.write("No emotional data to display.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
+
with tab4:
|
54 |
+
st.subheader("π Emotional Trends Over Time")
|
55 |
+
|
56 |
+
session_dates = ["2024-04-01", "2024-04-08", "2024-04-15", "2024-04-22"]
|
57 |
+
anxiety_scores = [70, 65, 55, 40]
|
58 |
+
sadness_scores = [30, 20, 25, 15]
|
59 |
+
|
60 |
+
fig = go.Figure()
|
61 |
+
fig.add_trace(go.Scatter(x=session_dates, y=anxiety_scores, mode='lines+markers', name='Anxiety'))
|
62 |
+
fig.add_trace(go.Scatter(x=session_dates, y=sadness_scores, mode='lines+markers', name='Sadness'))
|
63 |
+
fig.update_layout(title='Emotional Trends', xaxis_title='Date', yaxis_title='Score (%)')
|
64 |
+
st.plotly_chart(fig)
|
65 |
|
66 |
# Export Button
|
67 |
st.subheader("π₯ Export Session Report")
|