Datasets:
Tasks:
Text Retrieval
Modalities:
Text
Formats:
parquet
Sub-tasks:
document-retrieval
Languages:
English
Size:
1K - 10K
ArXiv:
License:
import os | |
import datasets | |
from datasets import DownloadManager, DatasetInfo, Features, Value, Split, SplitGenerator | |
_CITATION = """"@misc{birco,\n title={{BIRCO: A Benchmark of Information Retrieval Tasks with Complex Objectives}},\n author={{Xiaoyue Wang et al.}},\n year={2024},\n url={https://arxiv.org/abs/2402.14151},\n}"""" | |
_DESCRIPTION = """"BIRCO benchmark containing corpus, queries, and relevance judgments"""" | |
_HOMEPAGE = "https://github.com/BIRCO-benchmark/BIRCO" | |
_LICENSE = "CC-BY-4.0" | |
class BIRCO(datasets.GeneratorBasedBuilder): | |
BUILDER_CONFIGS = [ | |
datasets.BuilderConfig( | |
name="corpus", | |
version=datasets.Version("1.0.0"), | |
description="Document corpus", | |
), | |
datasets.BuilderConfig( | |
name="queries", | |
version=datasets.Version("1.0.0"), | |
description="Search queries", | |
), | |
datasets.BuilderConfig( | |
name="default", | |
version=datasets.Version("1.0.0"), | |
description="Relevance judgments", | |
), | |
] | |
def _info(self): | |
if self.config.name == "corpus": | |
features = Features({ | |
"_id": Value("string"), | |
"text": Value("string"), | |
"title": Value("string") | |
}) | |
elif self.config.name == "queries": | |
features = Features({ | |
"_id": Value("string"), | |
"text": Value("string") | |
}) | |
elif self.config.name == "default": | |
features = Features({ | |
"query-id": Value("string"), | |
"corpus-id": Value("string"), | |
"score": Value("float64") | |
}) | |
return DatasetInfo( | |
description=_DESCRIPTION, | |
features=features, | |
citation=_CITATION, | |
homepage=_HOMEPAGE, | |
license=_LICENSE | |
) | |
def _split_generators(self, dl_manager): | |
return [ | |
SplitGenerator( | |
name=Split.TEST, | |
gen_kwargs={ | |
"files": dl_manager.download_and_extract({ | |
"data": f"data/{self.config.name}/test-*.parquet" | |
}), | |
"split": "test" | |
} | |
) | |
] | |
def _generate_examples(self, files, split): | |
dataset = datasets.load_dataset("parquet", data_files=files["data"], split=split) | |
for idx, example in enumerate(dataset): | |
yield idx, example | |