Datasets:
Sub-tasks:
multi-class-classification
Languages:
English
Size:
1K<n<10K
Tags:
natural-language-understanding
ideology classification
text classification
natural language processing
License:
EricR401S
commited on
Commit
·
c6be7ba
1
Parent(s):
38271b7
checking nan for colab
Browse files- 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 |
-
|
174 |
-
)
|
175 |
-
train, val = train_test_split(
|
176 |
-
|
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 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
),
|
196 |
-
datasets.SplitGenerator(
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
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`
|