Spaces:
Sleeping
Sleeping
chore: top 20 auths, cap score
Browse files
app.py
CHANGED
@@ -107,7 +107,7 @@ def compute_coverage_score(eval_data):
|
|
107 |
"fields_total": 0,
|
108 |
}
|
109 |
|
110 |
-
return
|
111 |
|
112 |
|
113 |
def get_llm_feedback(yaml_content, api_token=None):
|
@@ -216,6 +216,7 @@ def load_all_eval_cards():
|
|
216 |
|
217 |
# Compute coverage score
|
218 |
score, score_details = compute_coverage_score(eval_data)
|
|
|
219 |
|
220 |
# Extract key metadata
|
221 |
eval_cards.append(
|
@@ -367,14 +368,29 @@ def refresh_gallery():
|
|
367 |
# Convert data to pandas DataFrame for table view
|
368 |
table_data = []
|
369 |
for card in eval_cards:
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
|
379 |
df = pd.DataFrame(table_data)
|
380 |
|
|
|
107 |
"fields_total": 0,
|
108 |
}
|
109 |
|
110 |
+
return min(round(total_score, 2), 100), scores
|
111 |
|
112 |
|
113 |
def get_llm_feedback(yaml_content, api_token=None):
|
|
|
216 |
|
217 |
# Compute coverage score
|
218 |
score, score_details = compute_coverage_score(eval_data)
|
219 |
+
score = min(score, 100)
|
220 |
|
221 |
# Extract key metadata
|
222 |
eval_cards.append(
|
|
|
368 |
# Convert data to pandas DataFrame for table view
|
369 |
table_data = []
|
370 |
for card in eval_cards:
|
371 |
+
author_counts = {}
|
372 |
+
for card in eval_cards:
|
373 |
+
authors = card["authors"].split(", ")
|
374 |
+
for author in authors:
|
375 |
+
if author in author_counts:
|
376 |
+
author_counts[author] += 1
|
377 |
+
else:
|
378 |
+
author_counts[author] = 1
|
379 |
+
|
380 |
+
top_authors = sorted(author_counts.items(), key=lambda x: x[1], reverse=True)[:5]
|
381 |
+
top_authors = [author for author, count in top_authors]
|
382 |
+
|
383 |
+
for card in eval_cards:
|
384 |
+
authors = card["authors"].split(", ")
|
385 |
+
filtered_authors = [author for author in authors if author in top_authors]
|
386 |
+
table_data.append(
|
387 |
+
{
|
388 |
+
"Title": card["title"],
|
389 |
+
"Authors": ", ".join(filtered_authors),
|
390 |
+
"Creation Date": card["creation_date"],
|
391 |
+
"Coverage Score": f"{card['coverage_score']}%",
|
392 |
+
}
|
393 |
+
)
|
394 |
|
395 |
df = pd.DataFrame(table_data)
|
396 |
|