Datasets:
Sub-tasks:
dialogue-modeling
Languages:
English
Size:
1K<n<10K
ArXiv:
Tags:
relation-extraction
License:
Commit
•
8ffe18f
0
Parent(s):
Update files from the datasets library (from 1.2.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.2.0
- .gitattributes +27 -0
- README.md +150 -0
- dataset_infos.json +1 -0
- dialog_re.py +142 -0
- dummy/dialog_re/1.1.0/dummy_data.zip +3 -0
.gitattributes
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
|
README.md
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- expert-generated
|
6 |
+
languages:
|
7 |
+
- en
|
8 |
+
licenses: []
|
9 |
+
multilinguality:
|
10 |
+
- monolingual
|
11 |
+
size_categories:
|
12 |
+
- 1K<n<10K
|
13 |
+
source_datasets:
|
14 |
+
- original
|
15 |
+
task_categories:
|
16 |
+
- other
|
17 |
+
task_ids:
|
18 |
+
- other-other-relation-extraction
|
19 |
+
---
|
20 |
+
|
21 |
+
# Dataset Card for [DialogRE]
|
22 |
+
|
23 |
+
## Table of Contents
|
24 |
+
- [Dataset Description](#dataset-description)
|
25 |
+
- [Dataset Summary](#dataset-summary)
|
26 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
27 |
+
- [Languages](#languages)
|
28 |
+
- [Dataset Structure](#dataset-structure)
|
29 |
+
- [Data Instances](#data-instances)
|
30 |
+
- [Data Fields](#data-instances)
|
31 |
+
- [Data Splits](#data-instances)
|
32 |
+
- [Dataset Creation](#dataset-creation)
|
33 |
+
- [Curation Rationale](#curation-rationale)
|
34 |
+
- [Source Data](#source-data)
|
35 |
+
- [Annotations](#annotations)
|
36 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
37 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
38 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
39 |
+
- [Discussion of Biases](#discussion-of-biases)
|
40 |
+
- [Other Known Limitations](#other-known-limitations)
|
41 |
+
- [Additional Information](#additional-information)
|
42 |
+
- [Dataset Curators](#dataset-curators)
|
43 |
+
- [Licensing Information](#licensing-information)
|
44 |
+
- [Citation Information](#citation-information)
|
45 |
+
|
46 |
+
## Dataset Description
|
47 |
+
|
48 |
+
- **Homepage:** [Github](https://github.com/nlpdata/dialogre)
|
49 |
+
- **Repository:** [Github](https://github.com/nlpdata/dialogre)
|
50 |
+
- **Paper:** [Arxiv](https://arxiv.org/abs/2004.08056v1)
|
51 |
+
- **Leaderboard:**
|
52 |
+
- **Point of Contact:**
|
53 |
+
|
54 |
+
### Dataset Summary
|
55 |
+
|
56 |
+
[More Information Needed]
|
57 |
+
|
58 |
+
### Supported Tasks and Leaderboards
|
59 |
+
|
60 |
+
[More Information Needed]
|
61 |
+
|
62 |
+
### Languages
|
63 |
+
|
64 |
+
[More Information Needed]
|
65 |
+
|
66 |
+
## Dataset Structure
|
67 |
+
|
68 |
+
### Data Instances
|
69 |
+
|
70 |
+
[More Information Needed]
|
71 |
+
|
72 |
+
### Data Fields
|
73 |
+
|
74 |
+
* `dialog`
|
75 |
+
|
76 |
+
* List of dialog spoken between two speakers
|
77 |
+
|
78 |
+
* List of annotations per dialog per argument
|
79 |
+
|
80 |
+
* `x` : First entity
|
81 |
+
|
82 |
+
* `y` : Second entity
|
83 |
+
|
84 |
+
* `x_type` : First entity type
|
85 |
+
* `y_type`: Second entity type
|
86 |
+
* `r` : List of relations
|
87 |
+
* `rid`: List of relation IDs
|
88 |
+
* `t`: List of relation Trigger words
|
89 |
+
|
90 |
+
### Data Splits
|
91 |
+
|
92 |
+
[More Information Needed]
|
93 |
+
|
94 |
+
## Dataset Creation
|
95 |
+
|
96 |
+
### Curation Rationale
|
97 |
+
|
98 |
+
[More Information Needed]
|
99 |
+
|
100 |
+
### Source Data
|
101 |
+
|
102 |
+
#### Initial Data Collection and Normalization
|
103 |
+
|
104 |
+
[More Information Needed]
|
105 |
+
|
106 |
+
#### Who are the source language producers?
|
107 |
+
|
108 |
+
[More Information Needed]
|
109 |
+
|
110 |
+
### Annotations
|
111 |
+
|
112 |
+
#### Annotation process
|
113 |
+
|
114 |
+
[More Information Needed]
|
115 |
+
|
116 |
+
#### Who are the annotators?
|
117 |
+
|
118 |
+
[More Information Needed]
|
119 |
+
|
120 |
+
### Personal and Sensitive Information
|
121 |
+
|
122 |
+
[More Information Needed]
|
123 |
+
|
124 |
+
## Considerations for Using the Data
|
125 |
+
|
126 |
+
### Social Impact of Dataset
|
127 |
+
|
128 |
+
[More Information Needed]
|
129 |
+
|
130 |
+
### Discussion of Biases
|
131 |
+
|
132 |
+
[More Information Needed]
|
133 |
+
|
134 |
+
### Other Known Limitations
|
135 |
+
|
136 |
+
[More Information Needed]
|
137 |
+
|
138 |
+
## Additional Information
|
139 |
+
|
140 |
+
### Dataset Curators
|
141 |
+
|
142 |
+
[More Information Needed]
|
143 |
+
|
144 |
+
### Licensing Information
|
145 |
+
|
146 |
+
[More Information Needed]
|
147 |
+
|
148 |
+
### Citation Information
|
149 |
+
|
150 |
+
[More Information Needed]
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"dialog_re": {"description": "DialogRE is the first human-annotated dialogue based relation extraction (RE) dataset aiming\nto support the prediction of relation(s) between two arguments that appear in a dialogue.\nThe dataset annotates all occurrences of 36 possible relation types that exist between pairs\nof arguments in the 1,788 dialogues originating from the complete transcripts of Friends.\n", "citation": "@inproceedings{yu2020dialogue,\n title={Dialogue-Based Relation Extraction},\n author={Yu, Dian and Sun, Kai and Cardie, Claire and Yu, Dong},\n booktitle={Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics},\n year={2020},\n url={https://arxiv.org/abs/2004.08056v1}\n}\n", "homepage": "https://github.com/nlpdata/dialogre", "license": "https://github.com/nlpdata/dialogre/blob/master/license.txt", "features": {"dialog": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "relation_data": {"feature": {"x": {"dtype": "string", "id": null, "_type": "Value"}, "y": {"dtype": "string", "id": null, "_type": "Value"}, "x_type": {"dtype": "string", "id": null, "_type": "Value"}, "y_type": {"dtype": "string", "id": null, "_type": "Value"}, "r": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "rid": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "t": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "dialog_re", "config_name": "dialog_re", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1520940, "num_examples": 1073, "dataset_name": "dialog_re"}, "test": {"name": "test", "num_bytes": 472306, "num_examples": 357, "dataset_name": "dialog_re"}, "validation": {"name": "validation", "num_bytes": 490580, "num_examples": 358, "dataset_name": "dialog_re"}}, "download_checksums": {"https://raw.githubusercontent.com/nlpdata/dialogre/master/data_v2/en/data/train.json": {"num_bytes": 2338606, "checksum": "94b5799642107f9afecc5c46655d6d9612f41969893deff291b15a66298c08a0"}, "https://raw.githubusercontent.com/nlpdata/dialogre/master/data_v2/en/data/dev.json": {"num_bytes": 751932, "checksum": "3e0036a1853f33dd8fab1f008ff3c3b351f0b53e9084a6f6bce7b4c95d0f0472"}, "https://raw.githubusercontent.com/nlpdata/dialogre/master/data_v2/en/data/test.json": {"num_bytes": 725696, "checksum": "180e766323d2b5ae4763c77b2db280eeb49c909ab48c7393fbc309b7890061af"}}, "download_size": 3816234, "post_processing_size": null, "dataset_size": 2483826, "size_in_bytes": 6300060}}
|
dialog_re.py
ADDED
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
16 |
+
"""DialogRE: the first human-annotated dialogue-based relation extraction dataset"""
|
17 |
+
|
18 |
+
from __future__ import absolute_import, division, print_function
|
19 |
+
|
20 |
+
import json
|
21 |
+
import os
|
22 |
+
|
23 |
+
import datasets
|
24 |
+
|
25 |
+
|
26 |
+
_CITATION = """\
|
27 |
+
@inproceedings{yu2020dialogue,
|
28 |
+
title={Dialogue-Based Relation Extraction},
|
29 |
+
author={Yu, Dian and Sun, Kai and Cardie, Claire and Yu, Dong},
|
30 |
+
booktitle={Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics},
|
31 |
+
year={2020},
|
32 |
+
url={https://arxiv.org/abs/2004.08056v1}
|
33 |
+
}
|
34 |
+
"""
|
35 |
+
|
36 |
+
_DESCRIPTION = """\
|
37 |
+
DialogRE is the first human-annotated dialogue based relation extraction (RE) dataset aiming
|
38 |
+
to support the prediction of relation(s) between two arguments that appear in a dialogue.
|
39 |
+
The dataset annotates all occurrences of 36 possible relation types that exist between pairs
|
40 |
+
of arguments in the 1,788 dialogues originating from the complete transcripts of Friends.
|
41 |
+
"""
|
42 |
+
|
43 |
+
_HOMEPAGE = "https://github.com/nlpdata/dialogre"
|
44 |
+
|
45 |
+
_LICENSE = "https://github.com/nlpdata/dialogre/blob/master/license.txt"
|
46 |
+
|
47 |
+
_URL = "https://raw.githubusercontent.com/nlpdata/dialogre/master/data_v2/en/data/"
|
48 |
+
_URLs = {
|
49 |
+
"train": _URL + "train.json",
|
50 |
+
"dev": _URL + "dev.json",
|
51 |
+
"test": _URL + "test.json",
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
class DialogREConfig(datasets.BuilderConfig):
|
56 |
+
"""BuilderConfig for DialogRE"""
|
57 |
+
|
58 |
+
def __init__(self, **kwargs):
|
59 |
+
"""BuilderConfig for DialogRE.
|
60 |
+
Args:
|
61 |
+
**kwargs: keyword arguments forwarded to super.
|
62 |
+
"""
|
63 |
+
super(DialogREConfig, self).__init__(**kwargs)
|
64 |
+
|
65 |
+
|
66 |
+
class DialogRE(datasets.GeneratorBasedBuilder):
|
67 |
+
"""DialogRE: Human-annotated dialogue-based relation extraction dataset Version 2"""
|
68 |
+
|
69 |
+
VERSION = datasets.Version("1.1.0")
|
70 |
+
|
71 |
+
BUILDER_CONFIGS = [
|
72 |
+
DialogREConfig(
|
73 |
+
name="dialog_re",
|
74 |
+
version=datasets.Version("1.1.0"),
|
75 |
+
description="DialogRE: Human-annotated dialogue-based relation extraction dataset",
|
76 |
+
),
|
77 |
+
]
|
78 |
+
|
79 |
+
def _info(self):
|
80 |
+
return datasets.DatasetInfo(
|
81 |
+
description=_DESCRIPTION,
|
82 |
+
features=datasets.Features(
|
83 |
+
{
|
84 |
+
"dialog": datasets.Sequence(datasets.Value("string")),
|
85 |
+
"relation_data": datasets.Sequence(
|
86 |
+
{
|
87 |
+
"x": datasets.Value("string"),
|
88 |
+
"y": datasets.Value("string"),
|
89 |
+
"x_type": datasets.Value("string"),
|
90 |
+
"y_type": datasets.Value("string"),
|
91 |
+
"r": datasets.Sequence(datasets.Value("string")),
|
92 |
+
"rid": datasets.Sequence(datasets.Value("int32")),
|
93 |
+
"t": datasets.Sequence(datasets.Value("string")),
|
94 |
+
}
|
95 |
+
),
|
96 |
+
}
|
97 |
+
),
|
98 |
+
supervised_keys=None,
|
99 |
+
homepage=_HOMEPAGE,
|
100 |
+
license=_LICENSE,
|
101 |
+
citation=_CITATION,
|
102 |
+
)
|
103 |
+
|
104 |
+
def _split_generators(self, dl_manager):
|
105 |
+
"""Returns SplitGenerators."""
|
106 |
+
|
107 |
+
data_dir = dl_manager.download_and_extract(_URLs)
|
108 |
+
return [
|
109 |
+
datasets.SplitGenerator(
|
110 |
+
name=datasets.Split.TRAIN,
|
111 |
+
gen_kwargs={
|
112 |
+
"filepath": os.path.join(data_dir["train"]),
|
113 |
+
"split": "train",
|
114 |
+
},
|
115 |
+
),
|
116 |
+
datasets.SplitGenerator(
|
117 |
+
name=datasets.Split.TEST,
|
118 |
+
gen_kwargs={"filepath": os.path.join(data_dir["test"]), "split": "test"},
|
119 |
+
),
|
120 |
+
datasets.SplitGenerator(
|
121 |
+
name=datasets.Split.VALIDATION,
|
122 |
+
gen_kwargs={
|
123 |
+
"filepath": os.path.join(data_dir["dev"]),
|
124 |
+
"split": "dev",
|
125 |
+
},
|
126 |
+
),
|
127 |
+
]
|
128 |
+
|
129 |
+
def _generate_examples(self, filepath, split):
|
130 |
+
""" Yields examples. """
|
131 |
+
|
132 |
+
with open(filepath, encoding="utf-8") as f:
|
133 |
+
dataset = json.load(f)
|
134 |
+
|
135 |
+
for id_, data in enumerate(dataset):
|
136 |
+
dialog = data[0]
|
137 |
+
relation_data = data[1]
|
138 |
+
|
139 |
+
yield id_, {
|
140 |
+
"dialog": dialog,
|
141 |
+
"relation_data": relation_data,
|
142 |
+
}
|
dummy/dialog_re/1.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dd6fde520211e683114df27d16553a310cd21d74d9f5e97ce2037d3a85277d14
|
3 |
+
size 2962
|