zqwerty
commited on
Commit
·
b483afc
1
Parent(s):
eceb0d4
fix bug in script
Browse files- CrossWOZ.py +3 -5
CrossWOZ.py
CHANGED
|
@@ -219,7 +219,7 @@ class CrossWOZ(datasets.GeneratorBasedBuilder):
|
|
| 219 |
name=datasets.Split.TRAIN,
|
| 220 |
# These kwargs will be passed to _generate_examples
|
| 221 |
gen_kwargs={
|
| 222 |
-
"filepath": downloaded_files["train"],
|
| 223 |
"split": "train",
|
| 224 |
},
|
| 225 |
),
|
|
@@ -227,7 +227,7 @@ class CrossWOZ(datasets.GeneratorBasedBuilder):
|
|
| 227 |
name=datasets.Split.TEST,
|
| 228 |
# These kwargs will be passed to _generate_examples
|
| 229 |
gen_kwargs={
|
| 230 |
-
"filepath": downloaded_files["test"],
|
| 231 |
"split": "test"
|
| 232 |
},
|
| 233 |
),
|
|
@@ -235,7 +235,7 @@ class CrossWOZ(datasets.GeneratorBasedBuilder):
|
|
| 235 |
name=datasets.Split.VALIDATION,
|
| 236 |
# These kwargs will be passed to _generate_examples
|
| 237 |
gen_kwargs={
|
| 238 |
-
"filepath": downloaded_files["val"],
|
| 239 |
"split": "dev",
|
| 240 |
},
|
| 241 |
),
|
|
@@ -247,8 +247,6 @@ class CrossWOZ(datasets.GeneratorBasedBuilder):
|
|
| 247 |
""" Yields examples as (key, example) tuples. """
|
| 248 |
# This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
| 249 |
# The `key` is here for legacy reason (tfds) and is not important in itself.
|
| 250 |
-
print(filepath)
|
| 251 |
-
print(os.listdir(os.path.dirname(filepath)))
|
| 252 |
def convert_goal(raw_goal):
|
| 253 |
goal = []
|
| 254 |
for subgoal in raw_goal:
|
|
|
|
| 219 |
name=datasets.Split.TRAIN,
|
| 220 |
# These kwargs will be passed to _generate_examples
|
| 221 |
gen_kwargs={
|
| 222 |
+
"filepath": os.path.join(downloaded_files["train"], "{}.json".format(os.path.basename(downloaded_files["train"]))),
|
| 223 |
"split": "train",
|
| 224 |
},
|
| 225 |
),
|
|
|
|
| 227 |
name=datasets.Split.TEST,
|
| 228 |
# These kwargs will be passed to _generate_examples
|
| 229 |
gen_kwargs={
|
| 230 |
+
"filepath": os.path.join(downloaded_files["test"], "{}.json".format(os.path.basename(downloaded_files["test"]))),
|
| 231 |
"split": "test"
|
| 232 |
},
|
| 233 |
),
|
|
|
|
| 235 |
name=datasets.Split.VALIDATION,
|
| 236 |
# These kwargs will be passed to _generate_examples
|
| 237 |
gen_kwargs={
|
| 238 |
+
"filepath": os.path.join(downloaded_files["val"], "{}.json".format(os.path.basename(downloaded_files["val"]))),
|
| 239 |
"split": "dev",
|
| 240 |
},
|
| 241 |
),
|
|
|
|
| 247 |
""" Yields examples as (key, example) tuples. """
|
| 248 |
# This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
| 249 |
# The `key` is here for legacy reason (tfds) and is not important in itself.
|
|
|
|
|
|
|
| 250 |
def convert_goal(raw_goal):
|
| 251 |
goal = []
|
| 252 |
for subgoal in raw_goal:
|