Datasets:
Upload reddit_climate_comment.py
Browse files
reddit_climate_comment.py
CHANGED
@@ -8,9 +8,8 @@ from typing import Dict
|
|
8 |
|
9 |
CITATION = ""
|
10 |
_DESCRIPTION = "Demo"
|
11 |
-
|
12 |
-
|
13 |
-
_LICENSE = ""
|
14 |
|
15 |
_URL = "https://github.com/catherine-ywang/reddit_climate_comment_data/raw/main/climate_comments.csv.zip"
|
16 |
|
@@ -55,7 +54,6 @@ class NewDataset(GeneratorBasedBuilder):
|
|
55 |
|
56 |
def _generate_examples(self, filepath):
|
57 |
df = pd.read_csv(filepath)
|
58 |
-
examples = []
|
59 |
for column in df.columns:
|
60 |
df[column] = df[column].replace({pd.NA: None})
|
61 |
# Group the DataFrame by post ID
|
@@ -134,9 +132,6 @@ class NewDataset(GeneratorBasedBuilder):
|
|
134 |
}
|
135 |
|
136 |
yield post_id, example
|
137 |
-
examples.append(example)
|
138 |
-
all_examples_df = pd.DataFrame(examples)
|
139 |
-
all_examples_df.to_parquet('climate_comments.parquet')
|
140 |
|
141 |
|
142 |
|
|
|
8 |
|
9 |
CITATION = ""
|
10 |
_DESCRIPTION = "Demo"
|
11 |
+
_HOMEPAGE = "https://huggingface.co/datasets/cathw/reddit_climate_comment"
|
12 |
+
_LICENSE = "MIT"
|
|
|
13 |
|
14 |
_URL = "https://github.com/catherine-ywang/reddit_climate_comment_data/raw/main/climate_comments.csv.zip"
|
15 |
|
|
|
54 |
|
55 |
def _generate_examples(self, filepath):
|
56 |
df = pd.read_csv(filepath)
|
|
|
57 |
for column in df.columns:
|
58 |
df[column] = df[column].replace({pd.NA: None})
|
59 |
# Group the DataFrame by post ID
|
|
|
132 |
}
|
133 |
|
134 |
yield post_id, example
|
|
|
|
|
|
|
135 |
|
136 |
|
137 |
|