Datasets:
EricR401S
commited on
Commit
·
2cb9bff
1
Parent(s):
0941189
all
Browse files- reddit_dataset_loader.py +3 -1
reddit_dataset_loader.py
CHANGED
@@ -187,10 +187,12 @@ class SubRedditPosts(datasets.GeneratorBasedBuilder):
|
|
187 |
def _generate_examples(self, filepath, split):
|
188 |
# TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
189 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
190 |
-
|
191 |
with open(filepath, encoding="utf-8") as f:
|
|
|
192 |
for key, row in enumerate(f):
|
193 |
data = json.loads(row)
|
|
|
194 |
if self.config.name == "first_domain":
|
195 |
# Yields examples as (key, example) tuples
|
196 |
yield key, {
|
|
|
187 |
def _generate_examples(self, filepath, split):
|
188 |
# TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
189 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
190 |
+
print(filepath, "is the filepath")
|
191 |
with open(filepath, encoding="utf-8") as f:
|
192 |
+
print(f, "is the file")
|
193 |
for key, row in enumerate(f):
|
194 |
data = json.loads(row)
|
195 |
+
print(data, "is the data")
|
196 |
if self.config.name == "first_domain":
|
197 |
# Yields examples as (key, example) tuples
|
198 |
yield key, {
|