abdoelsayed commited on
Commit
c8a2ae7
·
1 Parent(s): a9c03d7

Remove custom dataset script

Browse files
Files changed (1) hide show
  1. FutureQueryEval.py +0 -143
FutureQueryEval.py DELETED
@@ -1,143 +0,0 @@
1
- import csv
2
- import datasets
3
-
4
- _CITATION = """\
5
- @misc{abdallah2025good,
6
- title={How Good are LLM-based Rerankers? An Empirical Analysis of State-of-the-Art Reranking Models},
7
- author={Abdelrahman Abdallah and Bhawna Piryani and Jamshid Mozafari and Mohammed Ali and Adam Jatowt},
8
- year={2025},
9
- eprint={2508.16757},
10
- archivePrefix={arXiv},
11
- primaryClass={cs.CL}
12
- }
13
- """
14
-
15
- _DESCRIPTION = """\
16
- FutureQueryEval is a novel IR benchmark comprising 148 queries with 2,938 query-document pairs
17
- across 7 topical categories, designed to evaluate reranker performance on temporal novelty.
18
- All queries refer to events after April 2025 to ensure zero contamination with LLM pretraining data.
19
- """
20
-
21
- _HOMEPAGE = "https://github.com/DataScienceUIBK/llm-reranking-generalization-study"
22
-
23
- _LICENSE = "Apache-2.0"
24
-
25
- _URLS = {
26
- "queries": "queries.csv",
27
- "corpus": "corpus.tsv",
28
- "qrels": "qrels.txt",
29
- }
30
-
31
- class FutureQueryEval(datasets.GeneratorBasedBuilder):
32
- """FutureQueryEval dataset for temporal IR evaluation."""
33
-
34
- VERSION = datasets.Version("1.0.0")
35
-
36
- BUILDER_CONFIGS = [
37
- datasets.BuilderConfig(
38
- name="queries",
39
- version=VERSION,
40
- description="Query collection with categories",
41
- ),
42
- datasets.BuilderConfig(
43
- name="corpus",
44
- version=VERSION,
45
- description="Document corpus",
46
- ),
47
- datasets.BuilderConfig(
48
- name="qrels",
49
- version=VERSION,
50
- description="Relevance judgments",
51
- ),
52
- ]
53
-
54
- DEFAULT_CONFIG_NAME = "queries"
55
-
56
- def _info(self):
57
- if self.config.name == "queries":
58
- features = datasets.Features({
59
- "query_id": datasets.Value("string"),
60
- "query_text": datasets.Value("string"),
61
- "category": datasets.Value("string"),
62
- })
63
- elif self.config.name == "corpus":
64
- features = datasets.Features({
65
- "doc_id": datasets.Value("string"),
66
- "title": datasets.Value("string"),
67
- "text": datasets.Value("string"),
68
- "url": datasets.Value("string"),
69
- })
70
- elif self.config.name == "qrels":
71
- features = datasets.Features({
72
- "query_id": datasets.Value("string"),
73
- "iteration": datasets.Value("int32"),
74
- "doc_id": datasets.Value("string"),
75
- "relevance": datasets.Value("int32"),
76
- })
77
-
78
- return datasets.DatasetInfo(
79
- description=_DESCRIPTION,
80
- features=features,
81
- homepage=_HOMEPAGE,
82
- license=_LICENSE,
83
- citation=_CITATION,
84
- )
85
-
86
- def _split_generators(self, dl_manager):
87
- downloaded_files = dl_manager.download(_URLS)
88
-
89
- if self.config.name == "queries":
90
- return [
91
- datasets.SplitGenerator(
92
- name="queries",
93
- gen_kwargs={"filepath": downloaded_files["queries"]},
94
- ),
95
- ]
96
- elif self.config.name == "corpus":
97
- return [
98
- datasets.SplitGenerator(
99
- name="corpus",
100
- gen_kwargs={"filepath": downloaded_files["corpus"]},
101
- ),
102
- ]
103
- elif self.config.name == "qrels":
104
- return [
105
- datasets.SplitGenerator(
106
- name="qrels",
107
- gen_kwargs={"filepath": downloaded_files["qrels"]},
108
- ),
109
- ]
110
-
111
- def _generate_examples(self, filepath):
112
- if self.config.name == "queries":
113
- with open(filepath, encoding="utf-8") as f:
114
- reader = csv.DictReader(f, delimiter=",")
115
- for key, row in enumerate(reader):
116
- yield key, {
117
- "query_id": row["query_id"],
118
- "query_text": row["query_text"],
119
- "category": row["category"],
120
- }
121
-
122
- elif self.config.name == "corpus":
123
- with open(filepath, encoding="utf-8") as f:
124
- reader = csv.DictReader(f, delimiter="\t")
125
- for key, row in enumerate(reader):
126
- yield key, {
127
- "doc_id": row["doc_id"],
128
- "title": row["title"],
129
- "text": row["text"],
130
- "url": row["url"],
131
- }
132
-
133
- elif self.config.name == "qrels":
134
- with open(filepath, encoding="utf-8") as f:
135
- for key, line in enumerate(f):
136
- parts = line.strip().split()
137
- if len(parts) == 4:
138
- yield key, {
139
- "query_id": parts[0],
140
- "iteration": int(parts[1]),
141
- "doc_id": parts[2],
142
- "relevance": int(parts[3]),
143
- }