EricR401S commited on
Commit
c6be7ba
1 Parent(s): 38271b7

checking nan for colab

Browse files
Files changed (1) hide show
  1. Pill_Ideologies-Post_Titles.py +24 -23
Pill_Ideologies-Post_Titles.py CHANGED
@@ -169,38 +169,39 @@ class SubRedditPosts(datasets.GeneratorBasedBuilder):
169
  data.fillna("NAN -Nothing found", inplace=True)
170
 
171
  # make splits
172
- train, test = train_test_split(
173
- data, test_size=0.10, stratify=data["subreddit"], random_state=80
174
- )
175
- train, val = train_test_split(
176
- train, test_size=0.20, stratify=train["subreddit"], random_state=42
177
- )
178
 
179
  return [
180
  datasets.SplitGenerator(
181
  name=datasets.Split.TRAIN,
182
  # These kwargs will be passed to _generate_examples
183
  gen_kwargs={
184
- "filepath": train,
 
185
  "split": "train",
186
  },
187
  ),
188
- datasets.SplitGenerator(
189
- name=datasets.Split.VALIDATION,
190
- # These kwargs will be passed to _generate_examples
191
- gen_kwargs={
192
- "filepath": val,
193
- "split": "dev",
194
- },
195
- ),
196
- datasets.SplitGenerator(
197
- name=datasets.Split.TEST,
198
- # These kwargs will be passed to _generate_examples
199
- gen_kwargs={
200
- "filepath": test,
201
- "split": "test",
202
- },
203
- ),
204
  ]
205
 
206
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
 
169
  data.fillna("NAN -Nothing found", inplace=True)
170
 
171
  # make splits
172
+ # train, test = train_test_split(
173
+ # data, test_size=0.10, stratify=data["subreddit"], random_state=42
174
+ # )
175
+ # train, val = train_test_split(
176
+ # train, test_size=0.20, stratify=train["subreddit"], random_state=42
177
+ # )
178
 
179
  return [
180
  datasets.SplitGenerator(
181
  name=datasets.Split.TRAIN,
182
  # These kwargs will be passed to _generate_examples
183
  gen_kwargs={
184
+ # "filepath": train,
185
+ "filepath": data,
186
  "split": "train",
187
  },
188
  ),
189
+ # datasets.SplitGenerator(
190
+ # name=datasets.Split.VALIDATION,
191
+ # # These kwargs will be passed to _generate_examples
192
+ # gen_kwargs={
193
+ # "filepath": val,
194
+ # "split": "dev",
195
+ # },
196
+ # ),
197
+ # datasets.SplitGenerator(
198
+ # name=datasets.Split.TEST,
199
+ # # These kwargs will be passed to _generate_examples
200
+ # gen_kwargs={
201
+ # "filepath": test,
202
+ # "split": "test",
203
+ # },
204
+ # ),
205
  ]
206
 
207
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`