Datasets:
Upload adult.py
Browse files
adult.py
CHANGED
@@ -139,11 +139,11 @@ class Adult(datasets.GeneratorBasedBuilder):
|
|
139 |
|
140 |
def _info(self):
|
141 |
print(self.__dict__)
|
142 |
-
if self.
|
143 |
-
raise ValueError(f"Unknown configuration: {self.
|
144 |
|
145 |
info = datasets.DatasetInfo(description=__DESCRIPTION, citation=__CITATION, homepage=__HOMEPAGE,
|
146 |
-
features=features_per_config[self.
|
147 |
|
148 |
return info
|
149 |
|
@@ -157,7 +157,7 @@ class Adult(datasets.GeneratorBasedBuilder):
|
|
157 |
|
158 |
def _generate_examples(self, filepath: str):
|
159 |
data = pandas.read_csv(filepath)
|
160 |
-
data = self.preprocess(data, config=self.
|
161 |
|
162 |
for row in data.iterrows():
|
163 |
data_row = dict(row)
|
|
|
139 |
|
140 |
def _info(self):
|
141 |
print(self.__dict__)
|
142 |
+
if self.config.name not in features_per_config:
|
143 |
+
raise ValueError(f"Unknown configuration: {self.config.name}")
|
144 |
|
145 |
info = datasets.DatasetInfo(description=__DESCRIPTION, citation=__CITATION, homepage=__HOMEPAGE,
|
146 |
+
features=features_per_config[self.config.name])
|
147 |
|
148 |
return info
|
149 |
|
|
|
157 |
|
158 |
def _generate_examples(self, filepath: str):
|
159 |
data = pandas.read_csv(filepath)
|
160 |
+
data = self.preprocess(data, config=self.config.name)
|
161 |
|
162 |
for row in data.iterrows():
|
163 |
data_row = dict(row)
|