Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import streamlit as st
|
2 |
-
import
|
3 |
from transformers import pipeline
|
4 |
from pydub import AudioSegment
|
5 |
import os
|
@@ -143,17 +143,9 @@ if 'diarized_transcript' in locals() and 'final_output' in locals() and 'emotion
|
|
143 |
st.write(f"{emo['label']}: {round(emo['score']*100, 2)}%")
|
144 |
|
145 |
with tab4:
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
fig, ax = plt.subplots()
|
153 |
-
ax.plot(session_dates, anxiety_scores, label='Anxiety', marker='o')
|
154 |
-
ax.plot(session_dates, sadness_scores, label='Sadness', marker='o')
|
155 |
-
ax.set_title("Emotional Trends Over Time")
|
156 |
-
ax.set_ylabel("Score (%)")
|
157 |
-
ax.set_xlabel("Session Date")
|
158 |
-
ax.legend()
|
159 |
-
st.pyplot(fig)
|
|
|
1 |
import streamlit as st
|
2 |
+
import plotly.graph_objects as go
|
3 |
from transformers import pipeline
|
4 |
from pydub import AudioSegment
|
5 |
import os
|
|
|
143 |
st.write(f"{emo['label']}: {round(emo['score']*100, 2)}%")
|
144 |
|
145 |
with tab4:
|
146 |
+
st.subheader("📈 Emotional Trends Over Time")
|
147 |
+
fig = go.Figure()
|
148 |
+
fig.add_trace(go.Scatter(x=session_dates, y=anxiety_scores, mode='lines+markers', name='Anxiety'))
|
149 |
+
fig.add_trace(go.Scatter(x=session_dates, y=sadness_scores, mode='lines+markers', name='Sadness'))
|
150 |
+
fig.update_layout(title='Emotional Trends', xaxis_title='Date', yaxis_title='Score (%)')
|
151 |
+
st.plotly_chart(fig)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|