zsss0316 commited on
Commit
4368125
·
verified ·
1 Parent(s): 549676f

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +114 -60
index.html CHANGED
@@ -1,75 +1,129 @@
1
- <html>
 
2
  <head>
3
- <meta charset="UTF-8">
4
- <title>Infernet Leaderboard</title>
5
- <script type="module" src="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.js"></script>
6
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.css" />
7
- <style>
8
- body { background-color: #f3f4f6; padding-top: 20px; }
9
- .gradio-container { border-radius: 15px !important; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1 ) !important; }
10
- </style>
11
  </head>
12
  <body>
13
- <gradio-lite>
14
- <gradio-file name="app.py" entrypoint>
15
  import gradio as gr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
- # 1. 核心数据(原生列表格式,无需 pandas)
18
- # 格式:[模型名, 编译%, 复现%, 方向%, 综合分]
19
- RAW_DATA = [
20
- ["Econometrics-Agent (Ours)", 92.5, 88.0, 85.0, 88.5],
21
- ["GPT-4o", 98.0, 82.5, 75.1, 85.2],
22
- ["Claude 3.5 Sonnet", 96.2, 80.4, 72.8, 83.1],
23
- ["Llama-3-70B", 85.0, 65.0, 60.5, 70.2]
24
- ]
25
-
26
- HEADERS = ["Model", "Compilation %", "Replication %", "Direction %", "Overall Score"]
27
-
28
- def get_leaderboard(query=""):
29
- # 过滤与排序逻辑
30
- filtered = [row for row in RAW_DATA if query.lower() in row[0].lower()]
31
- # 按最后一列(综合分)降序排列
32
- sorted_data = sorted(filtered, key=lambda x: x[4], reverse=True)
33
- return sorted_data
34
-
35
- # 2. 界面构建
36
- with gr.Blocks(title="Infernet Leaderboard") as demo:
37
- gr.HTML("<h1 style='text-align: center; color: #111827;'>🏆 Infernet Econometrics Leaderboard</h1>")
38
- gr.HTML("<p style='text-align: center; color: #4b5563; margin-bottom: 20px;'>CamoAiLab | Browser-based Empirical AI Benchmark</p>")
39
-
40
  with gr.Row():
41
- gr.Number(label="Total Models", value=len(RAW_DATA), interactive=False)
42
- gr.Number(label="Best Score (%)", value=max(row[4] for row in RAW_DATA), interactive=False)
 
 
 
 
 
 
43
 
44
- gr.Markdown("---")
45
-
46
  with gr.Tabs():
47
  with gr.TabItem("📊 Main Leaderboard"):
48
- search = gr.Textbox(placeholder="🔍 Search for a model...", label=None, show_label=False)
49
- # 使用原生列表渲染表格
 
 
 
50
  table = gr.Dataframe(
51
- headers=HEADERS,
52
- value=get_leaderboard(),
53
- datatype=["str", "number", "number", "number", "number"],
54
- interactive=False
55
  )
56
-
57
- search.change(fn=get_leaderboard, inputs=search, outputs=table)
 
 
 
 
 
 
58
 
59
  with gr.TabItem("📖 Metric Definitions"):
60
  gr.Markdown("""
61
- ### 🔍 计量经济学评测指标说明
62
-
63
- 1. **Compilation %**: Agent 生成的代码是否能成功运行通过。
64
- 2. **Replication %**: 回归系数等结果与原始论文的重合度。
65
- 3. **Direction %**: **核心指标**。回归系数的正负号预测是否正确。
66
- """)
67
-
68
- with gr.TabItem("✉️ Submission"):
69
- gr.Markdown("请将您的预测文件上传至 [CamoAiLab/Infernet](https://huggingface.co/datasets/CamoAiLab/Infernet ) 社区。")
70
-
71
- demo.launch()
72
- </gradio-file>
73
- </gradio-lite>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  </body>
75
- </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
  <head>
4
+ <meta charset="utf-8">
5
+ <title>Infernet Econometrics Benchmark Leaderboard</title>
6
+ <script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.js"></script>
7
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.css"/>
8
+ <style>
9
+ body { margin:0; background-color:#f7f8fa; }
10
+ </style>
 
11
  </head>
12
  <body>
13
+ <gradio-lite>
 
14
  import gradio as gr
15
+ import pandas as pd
16
+
17
+ CSS = """
18
+ .gradio-container {
19
+ max-width: 1280px !important;
20
+ margin: 24px auto !important;
21
+ padding: 0 20px !important;
22
+ background-color: #ffffff;
23
+ border-radius: 12px;
24
+ box-shadow: 0 2px 12px rgba(0,0,0,0.06);
25
+ }
26
+ .stat-card {
27
+ background: linear-gradient(135deg,#f0f4f9,#ffffff);
28
+ padding:20px 12px;
29
+ border-radius:12px;
30
+ text-align:center;
31
+ border:1px solid #e2e8f0;
32
+ box-shadow:0 1px 4px rgba(0,0,0,0.04);
33
+ }
34
+ .stat-val {
35
+ font-size:28px;
36
+ font-weight:700;
37
+ color:#2b549c;
38
+ margin-bottom:4px;
39
+ }
40
+ .stat-label {
41
+ font-size:14px;
42
+ color:#475569;
43
+ }
44
+ h1 {
45
+ color:#1e293b;
46
+ }
47
+ """
48
+
49
+ def load_data():
50
+ df = pd.read_csv("results.csv")
51
+ df["Overall Score"] = df[["Compilation %","Replication %","Direction %"]].mean(axis=1).round(2)
52
+ return df.sort_values("Overall Score", ascending=False).reset_index(drop=True)
53
+
54
+ with gr.Blocks(css=CSS, title="Infernet Leaderboard") as demo:
55
+ gr.HTML("""
56
+ <div style="text-align:center;padding-top:28px;padding-bottom:12px;">
57
+ <h1 style="margin:0 0 8px 0;color:#0f172a;">🏆 Infernet Econometrics Benchmark Leaderboard</h1>
58
+ <p style="color:#475569;font-size:15px;">
59
+ CamoAiLab, HKU&nbsp;&nbsp;|&nbsp;&nbsp;
60
+ Dataset: <a target="_blank" href="https://huggingface.co/datasets/CamoAiLab/Infernet">CamoAiLab/Infernet</a>
61
+ &nbsp;&nbsp;Paper: <a target="_blank" href="https://arxiv.org/abs/2506.00856">arXiv:2506.00856</a>
62
+ </p>
63
+ </div>
64
+ """)
65
+
66
+ df_init = load_data()
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  with gr.Row():
69
+ with gr.Column():
70
+ gr.HTML(f'<div class="stat-card"><div class="stat-val">{len(df_init)}</div><div class="stat-label">Total Evaluated Models</div></div>')
71
+ with gr.Column():
72
+ gr.HTML(f'<div class="stat-card"><div class="stat-val">{df_init["Overall Score"].max()}%</div><div class="stat-label">Best Overall Score</div></div>')
73
+ with gr.Column():
74
+ gr.HTML(f'<div class="stat-card"><div class="stat-val">1000</div><div class="stat-label">Test Instances</div></div>')
75
+
76
+ gr.Markdown("<hr style='margin:24px 0'>")
77
 
 
 
78
  with gr.Tabs():
79
  with gr.TabItem("📊 Main Leaderboard"):
80
+ search_box = gr.Textbox(
81
+ placeholder="🔍 Search model name ...",
82
+ label=None,
83
+ show_label=False
84
+ )
85
  table = gr.Dataframe(
86
+ value=df_init,
87
+ interactive=False,
88
+ wrap=True
 
89
  )
90
+
91
+ def filter_data(query):
92
+ full = load_data()
93
+ if not query:
94
+ return full
95
+ return full[full["Model"].str.contains(query, case=False)]
96
+
97
+ search_box.change(filter_data, inputs=search_box, outputs=table)
98
 
99
  with gr.TabItem("📖 Metric Definitions"):
100
  gr.Markdown("""
101
+ ### Evaluation Metrics Explanation
102
+
103
+ 1. **Compilation %**
104
+ Code compilation success rate: proportion of generated econometric code that runs without runtime errors.
105
+
106
+ 2. **Replication % (Partial Replication)**
107
+ Partial replication rate: proportion of tasks where model partially reproduces target estimation outputs.
108
+
109
+ 3. **Direction % (Correct Coefficient Direction)**
110
+ Core metric: accuracy for predicting correct positive/negative sign of target regression coefficients.
111
+
112
+ 4. **Overall Score**
113
+ Simple average of above three metrics for comprehensive comparison.
114
+ """)
115
+
116
+ with gr.TabItem("✉️ Submit Results"):
117
+ gr.Markdown("""
118
+ To submit your model results:
119
+ 1. Open a **Discussion** on dataset page: [CamoAiLab/Infernet](https://huggingface.co/datasets/CamoAiLab/Infernet)
120
+ 2. Provide model name, scores and reproduction evidence/logs.
121
+ 3. After verification, we will update the leaderboard.
122
+ """)
123
+
124
+ demo
125
+ </gradio-lite>
126
+
127
+ <gradio-file name="results.csv" url="./results.csv"/>
128
  </body>
129
+ </html>