Smita R Smita commited on
Commit
ac15cf4
·
unverified ·
1 Parent(s): 7b52df4

benchmark descriptions and styling (#59)

Browse files
.claude/settings.local.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(python3:*)",
5
+ "Bash(source:*)",
6
+ "Bash(python:*)",
7
+ "Bash(ls:*)"
8
+ ],
9
+ "deny": []
10
+ },
11
+ "$schema": "https://json.schemastore.org/claude-code-settings.json"
12
+ }
assets/up-arrow.svg ADDED
category_page_builder.py CHANGED
@@ -30,7 +30,8 @@ def build_category_page(CATEGORY_NAME, PAGE_DESCRIPTION):
30
  create_benchmark_details_display(
31
  full_df=test_df,
32
  tag_map=test_tag_map,
33
- category_name=CATEGORY_NAME
 
34
  )
35
  else:
36
  gr.Markdown("No data available for test split.")
@@ -50,7 +51,8 @@ def build_category_page(CATEGORY_NAME, PAGE_DESCRIPTION):
50
  create_benchmark_details_display(
51
  full_df=validation_df,
52
  tag_map=validation_tag_map,
53
- category_name=CATEGORY_NAME
 
54
  )
55
  else:
56
  gr.Markdown("No data available for validation split.")
 
30
  create_benchmark_details_display(
31
  full_df=test_df,
32
  tag_map=test_tag_map,
33
+ category_name=CATEGORY_NAME,
34
+ validation=False,
35
  )
36
  else:
37
  gr.Markdown("No data available for test split.")
 
51
  create_benchmark_details_display(
52
  full_df=validation_df,
53
  tag_map=validation_tag_map,
54
+ category_name=CATEGORY_NAME,
55
+ validation=True,
56
  )
57
  else:
58
  gr.Markdown("No data available for validation split.")
content.py CHANGED
@@ -1,3 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  TITLE = """<h1 align="left" id="space-title">AstaBench Leaderboard</h1>"""
2
 
3
  INTRO_PARAGRAPH = """
@@ -73,6 +88,99 @@ Scores in this category are aggregated from two benchmarks, providing the first
73
  <br>
74
  """
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"
77
  CITATION_BUTTON_TEXT = r"""@article{asta-bench,
78
  title={AstaBench},
@@ -123,6 +231,15 @@ def hf_uri_to_web_url(uri: str) -> str:
123
 
124
 
125
  css = """
 
 
 
 
 
 
 
 
 
126
  #intro-paragraph {
127
  font-size: 18px;
128
  max-width: 60%;
@@ -366,30 +483,24 @@ span.wrap[tabindex="0"][role="button"][data-editable="false"] {
366
  grid-row: 2 !important;
367
  grid-column: 1 / -1 !important;
368
  }
369
- .benchmark-header {
370
- display: flex !important;
371
- align-items: center !important;
372
- gap: 20px !important;
373
- width: 100% !important;
374
  }
375
- .scroll-up-container .prose {
376
- display: flex;
377
- justify-content: flex-end;
 
 
378
  }
379
  .scroll-up-button {
380
- flex-grow: 0;
381
- display: flex;
382
- color: #032629;
383
- background-color: #faf2e9;
384
- align-items: flex-end;
385
- height: 57px;
386
- padding: 0px;
387
- padding-bottom: 2px;
388
- min-width: 50px;
389
- }
390
- .dark .scroll-up-button {
391
- color: #faf2e9;
392
- background-color: #032629;
393
  }
394
  /*------ Submission Page CSS ------*/
395
  #custom-form-group {
@@ -543,4 +654,8 @@ span.wrap[tabindex="0"][role="button"][data-editable="false"] {
543
  .info-list {
544
  padding-left: 20px;
545
  }
 
 
 
 
546
  """
 
1
+ import re
2
+
3
+ def create_gradio_anchor_id(text: str, validation) -> str:
4
+ """
5
+ Replicates the ID format created by gr.Markdown(header_links=True).
6
+ Example: "Paper Finder Validation" -> "h-paper-finder-validation"
7
+ """
8
+ text = text.lower()
9
+ text = re.sub(r'\s+', '-', text) # Replace spaces with hyphens
10
+ text = re.sub(r'[^\w-]', '', text) # Remove non-word characters
11
+ if validation:
12
+ return f"h-{text}-leaderboard-1"
13
+ return f"h-{text}-leaderboard"
14
+
15
+
16
  TITLE = """<h1 align="left" id="space-title">AstaBench Leaderboard</h1>"""
17
 
18
  INTRO_PARAGRAPH = """
 
88
  <br>
89
  """
90
 
91
+ # External URLs for benchmark descriptions
92
+ SCHOLAR_QA_CS_URL = "https://www.semanticscholar.org/paper/OpenScholar%3A-Synthesizing-Scientific-Literature-LMs-Asai-He/b40df4b273f255b3cb5639e220c8ab7b1bdb313e"
93
+ LITQA2_URL = "https://www.semanticscholar.org/paper/Language-agents-achieve-superhuman-synthesis-of-Skarlinski-Cox/fa5f9aa1cb6f97654ca8e6d279ceee1427a87e68"
94
+ ARXIV_DIGESTABLES_URL = "https://www.semanticscholar.org/paper/ArxivDIGESTables%3A-Synthesizing-Scientific-into-Newman-Lee/c7face35e84f2cb04fb1600d54298799aa0ed189"
95
+ SUPER_URL = "https://www.semanticscholar.org/paper/SUPER%3A-Evaluating-Agents-on-Setting-Up-and-Tasks-Bogin-Yang/053ef8299988680d47df36224bfccffc817472f1"
96
+ CORE_BENCH_URL = "https://www.semanticscholar.org/paper/CORE-Bench%3A-Fostering-the-Credibility-of-Published-Siegel-Kapoor/4c913d59d150fe7581386b87dfd9f90448a9adee"
97
+ DS1000_URL = "https://arxiv.org/abs/2211.11501"
98
+ DISCOVERY_BENCH_URL = "https://www.semanticscholar.org/paper/DiscoveryBench%3A-Towards-Data-Driven-Discovery-with-Majumder-Surana/48c83799530dc523ee01e6c1c40ad577d5c10a16"
99
+
100
+ # Helper function to create external links
101
+ def external_link(url, text, is_s2_url=False):
102
+ url = f"{url}?utm_source=asta_leaderboard" if is_s2_url else url
103
+ return f"<a href='{url}' target='_blank' rel='noopener noreferrer'>{text}</a>"
104
+
105
+ def internal_leaderboard_link(text, validation):
106
+ anchor_id = create_gradio_anchor_id(text, validation)
107
+ return f"<a href='#{anchor_id}'>{text}</a>"
108
+
109
+ # Function to get benchmark descriptions with validation flag
110
+ def get_benchmark_description(benchmark_name, validation):
111
+ descriptions = {
112
+ 'PaperFindingBench': (
113
+ "PaperFindingBench assesses an agent's ability to locate sets of papers based on a natural language "
114
+ "description that may involve both the papers' content and metadata, such as the author or publication year."
115
+ ),
116
+ 'LitQA2-FullText-Search': (
117
+ f"A version of {internal_leaderboard_link('LitQA2-FullText', validation)} that isolates the retrieval aspect of the task. "
118
+ f"This benchmark features the same multi-choice questions as {internal_leaderboard_link('LitQA2-FullText', validation)}, but the agent is not evaluated on answering the actual question "
119
+ "but rather on providing a ranked list of papers in which the answer is likely to be found."
120
+ ),
121
+ 'ScholarQA-CS2': (
122
+ "ScholarQA-CS2 assesses long-form model responses to literature review questions in the domain of computer science. "
123
+ "Answers are expected to be comprehensive reports, such as those produced by deep research systems. "
124
+ f"This benchmark advances on the previously released {external_link(SCHOLAR_QA_CS_URL, 'ScholarQA-CS', is_s2_url=True)} "
125
+ "by using queries from real-world usage, and introducing new evaluation methods for coverage and precision "
126
+ "of both the report text and its citations."
127
+ ),
128
+ 'LitQA2-FullText': (
129
+ f"{external_link(LITQA2_URL, 'LitQA2', is_s2_url=True)}, a benchmark introduced by FutureHouse, gauges a model's ability to answer questions that require document retrieval from the scientific literature. "
130
+ "It consists of multiple-choice questions that necessitate finding a unique paper and analyzing its detailed full text to spot precise information; these questions cannot be answered from a paper’s abstract. "
131
+ "While the original version of the benchmark provided for each question the title of the paper in which the answer can be found, it did not specify the overall collection to search over. In our version, "
132
+ "we search over the index we provide as part of the Asta standard toolset. The “-FullText” suffix indicates we consider only the subset of LitQA2 questions for which "
133
+ "the full-text version of the answering paper is open source and available in our index."
134
+ ),
135
+ 'ArxivDIGESTables-Clean': (
136
+ f"{external_link(ARXIV_DIGESTABLES_URL, 'ArxivDIGESTables', is_s2_url=True)} assesses the ability of models to construct literature review tables, i.e., tables whose rows are papers and whose columns constitute a set of "
137
+ "aspects used to compare and contrast the papers. The goal is to construct such tables given a set of related papers and a table caption describing the user's goal. Generated tables are evaluated by "
138
+ "comparing them to actual tables published in ArXiv papers. The “-Clean” suffix indicates a curated subset of ArxivDIGESTables which drops tables that are either trivial or impossible to reconstruct from full-texts."
139
+ ),
140
+ 'SUPER-Expert': (
141
+ "SUPER-Expert evaluates the capability of models in setting up and executing tasks from low-resource "
142
+ "research repositories—centralized databases containing research data and related materials. "
143
+ f"The \"-Expert\" split indicates the name of the most challenging split in the {external_link(SUPER_URL, 'original SUPER benchmark', is_s2_url=True)} "
144
+ "that involves solving reproduction tasks from scratch and without any intermediate hints or details "
145
+ "about the important landmarks involved in each task."
146
+ ),
147
+ 'CORE-Bench-Hard': (
148
+ "Core-Bench-Hard tests computational reproducibility, a task involving reproducing the results of a study "
149
+ "using provided code and data. It consists of both language-only and vision-language challenges across "
150
+ "multiple difficulty levels. "
151
+ f"The \"-Hard\" split refers to the name of the most challenging split in the original {external_link(CORE_BENCH_URL, 'Core-bench benchmark', is_s2_url=True)} "
152
+ "where only a README file is provided with no instructions or an auxiliary Dockerfile."
153
+ ),
154
+ 'DS-1000': (
155
+ "DS-1000 is an established code generation benchmark containing Python data science coding questions "
156
+ "originally sourced from StackOverflow. It's designed to reflect an array of diverse, realistic, and "
157
+ "practical use cases and directly involves many of the Python libraries commonly used in data science "
158
+ f"and machine learning research. We split the original {external_link(DS1000_URL, 'dataset')} "
159
+ "into 100 validation and 900 test problems."
160
+ ),
161
+ 'DiscoveryBench': (
162
+ "DiscoveryBench is the first comprehensive benchmark to formalize the multi-step process of data-driven "
163
+ "analysis and discovery (i.e., data loading, transformation, statistical analysis, and modeling). "
164
+ f"Originally introduced {external_link(DISCOVERY_BENCH_URL, 'here', is_s2_url=True)}, it is designed to systematically "
165
+ "evaluate how well current LLMs can replicate or reproduce published scientific findings across diverse "
166
+ "domains, including social science, biology, history, and more."
167
+ ),
168
+ 'E2E-Bench': (
169
+ "E2E-Bench is the \"decathlon\" of AI-assisted research. It measures whether a system can run the entire "
170
+ "research pipeline, starting with an initial task description, to designing and performing (software) "
171
+ "experiments, to analyzing and writing up the results."
172
+ ),
173
+ 'E2E-Bench-Hard': (
174
+ f"E2E-Bench-Hard is a more challenging variant of {internal_leaderboard_link('E2E-Bench', validation)}. Tasks are generated using the HypER system, "
175
+ "which identifies research trends and proposes new, underexplored problems. Unlike the regular version, "
176
+ "these tasks are not simplified or curated for accessibility; they are reviewed only for feasibility. "
177
+ "This version is intended to test whether systems can handle more complex and less-structured research "
178
+ f"scenarios, following the same end-to-end process as {internal_leaderboard_link('E2E-Bench', validation)}."
179
+ )
180
+ }
181
+
182
+ return descriptions.get(benchmark_name, "")
183
+
184
  CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"
185
  CITATION_BUTTON_TEXT = r"""@article{asta-bench,
186
  title={AstaBench},
 
231
 
232
 
233
  css = """
234
+ /* CSS Color Variables using Gradio theme */
235
+ :root {
236
+ --color-primary-green: var(--primary-900); /* #0FCB8C */
237
+ --color-primary-pink: var(--secondary-900); /* #f0529c */
238
+ --color-neutral-light: var(--neutral-200); /* #C9C9C3 */
239
+ --color-background-light: var(--neutral-50); /* #FAF2E9 */
240
+ --color-background-dark: var(--neutral-900); /* #032629 */
241
+ --color-text-light: var(--neutral-50); /* #FAF2E9 */
242
+ }
243
  #intro-paragraph {
244
  font-size: 18px;
245
  max-width: 60%;
 
483
  grid-row: 2 !important;
484
  grid-column: 1 / -1 !important;
485
  }
486
+ .benchmark-main-subtitle{
487
+ color: var(--color-primary-green);
488
+ overflow: hidden;
489
+ padding-top: 120px;
 
490
  }
491
+ .benchmark-title{
492
+ color: var(--color-primary-pink);
493
+ }
494
+ .dark .benchmark-title{
495
+ color: var(--color-primary-green);
496
  }
497
  .scroll-up-button {
498
+ margin: 20px 0;
499
+ text-align: left;
500
+ text-decoration: underline;
501
+ }
502
+ .scroll-up-button:hover {
503
+ text-decoration: none;
 
 
 
 
 
 
 
504
  }
505
  /*------ Submission Page CSS ------*/
506
  #custom-form-group {
 
654
  .info-list {
655
  padding-left: 20px;
656
  }
657
+ /* Smooth scrolling for the entire page */
658
+ html {
659
+ scroll-behavior: smooth;
660
+ }
661
  """
ui_components.py CHANGED
@@ -2,7 +2,6 @@ import gradio as gr
2
  import pandas as pd
3
  import plotly.graph_objects as go
4
  import os
5
- import re
6
  import base64
7
 
8
  from agenteval.leaderboard.view import LeaderboardViewer
@@ -27,9 +26,9 @@ from config import (
27
  RESULTS_DATASET,
28
  )
29
  from content import (
 
30
  format_error,
31
- format_log,
32
- format_warning,
33
  hf_uri_to_web_url,
34
  hyperlink,
35
  SCATTER_DISCLAIMER,
@@ -533,7 +532,8 @@ def create_leaderboard_display(
533
  def create_benchmark_details_display(
534
  full_df: pd.DataFrame,
535
  tag_map: dict,
536
- category_name: str
 
537
  ):
538
  """
539
  Generates a detailed breakdown for each benchmark within a given category.
@@ -550,21 +550,15 @@ def create_benchmark_details_display(
550
  gr.Markdown(f"No detailed benchmarks found for the category: {category_name}")
551
  return
552
 
553
- gr.HTML(f'<h2 style="padding-top: 120px;">{category_name} Detailed Benchmark Results</h2>')
554
  gr.Markdown("---")
555
  # 2. Loop through each benchmark and create its UI components
556
  for benchmark_name in benchmark_names:
557
- with gr.Row(elem_classes=["benchmark-header"]):
558
- gr.Markdown(f"### {benchmark_name} Leaderboard", header_links=True)
559
- button_str = f"""
560
- <button
561
- class="scroll-up-button"
562
- onclick="scroll_to_element('page-content-wrapper')"
563
- >
564
- {"⬆"}
565
- </button>
566
- """
567
- gr.HTML(button_str,elem_classes="scroll-up-container")
568
 
569
  # 3. Prepare the data for this specific benchmark's table and plot
570
  benchmark_score_col = f"{benchmark_name} Score"
@@ -724,18 +718,6 @@ def get_full_leaderboard_data(split: str) -> tuple[pd.DataFrame, dict]:
724
 
725
  # Fallback for unexpected types
726
  return pd.DataFrame(), {}
727
- # Create sub-nav bar for benchmarks
728
- def create_gradio_anchor_id(text: str, validation) -> str:
729
- """
730
- Replicates the ID format created by gr.Markdown(header_links=True).
731
- Example: "Paper Finder Validation" -> "h-paper-finder-validation"
732
- """
733
- text = text.lower()
734
- text = re.sub(r'\s+', '-', text) # Replace spaces with hyphens
735
- text = re.sub(r'[^\w-]', '', text) # Remove non-word characters
736
- if validation:
737
- return f"h-{text}-leaderboard-1"
738
- return f"h-{text}-leaderboard"
739
  def create_sub_navigation_bar(tag_map: dict, category_name: str, validation: bool = False) -> gr.HTML:
740
  """
741
  Builds the entire sub-navigation bar as a single, self-contained HTML component.
 
2
  import pandas as pd
3
  import plotly.graph_objects as go
4
  import os
 
5
  import base64
6
 
7
  from agenteval.leaderboard.view import LeaderboardViewer
 
26
  RESULTS_DATASET,
27
  )
28
  from content import (
29
+ create_gradio_anchor_id,
30
  format_error,
31
+ get_benchmark_description,
 
32
  hf_uri_to_web_url,
33
  hyperlink,
34
  SCATTER_DISCLAIMER,
 
532
  def create_benchmark_details_display(
533
  full_df: pd.DataFrame,
534
  tag_map: dict,
535
+ category_name: str,
536
+ validation: bool = False,
537
  ):
538
  """
539
  Generates a detailed breakdown for each benchmark within a given category.
 
550
  gr.Markdown(f"No detailed benchmarks found for the category: {category_name}")
551
  return
552
 
553
+ gr.HTML(f'<h2 class="benchmark-main-subtitle">{category_name} Detailed Benchmark Results</h2>')
554
  gr.Markdown("---")
555
  # 2. Loop through each benchmark and create its UI components
556
  for benchmark_name in benchmark_names:
557
+ gr.HTML(f'''
558
+ <h3 class="benchmark-title" id="{create_gradio_anchor_id(benchmark_name, validation)}">{benchmark_name} Leaderboard</h3>
559
+ <div class="benchmark-description">{get_benchmark_description(benchmark_name, validation)}</div>
560
+ <button onclick="scroll_to_element('page-content-wrapper')" class="scroll-up-button">Return to the aggregate {category_name} leaderboard</button>
561
+ ''')
 
 
 
 
 
 
562
 
563
  # 3. Prepare the data for this specific benchmark's table and plot
564
  benchmark_score_col = f"{benchmark_name} Score"
 
718
 
719
  # Fallback for unexpected types
720
  return pd.DataFrame(), {}
 
 
 
 
 
 
 
 
 
 
 
 
721
  def create_sub_navigation_bar(tag_map: dict, category_name: str, validation: bool = False) -> gr.HTML:
722
  """
723
  Builds the entire sub-navigation bar as a single, self-contained HTML component.