cathw commited on
Commit
2a789b7
1 Parent(s): ac62d24

Upload self-annotated_reddit_climate_comment.py

Browse files
self-annotated_reddit_climate_comment.py CHANGED
@@ -18,32 +18,30 @@ class NewDataset(GeneratorBasedBuilder):
18
  return DatasetInfo(
19
  description=_DESCRIPTION,
20
  features=Features({
21
- "id": Value("string"),
22
- "post_title": Value("string"),
23
- "post_author": Value("string"),
24
- "post_body": Value("string"),
25
- "post_url": Value("string"),
26
- "post_pic": Image(),
27
- "subreddit": Value("string"),
28
- "post_timestamp": Value("string"),
29
- "post_upvotes": Value("int32"),
30
- "post_permalink": Value("string"),
31
- "comments": Sequence({
32
- "CommentID": Value("string"),
33
- "CommentAuthor": Value("string"),
34
- "CommentBody": Value("string"),
35
- "CommentTimestamp": Value("string"),
36
- "CommentUpvotes": Value("int32"),
37
- "CommentPermalink": Value("string"),
38
- "CommentLink": Value("int32")
39
- })
40
- }),
41
  homepage=_HOMEPAGE,
42
  )
43
  def _split_generators(self, dl_manager):
44
- path = dl_manager.download_and_extract(_URL)
45
- train_splits = SplitGenerator(name=Split.TRAIN, gen_kwargs={"filepath": path+"/self_annotated_comments.csv"})
46
- return [train_splits]
47
 
48
  def _generate_examples(self, filepath):
49
  df = pd.read_csv(filepath)
@@ -105,6 +103,7 @@ class NewDataset(GeneratorBasedBuilder):
105
  }
106
 
107
  yield post_id, example
 
108
 
109
 
110
 
 
18
  return DatasetInfo(
19
  description=_DESCRIPTION,
20
  features=Features({
21
+ "id": Value("string"),
22
+ "post_title": Value("string"),
23
+ "post_author": Value("string"),
24
+ "post_body": Value("string"),
25
+ "post_url": Value("string"),
26
+ "post_pic": Image(),
27
+ "subreddit": Value("string"),
28
+ "post_timestamp": Value("string"),
29
+ "post_upvotes": Value("int32"),
30
+ "post_permalink": Value("string"),
31
+ "comments": Sequence({
32
+ "CommentID": Value("string"),
33
+ "CommentAuthor": Value("string"),
34
+ "CommentBody": Value("string"),
35
+ "CommentTimestamp": Value("string"),
36
+ "CommentUpvotes": Value("int32"),
37
+ "CommentPermalink": Value("string"),
38
+ "CommentLink": Value("int32")
39
+ })
40
+ }),
41
  homepage=_HOMEPAGE,
42
  )
43
  def _split_generators(self, dl_manager):
44
+ return [SplitGenerator(name=Split.TRAIN, gen_kwargs={"filepath": dl_manager.download(_URL)})]
 
 
45
 
46
  def _generate_examples(self, filepath):
47
  df = pd.read_csv(filepath)
 
103
  }
104
 
105
  yield post_id, example
106
+
107
 
108
 
109