zqwerty
commited on
Commit
·
679d001
1
Parent(s):
8669bbe
- CrossWOZ.py +8 -6
CrossWOZ.py
CHANGED
|
@@ -42,9 +42,10 @@ _HOMEPAGE = "https://github.com/thu-coai/CrossWOZ"
|
|
| 42 |
_LICENSE = "Apache License, Version 2.0"
|
| 43 |
|
| 44 |
_URLs = {
|
| 45 |
-
"train": "train.json.zip",
|
| 46 |
-
"val": "val.json.zip",
|
| 47 |
-
"test": "test.json.zip"
|
|
|
|
| 48 |
}
|
| 49 |
|
| 50 |
|
|
@@ -213,12 +214,13 @@ class CrossWOZ(datasets.GeneratorBasedBuilder):
|
|
| 213 |
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs
|
| 214 |
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
| 215 |
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
|
|
|
| 216 |
return [
|
| 217 |
datasets.SplitGenerator(
|
| 218 |
name=datasets.Split.TRAIN,
|
| 219 |
# These kwargs will be passed to _generate_examples
|
| 220 |
gen_kwargs={
|
| 221 |
-
"filepath":
|
| 222 |
"split": "train",
|
| 223 |
},
|
| 224 |
),
|
|
@@ -226,7 +228,7 @@ class CrossWOZ(datasets.GeneratorBasedBuilder):
|
|
| 226 |
name=datasets.Split.TEST,
|
| 227 |
# These kwargs will be passed to _generate_examples
|
| 228 |
gen_kwargs={
|
| 229 |
-
"filepath":
|
| 230 |
"split": "test"
|
| 231 |
},
|
| 232 |
),
|
|
@@ -234,7 +236,7 @@ class CrossWOZ(datasets.GeneratorBasedBuilder):
|
|
| 234 |
name=datasets.Split.VALIDATION,
|
| 235 |
# These kwargs will be passed to _generate_examples
|
| 236 |
gen_kwargs={
|
| 237 |
-
"filepath":
|
| 238 |
"split": "dev",
|
| 239 |
},
|
| 240 |
),
|
|
|
|
| 42 |
_LICENSE = "Apache License, Version 2.0"
|
| 43 |
|
| 44 |
_URLs = {
|
| 45 |
+
# "train": "train.json.zip",
|
| 46 |
+
# "val": "val.json.zip",
|
| 47 |
+
# "test": "test.json.zip"
|
| 48 |
+
"all": "data.zip"
|
| 49 |
}
|
| 50 |
|
| 51 |
|
|
|
|
| 214 |
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs
|
| 215 |
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
| 216 |
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
| 217 |
+
data_dir = os.path.join(dl_manager.download_and_extract(_URLs["all"]), "data")
|
| 218 |
return [
|
| 219 |
datasets.SplitGenerator(
|
| 220 |
name=datasets.Split.TRAIN,
|
| 221 |
# These kwargs will be passed to _generate_examples
|
| 222 |
gen_kwargs={
|
| 223 |
+
"filepath": os.path.join(data_dir, "train.json"),
|
| 224 |
"split": "train",
|
| 225 |
},
|
| 226 |
),
|
|
|
|
| 228 |
name=datasets.Split.TEST,
|
| 229 |
# These kwargs will be passed to _generate_examples
|
| 230 |
gen_kwargs={
|
| 231 |
+
"filepath": os.path.join(data_dir, "test.json"),
|
| 232 |
"split": "test"
|
| 233 |
},
|
| 234 |
),
|
|
|
|
| 236 |
name=datasets.Split.VALIDATION,
|
| 237 |
# These kwargs will be passed to _generate_examples
|
| 238 |
gen_kwargs={
|
| 239 |
+
"filepath": os.path.join(data_dir, "val.json"),
|
| 240 |
"split": "dev",
|
| 241 |
},
|
| 242 |
),
|