hynky HF Staff commited on
Commit
f43ecb1
·
1 Parent(s): c76a4d8

length fix grouping

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -141,8 +141,8 @@ def prepare_grouped_data(path, stat_name, grouping, top_k, direction):
141
  keys = heapq.nlargest(top_k, totals, key=totals.get)
142
 
143
  elif direction == "Most frequent (length)":
144
- n_docs = load_stats(path, "n_docs", grouping)
145
- totals = {key: value.total for key, value in n_docs.items()}
146
  keys = heapq.nlargest(top_k, totals, key=totals.get)
147
  else:
148
  keys = heapq.nsmallest(top_k, means, key=means.get)
 
141
  keys = heapq.nlargest(top_k, totals, key=totals.get)
142
 
143
  elif direction == "Most frequent (length)":
144
+ n_docs = load_stats(path, "length", grouping)
145
+ totals = {key: value.total * value.mean for key, value in n_docs.items()}
146
  keys = heapq.nlargest(top_k, totals, key=totals.get)
147
  else:
148
  keys = heapq.nsmallest(top_k, means, key=means.get)