Datasets:
Tasks:
Text Generation
Sub-tasks:
language-modeling
Languages:
English
Size:
10K - 100K
ArXiv:
Tags:
question-generation
License:
parquet-converter
commited on
Commit
•
463d7ae
1
Parent(s):
4cf327a
Update parquet files
Browse files- .gitattributes +0 -55
- .gitignore +0 -2
- README.md +0 -91
- data/processed/books.test.jsonl → all/qg_subjqa-test.parquet +2 -2
- all/qg_subjqa-train.parquet +3 -0
- data/processed/books.train.jsonl → all/qg_subjqa-validation.parquet +2 -2
- data/processed/grocery.dev.jsonl → books/qg_subjqa-test.parquet +2 -2
- books/qg_subjqa-train.parquet +3 -0
- data/processed/movies.dev.jsonl → books/qg_subjqa-validation.parquet +2 -2
- data/processed/electronics.test.jsonl +0 -3
- data/processed/electronics.train.jsonl +0 -3
- data/processed/grocery.test.jsonl +0 -3
- data/processed/grocery.train.jsonl +0 -3
- data/processed/movies.test.jsonl +0 -3
- data/processed/movies.train.jsonl +0 -3
- data/processed/restaurants.dev.jsonl +0 -3
- data/processed/restaurants.test.jsonl +0 -3
- data/processed/restaurants.train.jsonl +0 -3
- data/processed/tripadvisor.dev.jsonl +0 -3
- data/processed/tripadvisor.test.jsonl +0 -3
- data/processed/tripadvisor.train.jsonl +0 -3
- data/processed/electronics.dev.jsonl → electronics/qg_subjqa-test.parquet +2 -2
- electronics/qg_subjqa-train.parquet +3 -0
- data/processed/books.dev.jsonl → electronics/qg_subjqa-validation.parquet +2 -2
- grocery/qg_subjqa-test.parquet +3 -0
- grocery/qg_subjqa-train.parquet +3 -0
- grocery/qg_subjqa-validation.parquet +3 -0
- movies/qg_subjqa-test.parquet +3 -0
- movies/qg_subjqa-train.parquet +3 -0
- movies/qg_subjqa-validation.parquet +3 -0
- process.py +0 -103
- qg_subjqa.py +0 -92
- restaurants/qg_subjqa-test.parquet +3 -0
- restaurants/qg_subjqa-train.parquet +3 -0
- restaurants/qg_subjqa-validation.parquet +3 -0
- tripadvisor/qg_subjqa-test.parquet +3 -0
- tripadvisor/qg_subjqa-train.parquet +3 -0
- tripadvisor/qg_subjqa-validation.parquet +3 -0
.gitattributes
DELETED
@@ -1,55 +0,0 @@
|
|
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 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
19 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
20 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.wasm 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
|
28 |
-
# Audio files - uncompressed
|
29 |
-
*.pcm filter=lfs diff=lfs merge=lfs -text
|
30 |
-
*.sam filter=lfs diff=lfs merge=lfs -text
|
31 |
-
*.raw filter=lfs diff=lfs merge=lfs -text
|
32 |
-
# Audio files - compressed
|
33 |
-
*.aac filter=lfs diff=lfs merge=lfs -text
|
34 |
-
*.flac 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 |
-
data/processed/tripadvisor.test.jsonl filter=lfs diff=lfs merge=lfs -text
|
39 |
-
data/processed/books.dev.jsonl filter=lfs diff=lfs merge=lfs -text
|
40 |
-
data/processed/books.test.jsonl filter=lfs diff=lfs merge=lfs -text
|
41 |
-
data/processed/grocery.dev.jsonl filter=lfs diff=lfs merge=lfs -text
|
42 |
-
data/processed/grocery.train.jsonl filter=lfs diff=lfs merge=lfs -text
|
43 |
-
data/processed/restaurants.test.jsonl filter=lfs diff=lfs merge=lfs -text
|
44 |
-
data/processed/electronics.test.jsonl filter=lfs diff=lfs merge=lfs -text
|
45 |
-
data/processed/movies.test.jsonl filter=lfs diff=lfs merge=lfs -text
|
46 |
-
data/processed/electronics.dev.jsonl filter=lfs diff=lfs merge=lfs -text
|
47 |
-
data/processed/movies.train.jsonl filter=lfs diff=lfs merge=lfs -text
|
48 |
-
data/processed/restaurants.dev.jsonl filter=lfs diff=lfs merge=lfs -text
|
49 |
-
data/processed/restaurants.train.jsonl filter=lfs diff=lfs merge=lfs -text
|
50 |
-
data/processed/tripadvisor.train.jsonl filter=lfs diff=lfs merge=lfs -text
|
51 |
-
data/processed/books.train.jsonl filter=lfs diff=lfs merge=lfs -text
|
52 |
-
data/processed/electronics.train.jsonl filter=lfs diff=lfs merge=lfs -text
|
53 |
-
data/processed/grocery.test.jsonl filter=lfs diff=lfs merge=lfs -text
|
54 |
-
data/processed/movies.dev.jsonl filter=lfs diff=lfs merge=lfs -text
|
55 |
-
data/processed/tripadvisor.dev.jsonl filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.gitignore
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
SubjQA
|
2 |
-
data/processed/default.train.jsonl
|
|
|
|
|
|
README.md
DELETED
@@ -1,91 +0,0 @@
|
|
1 |
-
---
|
2 |
-
license: cc-by-4.0
|
3 |
-
pretty_name: SubjQA for question generation
|
4 |
-
language: en
|
5 |
-
multilinguality: monolingual
|
6 |
-
size_categories: 10K<n<100K
|
7 |
-
source_datasets: subjqa
|
8 |
-
task_categories:
|
9 |
-
- text-generation
|
10 |
-
task_ids:
|
11 |
-
- language-modeling
|
12 |
-
tags:
|
13 |
-
- question-generation
|
14 |
-
---
|
15 |
-
|
16 |
-
# Dataset Card for "lmqg/qg_subjqa"
|
17 |
-
|
18 |
-
## Dataset Description
|
19 |
-
- **Repository:** [https://github.com/asahi417/lm-question-generation](https://github.com/asahi417/lm-question-generation)
|
20 |
-
- **Paper:** [https://arxiv.org/abs/2210.03992](https://arxiv.org/abs/2210.03992)
|
21 |
-
- **Point of Contact:** [Asahi Ushio](http://asahiushio.com/)
|
22 |
-
|
23 |
-
### Dataset Summary
|
24 |
-
This is a subset of [QG-Bench](https://github.com/asahi417/lm-question-generation/blob/master/QG_BENCH.md#datasets), a unified question generation benchmark proposed in
|
25 |
-
["Generative Language Models for Paragraph-Level Question Generation: A Unified Benchmark and Evaluation, EMNLP 2022 main conference"](https://arxiv.org/abs/2210.03992).
|
26 |
-
Modified version of [SubjQA](https://github.com/megagonlabs/SubjQA) for question generation (QG) task.
|
27 |
-
|
28 |
-
### Supported Tasks and Leaderboards
|
29 |
-
* `question-generation`: The dataset can be used to train a model for question generation.
|
30 |
-
Success on this task is typically measured by achieving a high BLEU4/METEOR/ROUGE-L/BERTScore/MoverScore (see our paper for more in detail).
|
31 |
-
|
32 |
-
### Languages
|
33 |
-
English (en)
|
34 |
-
|
35 |
-
## Dataset Structure
|
36 |
-
An example of 'train' looks as follows.
|
37 |
-
```
|
38 |
-
{
|
39 |
-
"question": "How is book?",
|
40 |
-
"paragraph": "I am giving "Gone Girl" 3 stars, but only begrudgingly. In my mind, any book that takes me 3 months and 20 different tries to read is not worth 3 stars, especially a book written by an author I already respect. And I am not kidding, for me the first half of "Gone Girl" was a PURE TORTURE to read.Amy Dunn disappears on the day of her 5th wedding anniversary. All gradually uncovered evidence suggests that her husband, Nick, is somehow involved. Did he kill her? Was she kidnapped? What happened to Amy? One thing is clear, Nick and Amy's marriage wasn't as perfect as everybody thought.The first part of the novel is all about the investigation into Amy's disappearance, slow unraveling of Nick's dirty secrets, reminiscing about the troubled history of Nick and Amy's marriage as told in Amy's hidden diary. I strained and strained my brain trying to understand why this chunk of Gone Girl had no appeal to me whatsoever. The only answer I have is this: I am really not into reading about rich white people's problems. You want to whine to me about your dwindling trust fund? Losing your cushy New York job? Moving south and "only" renting a mansion there? Being unhappy because you have too much free time on your hands and you are used to only work as a hobby? You want to make fun of your lowly, un-posh neighbors and their casseroles? Well, I am not interested. I'd rather read about someone not necessarily likable, but at least worthy of my empathy, not waste my time on self-centered, spoiled, pathetic people who don't know what real problems are. Granted, characters in Flynn's previous novels ("Sharp Objects" and "Dark Places") are pretty pathetic and and at times revolting too, but I always felt some strange empathy towards them, not annoyance and boredom, like I felt reading about Amy and Nick's marriage voes.But then second part, with its wicked twist, changed everything. The story became much more exciting, dangerous and deranged. The main characters revealed sides to them that were quite shocking and VERY entertaining. I thought the Gillian Flynn I knew before finally unleashed her talent for writing utterly unlikable and crafty women. THEN I got invested in the story, THEN I cared.Was it too little too late though? I think it was. Something needed to be done to make "Gone Girl" a better read. Make it shorter? Cut out first part completely? I don't know. But because of my uneven experience with this novel I won't be able to recommend "Gone Girl" as readily as I did Flynn's earlier novels, even though I think this horror marriage story (it's not a true mystery, IMO) has some brilliantly written psycho goodness in it and an absolutely messed up ending that many loathed but I LOVED. I wish it didn't take so much time and patience to get to all of that...",
|
41 |
-
"answer": "any book that takes me 3 months and 20 different tries to read is not worth 3 stars",
|
42 |
-
"sentence": "In my mind, any book that takes me 3 months and 20 different tries to read is not worth 3 stars , especially a book written by an author I already respect.",
|
43 |
-
"paragraph_sentence": "I am giving "Gone Girl" 3 stars, but only begrudgingly. <hl> In my mind, any book that takes me 3 months and 20 different tries to read is not worth 3 stars , especially a book written by an author I already respect. <hl> And I am not kidding, for me the first half of "Gone Girl" was a PURE TORTURE to read. Amy Dunn disappears on the day of her 5th wedding anniversary. All gradually uncovered evidence suggests that her husband, Nick, is somehow involved. Did he kill her? Was she kidnapped? What happened to Amy? One thing is clear, Nick and Amy's marriage wasn't as perfect as everybody thought. The first part of the novel is all about the investigation into Amy's disappearance, slow unraveling of Nick's dirty secrets, reminiscing about the troubled history of Nick and Amy's marriage as told in Amy's hidden diary. I strained and strained my brain trying to understand why this chunk of Gone Girl had no appeal to me whatsoever. The only answer I have is this: I am really not into reading about rich white people's problems. You want to whine to me about your dwindling trust fund? Losing your cushy New York job? Moving south and "only" renting a mansion there? Being unhappy because you have too much free time on your hands and you are used to only work as a hobby? You want to make fun of your lowly, un-posh neighbors and their casseroles? Well, I am not interested. I'd rather read about someone not necessarily likable, but at least worthy of my empathy, not waste my time on self-centered, spoiled, pathetic people who don't know what real problems are. Granted, characters in Flynn's previous novels ("Sharp Objects" and "Dark Places") are pretty pathetic and and at times revolting too, but I always felt some strange empathy towards them, not annoyance and boredom, like I felt reading about Amy and Nick's marriage voes. But then second part, with its wicked twist, changed everything. The story became much more exciting, dangerous and deranged. The main characters revealed sides to them that were quite shocking and VERY entertaining. I thought the Gillian Flynn I knew before finally unleashed her talent for writing utterly unlikable and crafty women. THEN I got invested in the story, THEN I cared. Was it too little too late though? I think it was. Something needed to be done to make "Gone Girl" a better read. Make it shorter? Cut out first part completely? I don't know. But because of my uneven experience with this novel I won't be able to recommend "Gone Girl" as readily as I did Flynn's earlier novels, even though I think this horror marriage story (it's not a true mystery, IMO) has some brilliantly written psycho goodness in it and an absolutely messed up ending that many loathed but I LOVED. I wish it didn't take so much time and patience to get to all of that...",
|
44 |
-
"paragraph_answer": "I am giving "Gone Girl" 3 stars, but only begrudgingly. In my mind, <hl> any book that takes me 3 months and 20 different tries to read is not worth 3 stars <hl>, especially a book written by an author I already respect. And I am not kidding, for me the first half of "Gone Girl" was a PURE TORTURE to read.Amy Dunn disappears on the day of her 5th wedding anniversary. All gradually uncovered evidence suggests that her husband, Nick, is somehow involved. Did he kill her? Was she kidnapped? What happened to Amy? One thing is clear, Nick and Amy's marriage wasn't as perfect as everybody thought.The first part of the novel is all about the investigation into Amy's disappearance, slow unraveling of Nick's dirty secrets, reminiscing about the troubled history of Nick and Amy's marriage as told in Amy's hidden diary. I strained and strained my brain trying to understand why this chunk of Gone Girl had no appeal to me whatsoever. The only answer I have is this: I am really not into reading about rich white people's problems. You want to whine to me about your dwindling trust fund? Losing your cushy New York job? Moving south and "only" renting a mansion there? Being unhappy because you have too much free time on your hands and you are used to only work as a hobby? You want to make fun of your lowly, un-posh neighbors and their casseroles? Well, I am not interested. I'd rather read about someone not necessarily likable, but at least worthy of my empathy, not waste my time on self-centered, spoiled, pathetic people who don't know what real problems are. Granted, characters in Flynn's previous novels ("Sharp Objects" and "Dark Places") are pretty pathetic and and at times revolting too, but I always felt some strange empathy towards them, not annoyance and boredom, like I felt reading about Amy and Nick's marriage voes.But then second part, with its wicked twist, changed everything. The story became much more exciting, dangerous and deranged. The main characters revealed sides to them that were quite shocking and VERY entertaining. I thought the Gillian Flynn I knew before finally unleashed her talent for writing utterly unlikable and crafty women. THEN I got invested in the story, THEN I cared.Was it too little too late though? I think it was. Something needed to be done to make "Gone Girl" a better read. Make it shorter? Cut out first part completely? I don't know. But because of my uneven experience with this novel I won't be able to recommend "Gone Girl" as readily as I did Flynn's earlier novels, even though I think this horror marriage story (it's not a true mystery, IMO) has some brilliantly written psycho goodness in it and an absolutely messed up ending that many loathed but I LOVED. I wish it didn't take so much time and patience to get to all of that...",
|
45 |
-
"sentence_answer": "In my mind, <hl> any book that takes me 3 months and 20 different tries to read is not worth 3 stars <hl> , especially a book written by an author I already respect.",
|
46 |
-
"paragraph_id": "1b7cc3db9ec681edd253a41a2785b5a9",
|
47 |
-
"question_subj_level": 1,
|
48 |
-
"answer_subj_level": 1,
|
49 |
-
"domain": "books"
|
50 |
-
}
|
51 |
-
```
|
52 |
-
|
53 |
-
The data fields are the same among all splits.
|
54 |
-
- `question`: a `string` feature.
|
55 |
-
- `paragraph`: a `string` feature.
|
56 |
-
- `answer`: a `string` feature.
|
57 |
-
- `sentence`: a `string` feature.
|
58 |
-
- `paragraph_answer`: a `string` feature, which is same as the paragraph but the answer is highlighted by a special token `<hl>`.
|
59 |
-
- `paragraph_sentence`: a `string` feature, which is same as the paragraph but a sentence containing the answer is highlighted by a special token `<hl>`.
|
60 |
-
- `sentence_answer`: a `string` feature, which is same as the sentence but the answer is highlighted by a special token `<hl>`.
|
61 |
-
|
62 |
-
Each of `paragraph_answer`, `paragraph_sentence`, and `sentence_answer` feature is assumed to be used to train a question generation model,
|
63 |
-
but with different information. The `paragraph_answer` and `sentence_answer` features are for answer-aware question generation and
|
64 |
-
`paragraph_sentence` feature is for sentence-aware question generation.
|
65 |
-
|
66 |
-
### Data Splits
|
67 |
-
|
68 |
-
| name |train|validation|test |
|
69 |
-
|-------------|----:|---------:|----:|
|
70 |
-
|default (all)|4437 | 659 |1489 |
|
71 |
-
| books |636 | 91 |190 |
|
72 |
-
| electronics |696 | 98 |237 |
|
73 |
-
| movies |723 | 100 |153 |
|
74 |
-
| grocery |686 | 100 |378 |
|
75 |
-
| restaurants |822 | 128 |135 |
|
76 |
-
| tripadvisor |874 | 142 |396 |
|
77 |
-
|
78 |
-
## Citation Information
|
79 |
-
```
|
80 |
-
@inproceedings{ushio-etal-2022-generative,
|
81 |
-
title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
|
82 |
-
author = "Ushio, Asahi and
|
83 |
-
Alva-Manchego, Fernando and
|
84 |
-
Camacho-Collados, Jose",
|
85 |
-
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
|
86 |
-
month = dec,
|
87 |
-
year = "2022",
|
88 |
-
address = "Abu Dhabi, U.A.E.",
|
89 |
-
publisher = "Association for Computational Linguistics",
|
90 |
-
}
|
91 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data/processed/books.test.jsonl → all/qg_subjqa-test.parquet
RENAMED
@@ -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:7c8c68f2fb0b26d501f5eb2b6b87325ad4f4ea5dcf3628f83e401b7491946ba7
|
3 |
+
size 4572281
|
all/qg_subjqa-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:db9e179c1917014aac5973d1596f0a235ad3b39847d775737ef67b4bf3257a61
|
3 |
+
size 14793918
|
data/processed/books.train.jsonl → all/qg_subjqa-validation.parquet
RENAMED
@@ -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:f461a3c222e193f69d74c3e4e02624c92249e91df2b70772d5b172e62dfb3119
|
3 |
+
size 2170849
|
data/processed/grocery.dev.jsonl → books/qg_subjqa-test.parquet
RENAMED
@@ -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:853cbba5a9b3339c3f04db6310b52f8c822ab2eafe6424bde3339fc11524a9e0
|
3 |
+
size 778512
|
books/qg_subjqa-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:54e96fbe0d2ea1de56d7ba82435cb39667bf01314b7c4d0d6c6ab69c9c7f2cdc
|
3 |
+
size 2683205
|
data/processed/movies.dev.jsonl → books/qg_subjqa-validation.parquet
RENAMED
@@ -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:eab014788dacc7caca88ee52aaf033c19229f1d5c60a7536e195c3200102d9a5
|
3 |
+
size 400614
|
data/processed/electronics.test.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:58436abd41d42ca5b4f4f3756cb31b6ee31118b4933a464b5084744157de60e1
|
3 |
-
size 1354691
|
|
|
|
|
|
|
|
data/processed/electronics.train.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:0be7c09b63435d9d8bea43f3b3827ea0fcdc6be0c026e5a9afd8682cf1f32505
|
3 |
-
size 4106483
|
|
|
|
|
|
|
|
data/processed/grocery.test.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:8fbf5308ba4930ea0fb47bf2ca719e3763f4d3a4e2058966a1b3e15e253b5751
|
3 |
-
size 1590280
|
|
|
|
|
|
|
|
data/processed/grocery.train.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:4446f8d1cae3b4adc5b90feb4f0a075166216e2093797828e0553de228ebb2d3
|
3 |
-
size 2934897
|
|
|
|
|
|
|
|
data/processed/movies.test.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:53dcac5f26845ad94d29f1fe9f3fe5ef74b7615d67ea5ca110eaabbaed39d306
|
3 |
-
size 1119458
|
|
|
|
|
|
|
|
data/processed/movies.train.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:880e5184aa865fb498b189c0b3dd8d1e6d365ca615c8e0758169c37feff0531a
|
3 |
-
size 5697913
|
|
|
|
|
|
|
|
data/processed/restaurants.dev.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:5e3a52398e8393e0e7564945825d9c8897afc194f3600dca6d1229311f6df92f
|
3 |
-
size 598249
|
|
|
|
|
|
|
|
data/processed/restaurants.test.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:e6f549239de3cd1fa1113c211fe66399d3f2f2bd0944148ecfc1d109dfc77ffa
|
3 |
-
size 620262
|
|
|
|
|
|
|
|
data/processed/restaurants.train.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:9a6d7cf3073a1ddb95c2817d9fa75b5b5fcd5a46e739992c551ba2ad3e060294
|
3 |
-
size 3860006
|
|
|
|
|
|
|
|
data/processed/tripadvisor.dev.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a8064d30202373c7ac64a4189be30a398f7b5fc3f686e0affca79d92a08d4de9
|
3 |
-
size 666278
|
|
|
|
|
|
|
|
data/processed/tripadvisor.test.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:22578e29e951799934b4e7e4239d519d2e29be07ec75c25342bfec255815639f
|
3 |
-
size 1885247
|
|
|
|
|
|
|
|
data/processed/tripadvisor.train.jsonl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:ee326024cd055330423d42896b63ef987c93204f7388820f1b98b8072573d19f
|
3 |
-
size 4046684
|
|
|
|
|
|
|
|
data/processed/electronics.dev.jsonl → electronics/qg_subjqa-test.parquet
RENAMED
@@ -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:e880c1fb88b6d3d4d81f8f0627a532592d4cf36db37ea66e498340e21a317aee
|
3 |
+
size 817784
|
electronics/qg_subjqa-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4d5b0bc449dda0804b24748f8141162538e1508e054c411c993746d948ef5785
|
3 |
+
size 2431000
|
data/processed/books.dev.jsonl → electronics/qg_subjqa-validation.parquet
RENAMED
@@ -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:878f9ecfb1ebecae240cd9f5a7fb6658037afb53321ee027c25aa71bd62b8da6
|
3 |
+
size 365639
|
grocery/qg_subjqa-test.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:add3e4e141ea16847e60a509f94e60074e329e921fbccf14a3cbee3cc5fea83d
|
3 |
+
size 915527
|
grocery/qg_subjqa-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:39089bbad74b71aeb47674a387cb23424d30580c2df05df7dc00090f290498ba
|
3 |
+
size 1690146
|
grocery/qg_subjqa-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6b82868d2172b2aee332b1213d1e03d0e754754d434c3da42f868b9b26a4cfd2
|
3 |
+
size 263680
|
movies/qg_subjqa-test.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3ff78ed5f6dce2d124e0a023fbea53ea452feb6fcf996ba3e65435b9fa977000
|
3 |
+
size 740099
|
movies/qg_subjqa-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fe6cfa6fcae68b79ce13eb31255f03b82288ba3a6f045e420bfb69024cb6d158
|
3 |
+
size 3484140
|
movies/qg_subjqa-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bcbd34b2177ef6cd708ba58b08df3999ecfad03d657c5fc33267c61577d49c8b
|
3 |
+
size 515275
|
process.py
DELETED
@@ -1,103 +0,0 @@
|
|
1 |
-
""" Script to process raw SQuAD file for Question Generation format
|
2 |
-
You need to run `python -m spacy download en_core_web_sm`.
|
3 |
-
Split when uploading to dataset hub by
|
4 |
-
```
|
5 |
-
gsplit -l 1500 -d --additional-suffix=.jsonl default.train.jsonl default.train
|
6 |
-
```
|
7 |
-
"""
|
8 |
-
import json
|
9 |
-
import os
|
10 |
-
import re
|
11 |
-
|
12 |
-
import pandas as pd
|
13 |
-
import spacy
|
14 |
-
|
15 |
-
|
16 |
-
SPLITTER = spacy.load('en_core_web_sm')
|
17 |
-
HIGHLIGHT_TOKEN = '<hl>'
|
18 |
-
|
19 |
-
|
20 |
-
def get_sentence(document: str):
|
21 |
-
return [str(s) for s in SPLITTER(document).sents]
|
22 |
-
|
23 |
-
|
24 |
-
def process_single_data(question, paragraph, answer):
|
25 |
-
""" Convert single raw json data into QG format """
|
26 |
-
example = {'question': question, 'paragraph': paragraph, 'answer': answer}
|
27 |
-
start = example['paragraph'].find(example['answer'])
|
28 |
-
end = start + len(answer)
|
29 |
-
assert paragraph[start:end] == answer
|
30 |
-
# get sentence
|
31 |
-
before_tmp = get_sentence(example['paragraph'][:start])
|
32 |
-
if len(before_tmp) == 0:
|
33 |
-
before = ''
|
34 |
-
before_sentence = ''
|
35 |
-
else:
|
36 |
-
if before_tmp[-1].endswith('.'):
|
37 |
-
before = ' '.join(before_tmp)
|
38 |
-
before_sentence = ''
|
39 |
-
else:
|
40 |
-
before = ' '.join(before_tmp[:-1])
|
41 |
-
before_sentence = before_tmp[-1]
|
42 |
-
before_sentence = before_sentence if before_sentence.endswith(' ') else '{} '.format(before_sentence)
|
43 |
-
after_tmp = get_sentence(example['paragraph'][start + len(example['answer']):])
|
44 |
-
if len(after_tmp) == 0:
|
45 |
-
after = ''
|
46 |
-
after_sentence = ''
|
47 |
-
else:
|
48 |
-
after = ' '.join(after_tmp[1:])
|
49 |
-
after_sentence = after_tmp[0]
|
50 |
-
after_sentence = after_sentence if after_sentence.startswith(' ') else ' {}'.format(after_sentence)
|
51 |
-
example['sentence'] = '{}{}{}'.format(before_sentence, example['answer'], after_sentence)
|
52 |
-
|
53 |
-
# get paragraph_sentence
|
54 |
-
before = '' if before == '' else '{} '.format(before)
|
55 |
-
after = '' if after == '' else ' {}'.format(after)
|
56 |
-
source_text = '{0}{1} {2} {1}{3}'.format(before, HIGHLIGHT_TOKEN, example['sentence'], after)
|
57 |
-
example['paragraph_sentence'] = re.sub(r'\s+', ' ', source_text)
|
58 |
-
|
59 |
-
# get paragraph_answer
|
60 |
-
source_text = '{0}{1} {2} {1}{3}'.format(
|
61 |
-
example['paragraph'][:start], HIGHLIGHT_TOKEN, example['answer'],
|
62 |
-
example['paragraph'][start + len(example['answer']):])
|
63 |
-
example['paragraph_answer'] = re.sub(r'\s+', ' ', source_text)
|
64 |
-
|
65 |
-
# get sentence_answer
|
66 |
-
if len(before_tmp) == 0 or before_tmp[-1].endswith('.'):
|
67 |
-
before = ''
|
68 |
-
else:
|
69 |
-
before = before_tmp[-1] if before_tmp[-1].endswith(' ') else '{} '.format(before_tmp[-1])
|
70 |
-
if len(after_tmp) == 0:
|
71 |
-
after = ''
|
72 |
-
else:
|
73 |
-
after = after_tmp[0] if after_tmp[0].startswith(' ') else ' {}'.format(after_tmp[0])
|
74 |
-
source_text = '{0}{1} {2} {1}{3}'.format(before, HIGHLIGHT_TOKEN, example['answer'], after)
|
75 |
-
example['sentence_answer'] = re.sub(r'\s+', ' ', source_text)
|
76 |
-
|
77 |
-
return example
|
78 |
-
|
79 |
-
|
80 |
-
if __name__ == '__main__':
|
81 |
-
os.makedirs('./data/processed', exist_ok=True)
|
82 |
-
for i in ["books", "electronics", "grocery", "movies", "restaurants", "tripadvisor"]:
|
83 |
-
for s in ["dev.csv", "test.csv", "train.csv"]:
|
84 |
-
df = pd.read_csv(f'SubjQA/SubjQA/{i}/splits/{s}')
|
85 |
-
df = df[[x != 'ANSWERNOTFOUND' for x in df['human_ans_spans']]]
|
86 |
-
df['review'] = [x.replace('ANSWERNOTFOUND', '') for x in df['review']]
|
87 |
-
output = []
|
88 |
-
for _, _g in df.groupby('q_review_id'):
|
89 |
-
if any(i == 'ANSWERNOTFOUND' for i in _g['human_ans_spans']):
|
90 |
-
continue
|
91 |
-
_len = [len(i) for i in _g["human_ans_spans"]]
|
92 |
-
_df = _g.iloc[_len.index(max(_len))]
|
93 |
-
start, end = eval(_df['human_ans_indices'])
|
94 |
-
out = process_single_data(question=re.sub(r'\s+\?', '?', _df['question']),
|
95 |
-
answer=_df['review'][start:end],
|
96 |
-
paragraph=_df['review'])
|
97 |
-
out['question_subj_level'] = int(_df['question_subj_level'])
|
98 |
-
out['answer_subj_level'] = int(_df['answer_subj_level'])
|
99 |
-
out['paragraph_id'] = _df['review_id']
|
100 |
-
out['domain'] = _df['domain']
|
101 |
-
output.append(out)
|
102 |
-
with open(f'./data/processed/{i}.{s.replace(".csv", ".jsonl")}', 'w') as f:
|
103 |
-
f.write('\n'.join([json.dumps(i) for i in output]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qg_subjqa.py
DELETED
@@ -1,92 +0,0 @@
|
|
1 |
-
import json
|
2 |
-
import datasets
|
3 |
-
|
4 |
-
logger = datasets.logging.get_logger(__name__)
|
5 |
-
_VERSION = "5.0.1"
|
6 |
-
_CITATION = """
|
7 |
-
@inproceedings{ushio-etal-2022-generative,
|
8 |
-
title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
|
9 |
-
author = "Ushio, Asahi and
|
10 |
-
Alva-Manchego, Fernando and
|
11 |
-
Camacho-Collados, Jose",
|
12 |
-
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
|
13 |
-
month = dec,
|
14 |
-
year = "2022",
|
15 |
-
address = "Abu Dhabi, U.A.E.",
|
16 |
-
publisher = "Association for Computational Linguistics",
|
17 |
-
}
|
18 |
-
"""
|
19 |
-
_DESCRIPTION = """[SubjQA](https://github.com/megagonlabs/SubjQA) dataset for question generation (QG) task."""
|
20 |
-
_URL = 'https://huggingface.co/datasets/lmqg/qg_subjqa/resolve/main/data/processed'
|
21 |
-
_DOMAINS = ["books", "electronics", "grocery", "movies", "restaurants", "tripadvisor"]
|
22 |
-
|
23 |
-
|
24 |
-
class QGSubjQAConfig(datasets.BuilderConfig):
|
25 |
-
"""BuilderConfig for SquadQG"""
|
26 |
-
|
27 |
-
def __init__(self, **kwargs):
|
28 |
-
"""BuilderConfig for SquadQG.
|
29 |
-
Args:
|
30 |
-
**kwargs: keyword arguments forwarded to super.
|
31 |
-
"""
|
32 |
-
super(QGSubjQAConfig, self).__init__(**kwargs)
|
33 |
-
|
34 |
-
|
35 |
-
class QGSubjQA(datasets.GeneratorBasedBuilder):
|
36 |
-
|
37 |
-
BUILDER_CONFIGS = [QGSubjQAConfig(name="all", version=datasets.Version(_VERSION), description="SubjQA from all domain of `{}`.")]
|
38 |
-
BUILDER_CONFIGS += [QGSubjQAConfig(name=i, version=datasets.Version(_VERSION), description=f"SubjQA from domain of `{i}`.") for i in _DOMAINS]
|
39 |
-
|
40 |
-
def _info(self):
|
41 |
-
return datasets.DatasetInfo(
|
42 |
-
description=_DESCRIPTION,
|
43 |
-
features=datasets.Features(
|
44 |
-
{
|
45 |
-
"answer": datasets.Value("string"), "paragraph_question": datasets.Value("string"),
|
46 |
-
"question": datasets.Value("string"),
|
47 |
-
"sentence": datasets.Value("string"),
|
48 |
-
"paragraph": datasets.Value("string"),
|
49 |
-
"sentence_answer": datasets.Value("string"),
|
50 |
-
"paragraph_answer": datasets.Value("string"),
|
51 |
-
"paragraph_sentence": datasets.Value("string"),
|
52 |
-
"paragraph_id": datasets.Value("string"),
|
53 |
-
"question_subj_level": datasets.Value("int32"),
|
54 |
-
"answer_subj_level": datasets.Value("int32"),
|
55 |
-
"domain": datasets.Value("string"),
|
56 |
-
}
|
57 |
-
),
|
58 |
-
supervised_keys=None,
|
59 |
-
homepage="https://github.com/asahi417/lm-question-generation"
|
60 |
-
)
|
61 |
-
|
62 |
-
def _split_generators(self, dl_manager):
|
63 |
-
if self.config.name == 'all':
|
64 |
-
downloaded_file = dl_manager.download_and_extract({
|
65 |
-
'train': [f"{_URL}/{i}.train.jsonl" for i in _DOMAINS],
|
66 |
-
'dev': [f"{_URL}/{i}.dev.jsonl" for i in _DOMAINS],
|
67 |
-
'test': [f"{_URL}/{i}.test.jsonl" for i in _DOMAINS]
|
68 |
-
})
|
69 |
-
else:
|
70 |
-
downloaded_file = dl_manager.download_and_extract({
|
71 |
-
'train': [f"{_URL}/{self.config.name}.train.jsonl"],
|
72 |
-
'dev': [f"{_URL}/{self.config.name}.dev.jsonl"],
|
73 |
-
'test': [f"{_URL}/{self.config.name}.test.jsonl"]
|
74 |
-
})
|
75 |
-
return [
|
76 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepaths": downloaded_file["train"]}),
|
77 |
-
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepaths": downloaded_file["dev"]}),
|
78 |
-
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepaths": downloaded_file["test"]})
|
79 |
-
]
|
80 |
-
|
81 |
-
def _generate_examples(self, filepaths):
|
82 |
-
_key = 0
|
83 |
-
for filepath in filepaths:
|
84 |
-
logger.info("generating examples from = %s", filepath)
|
85 |
-
with open(filepath, encoding="utf-8") as f:
|
86 |
-
_list = f.read().split('\n')
|
87 |
-
if _list[-1] == '':
|
88 |
-
_list = _list[:-1]
|
89 |
-
for i in _list:
|
90 |
-
data = json.loads(i)
|
91 |
-
yield _key, data
|
92 |
-
_key += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
restaurants/qg_subjqa-test.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:67310c125e4b7d806ff7348a89d4cc5c0dd02299a693f25226c6ee42583905e1
|
3 |
+
size 406101
|
restaurants/qg_subjqa-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dd4421b9221c3d793c1aa405f7125488105001ae5cbb07cc4c01b16b856ab583
|
3 |
+
size 2268837
|
restaurants/qg_subjqa-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b312230c05db85d1908100f2f7c3730e4b54962f0e29288c4c3983695ac6d23e
|
3 |
+
size 392221
|
tripadvisor/qg_subjqa-test.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:61a55e54b427043ab76ceeb281f8b9f27f7539ea4fb58b6170653d1afa041713
|
3 |
+
size 1057125
|
tripadvisor/qg_subjqa-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:eb9af38701f365e748a11836aa5b3ea80877e66f43240972b11f8c340254b7ae
|
3 |
+
size 2221494
|
tripadvisor/qg_subjqa-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:89cc13dfcbb369d430cd5ada2a3be2f2a30e538d2acc75d473c82e9d2355a342
|
3 |
+
size 402683
|