Datasets:
Tasks:
Text Classification
Sub-tasks:
multi-label-classification
Languages:
English
Size:
10K<n<100K
License:
Convert dataset to Parquet
#8
by
Chuboy
- opened
- README.md +16 -7
- daily_dialog.py +0 -122
- data/test-00000-of-00001.parquet +3 -0
- data/train-00000-of-00001.parquet +3 -0
- data/validation-00000-of-00001.parquet +3 -0
README.md
CHANGED
@@ -48,16 +48,25 @@ dataset_info:
|
|
48 |
'6': surprise
|
49 |
splits:
|
50 |
- name: train
|
51 |
-
num_bytes:
|
52 |
num_examples: 11118
|
53 |
-
- name: test
|
54 |
-
num_bytes: 655844
|
55 |
-
num_examples: 1000
|
56 |
- name: validation
|
57 |
-
num_bytes:
|
|
|
|
|
|
|
58 |
num_examples: 1000
|
59 |
-
download_size:
|
60 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
---
|
62 |
|
63 |
# Dataset Card for "daily_dialog"
|
|
|
48 |
'6': surprise
|
49 |
splits:
|
50 |
- name: train
|
51 |
+
num_bytes: 7296683
|
52 |
num_examples: 11118
|
|
|
|
|
|
|
53 |
- name: validation
|
54 |
+
num_bytes: 673927
|
55 |
+
num_examples: 1000
|
56 |
+
- name: test
|
57 |
+
num_bytes: 655828
|
58 |
num_examples: 1000
|
59 |
+
download_size: 4273740
|
60 |
+
dataset_size: 8626438
|
61 |
+
configs:
|
62 |
+
- config_name: default
|
63 |
+
data_files:
|
64 |
+
- split: train
|
65 |
+
path: data/train-*
|
66 |
+
- split: validation
|
67 |
+
path: data/validation-*
|
68 |
+
- split: test
|
69 |
+
path: data/test-*
|
70 |
---
|
71 |
|
72 |
# Dataset Card for "daily_dialog"
|
daily_dialog.py
DELETED
@@ -1,122 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2020 The HuggingFace Datasets Authors
|
3 |
-
#
|
4 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
# you may not use this file except in compliance with the License.
|
6 |
-
# You may obtain a copy of the License at
|
7 |
-
#
|
8 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
#
|
10 |
-
# Unless required by applicable law or agreed to in writing, software
|
11 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
# See the License for the specific language governing permissions and
|
14 |
-
# limitations under the License.
|
15 |
-
"""DailyDialog: A Manually Labelled Multi-turn Dialogue Dataset"""
|
16 |
-
|
17 |
-
|
18 |
-
import os
|
19 |
-
from zipfile import ZipFile
|
20 |
-
|
21 |
-
import datasets
|
22 |
-
|
23 |
-
|
24 |
-
_CITATION = """\
|
25 |
-
@InProceedings{li2017dailydialog,
|
26 |
-
author = {Li, Yanran and Su, Hui and Shen, Xiaoyu and Li, Wenjie and Cao, Ziqiang and Niu, Shuzi},
|
27 |
-
title = {DailyDialog: A Manually Labelled Multi-turn Dialogue Dataset},
|
28 |
-
booktitle = {Proceedings of The 8th International Joint Conference on Natural Language Processing (IJCNLP 2017)},
|
29 |
-
year = {2017}
|
30 |
-
}
|
31 |
-
"""
|
32 |
-
|
33 |
-
_DESCRIPTION = """\
|
34 |
-
We develop a high-quality multi-turn dialog dataset, DailyDialog, which is intriguing in several aspects.
|
35 |
-
The language is human-written and less noisy. The dialogues in the dataset reflect our daily communication way
|
36 |
-
and cover various topics about our daily life. We also manually label the developed dataset with communication
|
37 |
-
intention and emotion information. Then, we evaluate existing approaches on DailyDialog dataset and hope it
|
38 |
-
benefit the research field of dialog systems.
|
39 |
-
"""
|
40 |
-
|
41 |
-
_URL = "http://yanran.li/files/ijcnlp_dailydialog.zip"
|
42 |
-
|
43 |
-
act_label = {
|
44 |
-
"0": "__dummy__", # Added to be compatible out-of-the-box with datasets.ClassLabel
|
45 |
-
"1": "inform",
|
46 |
-
"2": "question",
|
47 |
-
"3": "directive",
|
48 |
-
"4": "commissive",
|
49 |
-
}
|
50 |
-
|
51 |
-
emotion_label = {
|
52 |
-
"0": "no emotion",
|
53 |
-
"1": "anger",
|
54 |
-
"2": "disgust",
|
55 |
-
"3": "fear",
|
56 |
-
"4": "happiness",
|
57 |
-
"5": "sadness",
|
58 |
-
"6": "surprise",
|
59 |
-
}
|
60 |
-
|
61 |
-
|
62 |
-
class DailyDialog(datasets.GeneratorBasedBuilder):
|
63 |
-
"""DailyDialog: A Manually Labelled Multi-turn Dialogue Dataset"""
|
64 |
-
|
65 |
-
VERSION = datasets.Version("1.0.0")
|
66 |
-
|
67 |
-
__EOU__ = "__eou__"
|
68 |
-
|
69 |
-
def _info(self):
|
70 |
-
return datasets.DatasetInfo(
|
71 |
-
description=_DESCRIPTION,
|
72 |
-
features=datasets.Features(
|
73 |
-
{
|
74 |
-
"dialog": datasets.features.Sequence(datasets.Value("string")),
|
75 |
-
"act": datasets.features.Sequence(datasets.ClassLabel(names=list(act_label.values()))),
|
76 |
-
"emotion": datasets.features.Sequence(datasets.ClassLabel(names=list(emotion_label.values()))),
|
77 |
-
}
|
78 |
-
),
|
79 |
-
supervised_keys=None,
|
80 |
-
homepage="http://yanran.li/dailydialog",
|
81 |
-
citation=_CITATION,
|
82 |
-
)
|
83 |
-
|
84 |
-
def _split_generators(self, dl_manager: datasets.DownloadManager):
|
85 |
-
dl_dir = dl_manager.download_and_extract(_URL)
|
86 |
-
data_dir = os.path.join(dl_dir, "ijcnlp_dailydialog")
|
87 |
-
splits = [datasets.Split.TRAIN, datasets.Split.VALIDATION, datasets.Split.TEST]
|
88 |
-
return [
|
89 |
-
datasets.SplitGenerator(
|
90 |
-
name=split,
|
91 |
-
gen_kwargs={
|
92 |
-
"data_zip": os.path.join(data_dir, f"{split}.zip"),
|
93 |
-
"dialog_path": f"{split}/dialogues_{split}.txt",
|
94 |
-
"act_path": f"{split}/dialogues_act_{split}.txt",
|
95 |
-
"emotion_path": f"{split}/dialogues_emotion_{split}.txt",
|
96 |
-
},
|
97 |
-
)
|
98 |
-
for split in splits
|
99 |
-
]
|
100 |
-
|
101 |
-
def _generate_examples(self, data_zip, dialog_path, act_path, emotion_path):
|
102 |
-
with open(data_zip, "rb") as data_file:
|
103 |
-
with ZipFile(data_file) as zip_file:
|
104 |
-
with zip_file.open(dialog_path) as dialog_file, zip_file.open(act_path) as act_file, zip_file.open(
|
105 |
-
emotion_path
|
106 |
-
) as emotion_file:
|
107 |
-
for idx, (dialog_line, act_line, emotion_line) in enumerate(
|
108 |
-
zip(dialog_file, act_file, emotion_file)
|
109 |
-
):
|
110 |
-
if not dialog_line.strip():
|
111 |
-
break
|
112 |
-
dialog = dialog_line.decode().split(self.__EOU__)[:-1]
|
113 |
-
act = act_line.decode().split(" ")[:-1]
|
114 |
-
emotion = emotion_line.decode().split(" ")[:-1]
|
115 |
-
assert (
|
116 |
-
len(dialog) == len(act) == len(emotion)
|
117 |
-
), "Different turns btw dialogue & emotion & action"
|
118 |
-
yield idx, {
|
119 |
-
"dialog": dialog,
|
120 |
-
"act": [act_label[x] for x in act],
|
121 |
-
"emotion": [emotion_label[x] for x in emotion],
|
122 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1d0626b5416e951cf47e8246f2c4f5ab25047e03b4c4530e37a20bb341363c04
|
3 |
+
size 331465
|
data/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:531dafe837f195164c8bc05867c9a3e4fb3b3ccc3414b71a1e923716ca4f76e6
|
3 |
+
size 3608039
|
data/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7c0da07737c45a6249c8f878e09e6d689040120c77e3127a93c73918f2a75c75
|
3 |
+
size 334236
|