Datasets:
shuyangcao
commited on
Commit
•
0034b4b
1
Parent(s):
6b07d21
first version
Browse files- .gitattributes +1 -0
- README.md +155 -0
- data/test.jsonl +3 -0
- data/train.jsonl +3 -0
- data/valid.jsonl +3 -0
- reddit_qg.py +78 -0
.gitattributes
CHANGED
@@ -35,3 +35,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
35 |
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
36 |
*.ogg filter=lfs diff=lfs merge=lfs -text
|
37 |
*.wav filter=lfs diff=lfs merge=lfs -text
|
|
|
|
35 |
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
36 |
*.ogg filter=lfs diff=lfs merge=lfs -text
|
37 |
*.wav filter=lfs diff=lfs merge=lfs -text
|
38 |
+
*.jsonl filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
languages:
|
5 |
+
- en
|
6 |
+
licenses:
|
7 |
+
- cc-by-4.0
|
8 |
+
multilinguality:
|
9 |
+
- monolingual
|
10 |
+
task_categories:
|
11 |
+
- classification
|
12 |
+
task_ids:
|
13 |
+
- classification
|
14 |
+
pretty_name: RedditQG
|
15 |
+
---
|
16 |
+
|
17 |
+
|
18 |
+
# Dataset Card for RedditQG
|
19 |
+
|
20 |
+
## Table of Contents
|
21 |
+
- [Table of Contents](#table-of-contents)
|
22 |
+
- [Dataset Description](#dataset-description)
|
23 |
+
- [Dataset Summary](#dataset-summary)
|
24 |
+
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
25 |
+
- [Languages](#languages)
|
26 |
+
- [Dataset Structure](#dataset-structure)
|
27 |
+
- [Data Instances](#data-instances)
|
28 |
+
- [Data Fields](#data-fields)
|
29 |
+
- [Data Splits](#data-splits)
|
30 |
+
- [Dataset Creation](#dataset-creation)
|
31 |
+
- [Curation Rationale](#curation-rationale)
|
32 |
+
- [Source Data](#source-data)
|
33 |
+
- [Annotations](#annotations)
|
34 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
35 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
36 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
37 |
+
- [Discussion of Biases](#discussion-of-biases)
|
38 |
+
- [Other Known Limitations](#other-known-limitations)
|
39 |
+
- [Additional Information](#additional-information)
|
40 |
+
- [Dataset Curators](#dataset-curators)
|
41 |
+
- [Licensing Information](#licensing-information)
|
42 |
+
- [Citation Information](#citation-information)
|
43 |
+
- [Contributions](#contributions)
|
44 |
+
|
45 |
+
## Dataset Description
|
46 |
+
|
47 |
+
- **Homepage:** [https://shuyangcao.github.io/projects/ontology_open_ended_question/](https://shuyangcao.github.io/projects/ontology_open_ended_question/)
|
48 |
+
- **Repository:** [https://github.com/ShuyangCao/open-ended_question_ontology](https://github.com/ShuyangCao/open-ended_question_ontology)
|
49 |
+
- **Paper:** [https://aclanthology.org/2021.acl-long.502/](https://aclanthology.org/2021.acl-long.502/)
|
50 |
+
- **Leaderboard:** [Needs More Information]
|
51 |
+
- **Point of Contact:** [Needs More Information]
|
52 |
+
|
53 |
+
### Dataset Summary
|
54 |
+
|
55 |
+
This dataset contains answer-question pairs from QA communities of Reddit.
|
56 |
+
|
57 |
+
### Supported Tasks and Leaderboards
|
58 |
+
|
59 |
+
[More Information Needed]
|
60 |
+
|
61 |
+
### Languages
|
62 |
+
|
63 |
+
English
|
64 |
+
|
65 |
+
## Dataset Structure
|
66 |
+
|
67 |
+
### Data Instances
|
68 |
+
|
69 |
+
An example looks as follows.
|
70 |
+
```
|
71 |
+
{
|
72 |
+
"id": "askscience/123",
|
73 |
+
"qid": "2323",
|
74 |
+
"answer": "A test answer.",
|
75 |
+
"question": "A test question?",
|
76 |
+
"score": 20
|
77 |
+
}
|
78 |
+
```
|
79 |
+
|
80 |
+
### Data Fields
|
81 |
+
|
82 |
+
- `id`: a `string` feature.
|
83 |
+
- `qid`: a `string` feature. There could be multiple answers to the same question.
|
84 |
+
- `answer`: a `string` feature.
|
85 |
+
- `question`: a `string` feature.
|
86 |
+
- `score`: an `int` feature which is the value of `upvotes - downvotes`.
|
87 |
+
|
88 |
+
### Data Splits
|
89 |
+
|
90 |
+
- train: 647763
|
91 |
+
- valid: 36023
|
92 |
+
- test: 36202
|
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 |
+
Reddit users.
|
109 |
+
|
110 |
+
### Personal and Sensitive Information
|
111 |
+
|
112 |
+
Samples with abusive words are discarded, but there could be samples containing personal information.
|
113 |
+
|
114 |
+
## Considerations for Using the Data
|
115 |
+
|
116 |
+
### Social Impact of Dataset
|
117 |
+
|
118 |
+
[More Information Needed]
|
119 |
+
|
120 |
+
### Discussion of Biases
|
121 |
+
|
122 |
+
[More Information Needed]
|
123 |
+
|
124 |
+
### Other Known Limitations
|
125 |
+
|
126 |
+
[More Information Needed]
|
127 |
+
|
128 |
+
## Additional Information
|
129 |
+
|
130 |
+
### Dataset Curators
|
131 |
+
|
132 |
+
[More Information Needed]
|
133 |
+
|
134 |
+
### Licensing Information
|
135 |
+
|
136 |
+
CC BY 4.0
|
137 |
+
|
138 |
+
### Citation Information
|
139 |
+
|
140 |
+
```
|
141 |
+
@inproceedings{cao-wang-2021-controllable,
|
142 |
+
title = "Controllable Open-ended Question Generation with A New Question Type Ontology",
|
143 |
+
author = "Cao, Shuyang and
|
144 |
+
Wang, Lu",
|
145 |
+
booktitle = "Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)",
|
146 |
+
month = aug,
|
147 |
+
year = "2021",
|
148 |
+
address = "Online",
|
149 |
+
publisher = "Association for Computational Linguistics",
|
150 |
+
url = "https://aclanthology.org/2021.acl-long.502",
|
151 |
+
doi = "10.18653/v1/2021.acl-long.502",
|
152 |
+
pages = "6424--6439",
|
153 |
+
abstract = "We investigate the less-explored task of generating open-ended questions that are typically answered by multiple sentences. We first define a new question type ontology which differentiates the nuanced nature of questions better than widely used question words. A new dataset with 4,959 questions is labeled based on the new ontology. We then propose a novel question type-aware question generation framework, augmented by a semantic graph representation, to jointly predict question focuses and produce the question. Based on this framework, we further use both exemplars and automatically generated templates to improve controllability and diversity. Experiments on two newly collected large-scale datasets show that our model improves question quality over competitive comparisons based on automatic metrics. Human judges also rate our model outputs highly in answerability, coverage of scope, and overall quality. Finally, our model variants with templates can produce questions with enhanced controllability and diversity.",
|
154 |
+
}
|
155 |
+
```
|
data/test.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d3643d3e0a6604d7590e59df2fb8af6f1f0d1ef7b5f94d5cdd1713cce9e29467
|
3 |
+
size 26200884
|
data/train.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f95c6733daacb68c115fa7a28c6732f36ad73730d7c107f53fe66cb019d8fe69
|
3 |
+
size 469436698
|
data/valid.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:07fb2acfed2ef62b3e6e0889c7c17774a917d8a3d161edf72979a99f17b0e77e
|
3 |
+
size 26137417
|
reddit_qg.py
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""RedditQG: Reddit Question Generation Dataset."""
|
2 |
+
|
3 |
+
|
4 |
+
import json
|
5 |
+
|
6 |
+
import datasets
|
7 |
+
|
8 |
+
|
9 |
+
logger = datasets.logging.get_logger(__name__)
|
10 |
+
|
11 |
+
|
12 |
+
_CITATION = """\
|
13 |
+
@inproceedings{cao-wang-2021-controllable,
|
14 |
+
title = "Controllable Open-ended Question Generation with A New Question Type Ontology",
|
15 |
+
author = "Cao, Shuyang and
|
16 |
+
Wang, Lu",
|
17 |
+
booktitle = "Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)",
|
18 |
+
month = aug,
|
19 |
+
year = "2021",
|
20 |
+
address = "Online",
|
21 |
+
publisher = "Association for Computational Linguistics",
|
22 |
+
url = "https://aclanthology.org/2021.acl-long.502",
|
23 |
+
doi = "10.18653/v1/2021.acl-long.502",
|
24 |
+
pages = "6424--6439",
|
25 |
+
abstract = "We investigate the less-explored task of generating open-ended questions that are typically answered by multiple sentences. We first define a new question type ontology which differentiates the nuanced nature of questions better than widely used question words. A new dataset with 4,959 questions is labeled based on the new ontology. We then propose a novel question type-aware question generation framework, augmented by a semantic graph representation, to jointly predict question focuses and produce the question. Based on this framework, we further use both exemplars and automatically generated templates to improve controllability and diversity. Experiments on two newly collected large-scale datasets show that our model improves question quality over competitive comparisons based on automatic metrics. Human judges also rate our model outputs highly in answerability, coverage of scope, and overall quality. Finally, our model variants with templates can produce questions with enhanced controllability and diversity.",
|
26 |
+
}
|
27 |
+
"""
|
28 |
+
|
29 |
+
_DESCRIPTION = """\
|
30 |
+
Reddit question generation dataset.
|
31 |
+
"""
|
32 |
+
|
33 |
+
_URL = "https://huggingface.co/datasets/shuyangcao/reddit_qg/resolve/main/data/"
|
34 |
+
_URLS = {
|
35 |
+
"train": _URL + "train.jsonl",
|
36 |
+
"valid": _URL + "valid.jsonl",
|
37 |
+
"test": _URL + "test.jsonl",
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
class RedditQG(datasets.GeneratorBasedBuilder):
|
42 |
+
VERSION = datasets.Version("1.0.0")
|
43 |
+
|
44 |
+
def _info(self):
|
45 |
+
features = datasets.Features(
|
46 |
+
{
|
47 |
+
"id": datasets.Value("string"),
|
48 |
+
"qid": datasets.Value("string"),
|
49 |
+
"question": datasets.Value("string"),
|
50 |
+
"answer": datasets.Value("string"),
|
51 |
+
"score": datasets.Value("int")
|
52 |
+
}
|
53 |
+
)
|
54 |
+
return datasets.DatasetInfo(
|
55 |
+
description=_DESCRIPTION,
|
56 |
+
features=features,
|
57 |
+
supervised_keys=("answer", "question"),
|
58 |
+
homepage="",
|
59 |
+
citation=_CITATION,
|
60 |
+
)
|
61 |
+
|
62 |
+
def _split_generators(self, dl_manager):
|
63 |
+
downloaded_files = dl_manager.download_and_extract(_URLS)
|
64 |
+
|
65 |
+
return [
|
66 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"split_file": downloaded_files["train"]}),
|
67 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"split_file": downloaded_files["valid"]}),
|
68 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"split_file": downloaded_files["test"]}),
|
69 |
+
]
|
70 |
+
|
71 |
+
def _generate_examples(self, split_file):
|
72 |
+
"""This function returns the examples in the raw (text) form."""
|
73 |
+
logger.info(f"generating examples from = {split_file}")
|
74 |
+
|
75 |
+
with open(split_file) as f:
|
76 |
+
for line in f:
|
77 |
+
data = json.loads(line)
|
78 |
+
yield data["id"], data
|