|
"""TODO: Add a description here.""" |
|
|
|
|
|
import json |
|
|
|
import datasets |
|
|
|
|
|
_CITATION = """\ |
|
""" |
|
|
|
|
|
_DESCRIPTION = """\ |
|
""" |
|
|
|
|
|
_HOMEPAGE = "" |
|
|
|
|
|
_LICENSE = "" |
|
|
|
_URL = "https://huggingface.co/datasets/alexjercan/AoC/resolve/main/" |
|
_URLS = { |
|
"dataset": _URL + "dataset.jsonl", |
|
} |
|
|
|
|
|
class Bugnet(datasets.GeneratorBasedBuilder): |
|
"""TODO: Short description of my dataset.""" |
|
|
|
VERSION = datasets.Version("3.0.1") |
|
|
|
def _info(self): |
|
features = datasets.Features( |
|
{ |
|
"year": datasets.Value("string"), |
|
"day": datasets.Value("string"), |
|
"part": datasets.Value("string"), |
|
"pass": datasets.Value("string"), |
|
"fail": datasets.Value("string"), |
|
"test": datasets.Value("string"), |
|
"change": datasets.Value("string"), |
|
"i1": datasets.Value("uint32"), |
|
"i2": datasets.Value("uint32"), |
|
"j1": datasets.Value("uint32"), |
|
"j2": datasets.Value("uint32"), |
|
} |
|
) |
|
|
|
return datasets.DatasetInfo( |
|
description=_DESCRIPTION, |
|
features=features, |
|
homepage=_HOMEPAGE, |
|
license=_LICENSE, |
|
citation=_CITATION, |
|
) |
|
|
|
def _split_generators(self, dl_manager): |
|
data_dir = dl_manager.download_and_extract(_URLS) |
|
return [ |
|
datasets.SplitGenerator( |
|
name=datasets.Split.TRAIN, |
|
gen_kwargs={"filepath": data_dir["dataset"]}, |
|
), |
|
] |
|
|
|
def _generate_examples(self, filepath): |
|
with open(filepath, encoding="utf-8") as file: |
|
for key, row in enumerate(file): |
|
data = json.loads(row) |
|
|
|
yield key, { |
|
"year": data["year"], |
|
"day": data["day"], |
|
"part": data["part"], |
|
"pass": data["pass"], |
|
"fail": data["fail"], |
|
"test": data["test"], |
|
"change": data["change"], |
|
"i1": data["i1"], |
|
"i2": data["i2"], |
|
"j1": data["j1"], |
|
"j2": data["j2"], |
|
} |
|
|