Datasets:
Upload reddit_climate_comment.py
Browse files
reddit_climate_comment.py
CHANGED
@@ -92,8 +92,8 @@ class NewDataset(GeneratorBasedBuilder):
|
|
92 |
"replies": [] # Initialize empty list for replies
|
93 |
}
|
94 |
|
95 |
-
#
|
96 |
-
replies_data =
|
97 |
for _, reply_data in replies_data.iterrows():
|
98 |
reply = {
|
99 |
"ReplyID": str(reply_data['ReplyID']),
|
@@ -119,4 +119,4 @@ class NewDataset(GeneratorBasedBuilder):
|
|
119 |
"post_upvotes": post_upvotes,
|
120 |
"post_permalink": post_permalink,
|
121 |
"comments": comments
|
122 |
-
}
|
|
|
92 |
"replies": [] # Initialize empty list for replies
|
93 |
}
|
94 |
|
95 |
+
# Get replies for the current comment
|
96 |
+
replies_data = group[group['CommentID'] == comment_id]
|
97 |
for _, reply_data in replies_data.iterrows():
|
98 |
reply = {
|
99 |
"ReplyID": str(reply_data['ReplyID']),
|
|
|
119 |
"post_upvotes": post_upvotes,
|
120 |
"post_permalink": post_permalink,
|
121 |
"comments": comments
|
122 |
+
}
|