Spaces:
Running
Running
Merge branch 'main' of https://huggingface.co/spaces/Neuralk-AI/tabbench
Browse files
app.py
CHANGED
|
@@ -778,9 +778,7 @@ with gr.Blocks(css=css, theme=gr.themes.Default()) as demo:
|
|
| 778 |
type="pandas",
|
| 779 |
)
|
| 780 |
gr.Markdown('### Features')
|
| 781 |
-
|
| 782 |
-
# Top row: Models & Datasets
|
| 783 |
-
# -------------------------
|
| 784 |
with gr.Row():
|
| 785 |
with gr.Column():
|
| 786 |
with gr.Accordion("π Datasets & use case", open=True):
|
|
@@ -789,9 +787,7 @@ with gr.Blocks(css=css, theme=gr.themes.Default()) as demo:
|
|
| 789 |
with gr.Accordion("π€ Models", open=False):
|
| 790 |
gr.Markdown(PRIVATE_MODEL_TEXT)
|
| 791 |
|
| 792 |
-
|
| 793 |
-
# Second row: Metrics & Evaluation Workflow
|
| 794 |
-
# -------------------------
|
| 795 |
with gr.Row():
|
| 796 |
with gr.Accordion("βοΈ Benchmarking procedure", open=False):
|
| 797 |
gr.Markdown(PRIVATE_BENCHMARKING_TEXT)
|
|
@@ -1074,13 +1070,11 @@ with gr.Blocks(css=css, theme=gr.themes.Default()) as demo:
|
|
| 1074 |
|
| 1075 |
|
| 1076 |
def show_content(visible_content, selected_btn):
|
| 1077 |
-
# All content blocks and buttons
|
| 1078 |
content_blocks = [home_intro, public_content, retail_domain_content, finance_domain_content, healthcare_domain_content, private_content, datamap_content]
|
| 1079 |
## btns = [home_btn, public_btn, domain_retail_btn, domain_finance_btn, domain_healthcare_btn, private_btn, datamap_btn]
|
| 1080 |
btns = [public_btn_home, home_btn_public, home_btn_retail, home_btn_finance, home_btn_health, home_btn_private, home_btn_datamap]
|
| 1081 |
# Set visibility
|
| 1082 |
updates = {block: gr.update(visible=(block == visible_content)) for block in content_blocks}
|
| 1083 |
-
# Set button classes
|
| 1084 |
for btn in btns:
|
| 1085 |
if btn == selected_btn:
|
| 1086 |
updates[btn] = gr.update(elem_classes=["white-btn", "selected-btn"])
|
|
|
|
| 778 |
type="pandas",
|
| 779 |
)
|
| 780 |
gr.Markdown('### Features')
|
| 781 |
+
|
|
|
|
|
|
|
| 782 |
with gr.Row():
|
| 783 |
with gr.Column():
|
| 784 |
with gr.Accordion("π Datasets & use case", open=True):
|
|
|
|
| 787 |
with gr.Accordion("π€ Models", open=False):
|
| 788 |
gr.Markdown(PRIVATE_MODEL_TEXT)
|
| 789 |
|
| 790 |
+
|
|
|
|
|
|
|
| 791 |
with gr.Row():
|
| 792 |
with gr.Accordion("βοΈ Benchmarking procedure", open=False):
|
| 793 |
gr.Markdown(PRIVATE_BENCHMARKING_TEXT)
|
|
|
|
| 1070 |
|
| 1071 |
|
| 1072 |
def show_content(visible_content, selected_btn):
|
|
|
|
| 1073 |
content_blocks = [home_intro, public_content, retail_domain_content, finance_domain_content, healthcare_domain_content, private_content, datamap_content]
|
| 1074 |
## btns = [home_btn, public_btn, domain_retail_btn, domain_finance_btn, domain_healthcare_btn, private_btn, datamap_btn]
|
| 1075 |
btns = [public_btn_home, home_btn_public, home_btn_retail, home_btn_finance, home_btn_health, home_btn_private, home_btn_datamap]
|
| 1076 |
# Set visibility
|
| 1077 |
updates = {block: gr.update(visible=(block == visible_content)) for block in content_blocks}
|
|
|
|
| 1078 |
for btn in btns:
|
| 1079 |
if btn == selected_btn:
|
| 1080 |
updates[btn] = gr.update(elem_classes=["white-btn", "selected-btn"])
|
run.py
CHANGED
|
@@ -5,7 +5,6 @@ import json
|
|
| 5 |
with open("complete_results_acad.json", "r") as f:
|
| 6 |
public_per_dataset = pd.json_normalize(json.load(f))
|
| 7 |
|
| 8 |
-
# Load dataset metadata (including industries)
|
| 9 |
with open("public_datasets_info.json", "r") as f:
|
| 10 |
public_datasets_info = pd.json_normalize(json.load(f))
|
| 11 |
|
|
@@ -16,23 +15,14 @@ merged_df = public_per_dataset.merge(
|
|
| 16 |
how='left'
|
| 17 |
)
|
| 18 |
|
| 19 |
-
# Ensure consistent column name
|
| 20 |
merged_df = merged_df.rename(columns={"dataset_industry": "industry"})
|
| 21 |
|
| 22 |
-
# Columns to average
|
| 23 |
metrics_cols = ['Accuracy', 'Precision', 'Recall', 'F1_score', 'AUC', 'Elo_score']
|
| 24 |
|
| 25 |
-
# Group by industry and model, compute mean
|
| 26 |
industry_model_avg = merged_df.groupby(['industry', 'model'])[metrics_cols].mean().reset_index()
|
| 27 |
|
| 28 |
-
# Round for readability
|
| 29 |
industry_model_avg = industry_model_avg.round(3)
|
| 30 |
-
|
| 31 |
-
# Optional: sort by industry and then by model
|
| 32 |
industry_model_avg = industry_model_avg.sort_values(by=['industry', 'model']).reset_index(drop=True)
|
| 33 |
|
| 34 |
-
# Save or display
|
| 35 |
print(industry_model_avg)
|
| 36 |
-
|
| 37 |
-
# Save to CSV if needed
|
| 38 |
industry_model_avg.to_csv("industry_model_average_performance.csv", index=False)
|
|
|
|
| 5 |
with open("complete_results_acad.json", "r") as f:
|
| 6 |
public_per_dataset = pd.json_normalize(json.load(f))
|
| 7 |
|
|
|
|
| 8 |
with open("public_datasets_info.json", "r") as f:
|
| 9 |
public_datasets_info = pd.json_normalize(json.load(f))
|
| 10 |
|
|
|
|
| 15 |
how='left'
|
| 16 |
)
|
| 17 |
|
|
|
|
| 18 |
merged_df = merged_df.rename(columns={"dataset_industry": "industry"})
|
| 19 |
|
|
|
|
| 20 |
metrics_cols = ['Accuracy', 'Precision', 'Recall', 'F1_score', 'AUC', 'Elo_score']
|
| 21 |
|
|
|
|
| 22 |
industry_model_avg = merged_df.groupby(['industry', 'model'])[metrics_cols].mean().reset_index()
|
| 23 |
|
|
|
|
| 24 |
industry_model_avg = industry_model_avg.round(3)
|
|
|
|
|
|
|
| 25 |
industry_model_avg = industry_model_avg.sort_values(by=['industry', 'model']).reset_index(drop=True)
|
| 26 |
|
|
|
|
| 27 |
print(industry_model_avg)
|
|
|
|
|
|
|
| 28 |
industry_model_avg.to_csv("industry_model_average_performance.csv", index=False)
|