Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -261,30 +261,34 @@ with st.spinner(text='Processing summary results...'):
|
|
| 261 |
if len(su) > 0:
|
| 262 |
summary_count += 1
|
| 263 |
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 288 |
|
| 289 |
|
| 290 |
userid = st.text_input("user id:", "Guest")
|
|
|
|
| 261 |
if len(su) > 0:
|
| 262 |
summary_count += 1
|
| 263 |
|
| 264 |
+
if summary_count > 1:
|
| 265 |
+
valid_summaries = []
|
| 266 |
+
for ssm in st.session_state.summaries:
|
| 267 |
+
if len(ssm) > 0:
|
| 268 |
+
valid_summaries.append(ssm)
|
| 269 |
+
lecturer_data = pd.DataFrame({
|
| 270 |
+
'ds' : range(summary_count) ,
|
| 271 |
+
'y' : [100*ssm[1][0]/ssm[0] for ssm in enumerate(valid_summaries)]
|
| 272 |
+
|
| 273 |
+
})
|
| 274 |
+
audience_data = pd.DataFrame({
|
| 275 |
+
'ds' : range(summary_count) ,
|
| 276 |
+
'y' : [100*ssm[1][1]/ssm[0] for ssm in enumerate(valid_summaries)]
|
| 277 |
+
|
| 278 |
+
})
|
| 279 |
+
speaker_data = pd.DataFrame({
|
| 280 |
+
'ds' : range(summary_count) ,
|
| 281 |
+
'y' : [len(ssm[2]) for ssm in enumerate(valid_summaries)]
|
| 282 |
+
|
| 283 |
+
})
|
| 284 |
+
fig_la = px.line(lecturer_data, x="ds", y="y", color_discrete_sequence=["#0514C0"], labels={'y': 'Lecturer Time'})
|
| 285 |
+
fig_la.add_scatter(x=audience_data['ds'], y=audience_data['y'], mode='lines', name='Audience Time', line=dict(color='#4CC005'))
|
| 286 |
+
fig_la.update_layout(title='Percentage of Time Speaking for Lecturer and Audience', xaxis_title='File', yaxis_title='Percent Time Spoken')
|
| 287 |
+
st.plotly_chart(fig_la, use_container_width=True)
|
| 288 |
+
|
| 289 |
+
fig_spc = px.line(speaker_data, x="ds", y="y", color_discrete_sequence=["#0514C0"], labels={'y': 'Speaker Count'})
|
| 290 |
+
fig_spc.update_layout(title='Number of Distinct Speakers over Time', xaxis_title='File', yaxis_title='# of Distinct Speakers')
|
| 291 |
+
st.plotly_chart(fig_spc, use_container_width=True)
|
| 292 |
|
| 293 |
|
| 294 |
userid = st.text_input("user id:", "Guest")
|