Sebastian Gehrmann
commited on
Commit
•
e317c5a
1
Parent(s):
bf370b5
xsum.py
CHANGED
@@ -78,7 +78,6 @@ class Xsum(datasets.GeneratorBasedBuilder):
|
|
78 |
def _split_generators(self, dl_manager):
|
79 |
"""Returns SplitGenerators."""
|
80 |
dl_dir = dl_manager.download_and_extract(_URLs)
|
81 |
-
print(dl_dir)
|
82 |
challenge_sets = [
|
83 |
("challenge_train_sample", "train_xsum_RandomSample500.json"),
|
84 |
("challenge_validation_sample", "validation_xsum_RandomSample500.json"),
|
@@ -132,8 +131,8 @@ class Xsum(datasets.GeneratorBasedBuilder):
|
|
132 |
|
133 |
def _generate_examples(self, filepath, split, filepaths=None):
|
134 |
"""Yields examples."""
|
|
|
135 |
if "challenge" in split:
|
136 |
-
print(split)
|
137 |
if "covid" in split:
|
138 |
with open(filepath, encoding="utf-8") as f:
|
139 |
id_ = -1
|
@@ -158,7 +157,6 @@ class Xsum(datasets.GeneratorBasedBuilder):
|
|
158 |
exple["gem_id"] = f"{self.config.name}-{split}-{id_}"
|
159 |
yield id_, exple
|
160 |
else:
|
161 |
-
print("ENDED UP HERE", split)
|
162 |
with open(filepath, "r", encoding="utf-8") as f:
|
163 |
split_ids = json.load(f)
|
164 |
for id_, i in enumerate(split_ids[split]):
|
|
|
78 |
def _split_generators(self, dl_manager):
|
79 |
"""Returns SplitGenerators."""
|
80 |
dl_dir = dl_manager.download_and_extract(_URLs)
|
|
|
81 |
challenge_sets = [
|
82 |
("challenge_train_sample", "train_xsum_RandomSample500.json"),
|
83 |
("challenge_validation_sample", "validation_xsum_RandomSample500.json"),
|
|
|
131 |
|
132 |
def _generate_examples(self, filepath, split, filepaths=None):
|
133 |
"""Yields examples."""
|
134 |
+
print(self.info.splits)
|
135 |
if "challenge" in split:
|
|
|
136 |
if "covid" in split:
|
137 |
with open(filepath, encoding="utf-8") as f:
|
138 |
id_ = -1
|
|
|
157 |
exple["gem_id"] = f"{self.config.name}-{split}-{id_}"
|
158 |
yield id_, exple
|
159 |
else:
|
|
|
160 |
with open(filepath, "r", encoding="utf-8") as f:
|
161 |
split_ids = json.load(f)
|
162 |
for id_, i in enumerate(split_ids[split]):
|