Datasets:

Languages:
Chinese
ArXiv:
License:
qian commited on
Commit
1e3ceee
1 Parent(s): a4a7445

Update T2Ranking.py

Browse files
Files changed (1) hide show
  1. T2Ranking.py +0 -7
T2Ranking.py CHANGED
@@ -163,12 +163,8 @@ class T2Ranking(datasets.GeneratorBasedBuilder):
163
  def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
164
  split_things = []
165
  for split_name in self.config.splits:
166
- # print('')
167
  split_data_path = _URLS_DICT[self.config.name]
168
- # print(split_data_path)
169
  filepath = dl_manager.download(split_data_path)
170
- # print(filepath)
171
- # print('')
172
  split_thing = datasets.SplitGenerator(
173
  name=datasets.Split.TRAIN,
174
  gen_kwargs={
@@ -179,12 +175,9 @@ class T2Ranking(datasets.GeneratorBasedBuilder):
179
  return split_things
180
 
181
  def _generate_examples(self, filepath):
182
- # data = pd.read_csv(filepath, sep='\t', quoting=3)
183
  reader = csv.DictReader(open(filepath), delimiter='\t', quoting=csv.QUOTE_NONE)
184
  keys = _FEATURES_DICT[self.config.name].keys()
185
  idx = -1
186
  for data in reader:
187
  idx+=1
188
  yield idx, {key: data[key] for key in keys}
189
- # for idx in range(data.shape[0]):
190
- # yield idx, {key: data[key][idx] for key in keys}
 
163
  def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
164
  split_things = []
165
  for split_name in self.config.splits:
 
166
  split_data_path = _URLS_DICT[self.config.name]
 
167
  filepath = dl_manager.download(split_data_path)
 
 
168
  split_thing = datasets.SplitGenerator(
169
  name=datasets.Split.TRAIN,
170
  gen_kwargs={
 
175
  return split_things
176
 
177
  def _generate_examples(self, filepath):
 
178
  reader = csv.DictReader(open(filepath), delimiter='\t', quoting=csv.QUOTE_NONE)
179
  keys = _FEATURES_DICT[self.config.name].keys()
180
  idx = -1
181
  for data in reader:
182
  idx+=1
183
  yield idx, {key: data[key] for key in keys}