l.append((k.upper(), v.num_examples))
l.append(("ALL", info.num_examples))
// Sort reverse on number of examples.
l = reversed(sorted(l, key=lambda x: x[1]))
l = "\n".join(["{0:10} | {1:>10,}".format(a[0], a[1]) for a in l])
return STATISTICS_TABLE.format(split_statistics=l)
After Change
for split_name, split_info in info.splits.items():
stats.append((split_info.num_examples, split_name.upper()))
// Sort reverse on number of examples.
stats.sort(reverse=True)
stats = "\n".join([
"{0:10} | {1:>10,}".format(name, num_exs) for (num_exs, name) in stats
])
return STATISTICS_TABLE.format(split_statistics=stats)