duongthienz commited on
Commit
df23de5
·
verified ·
1 Parent(s): 509858d

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +7 -1
utils.py CHANGED
@@ -456,7 +456,13 @@ def build_multifile_category_df(validNames, results, summaries, categories, cate
456
 
457
  for fn in validNames:
458
  currAnnotation, _ = results[fn]
459
- catSummary, extraCats = su.calcCategories(currAnnotation, categorySelect[fn])
 
 
 
 
 
 
460
  summaries[fn]["categories"] = (catSummary, extraCats)
461
  for extra in extraCats:
462
  df6_dict.setdefault(extra, [])
 
456
 
457
  for fn in validNames:
458
  currAnnotation, _ = results[fn]
459
+ # categorySelect is now a global token list [[token,...], ...]; extract raw IDs for fn
460
+ prefix = fn + ": "
461
+ per_file_selections = [
462
+ [t[len(prefix):] for t in tokens if t.startswith(prefix)]
463
+ for tokens in categorySelect
464
+ ]
465
+ catSummary, extraCats = su.calcCategories(currAnnotation, per_file_selections)
466
  summaries[fn]["categories"] = (catSummary, extraCats)
467
  for extra in extraCats:
468
  df6_dict.setdefault(extra, [])