vipulraheja commited on
Commit
c3576ab
1 Parent(s): 06ba0d0

fix: fix issues in dataloader

Browse files
Files changed (1) hide show
  1. simpitiki.py +7 -8
simpitiki.py CHANGED
@@ -61,8 +61,6 @@ _URLs = {
61
  "itwiki_test":"./v1/source_dataset_split/itwiki_test.json",
62
  "tn_test":"./v1/source_dataset_split/tn_test.json"
63
  }
64
-
65
-
66
  },
67
  "v2":{
68
  "random": {
@@ -117,6 +115,7 @@ class SIMPITIKI(datasets.GeneratorBasedBuilder):
117
  # This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
118
  features = datasets.Features(
119
  {
 
120
  "text": datasets.Value("string"),
121
  "simplified_text": datasets.Value("string"),
122
  "transformation_type":datasets.Value("string"),
@@ -201,7 +200,7 @@ class SIMPITIKI(datasets.GeneratorBasedBuilder):
201
  name='challenge_seen_transformations_test',
202
  # These kwargs will be passed to _generate_examples
203
  gen_kwargs={
204
- "filepath": downloaded_files['source_dataset']['seen_transformations_test'],
205
  "split": "challenge_seen_transformations_test",
206
  },
207
  ),
@@ -210,7 +209,7 @@ class SIMPITIKI(datasets.GeneratorBasedBuilder):
210
  name='challenge_unseen_transformations_test',
211
  # These kwargs will be passed to _generate_examples
212
  gen_kwargs={
213
- "filepath": downloaded_files['source_dataset']['unseen_transformations_test'],
214
  "split": "challenge_unseen_transformations_test",
215
  },
216
  ),
@@ -263,10 +262,10 @@ class SIMPITIKI(datasets.GeneratorBasedBuilder):
263
  data = json.load(f)
264
  for id_, row in enumerate(data):
265
  yield id_, {
266
- "text": data["text"],
267
- "simplified_text": data["simplified_text"],
268
- "transformation_type":data["transformation_type"],
269
- "source_dataset": data["source_dataset"],
270
  "gem_id": f"gem-SIMPITIKI-{split}-{id_}",
271
  }
272
 
61
  "itwiki_test":"./v1/source_dataset_split/itwiki_test.json",
62
  "tn_test":"./v1/source_dataset_split/tn_test.json"
63
  }
 
 
64
  },
65
  "v2":{
66
  "random": {
115
  # This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
116
  features = datasets.Features(
117
  {
118
+ "gem_id": datasets.Value("string"),
119
  "text": datasets.Value("string"),
120
  "simplified_text": datasets.Value("string"),
121
  "transformation_type":datasets.Value("string"),
200
  name='challenge_seen_transformations_test',
201
  # These kwargs will be passed to _generate_examples
202
  gen_kwargs={
203
+ "filepath": downloaded_files['transformations']['seen_transformations_test'],
204
  "split": "challenge_seen_transformations_test",
205
  },
206
  ),
209
  name='challenge_unseen_transformations_test',
210
  # These kwargs will be passed to _generate_examples
211
  gen_kwargs={
212
+ "filepath": downloaded_files['transformations']['unseen_transformations_test'],
213
  "split": "challenge_unseen_transformations_test",
214
  },
215
  ),
262
  data = json.load(f)
263
  for id_, row in enumerate(data):
264
  yield id_, {
265
+ "text": row["text"],
266
+ "simplified_text": row["simplified_text"],
267
+ "transformation_type":row["transformation_type"],
268
+ "source_dataset": row["source_dataset"],
269
  "gem_id": f"gem-SIMPITIKI-{split}-{id_}",
270
  }
271