update crosswoz data
Browse files- README.md +4 -4
- data.zip +2 -2
- preprocess.py +8 -6
- shuffled_dial_ids.json +0 -0
README.md
CHANGED
@@ -13,13 +13,13 @@ CrossWOZ is the first large-scale Chinese Cross-Domain Wizard-of-Oz task-oriente
|
|
13 |
- Run `python preprocess.py` in the current directory. Need `../../crosswoz/` as the original data.
|
14 |
- **Main changes of the transformation:**
|
15 |
- Add simple description for domains, slots, and intents.
|
16 |
-
-
|
17 |
- Binary dialog acts include: 1) domain == 'General'; 2) intent in ['NoOffer', 'Request', 'Select']; 3) slot in ['酒店设施']
|
18 |
- Categorical dialog acts include: slot in ['酒店类型', '车型', '车牌']
|
19 |
- Non-categorical dialogue acts: others. assert intent in ['Inform', 'Recommend'] and slot != 'none' and value != 'none'
|
20 |
- Transform original user goal to list of `{domain: {'inform': {slot: [value, mentioned/not mentioned]}, 'request': {slot: [value, mentioned/not mentioned]}}}`, stored as `user_state` of user turns.
|
21 |
- Transform `sys_state_init` (first API call of system turns) without `selectedResults` as belief state in user turns.
|
22 |
-
- Transform `sys_state` (last API call of system turns) to `db_query` with domain states that contain non-empty `selectedResults`. The `selectedResults` are saved as `db_results
|
23 |
- **Annotations:**
|
24 |
- user goal, user state, dialogue acts, state, db query, db results.
|
25 |
- Multiple values in state are separated by spaces, meaning all constraints should be satisfied.
|
@@ -36,10 +36,10 @@ Chinese
|
|
36 |
|
37 |
| split | dialogues | utterances | avg_utt | avg_tokens | avg_domains | cat slot match(state) | cat slot match(goal) | cat slot match(dialogue act) | non-cat slot span(dialogue act) |
|
38 |
|------------|-------------|--------------|-----------|--------------|---------------|-------------------------|------------------------|--------------------------------|-----------------------------------|
|
39 |
-
| train |
|
40 |
| validation | 500 | 8458 | 16.92 | 20.53 | 3.04 | 99.62 | - | 100 | 94.36 |
|
41 |
| test | 500 | 8476 | 16.95 | 20.51 | 3.08 | 99.61 | - | 100 | 94.85 |
|
42 |
-
| all |
|
43 |
|
44 |
6 domains: ['景点', '餐馆', '酒店', '地铁', '出租', 'General']
|
45 |
- **cat slot match**: how many values of categorical slots are in the possible values of ontology in percentage.
|
|
|
13 |
- Run `python preprocess.py` in the current directory. Need `../../crosswoz/` as the original data.
|
14 |
- **Main changes of the transformation:**
|
15 |
- Add simple description for domains, slots, and intents.
|
16 |
+
- Switch intent&domain of `General` dialog acts => domain == 'General' and intent in ['thank','bye','greet','welcome']
|
17 |
- Binary dialog acts include: 1) domain == 'General'; 2) intent in ['NoOffer', 'Request', 'Select']; 3) slot in ['酒店设施']
|
18 |
- Categorical dialog acts include: slot in ['酒店类型', '车型', '车牌']
|
19 |
- Non-categorical dialogue acts: others. assert intent in ['Inform', 'Recommend'] and slot != 'none' and value != 'none'
|
20 |
- Transform original user goal to list of `{domain: {'inform': {slot: [value, mentioned/not mentioned]}, 'request': {slot: [value, mentioned/not mentioned]}}}`, stored as `user_state` of user turns.
|
21 |
- Transform `sys_state_init` (first API call of system turns) without `selectedResults` as belief state in user turns.
|
22 |
+
- Transform `sys_state` (last API call of system turns) to `db_query` with domain states that contain non-empty `selectedResults`. The `selectedResults` are saved as `db_results` (only contain entity name). Both stored in system turns.
|
23 |
- **Annotations:**
|
24 |
- user goal, user state, dialogue acts, state, db query, db results.
|
25 |
- Multiple values in state are separated by spaces, meaning all constraints should be satisfied.
|
|
|
36 |
|
37 |
| split | dialogues | utterances | avg_utt | avg_tokens | avg_domains | cat slot match(state) | cat slot match(goal) | cat slot match(dialogue act) | non-cat slot span(dialogue act) |
|
38 |
|------------|-------------|--------------|-----------|--------------|---------------|-------------------------|------------------------|--------------------------------|-----------------------------------|
|
39 |
+
| train | 5012 | 84674 | 16.89 | 20.55 | 3.02 | 99.67 | - | 100 | 94.39 |
|
40 |
| validation | 500 | 8458 | 16.92 | 20.53 | 3.04 | 99.62 | - | 100 | 94.36 |
|
41 |
| test | 500 | 8476 | 16.95 | 20.51 | 3.08 | 99.61 | - | 100 | 94.85 |
|
42 |
+
| all | 6012 | 101608 | 16.9 | 20.54 | 3.03 | 99.66 | - | 100 | 94.43 |
|
43 |
|
44 |
6 domains: ['景点', '餐馆', '酒店', '地铁', '出租', 'General']
|
45 |
- **cat slot match**: how many values of categorical slots are in the possible values of ontology in percentage.
|
data.zip
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:128b43faafb54f423b91240ee12e6e0eb1966d6dcdd2c8b903e91e0e254f7376
|
3 |
+
size 15920814
|
preprocess.py
CHANGED
@@ -432,9 +432,6 @@ def preprocess():
|
|
432 |
split = 'validation'
|
433 |
|
434 |
for ori_dialog_id, ori_dialog in data.items():
|
435 |
-
if ori_dialog_id in ['10550', '11724']:
|
436 |
-
# skip error dialog
|
437 |
-
continue
|
438 |
dialogue_id = f'{dataset}-{split}-{len(dialogues_by_split[split])}'
|
439 |
|
440 |
# get user goal and involved domains
|
@@ -456,15 +453,20 @@ def preprocess():
|
|
456 |
}
|
457 |
|
458 |
for turn_id, turn in enumerate(ori_dialog['messages']):
|
|
|
459 |
if ori_dialog_id == '2660' and turn_id in [8,9]:
|
460 |
-
# skip error turns
|
461 |
continue
|
462 |
elif ori_dialog_id == '7467' and turn_id in [14,15]:
|
463 |
-
# skip error turns
|
464 |
continue
|
465 |
elif ori_dialog_id == '11726' and turn_id in [4,5]:
|
466 |
-
# skip error turns
|
467 |
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
speaker = 'user' if turn['role'] == 'usr' else 'system'
|
469 |
utt = turn['content']
|
470 |
|
|
|
432 |
split = 'validation'
|
433 |
|
434 |
for ori_dialog_id, ori_dialog in data.items():
|
|
|
|
|
|
|
435 |
dialogue_id = f'{dataset}-{split}-{len(dialogues_by_split[split])}'
|
436 |
|
437 |
# get user goal and involved domains
|
|
|
453 |
}
|
454 |
|
455 |
for turn_id, turn in enumerate(ori_dialog['messages']):
|
456 |
+
# skip error turns
|
457 |
if ori_dialog_id == '2660' and turn_id in [8,9]:
|
|
|
458 |
continue
|
459 |
elif ori_dialog_id == '7467' and turn_id in [14,15]:
|
|
|
460 |
continue
|
461 |
elif ori_dialog_id == '11726' and turn_id in [4,5]:
|
|
|
462 |
continue
|
463 |
+
elif ori_dialog_id == '10550' and turn_id == 6:
|
464 |
+
dialogue['user_state_final'] = dialogue['turns'][-2]['user_state']
|
465 |
+
break
|
466 |
+
elif ori_dialog_id == '11724' and turn_id == 8:
|
467 |
+
dialogue['user_state_final'] = dialogue['turns'][-2]['user_state']
|
468 |
+
break
|
469 |
+
|
470 |
speaker = 'user' if turn['role'] == 'usr' else 'system'
|
471 |
utt = turn['content']
|
472 |
|
shuffled_dial_ids.json
CHANGED
The diff for this file is too large to render.
See raw diff
|
|