Datasets:
Update divemt.py
Browse files
divemt.py
CHANGED
|
@@ -128,13 +128,12 @@ class DivEMT(datasets.GeneratorBasedBuilder):
|
|
| 128 |
|
| 129 |
def _split_generators(self, dl_manager):
|
| 130 |
"""Returns SplitGenerators."""
|
| 131 |
-
dl_dir = dl_manager.
|
| 132 |
-
fpath = dl_manager.iter_files(dl_dir)
|
| 133 |
return [
|
| 134 |
datasets.SplitGenerator(
|
| 135 |
name=datasets.Split.TRAIN,
|
| 136 |
gen_kwargs={
|
| 137 |
-
"filepath":
|
| 138 |
"features": self.config.features,
|
| 139 |
},
|
| 140 |
)
|
|
@@ -142,7 +141,7 @@ class DivEMT(datasets.GeneratorBasedBuilder):
|
|
| 142 |
|
| 143 |
def _generate_examples(self, filepath: str, features):
|
| 144 |
"""Yields examples as (key, example) tuples."""
|
| 145 |
-
data = pd.read_csv(filepath, sep="\t")
|
| 146 |
data = data[features]
|
| 147 |
for id_, row in data.iterrows():
|
| 148 |
yield id_, row.to_dict()
|
|
|
|
| 128 |
|
| 129 |
def _split_generators(self, dl_manager):
|
| 130 |
"""Returns SplitGenerators."""
|
| 131 |
+
dl_dir = dl_manager.download(_PATHS[self.config.name])
|
|
|
|
| 132 |
return [
|
| 133 |
datasets.SplitGenerator(
|
| 134 |
name=datasets.Split.TRAIN,
|
| 135 |
gen_kwargs={
|
| 136 |
+
"filepath": dl_dir,
|
| 137 |
"features": self.config.features,
|
| 138 |
},
|
| 139 |
)
|
|
|
|
| 141 |
|
| 142 |
def _generate_examples(self, filepath: str, features):
|
| 143 |
"""Yields examples as (key, example) tuples."""
|
| 144 |
+
data = pd.read_csv(filepath, sep="\t", compression="zip")
|
| 145 |
data = data[features]
|
| 146 |
for id_, row in data.iterrows():
|
| 147 |
yield id_, row.to_dict()
|