cathw commited on
Commit
2cb9642
1 Parent(s): cf63bc2

Upload reddit_climate_comment.py

Browse files
Files changed (1) hide show
  1. reddit_climate_comment.py +3 -3
reddit_climate_comment.py CHANGED
@@ -92,8 +92,8 @@ class NewDataset(GeneratorBasedBuilder):
92
  "replies": [] # Initialize empty list for replies
93
  }
94
 
95
- # Check if there are replies for the current comment
96
- replies_data = df[df['CommentID'] == comment_id][['ReplyID', 'ReplyAuthor', 'ReplyBody', 'ReplyTimestamp', 'ReplyUpvotes', 'ReplyPermalink']]
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
+ }