Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update src/populate.py
Browse files- src/populate.py +4 -0
src/populate.py
CHANGED
@@ -16,15 +16,19 @@ def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchm
|
|
16 |
|
17 |
|
18 |
df = pd.DataFrame.from_records(all_data_json)
|
|
|
|
|
19 |
score_cols = [
|
20 |
'ALT E to J BLEU', 'ALT J to E BLEU', 'WikiCorpus E to J BLEU', 'WikiCorpus J to E BLEU',
|
21 |
'XL-Sum JA BLEU', 'XL-Sum ROUGE1', 'XL-Sum ROUGE2', 'XL-Sum ROUGE-Lsum'
|
22 |
]
|
|
|
23 |
|
24 |
existing_score_cols = [col for col in score_cols if col in df.columns]
|
25 |
print(f"Existing score columns: {existing_score_cols}")
|
26 |
|
27 |
# スコア列を100で割り、.4f形式でフォーマット
|
|
|
28 |
df[existing_score_cols] = (df[existing_score_cols] / 100).applymap(lambda x: f'{x:.4f}')
|
29 |
df = df.sort_values(by=[AutoEvalColumn.AVG.name], ascending=False)
|
30 |
df = df[cols].round(decimals=2)
|
|
|
16 |
|
17 |
|
18 |
df = pd.DataFrame.from_records(all_data_json)
|
19 |
+
print(f"DataFrame before NaN filtering: {df}")
|
20 |
+
|
21 |
score_cols = [
|
22 |
'ALT E to J BLEU', 'ALT J to E BLEU', 'WikiCorpus E to J BLEU', 'WikiCorpus J to E BLEU',
|
23 |
'XL-Sum JA BLEU', 'XL-Sum ROUGE1', 'XL-Sum ROUGE2', 'XL-Sum ROUGE-Lsum'
|
24 |
]
|
25 |
+
print(f"Column names before creating DataFrame: {df.columns}")
|
26 |
|
27 |
existing_score_cols = [col for col in score_cols if col in df.columns]
|
28 |
print(f"Existing score columns: {existing_score_cols}")
|
29 |
|
30 |
# スコア列を100で割り、.4f形式でフォーマット
|
31 |
+
print(f"Existing score columns before adjustment: {df[existing_score_cols]}")
|
32 |
df[existing_score_cols] = (df[existing_score_cols] / 100).applymap(lambda x: f'{x:.4f}')
|
33 |
df = df.sort_values(by=[AutoEvalColumn.AVG.name], ascending=False)
|
34 |
df = df[cols].round(decimals=2)
|