Datasets:
lmqg
/

Languages:
Italian
Multilinguality:
monolingual
Size Categories:
1k<n<10K
Source Datasets:
lmqg/qg_itquad
ArXiv:
Tags:
question-generation
License:
asahi417 commited on
Commit
275e0ff
1 Parent(s): 08ff62e

Update qag_itquad.py

Browse files
Files changed (1) hide show
  1. qag_itquad.py +67 -59
qag_itquad.py CHANGED
@@ -1,62 +1,10 @@
1
- ---
2
- license: cc-by-sa-4.0
3
- pretty_name: SQuAD for question generation
4
- language: ko
5
- multilinguality: monolingual
6
- size_categories: 1k<n<10K
7
- source_datasets: lmqg/qg_itquad
8
- task_categories:
9
- - text-generation
10
- task_ids:
11
- - language-modeling
12
- tags:
13
- - question-generation
14
- ---
15
 
16
- # Dataset Card for "lmqg/qag_itquad"
17
-
18
-
19
- ## Dataset Description
20
- - **Repository:** [https://github.com/asahi417/lm-question-generation](https://github.com/asahi417/lm-question-generation)
21
- - **Paper:** [https://arxiv.org/abs/2210.03992](https://arxiv.org/abs/2210.03992)
22
- - **Point of Contact:** [Asahi Ushio](http://asahiushio.com/)
23
-
24
- ### Dataset Summary
25
- This is the question & answer generation dataset based on the ITQuAD.
26
-
27
- ### Supported Tasks and Leaderboards
28
- * `question-answer-generation`: The dataset is assumed to be used to train a model for question & answer generation.
29
- Success on this task is typically measured by achieving a high BLEU4/METEOR/ROUGE-L/BERTScore/MoverScore (see our paper for more in detail).
30
-
31
- ### Languages
32
- Korean (ko)
33
-
34
- ## Dataset Structure
35
- An example of 'train' looks as follows.
36
- ```
37
- {
38
- "paragraph": ""4 Minuti" è uscito come primo singolo dell' album e ha raggiunto il terzo posto sulla Billboard Hot 100. E' stato il 37° top-ten di Madonna che ha spinto Madonna oltre Elvis Presley come l' artista con i più top-ten hit. Nel Regno Unito ha mantenuto il suo record per il più numero uno single per una artista femminile;"4 Minuti" diventando il suo tredicesimo. Al 23° Japan Gold Disc Awards, Madonna ha ricevuto il suo quinto trofeo Artista dell' anno dalla Recording Industry Association of Japan, la più importante per qualsiasi artista. Per promuovere ulteriormente l' album, Madonna ha intrapreso il Sticky & Sweet Tour, la sua prima grande avventura con Live Nation. Con un lordo di 280 milioni di dollari, è diventato il tour più incassato di un artista solista, superando il precedente record di Madonna stabilito con il Confessions Tour; è stato poi superato da The Wall Live di Roger Waters. E' stato esteso al prossimo anno, aggiungendo nuove date europee, e dopo la fine, il totale lordo totale era di 408 milioni di dollari.",
39
- "questions": [ "Qual è il nome del primo tour con Live Nation?", "4 minuti è diventato Madonna's che numero uno nel Regno Unito?", "Quanto ha incassato Stick e Sweet Tour?", "Madonna ha superato l' artista con i più alti dieci colpi?" ],
40
- "answers": [ "Sticky & Sweet Tour", "tredicesimo", "280 milioni di dollari,", "Elvis Presley" ],
41
- "questions_answers": "question: Qual è il nome del primo tour con Live Nation?, answer: Sticky & Sweet Tour | question: 4 minuti è diventato Madonna's che numero uno nel Regno Unito?, answer: tredicesimo | question: Quanto ha incassato Stick e Sweet Tour?, answer: 280 milioni di dollari, | question: Madonna ha superato l' artista con i più alti dieci colpi?, answer: Elvis Presley"
42
- }
43
- ```
44
- The data fields are the same among all splits.
45
- - `questions`: a `list` of `string` features.
46
- - `answers`: a `list` of `string` features.
47
- - `paragraph`: a `string` feature.
48
- - `questions_answers`: a `string` feature.
49
-
50
- ## Data Splits
51
-
52
- |train|validation|test |
53
- |----:|---------:|----:|
54
- |9600 | 960 | 4442|
55
-
56
-
57
- ## Citation Information
58
-
59
- ```
60
  @inproceedings{ushio-etal-2022-generative,
61
  title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
62
  author = "Ushio, Asahi and
@@ -68,4 +16,64 @@ The data fields are the same among all splits.
68
  address = "Abu Dhabi, U.A.E.",
69
  publisher = "Association for Computational Linguistics",
70
  }
71
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import datasets
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
+ logger = datasets.logging.get_logger(__name__)
5
+ _VERSION = "0.0.0"
6
+ _NAME = "qag_itquad"
7
+ _CITATION = """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  @inproceedings{ushio-etal-2022-generative,
9
  title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
10
  author = "Ushio, Asahi and
 
16
  address = "Abu Dhabi, U.A.E.",
17
  publisher = "Association for Computational Linguistics",
18
  }
19
+ """
20
+ _DESCRIPTION = """Question & answer generation dataset based on SQuAD."""
21
+ _URL = f"https://huggingface.co/datasets/lmqg/{_NAME}/resolve/main/data/processed"
22
+ _URLS = {
23
+ 'train': f'{_URL}/train.jsonl',
24
+ 'test': f'{_URL}/test.jsonl',
25
+ 'validation': f'{_URL}/validation.jsonl'
26
+ }
27
+
28
+
29
+ class QAGITQuADConfig(datasets.BuilderConfig):
30
+ """BuilderConfig"""
31
+
32
+ def __init__(self, **kwargs):
33
+ """BuilderConfig.
34
+ Args:
35
+ **kwargs: keyword arguments forwarded to super.
36
+ """
37
+ super(QAGITQuADConfig, self).__init__(**kwargs)
38
+
39
+
40
+ class QAGITQuAD(datasets.GeneratorBasedBuilder):
41
+
42
+ BUILDER_CONFIGS = [
43
+ QAGITQuADConfig(name=_NAME, version=datasets.Version(_VERSION), description=_DESCRIPTION),
44
+ ]
45
+
46
+ def _info(self):
47
+ return datasets.DatasetInfo(
48
+ description=_DESCRIPTION,
49
+ features=datasets.Features(
50
+ {
51
+ "answers": datasets.Sequence(datasets.Value("string")),
52
+ "questions": datasets.Sequence(datasets.Value("string")),
53
+ "paragraph": datasets.Value("string"),
54
+ "questions_answers": datasets.Value("string")
55
+ }
56
+ ),
57
+ supervised_keys=None,
58
+ homepage="https://github.com/asahi417/lm-question-generation"
59
+ )
60
+
61
+ def _split_generators(self, dl_manager):
62
+ downloaded_file = dl_manager.download_and_extract(_URLS)
63
+ return [
64
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_file["train"]}),
65
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_file["validation"]}),
66
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_file["test"]}),
67
+ ]
68
+
69
+ def _generate_examples(self, filepath):
70
+ _key = 0
71
+ logger.info("generating examples from = %s", filepath)
72
+ with open(filepath, encoding="utf-8") as f:
73
+ _list = f.read().split('\n')
74
+ if _list[-1] == '':
75
+ _list = _list[:-1]
76
+ for i in _list:
77
+ data = json.loads(i)
78
+ yield _key, data
79
+ _key += 1