File size: 12,684 Bytes
37d6f58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4616cbd
37d6f58
4616cbd
37d6f58
4616cbd
37d6f58
 
06a3cd5
37d6f58
 
 
 
 
 
 
 
 
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
37d6f58
 
 
 
29d3896
37d6f58
 
 
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
37d6f58
 
 
 
29d3896
37d6f58
 
 
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
37d6f58
 
 
 
29d3896
37d6f58
 
 
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
37d6f58
 
 
 
29d3896
37d6f58
 
 
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
37d6f58
 
 
 
29d3896
37d6f58
 
 
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
37d6f58
 
 
 
29d3896
37d6f58
 
 
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
37d6f58
 
 
 
29d3896
37d6f58
 
 
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
5d0447c
 
29d3896
37d6f58
 
06a3cd5
29d3896
37d6f58
 
 
 
 
 
 
 
6a4a582
37d6f58
 
6a4a582
37d6f58
6a4a582
29d3896
6a4a582
06a3cd5
29d3896
6a4a582
29d3896
6a4a582
 
37d6f58
6a4a582
 
 
f278e5b
06a3cd5
29d3896
37d6f58
29d3896
37d6f58
29d3896
37d6f58
 
06a3cd5
37d6f58
29d3896
 
 
 
 
 
 
 
 
 
37d6f58
 
29d3896
37d6f58
29d3896
 
06a3cd5
 
 
 
 
 
 
37d6f58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
06a3cd5
37d6f58
 
6a4a582
f278e5b
6a4a582
f278e5b
6a4a582
f278e5b
 
 
 
 
 
 
 
6a4a582
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312

---
license: cc-by-4.0
metrics:
- bleu4
- meteor
- rouge-l
- bertscore
- moverscore
language: en
datasets:
- lmqg/qg_squad
pipeline_tag: text2text-generation
tags:
- question generation
widget:
- text: "<hl> Beyonce <hl> further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, Cadillac Records."
  example_title: "Question Generation Example 1" 
- text: "Beyonce further expanded her acting career, starring as blues singer <hl> Etta James <hl> in the 2008 musical biopic, Cadillac Records."
  example_title: "Question Generation Example 2" 
- text: "Beyonce further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic,  <hl> Cadillac Records <hl> ."
  example_title: "Question Generation Example 3" 
model-index:
- name: lmqg/mt5-small-squad-qg
  results:
  - task:
      name: Text2text Generation
      type: text2text-generation
    dataset:
      name: lmqg/qg_squad
      type: default
      args: default
    metrics:
    - name: BLEU4 (Question Generation)
      type: bleu4_question_generation
      value: 21.65
    - name: ROUGE-L (Question Generation)
      type: rouge_l_question_generation
      value: 48.95
    - name: METEOR (Question Generation)
      type: meteor_question_generation
      value: 23.83
    - name: BERTScore (Question Generation)
      type: bertscore_question_generation
      value: 90.01
    - name: MoverScore (Question Generation)
      type: moverscore_question_generation
      value: 62.75
  - task:
      name: Text2text Generation
      type: text2text-generation
    dataset:
      name: lmqg/qg_dequad
      type: default
      args: default
    metrics:
    - name: BLEU4 (Question Generation)
      type: bleu4_question_generation
      value: 9.242783121165897e-12
    - name: ROUGE-L (Question Generation)
      type: rouge_l_question_generation
      value: 0.01556150764938016
    - name: METEOR (Question Generation)
      type: meteor_question_generation
      value: 0.04809700451843158
    - name: BERTScore (Question Generation)
      type: bertscore_question_generation
      value: 0.7353078946893743
    - name: MoverScore (Question Generation)
      type: moverscore_question_generation
      value: 0.5036973829954939
  - task:
      name: Text2text Generation
      type: text2text-generation
    dataset:
      name: lmqg/qg_esquad
      type: default
      args: default
    metrics:
    - name: BLEU4 (Question Generation)
      type: bleu4_question_generation
      value: 0.0059191752064594125
    - name: ROUGE-L (Question Generation)
      type: rouge_l_question_generation
      value: 0.05208940592236566
    - name: METEOR (Question Generation)
      type: meteor_question_generation
      value: 0.06021086135293597
    - name: BERTScore (Question Generation)
      type: bertscore_question_generation
      value: 0.7494422899749911
    - name: MoverScore (Question Generation)
      type: moverscore_question_generation
      value: 0.5062373132800192
  - task:
      name: Text2text Generation
      type: text2text-generation
    dataset:
      name: lmqg/qg_frquad
      type: default
      args: default
    metrics:
    - name: BLEU4 (Question Generation)
      type: bleu4_question_generation
      value: 0.0171464639522496
    - name: ROUGE-L (Question Generation)
      type: rouge_l_question_generation
      value: 0.1583673053928925
    - name: METEOR (Question Generation)
      type: meteor_question_generation
      value: 0.08244973027319356
    - name: BERTScore (Question Generation)
      type: bertscore_question_generation
      value: 0.7291012183458674
    - name: MoverScore (Question Generation)
      type: moverscore_question_generation
      value: 0.509610854598101
  - task:
      name: Text2text Generation
      type: text2text-generation
    dataset:
      name: lmqg/qg_itquad
      type: default
      args: default
    metrics:
    - name: BLEU4 (Question Generation)
      type: bleu4_question_generation
      value: 0.005438910607183992
    - name: ROUGE-L (Question Generation)
      type: rouge_l_question_generation
      value: 0.05010570221421983
    - name: METEOR (Question Generation)
      type: meteor_question_generation
      value: 0.05890828426558759
    - name: BERTScore (Question Generation)
      type: bertscore_question_generation
      value: 0.7260160158030385
    - name: MoverScore (Question Generation)
      type: moverscore_question_generation
      value: 0.5023119088393686
  - task:
      name: Text2text Generation
      type: text2text-generation
    dataset:
      name: lmqg/qg_jaquad
      type: default
      args: default
    metrics:
    - name: BLEU4 (Question Generation)
      type: bleu4_question_generation
      value: 4.4114578660129224e-08
    - name: ROUGE-L (Question Generation)
      type: rouge_l_question_generation
      value: 0.06084267343290677
    - name: METEOR (Question Generation)
      type: meteor_question_generation
      value: 0.005149267426183168
    - name: BERTScore (Question Generation)
      type: bertscore_question_generation
      value: 0.6608093198082075
    - name: MoverScore (Question Generation)
      type: moverscore_question_generation
      value: 0.46526108687696893
  - task:
      name: Text2text Generation
      type: text2text-generation
    dataset:
      name: lmqg/qg_koquad
      type: default
      args: default
    metrics:
    - name: BLEU4 (Question Generation)
      type: bleu4_question_generation
      value: 1.4750917137316939e-12
    - name: ROUGE-L (Question Generation)
      type: rouge_l_question_generation
      value: 0.0006466767450454226
    - name: METEOR (Question Generation)
      type: meteor_question_generation
      value: 0.007310046912436679
    - name: BERTScore (Question Generation)
      type: bertscore_question_generation
      value: 0.6634288882769679
    - name: MoverScore (Question Generation)
      type: moverscore_question_generation
      value: 0.4586124640357038
  - task:
      name: Text2text Generation
      type: text2text-generation
    dataset:
      name: lmqg/qg_ruquad
      type: default
      args: default
    metrics:
    - name: BLEU4 (Question Generation)
      type: bleu4_question_generation
      value: 4.229109829516021e-12
    - name: ROUGE-L (Question Generation)
      type: rouge_l_question_generation
      value: 0.009881091250723615
    - name: METEOR (Question Generation)
      type: meteor_question_generation
      value: 0.017796529053904556
    - name: BERTScore (Question Generation)
      type: bertscore_question_generation
      value: 0.7089446693028568
    - name: MoverScore (Question Generation)
      type: moverscore_question_generation
      value: 0.49098728551715626
---

# Model Card of `lmqg/mt5-small-squad-qg`
This model is fine-tuned version of [google/mt5-small](https://huggingface.co/google/mt5-small) for question generation task on the [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) (dataset_name: default) via [`lmqg`](https://github.com/asahi417/lm-question-generation).


### Overview
- **Language model:** [google/mt5-small](https://huggingface.co/google/mt5-small)   
- **Language:** en  
- **Training data:** [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) (default)
- **Online Demo:** [https://autoqg.net/](https://autoqg.net/)
- **Repository:** [https://github.com/asahi417/lm-question-generation](https://github.com/asahi417/lm-question-generation)
- **Paper:** [https://arxiv.org/abs/2210.03992](https://arxiv.org/abs/2210.03992)

### Usage
- With [`lmqg`](https://github.com/asahi417/lm-question-generation#lmqg-language-model-for-question-generation-)
```python
from lmqg import TransformersQG

# initialize model
model = TransformersQG(language="en", model="lmqg/mt5-small-squad-qg")

# model prediction
questions = model.generate_q(list_context="William Turner was an English painter who specialised in watercolour landscapes", list_answer="William Turner")

```

- With `transformers`
```python
from transformers import pipeline

pipe = pipeline("text2text-generation", "lmqg/mt5-small-squad-qg")
output = pipe("<hl> Beyonce <hl> further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, Cadillac Records.")

```

## Evaluation


- ***Metric (Question Generation)***: [raw metric file](https://huggingface.co/lmqg/mt5-small-squad-qg/raw/main/eval/metric.first.sentence.paragraph_answer.question.lmqg_qg_squad.default.json) 

|            |   Score | Type    | Dataset                                                        |
|:-----------|--------:|:--------|:---------------------------------------------------------------|
| BERTScore  |   90.01 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
| Bleu_1     |   54.07 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
| Bleu_2     |   37.62 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
| Bleu_3     |   28.18 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
| Bleu_4     |   21.65 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
| METEOR     |   23.83 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
| MoverScore |   62.75 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |
| ROUGE_L    |   48.95 | default | [lmqg/qg_squad](https://huggingface.co/datasets/lmqg/qg_squad) |


- ***Metrics (Question Generation, Out-of-Domain)***
        
| Dataset | Type | BERTScore| Bleu_4 | METEOR | MoverScore | ROUGE_L | Link |
|:--------|:-----|---------:|-------:|-------:|-----------:|--------:|-----:|
| [lmqg/qg_dequad](https://huggingface.co/datasets/lmqg/qg_dequad) | default | 73.53 | 0.0 | 4.81 | 50.37 | 1.56 | [link](https://huggingface.co/lmqg/mt5-small-squad-qg/raw/main/eval_ood/metric.first.sentence.paragraph_answer.question.lmqg_qg_dequad.default.json) |
| [lmqg/qg_esquad](https://huggingface.co/datasets/lmqg/qg_esquad) | default | 74.94 | 0.59 | 6.02 | 50.62 | 5.21 | [link](https://huggingface.co/lmqg/mt5-small-squad-qg/raw/main/eval_ood/metric.first.sentence.paragraph_answer.question.lmqg_qg_esquad.default.json) |
| [lmqg/qg_frquad](https://huggingface.co/datasets/lmqg/qg_frquad) | default | 72.91 | 1.71 | 8.24 | 50.96 | 15.84 | [link](https://huggingface.co/lmqg/mt5-small-squad-qg/raw/main/eval_ood/metric.first.sentence.paragraph_answer.question.lmqg_qg_frquad.default.json) |
| [lmqg/qg_itquad](https://huggingface.co/datasets/lmqg/qg_itquad) | default | 72.6 | 0.54 | 5.89 | 50.23 | 5.01 | [link](https://huggingface.co/lmqg/mt5-small-squad-qg/raw/main/eval_ood/metric.first.sentence.paragraph_answer.question.lmqg_qg_itquad.default.json) |
| [lmqg/qg_jaquad](https://huggingface.co/datasets/lmqg/qg_jaquad) | default | 66.08 | 0.0 | 0.51 | 46.53 | 6.08 | [link](https://huggingface.co/lmqg/mt5-small-squad-qg/raw/main/eval_ood/metric.first.sentence.paragraph_answer.question.lmqg_qg_jaquad.default.json) |
| [lmqg/qg_koquad](https://huggingface.co/datasets/lmqg/qg_koquad) | default | 66.34 | 0.0 | 0.73 | 45.86 | 0.06 | [link](https://huggingface.co/lmqg/mt5-small-squad-qg/raw/main/eval_ood/metric.first.sentence.paragraph_answer.question.lmqg_qg_koquad.default.json) |
| [lmqg/qg_ruquad](https://huggingface.co/datasets/lmqg/qg_ruquad) | default | 70.89 | 0.0 | 1.78 | 49.1 | 0.99 | [link](https://huggingface.co/lmqg/mt5-small-squad-qg/raw/main/eval_ood/metric.first.sentence.paragraph_answer.question.lmqg_qg_ruquad.default.json) |


## Training hyperparameters

The following hyperparameters were used during fine-tuning:
 - dataset_path: lmqg/qg_squad
 - dataset_name: default
 - input_types: ['paragraph_answer']
 - output_types: ['question']
 - prefix_types: None
 - model: google/mt5-small
 - max_length: 512
 - max_length_output: 32
 - epoch: 15
 - batch: 64
 - lr: 0.0005
 - fp16: False
 - random_seed: 1
 - gradient_accumulation_steps: 1
 - label_smoothing: 0.15

The full configuration can be found at [fine-tuning config file](https://huggingface.co/lmqg/mt5-small-squad-qg/raw/main/trainer_config.json).

## Citation
```
@inproceedings{ushio-etal-2022-generative,
    title = "{G}enerative {L}anguage {M}odels for {P}aragraph-{L}evel {Q}uestion {G}eneration",
    author = "Ushio, Asahi  and
        Alva-Manchego, Fernando  and
        Camacho-Collados, Jose",
    booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
    month = dec,
    year = "2022",
    address = "Abu Dhabi, U.A.E.",
    publisher = "Association for Computational Linguistics",
}

```