length fix grouping
Browse files
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, "
|
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)
|