Datasets:
Upload 3 files
#11
by
Krazybeautiful85
- opened
- README (2).md +204 -0
- gitattributes (2).txt +27 -0
- samsum (2).py +112 -0
README (2).md
ADDED
@@ -0,0 +1,204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- expert-generated
|
6 |
+
language:
|
7 |
+
- en
|
8 |
+
license:
|
9 |
+
- cc-by-nc-nd-4.0
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 10K<n<100K
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- summarization
|
18 |
+
task_ids: []
|
19 |
+
paperswithcode_id: samsum-corpus
|
20 |
+
pretty_name: SAMSum Corpus
|
21 |
+
tags:
|
22 |
+
- conversations-summarization
|
23 |
+
dataset_info:
|
24 |
+
features:
|
25 |
+
- name: id
|
26 |
+
dtype: string
|
27 |
+
- name: dialogue
|
28 |
+
dtype: string
|
29 |
+
- name: summary
|
30 |
+
dtype: string
|
31 |
+
config_name: samsum
|
32 |
+
splits:
|
33 |
+
- name: train
|
34 |
+
num_bytes: 9479141
|
35 |
+
num_examples: 14732
|
36 |
+
- name: test
|
37 |
+
num_bytes: 534492
|
38 |
+
num_examples: 819
|
39 |
+
- name: validation
|
40 |
+
num_bytes: 516431
|
41 |
+
num_examples: 818
|
42 |
+
download_size: 2944100
|
43 |
+
dataset_size: 10530064
|
44 |
+
train-eval-index:
|
45 |
+
- config: samsum
|
46 |
+
task: summarization
|
47 |
+
task_id: summarization
|
48 |
+
splits:
|
49 |
+
eval_split: test
|
50 |
+
col_mapping:
|
51 |
+
dialogue: text
|
52 |
+
summary: target
|
53 |
+
---
|
54 |
+
|
55 |
+
# Dataset Card for SAMSum Corpus
|
56 |
+
|
57 |
+
## Table of Contents
|
58 |
+
- [Dataset Description](#dataset-description)
|
59 |
+
- [Dataset Summary](#dataset-summary)
|
60 |
+
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
61 |
+
- [Languages](#languages)
|
62 |
+
- [Dataset Structure](#dataset-structure)
|
63 |
+
- [Data Instances](#data-instances)
|
64 |
+
- [Data Fields](#data-fields)
|
65 |
+
- [Data Splits](#data-splits)
|
66 |
+
- [Dataset Creation](#dataset-creation)
|
67 |
+
- [Curation Rationale](#curation-rationale)
|
68 |
+
- [Source Data](#source-data)
|
69 |
+
- [Annotations](#annotations)
|
70 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
71 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
72 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
73 |
+
- [Discussion of Biases](#discussion-of-biases)
|
74 |
+
- [Other Known Limitations](#other-known-limitations)
|
75 |
+
- [Additional Information](#additional-information)
|
76 |
+
- [Dataset Curators](#dataset-curators)
|
77 |
+
- [Licensing Information](#licensing-information)
|
78 |
+
- [Citation Information](#citation-information)
|
79 |
+
- [Contributions](#contributions)
|
80 |
+
|
81 |
+
## Dataset Description
|
82 |
+
|
83 |
+
- **Homepage:** https://arxiv.org/abs/1911.12237v2
|
84 |
+
- **Repository:** [Needs More Information]
|
85 |
+
- **Paper:** https://arxiv.org/abs/1911.12237v2
|
86 |
+
- **Leaderboard:** [Needs More Information]
|
87 |
+
- **Point of Contact:** [Needs More Information]
|
88 |
+
|
89 |
+
### Dataset Summary
|
90 |
+
|
91 |
+
The SAMSum dataset contains about 16k messenger-like conversations with summaries. Conversations were created and written down by linguists fluent in English. Linguists were asked to create conversations similar to those they write on a daily basis, reflecting the proportion of topics of their real-life messenger convesations. The style and register are diversified - conversations could be informal, semi-formal or formal, they may contain slang words, emoticons and typos. Then, the conversations were annotated with summaries. It was assumed that summaries should be a concise brief of what people talked about in the conversation in third person.
|
92 |
+
The SAMSum dataset was prepared by Samsung R&D Institute Poland and is distributed for research purposes (non-commercial licence: CC BY-NC-ND 4.0).
|
93 |
+
|
94 |
+
### Supported Tasks and Leaderboards
|
95 |
+
|
96 |
+
[Needs More Information]
|
97 |
+
|
98 |
+
### Languages
|
99 |
+
|
100 |
+
English
|
101 |
+
|
102 |
+
## Dataset Structure
|
103 |
+
|
104 |
+
### Data Instances
|
105 |
+
|
106 |
+
The created dataset is made of 16369 conversations distributed uniformly into 4 groups based on the number of utterances in con- versations: 3-6, 7-12, 13-18 and 19-30. Each utterance contains the name of the speaker. Most conversations consist of dialogues between two interlocutors (about 75% of all conversations), the rest is between three or more people
|
107 |
+
|
108 |
+
The first instance in the training set:
|
109 |
+
{'id': '13818513', 'summary': 'Amanda baked cookies and will bring Jerry some tomorrow.', 'dialogue': "Amanda: I baked cookies. Do you want some?\r\nJerry: Sure!\r\nAmanda: I'll bring you tomorrow :-)"}
|
110 |
+
|
111 |
+
### Data Fields
|
112 |
+
|
113 |
+
- dialogue: text of dialogue.
|
114 |
+
- summary: human written summary of the dialogue.
|
115 |
+
- id: unique id of an example.
|
116 |
+
|
117 |
+
### Data Splits
|
118 |
+
|
119 |
+
- train: 14732
|
120 |
+
- val: 818
|
121 |
+
- test: 819
|
122 |
+
|
123 |
+
|
124 |
+
## Dataset Creation
|
125 |
+
|
126 |
+
### Curation Rationale
|
127 |
+
|
128 |
+
In paper:
|
129 |
+
> In the first approach, we reviewed datasets from the following categories: chatbot dialogues, SMS corpora, IRC/chat data, movie dialogues, tweets, comments data (conversations formed by replies to comments), transcription of meetings, written discussions, phone dialogues and daily communication data. Unfortunately, they all differed in some respect from the conversations that are typ- ically written in messenger apps, e.g. they were too technical (IRC data), too long (comments data, transcription of meetings), lacked context (movie dialogues) or they were more of a spoken type, such as a dialogue between a petrol station assis- tant and a client buying petrol.
|
130 |
+
As a consequence, we decided to create a chat dialogue dataset by constructing such conversa- tions that would epitomize the style of a messenger app.
|
131 |
+
|
132 |
+
### Source Data
|
133 |
+
|
134 |
+
#### Initial Data Collection and Normalization
|
135 |
+
|
136 |
+
In paper:
|
137 |
+
> We asked linguists to create conversations similar to those they write on a daily basis, reflecting the proportion of topics of their real-life messenger conversations. It includes chit-chats, gossiping about friends, arranging meetings, discussing politics, consulting university assignments with colleagues, etc. Therefore, this dataset does not contain any sensitive data or fragments of other corpora.
|
138 |
+
|
139 |
+
#### Who are the source language producers?
|
140 |
+
|
141 |
+
linguists
|
142 |
+
|
143 |
+
### Annotations
|
144 |
+
|
145 |
+
#### Annotation process
|
146 |
+
|
147 |
+
In paper:
|
148 |
+
> Each dialogue was created by one person. After collecting all of the conversations, we asked language experts to annotate them with summaries, assuming that they should (1) be rather short, (2) extract important pieces of information, (3) include names of interlocutors, (4) be written in the third person. Each dialogue contains only one ref- erence summary.
|
149 |
+
|
150 |
+
#### Who are the annotators?
|
151 |
+
|
152 |
+
language experts
|
153 |
+
|
154 |
+
### Personal and Sensitive Information
|
155 |
+
|
156 |
+
None, see above: Initial Data Collection and Normalization
|
157 |
+
|
158 |
+
## Considerations for Using the Data
|
159 |
+
|
160 |
+
### Social Impact of Dataset
|
161 |
+
|
162 |
+
[Needs More Information]
|
163 |
+
|
164 |
+
### Discussion of Biases
|
165 |
+
|
166 |
+
[Needs More Information]
|
167 |
+
|
168 |
+
### Other Known Limitations
|
169 |
+
|
170 |
+
[Needs More Information]
|
171 |
+
|
172 |
+
## Additional Information
|
173 |
+
|
174 |
+
### Dataset Curators
|
175 |
+
|
176 |
+
[Needs More Information]
|
177 |
+
|
178 |
+
### Licensing Information
|
179 |
+
|
180 |
+
non-commercial licence: CC BY-NC-ND 4.0
|
181 |
+
|
182 |
+
### Citation Information
|
183 |
+
|
184 |
+
```
|
185 |
+
@inproceedings{gliwa-etal-2019-samsum,
|
186 |
+
title = "{SAMS}um Corpus: A Human-annotated Dialogue Dataset for Abstractive Summarization",
|
187 |
+
author = "Gliwa, Bogdan and
|
188 |
+
Mochol, Iwona and
|
189 |
+
Biesek, Maciej and
|
190 |
+
Wawer, Aleksander",
|
191 |
+
booktitle = "Proceedings of the 2nd Workshop on New Frontiers in Summarization",
|
192 |
+
month = nov,
|
193 |
+
year = "2019",
|
194 |
+
address = "Hong Kong, China",
|
195 |
+
publisher = "Association for Computational Linguistics",
|
196 |
+
url = "https://www.aclweb.org/anthology/D19-5409",
|
197 |
+
doi = "10.18653/v1/D19-5409",
|
198 |
+
pages = "70--79"
|
199 |
+
}
|
200 |
+
```
|
201 |
+
|
202 |
+
### Contributions
|
203 |
+
|
204 |
+
Thanks to [@cccntu](https://github.com/cccntu) for adding this dataset.
|
gitattributes (2).txt
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
samsum (2).py
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
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 |
+
"""SAMSum dataset."""
|
16 |
+
|
17 |
+
|
18 |
+
import json
|
19 |
+
|
20 |
+
import py7zr
|
21 |
+
|
22 |
+
import datasets
|
23 |
+
|
24 |
+
|
25 |
+
_CITATION = """
|
26 |
+
@article{gliwa2019samsum,
|
27 |
+
title={SAMSum Corpus: A Human-annotated Dialogue Dataset for Abstractive Summarization},
|
28 |
+
author={Gliwa, Bogdan and Mochol, Iwona and Biesek, Maciej and Wawer, Aleksander},
|
29 |
+
journal={arXiv preprint arXiv:1911.12237},
|
30 |
+
year={2019}
|
31 |
+
}
|
32 |
+
"""
|
33 |
+
|
34 |
+
_DESCRIPTION = """
|
35 |
+
SAMSum Corpus contains over 16k chat dialogues with manually annotated
|
36 |
+
summaries.
|
37 |
+
There are two features:
|
38 |
+
- dialogue: text of dialogue.
|
39 |
+
- summary: human written summary of the dialogue.
|
40 |
+
- id: id of a example.
|
41 |
+
"""
|
42 |
+
|
43 |
+
_HOMEPAGE = "https://arxiv.org/abs/1911.12237"
|
44 |
+
|
45 |
+
_LICENSE = "CC BY-NC-ND 4.0"
|
46 |
+
|
47 |
+
_URL = "https://huggingface.co/datasets/samsum/resolve/main/data/corpus.7z"
|
48 |
+
|
49 |
+
|
50 |
+
class Samsum(datasets.GeneratorBasedBuilder):
|
51 |
+
"""SAMSum Corpus dataset."""
|
52 |
+
|
53 |
+
VERSION = datasets.Version("1.1.0")
|
54 |
+
|
55 |
+
BUILDER_CONFIGS = [
|
56 |
+
datasets.BuilderConfig(name="samsum"),
|
57 |
+
]
|
58 |
+
|
59 |
+
def _info(self):
|
60 |
+
features = datasets.Features(
|
61 |
+
{
|
62 |
+
"id": datasets.Value("string"),
|
63 |
+
"dialogue": datasets.Value("string"),
|
64 |
+
"summary": datasets.Value("string"),
|
65 |
+
}
|
66 |
+
)
|
67 |
+
return datasets.DatasetInfo(
|
68 |
+
description=_DESCRIPTION,
|
69 |
+
features=features,
|
70 |
+
supervised_keys=None,
|
71 |
+
homepage=_HOMEPAGE,
|
72 |
+
license=_LICENSE,
|
73 |
+
citation=_CITATION,
|
74 |
+
)
|
75 |
+
|
76 |
+
def _split_generators(self, dl_manager):
|
77 |
+
"""Returns SplitGenerators."""
|
78 |
+
path = dl_manager.download(_URL)
|
79 |
+
return [
|
80 |
+
datasets.SplitGenerator(
|
81 |
+
name=datasets.Split.TRAIN,
|
82 |
+
gen_kwargs={
|
83 |
+
"filepath": (path, "train.json"),
|
84 |
+
"split": "train",
|
85 |
+
},
|
86 |
+
),
|
87 |
+
datasets.SplitGenerator(
|
88 |
+
name=datasets.Split.TEST,
|
89 |
+
gen_kwargs={
|
90 |
+
"filepath": (path, "test.json"),
|
91 |
+
"split": "test",
|
92 |
+
},
|
93 |
+
),
|
94 |
+
datasets.SplitGenerator(
|
95 |
+
name=datasets.Split.VALIDATION,
|
96 |
+
gen_kwargs={
|
97 |
+
"filepath": (path, "val.json"),
|
98 |
+
"split": "val",
|
99 |
+
},
|
100 |
+
),
|
101 |
+
]
|
102 |
+
|
103 |
+
def _generate_examples(self, filepath, split):
|
104 |
+
"""Yields examples."""
|
105 |
+
path, fname = filepath
|
106 |
+
with open(path, "rb") as f:
|
107 |
+
with py7zr.SevenZipFile(f, "r") as z:
|
108 |
+
for name, bio in z.readall().items():
|
109 |
+
if name == fname:
|
110 |
+
data = json.load(bio)
|
111 |
+
for example in data:
|
112 |
+
yield example["id"], example
|