cathw commited on
Commit
5aa5df7
·
verified ·
1 Parent(s): dd254ac

Upload reddit_climate_comment.py

Browse files
Files changed (1) hide show
  1. reddit_climate_comment.py +7 -7
reddit_climate_comment.py CHANGED
@@ -69,13 +69,13 @@ class NewDataset(GeneratorBasedBuilder):
69
  post_permalink = post['PostPermalink']
70
  comments = []
71
 
72
- for i in range(0,len(post['Comments'])):
73
- comment_id = post['Comments']['CommentID'][i]
74
- comment_author = post['Comments']['CommentAuthor'][i]
75
- comment_body = post['Comments']['CommentBody'][i] if post['Comments']['CommentBody'][i] != "" else None
76
- comment_timestamp = post['Comments']['CommentTimestamp'][i]
77
- comment_upvotes = int(post['Comments']['CommentUpvotes'][i]) if post['Comments']['CommentUpvotes'][i] else None
78
- comment_permalink = post['Comments']['CommentPermalink'][i]
79
  replies = []
80
  comments.append({
81
  "CommentID": comment_id,
 
69
  post_permalink = post['PostPermalink']
70
  comments = []
71
 
72
+ for i in range(len(post['Comments'])):
73
+ comment_id = post['Comments'][i]['CommentID']
74
+ comment_author = post['Comments'][i]['CommentAuthor']
75
+ comment_body = post['Comments'][i]['CommentBody'] if post['Comments'][i]['CommentBody'] != "" else None
76
+ comment_timestamp = post['Comments'][i]['CommentTimestamp']
77
+ comment_upvotes = int(post['Comments'][i]['CommentUpvotes']) if post['Comments'][i]['CommentUpvotes'] else None
78
+ comment_permalink = post['Comments'][i]['CommentPermalink']
79
  replies = []
80
  comments.append({
81
  "CommentID": comment_id,