jaisun2004 commited on
Commit
d19971d
·
verified ·
1 Parent(s): a814215

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -15
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import streamlit as st
2
- import matplotlib.pyplot as plt
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
- st.subheader("📈 Emotional Trends Over Time")
147
-
148
- session_dates = ["2024-04-01", "2024-04-08", "2024-04-15", "2024-04-22"]
149
- anxiety_scores = [70, 65, 55, 40]
150
- sadness_scores = [30, 20, 25, 15]
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)