Datasets:
lmqg
/

Languages:
German
ArXiv:
License:
asahi417 commited on
Commit
3ccf7e8
1 Parent(s): f71a702
data/processed/test00.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/test01.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/test02.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/test03.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/test04.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train00.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train01.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train02.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train03.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train04.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train05.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train06.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train07.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train08.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train09.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train10.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train11.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train12.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train13.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train14.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train15.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train16.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train17.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/train18.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/validation00.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/validation01.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/validation02.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/validation03.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/processed/validation04.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
qg_dequad.py CHANGED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """ python -c "from datasets import load_dataset;load_dataset('.')" """
2
+ import json
3
+ from itertools import chain
4
+ import datasets
5
+
6
+ logger = datasets.logging.get_logger(__name__)
7
+ _DESCRIPTION = """[GermanSQuAD](https://huggingface.co/datasets/deepset/germanquad) dataset for question generation (QG) task."""
8
+ _URL = 'https://huggingface.co/datasets/asahi417/qg_dequad/raw/main/data/processed'
9
+ _URLS = {
10
+ str(datasets.Split.TEST): [f'{_URL}/test{i:02d}.jsonl' for i in range(5)],
11
+ str(datasets.Split.TRAIN): [f'{_URL}/train{i:02d}.jsonl' for i in range(19)],
12
+ str(datasets.Split.VALIDATION): [f'{_URL}/validation{i:02d}.jsonl' for i in range(5)],
13
+ }
14
+
15
+
16
+ class QGDEQuADConfig(datasets.BuilderConfig):
17
+ """BuilderConfig for SquadQG"""
18
+
19
+ def __init__(self, **kwargs):
20
+ """BuilderConfig for SquadQG.
21
+ Args:
22
+ **kwargs: keyword arguments forwarded to super.
23
+ """
24
+ super(QGDEQuADConfig, self).__init__(**kwargs)
25
+
26
+
27
+ class QGDEQuAD(datasets.GeneratorBasedBuilder):
28
+
29
+ def _info(self):
30
+ return datasets.DatasetInfo(
31
+ description=_DESCRIPTION,
32
+ features=datasets.Features(
33
+ {
34
+ "answer": datasets.Value("string"),
35
+ "question": datasets.Value("string"),
36
+ "sentence": datasets.Value("string"),
37
+ "paragraph": datasets.Value("string"),
38
+ "sentence_answer": datasets.Value("string"),
39
+ "paragraph_answer": datasets.Value("string"),
40
+ "paragraph_sentence": datasets.Value("string"),
41
+ "paragraph_id": datasets.Value("string")
42
+ }
43
+ ),
44
+ supervised_keys=None,
45
+ homepage="https://github.com/asahi417/lm-question-generation"
46
+ )
47
+
48
+ def _split_generators(self, dl_manager):
49
+ downloaded_file = dl_manager.download_and_extract(_URLS)
50
+ return [datasets.SplitGenerator(name=i, gen_kwargs={"filepaths": downloaded_file[str(i)]})
51
+ for i in [datasets.Split.TRAIN, datasets.Split.VALIDATION, datasets.Split.TEST]]
52
+
53
+ def _generate_examples(self, filepaths):
54
+ _key = 0
55
+ for filepath in filepaths:
56
+ logger.info("generating examples from = %s", filepath)
57
+ with open(filepath, encoding="utf-8") as f:
58
+ _list = f.read().split('\n')
59
+ if _list[-1] == '':
60
+ _list = _list[:-1]
61
+ for i in _list:
62
+ data = json.loads(i)
63
+ yield _key, data
64
+ _key += 1
65
+