tomerz-aai's picture
initial submit
c887522
raw
history blame
739 Bytes
import functools
from datasets import load_dataset
class F1Data:
def __init__(self, cp_ds_name: str, sub_ds_name: str, res_ds_name: str):
self.cp_dataset_name = cp_ds_name
self.submissions_dataset_name = sub_ds_name
self.results_dataset_name = res_ds_name
self.initialize()
@functools.cached_property
def code_problem_formulas(self) -> set[str]:
return set(self.code_problems.keys())
def initialize(self):
cp_ds = load_dataset(self.cp_dataset_name, split="hard")
self.code_problems: dict[str, str] = {r["formula_name"]: r["code_problem"]["problem_description"] for r in cp_ds}
def add_submission(self, submitter: str, submission_path: str):
pass