Datasets:
Languages:
English
Size:
1M<n<10M
ArXiv:
Tags:
task-oriented-dialog
task-oriented-dialogues
dialog-flow
dialog-modeling
dialogue-flow
dialogue-modeling
License:
sergioburdisso
commited on
Commit
•
66eb780
1
Parent(s):
8f839f6
Update dialog2flow-dataset.py
Browse files- dialog2flow-dataset.py +10 -6
dialog2flow-dataset.py
CHANGED
@@ -176,6 +176,7 @@ class Dialog2FlowBuilder(GeneratorBasedBuilder):
|
|
176 |
gen_kwargs={
|
177 |
"file_path": file_path["train"],
|
178 |
"split": SPLIT2NAME[split_name],
|
|
|
179 |
},
|
180 |
)
|
181 |
)
|
@@ -186,9 +187,12 @@ class Dialog2FlowBuilder(GeneratorBasedBuilder):
|
|
186 |
data = json.loads(f.read())
|
187 |
return data
|
188 |
|
189 |
-
def _generate_examples(self, file_path, split):
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
|
|
|
|
|
|
|
176 |
gen_kwargs={
|
177 |
"file_path": file_path["train"],
|
178 |
"split": SPLIT2NAME[split_name],
|
179 |
+
"split_name": split_name
|
180 |
},
|
181 |
)
|
182 |
)
|
|
|
187 |
data = json.loads(f.read())
|
188 |
return data
|
189 |
|
190 |
+
def _generate_examples(self, file_path, split, split_name=None):
|
191 |
+
if split_name is not None:
|
192 |
+
data = self._load_json(file_path)
|
193 |
+
data = [(dial_id, dial) for dial_id, dial in data["dialogs"].items() if split_name in dial_id]
|
194 |
+
logger.info(f"generating {len(data)} examples from = {split}")
|
195 |
+
for dial_id, dial in data.items():
|
196 |
+
yield dial_id, {"dialog": dial}
|
197 |
+
else:
|
198 |
+
pass
|