Datasets:
Update divemt.py
Browse files
divemt.py
CHANGED
|
@@ -134,14 +134,15 @@ class DivEMT(datasets.GeneratorBasedBuilder):
|
|
| 134 |
name=datasets.Split.TRAIN,
|
| 135 |
gen_kwargs={
|
| 136 |
"filepath": dl_dir,
|
|
|
|
| 137 |
"features": self.config.features,
|
| 138 |
},
|
| 139 |
)
|
| 140 |
]
|
| 141 |
|
| 142 |
-
def _generate_examples(self, filepath: str, features):
|
| 143 |
"""Yields examples as (key, example) tuples."""
|
| 144 |
-
data = pd.read_csv(filepath, sep="\t")
|
| 145 |
data = data[features]
|
| 146 |
for id_, row in data.iterrows():
|
| 147 |
yield id_, row.to_dict()
|
|
|
|
| 134 |
name=datasets.Split.TRAIN,
|
| 135 |
gen_kwargs={
|
| 136 |
"filepath": dl_dir,
|
| 137 |
+
"config_name": self.config.name,
|
| 138 |
"features": self.config.features,
|
| 139 |
},
|
| 140 |
)
|
| 141 |
]
|
| 142 |
|
| 143 |
+
def _generate_examples(self, filepath: str, config_name: str, features):
|
| 144 |
"""Yields examples as (key, example) tuples."""
|
| 145 |
+
data = pd.read_csv(f"{os.path.join(filepath, config_name)}.tsv", sep="\t")
|
| 146 |
data = data[features]
|
| 147 |
for id_, row in data.iterrows():
|
| 148 |
yield id_, row.to_dict()
|