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
·
16340cb
1
Parent(s):
3c4b807
issues with colab again
Browse files
Pill_Ideologies-Post_Titles.py
CHANGED
@@ -175,7 +175,7 @@ class SubRedditPosts(datasets.GeneratorBasedBuilder):
|
|
175 |
print(f"Cleaning NaNs in {col}")
|
176 |
if df[col].dtype == "object":
|
177 |
df[col].fillna("NAN -Nothing found", inplace=True)
|
178 |
-
elif df[col].dtype
|
179 |
df[col].fillna(0, inplace=True)
|
180 |
elif df[col].dtype == "bool":
|
181 |
df[col].fillna(False, inplace=True)
|
@@ -228,7 +228,7 @@ class SubRedditPosts(datasets.GeneratorBasedBuilder):
|
|
228 |
def _generate_examples(self, filepath, split):
|
229 |
# TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
230 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
231 |
-
print("Generating examples")
|
232 |
for key, row in filepath.iterrows():
|
233 |
|
234 |
if self.config.name == "first_domain":
|
|
|
175 |
print(f"Cleaning NaNs in {col}")
|
176 |
if df[col].dtype == "object":
|
177 |
df[col].fillna("NAN -Nothing found", inplace=True)
|
178 |
+
elif df[col].dtype in ["int64", "float64", "int32", "float32"]:
|
179 |
df[col].fillna(0, inplace=True)
|
180 |
elif df[col].dtype == "bool":
|
181 |
df[col].fillna(False, inplace=True)
|
|
|
228 |
def _generate_examples(self, filepath, split):
|
229 |
# TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
230 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
231 |
+
print("IN Generating examples")
|
232 |
for key, row in filepath.iterrows():
|
233 |
|
234 |
if self.config.name == "first_domain":
|