zqwerty
commited on
Commit
·
5849ec1
1
Parent(s):
8999af8
add challenge set CM+T
Browse files- CrossWOZ.py +10 -0
CrossWOZ.py
CHANGED
|
@@ -202,6 +202,14 @@ class CrossWOZ(datasets.GeneratorBasedBuilder):
|
|
| 202 |
"split": "dev",
|
| 203 |
},
|
| 204 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
]
|
| 206 |
|
| 207 |
def _generate_examples(
|
|
@@ -259,6 +267,8 @@ class CrossWOZ(datasets.GeneratorBasedBuilder):
|
|
| 259 |
with open(filepath, encoding="utf-8") as f:
|
| 260 |
data = json.load(f)
|
| 261 |
for dialog_id, dialog in data.items():
|
|
|
|
|
|
|
| 262 |
messages = []
|
| 263 |
for turn in dialog["messages"]:
|
| 264 |
if "user_state" not in turn:
|
|
|
|
| 202 |
"split": "dev",
|
| 203 |
},
|
| 204 |
),
|
| 205 |
+
datasets.SplitGenerator(
|
| 206 |
+
name="challenge_CM+T",
|
| 207 |
+
# These kwargs will be passed to _generate_examples
|
| 208 |
+
gen_kwargs={
|
| 209 |
+
"filepath": os.path.join(data_dir, "test.json"),
|
| 210 |
+
"split": "challenge_CM+T",
|
| 211 |
+
},
|
| 212 |
+
),
|
| 213 |
]
|
| 214 |
|
| 215 |
def _generate_examples(
|
|
|
|
| 267 |
with open(filepath, encoding="utf-8") as f:
|
| 268 |
data = json.load(f)
|
| 269 |
for dialog_id, dialog in data.items():
|
| 270 |
+
if split == "challenge_CM+T" and dialog["type"] != "不独立多领域+交通":
|
| 271 |
+
continue
|
| 272 |
messages = []
|
| 273 |
for turn in dialog["messages"]:
|
| 274 |
if "user_state" not in turn:
|