Datasets:
Upload reddit_climate_comment.py
Browse files
reddit_climate_comment.py
CHANGED
@@ -54,8 +54,8 @@ class NewDataset(GeneratorBasedBuilder):
|
|
54 |
path = dl_manager.download_and_extract(_URL)
|
55 |
train_splits = SplitGenerator(name=Split.TRAIN, gen_kwargs={"filepath": path+"/climate_comments.json"})
|
56 |
return [train_splits]
|
57 |
-
def _generate_examples(self,
|
58 |
-
with open(
|
59 |
data = json.load(f)
|
60 |
|
61 |
for post in data["Posts"]:
|
|
|
54 |
path = dl_manager.download_and_extract(_URL)
|
55 |
train_splits = SplitGenerator(name=Split.TRAIN, gen_kwargs={"filepath": path+"/climate_comments.json"})
|
56 |
return [train_splits]
|
57 |
+
def _generate_examples(self, filepath):
|
58 |
+
with open(filepath, encoding="utf-8") as f:
|
59 |
data = json.load(f)
|
60 |
|
61 |
for post in data["Posts"]:
|