howey commited on
Commit
81080c8
·
1 Parent(s): 9cfbda1

update split generators

Browse files
Files changed (1) hide show
  1. super_scirep.py +45 -45
super_scirep.py CHANGED
@@ -93,51 +93,51 @@ class SuperSciRep(datasets.GeneratorBasedBuilder):
93
  citation=self.config.citation,
94
  )
95
 
96
- def _split_generators(self, dl_manager):
97
- # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
98
- # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
99
- base_url = "https://ai2-s2-research-public.s3.us-west-2.amazonaws.com/scirepeval"
100
- data_urls = dict()
101
- data_dir = self.config.url if self.config.url else self.config.name
102
- if self.config.is_training:
103
- data_urls = {"train": f"{base_url}/train/{data_dir}/train.jsonl",
104
- "val": f"{base_url}/train/{data_dir}/val.jsonl"}
105
-
106
- if "cite_prediction" not in self.config.name:
107
- data_urls.update({"test": f"{base_url}/test/{data_dir}/meta.jsonl"})
108
- print(data_urls)
109
- downloaded_files = dl_manager.download_and_extract(data_urls)
110
- splits = []
111
- if "test" in downloaded_files:
112
- splits = [datasets.SplitGenerator(
113
- name=datasets.Split("evaluation"),
114
- # These kwargs will be passed to _generate_examples
115
- gen_kwargs={
116
- "filepath": downloaded_files["test"],
117
- "split": "evaluation"
118
- },
119
- ),
120
- ]
121
-
122
- if "train" in downloaded_files:
123
- splits += [
124
- datasets.SplitGenerator(
125
- name=datasets.Split.TRAIN,
126
- # These kwargs will be passed to _generate_examples
127
- gen_kwargs={
128
- "filepath": downloaded_files["train"],
129
- "split": "train",
130
- },
131
- ),
132
- datasets.SplitGenerator(
133
- name=datasets.Split.VALIDATION,
134
- # These kwargs will be passed to _generate_examples
135
- gen_kwargs={
136
- "filepath": downloaded_files["val"],
137
- "split": "validation",
138
- })
139
- ]
140
- return splits
141
 
142
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
143
  def _generate_examples(self, filepath, split):
 
93
  citation=self.config.citation,
94
  )
95
 
96
+ # def _split_generators(self, dl_manager):
97
+ # # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
98
+ # # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
99
+ # base_url = "https://ai2-s2-research-public.s3.us-west-2.amazonaws.com/scirepeval"
100
+ # data_urls = dict()
101
+ # data_dir = self.config.url if self.config.url else self.config.name
102
+ # if self.config.is_training:
103
+ # data_urls = {"train": f"{base_url}/train/{data_dir}/train.jsonl",
104
+ # "val": f"{base_url}/train/{data_dir}/val.jsonl"}
105
+ #
106
+ # if "cite_prediction" not in self.config.name:
107
+ # data_urls.update({"test": f"{base_url}/test/{data_dir}/meta.jsonl"})
108
+ # print(data_urls)
109
+ # downloaded_files = dl_manager.download_and_extract(data_urls)
110
+ # splits = []
111
+ # if "test" in downloaded_files:
112
+ # splits = [datasets.SplitGenerator(
113
+ # name=datasets.Split("evaluation"),
114
+ # # These kwargs will be passed to _generate_examples
115
+ # gen_kwargs={
116
+ # "filepath": downloaded_files["test"],
117
+ # "split": "evaluation"
118
+ # },
119
+ # ),
120
+ # ]
121
+ #
122
+ # if "train" in downloaded_files:
123
+ # splits += [
124
+ # datasets.SplitGenerator(
125
+ # name=datasets.Split.TRAIN,
126
+ # # These kwargs will be passed to _generate_examples
127
+ # gen_kwargs={
128
+ # "filepath": downloaded_files["train"],
129
+ # "split": "train",
130
+ # },
131
+ # ),
132
+ # datasets.SplitGenerator(
133
+ # name=datasets.Split.VALIDATION,
134
+ # # These kwargs will be passed to _generate_examples
135
+ # gen_kwargs={
136
+ # "filepath": downloaded_files["val"],
137
+ # "split": "validation",
138
+ # })
139
+ # ]
140
+ # return splits
141
 
142
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
143
  def _generate_examples(self, filepath, split):