czyoung commited on
Commit
78a4b12
·
verified ·
1 Parent(s): 2a7b740

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -387,24 +387,22 @@ else:
387
  st.success(f"Took {time.time() - start_time} seconds to analyze {totalFiles} files!")
388
 
389
  currFile = st.sidebar.selectbox('Current File', file_names,on_change=updateMultiSelect,key="select_currFile")
390
- st.info(currFile)
391
  if currFile is None and len(st.session_state.results) > 0 and len(st.session_state.results[0]) > 0:
392
  st.write("Select a file to view from the sidebar")
393
- st.info("Before try")
394
  try:
395
- st.info("In try")
396
  st.session_state.resetResult = False
397
  currFileIndex = file_names.index(currFile)
398
 
399
  if len(st.session_state.results) > currFileIndex and len(st.session_state.summaries) > currFileIndex and len(st.session_state.results[currFileIndex]) > 0:
400
- st.info("In if")
401
  # Handle
402
  currSpeakerList, currAnnotation, currTotalTime = st.session_state.results[currFileIndex]
403
  speakerNames = currAnnotation.labels()
404
-
405
  # Update other categories
406
  unusedSpeakers = st.session_state.unusedSpeakers[currFileIndex]
407
  categorySelections = st.session_state["categorySelect"][currFileIndex]
 
 
408
  for i,category in enumerate(st.session_state.categories):
409
  speakerSet = categorySelections[i]
410
  st.sidebar.multiselect(category,
@@ -417,7 +415,8 @@ try:
417
 
418
 
419
 
420
- newCategory = st.sidebar.text_input('Add category', key='categoryInput',on_change=addCategory)
 
421
 
422
  df4_dict = {}
423
  nameList = st.session_state.categories
@@ -580,7 +579,7 @@ if len(st.session_state.results) > 0:
580
  if category not in theseCategories:
581
  df6_dict[category].append(0)
582
  df6 = pd.DataFrame(df6_dict)
583
- summFig = px.bar(df6, x="files", y=allCategories)
584
  st.plotly_chart(summFig, use_container_width=True)
585
 
586
 
 
387
  st.success(f"Took {time.time() - start_time} seconds to analyze {totalFiles} files!")
388
 
389
  currFile = st.sidebar.selectbox('Current File', file_names,on_change=updateMultiSelect,key="select_currFile")
 
390
  if currFile is None and len(st.session_state.results) > 0 and len(st.session_state.results[0]) > 0:
391
  st.write("Select a file to view from the sidebar")
 
392
  try:
 
393
  st.session_state.resetResult = False
394
  currFileIndex = file_names.index(currFile)
395
 
396
  if len(st.session_state.results) > currFileIndex and len(st.session_state.summaries) > currFileIndex and len(st.session_state.results[currFileIndex]) > 0:
 
397
  # Handle
398
  currSpeakerList, currAnnotation, currTotalTime = st.session_state.results[currFileIndex]
399
  speakerNames = currAnnotation.labels()
400
+ st.info(f"currTotalTime: {currTotalTime}")
401
  # Update other categories
402
  unusedSpeakers = st.session_state.unusedSpeakers[currFileIndex]
403
  categorySelections = st.session_state["categorySelect"][currFileIndex]
404
+ st.info(f"Before categories")
405
+ st.info(st.session_state.categories)
406
  for i,category in enumerate(st.session_state.categories):
407
  speakerSet = categorySelections[i]
408
  st.sidebar.multiselect(category,
 
415
 
416
 
417
 
418
+ newCategory = st.sidebar.text_input('Add category', key='categoryInput',on_change=addCategory)
419
+ st.info(f"After categories")
420
 
421
  df4_dict = {}
422
  nameList = st.session_state.categories
 
579
  if category not in theseCategories:
580
  df6_dict[category].append(0)
581
  df6 = pd.DataFrame(df6_dict)
582
+ summFig = px.bar(df6, x="files", y=allCategories,title="Time Spoken by Each Speaker in Each File")
583
  st.plotly_chart(summFig, use_container_width=True)
584
 
585