duongthienz commited on
Commit
781a673
·
verified ·
1 Parent(s): 8f0b581

Fix Time Spoken chart

Browse files
Files changed (1) hide show
  1. utils.py +6 -2
utils.py CHANGED
@@ -414,9 +414,13 @@ def _seconds_to_hhmmss(seconds):
414
  return f"{h:02d}:{m:02d}:{s:05.2f}"
415
 
416
 
417
- def build_fig_bar(df2, catColors, speakerColors, get_display_name_fn, currFile):
418
- """Horizontal bar chart — time spoken per speaker (hh:mm:ss.ss)."""
 
 
419
  df2 = df2.copy()
 
 
420
  df2["names"] = df2["names"].apply(lambda s: get_display_name_fn(s, currFile))
421
  df2["time_label"] = df2["values"].apply(_seconds_to_hhmmss)
422
  fig = px.bar(
 
414
  return f"{h:02d}:{m:02d}:{s:05.2f}"
415
 
416
 
417
+ def build_fig_bar(df2, speakerNames, catColors, speakerColors, get_display_name_fn, currFile):
418
+ """Horizontal bar chart — time spoken per speaker (hh:mm:ss.ss).
419
+ Only individual speakers are shown; role/category rows are excluded.
420
+ """
421
  df2 = df2.copy()
422
+ # Keep only rows whose raw name is an actual speaker (not a category label)
423
+ df2 = df2[df2["names"].isin(speakerNames)]
424
  df2["names"] = df2["names"].apply(lambda s: get_display_name_fn(s, currFile))
425
  df2["time_label"] = df2["values"].apply(_seconds_to_hhmmss)
426
  fig = px.bar(