Datasets:

Modalities:
Text
Formats:
json
Languages:
French
ArXiv:
Libraries:
Datasets
pandas
License:
mciancone commited on
Commit
392ba3f
·
verified ·
1 Parent(s): 6a8674e

add train-test splits handling

Browse files
Files changed (1) hide show
  1. alloprof.py +6 -4
alloprof.py CHANGED
@@ -37,7 +37,7 @@ For more information about the data source and the features, please refer to the
37
  This re-edition of the dataset has been made for easier usage in the MTEB benchmarking pipeline. (https://huggingface.co/spaces/mteb/leaderboard). It is a filtered version of the original dataset, in a more ready-to-use format.
38
  """
39
 
40
- _SPLITS = ["documents", "queries"]
41
  _HOMEPAGE = "https://huggingface.co/datasets/antoinelb7/alloprof"
42
  _LICENSE = "Creative Commons Attribution Non Commercial Share Alike 4.0 International"
43
  _URLS = {
@@ -48,7 +48,7 @@ _URLS = {
48
  class Alloprof(datasets.GeneratorBasedBuilder):
49
  """Alloprof: a new French question-answer education dataset and its use in an information retrieval case study"""
50
 
51
- VERSION = datasets.Version("1.0.0")
52
  BUILDER_CONFIGS = [
53
  datasets.BuilderConfig(name="documents", version=VERSION, description="Corpus of documents from the Alloprof website"),
54
  datasets.BuilderConfig(name="queries", version=VERSION, description="Corpus of queries from students"),
@@ -90,8 +90,10 @@ class Alloprof(datasets.GeneratorBasedBuilder):
90
  dl_path = dl_manager.download_and_extract(_URLS["documents"])
91
  return [datasets.SplitGenerator(name="documents", gen_kwargs={"filepath": dl_path})]
92
  elif self.config.name == "queries":
93
- dl_paths = dl_manager.download_and_extract(_URLS["queries"])
94
- return [datasets.SplitGenerator(name="queries", gen_kwargs={"filepath": dl_paths})]
 
 
95
  else:
96
  raise ValueError(f"Please specify a valid config name : {_SPLITS}")
97
 
 
37
  This re-edition of the dataset has been made for easier usage in the MTEB benchmarking pipeline. (https://huggingface.co/spaces/mteb/leaderboard). It is a filtered version of the original dataset, in a more ready-to-use format.
38
  """
39
 
40
+ _SPLITS = ["documents", "queries-train", "queries-test"]
41
  _HOMEPAGE = "https://huggingface.co/datasets/antoinelb7/alloprof"
42
  _LICENSE = "Creative Commons Attribution Non Commercial Share Alike 4.0 International"
43
  _URLS = {
 
48
  class Alloprof(datasets.GeneratorBasedBuilder):
49
  """Alloprof: a new French question-answer education dataset and its use in an information retrieval case study"""
50
 
51
+ VERSION = datasets.Version("1.1.0")
52
  BUILDER_CONFIGS = [
53
  datasets.BuilderConfig(name="documents", version=VERSION, description="Corpus of documents from the Alloprof website"),
54
  datasets.BuilderConfig(name="queries", version=VERSION, description="Corpus of queries from students"),
 
90
  dl_path = dl_manager.download_and_extract(_URLS["documents"])
91
  return [datasets.SplitGenerator(name="documents", gen_kwargs={"filepath": dl_path})]
92
  elif self.config.name == "queries":
93
+ dl_path_train = dl_manager.download_and_extract(_URLS["queries-train"])
94
+ dl_path_test = dl_manager.download_and_extract(_URLS["queries-test"])
95
+ return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": dl_path_train}),
96
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": dl_path_test})]
97
  else:
98
  raise ValueError(f"Please specify a valid config name : {_SPLITS}")
99