Model Card of lmqg/t5-base-squad-qg
This model is fine-tuned version of t5-base for question generation task on the lmqg/qg_squad (dataset_name: default) via lmqg
.
Overview
- Language model: t5-base
- Language: en
- Training data: lmqg/qg_squad (default)
- Online Demo: https://autoqg.net/
- Repository: https://github.com/asahi417/lm-question-generation
- Paper: https://arxiv.org/abs/2210.03992
Usage
- With
lmqg
from lmqg import TransformersQG
# initialize model
model = TransformersQG(language="en", model="lmqg/t5-base-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
from transformers import pipeline
pipe = pipeline("text2text-generation", "lmqg/t5-base-squad-qg")
output = pipe("generate question: <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
Score | Type | Dataset | |
---|---|---|---|
BERTScore | 90.6 | default | lmqg/qg_squad |
Bleu_1 | 58.69 | default | lmqg/qg_squad |
Bleu_2 | 42.66 | default | lmqg/qg_squad |
Bleu_3 | 32.99 | default | lmqg/qg_squad |
Bleu_4 | 26.13 | default | lmqg/qg_squad |
METEOR | 26.97 | default | lmqg/qg_squad |
MoverScore | 64.74 | default | lmqg/qg_squad |
ROUGE_L | 53.33 | default | lmqg/qg_squad |
- Metric (Question & Answer Generation, Reference Answer): Each question is generated from the gold answer. raw metric file
Score | Type | Dataset | |
---|---|---|---|
QAAlignedF1Score (BERTScore) | 95.42 | default | lmqg/qg_squad |
QAAlignedF1Score (MoverScore) | 70.63 | default | lmqg/qg_squad |
QAAlignedPrecision (BERTScore) | 95.48 | default | lmqg/qg_squad |
QAAlignedPrecision (MoverScore) | 70.92 | default | lmqg/qg_squad |
QAAlignedRecall (BERTScore) | 95.37 | default | lmqg/qg_squad |
QAAlignedRecall (MoverScore) | 70.34 | default | lmqg/qg_squad |
- Metric (Question & Answer Generation, Pipeline Approach): Each question is generated on the answer generated by
lmqg/t5-base-squad-ae
. raw metric file
Score | Type | Dataset | |
---|---|---|---|
QAAlignedF1Score (BERTScore) | 92.75 | default | lmqg/qg_squad |
QAAlignedF1Score (MoverScore) | 64.36 | default | lmqg/qg_squad |
QAAlignedPrecision (BERTScore) | 92.59 | default | lmqg/qg_squad |
QAAlignedPrecision (MoverScore) | 64.45 | default | lmqg/qg_squad |
QAAlignedRecall (BERTScore) | 92.93 | default | lmqg/qg_squad |
QAAlignedRecall (MoverScore) | 64.35 | default | lmqg/qg_squad |
- Metrics (Question Generation, Out-of-Domain)
Dataset | Type | BERTScore | Bleu_4 | METEOR | MoverScore | ROUGE_L | Link |
---|---|---|---|---|---|---|---|
lmqg/qg_squadshifts | amazon | 90.75 | 6.57 | 22.37 | 60.8 | 24.81 | link |
lmqg/qg_squadshifts | new_wiki | 93.02 | 11.09 | 27.23 | 65.97 | 29.59 | link |
lmqg/qg_squadshifts | nyt | 92.2 | 7.77 | 25.16 | 63.83 | 24.56 | link |
lmqg/qg_squadshifts | 90.59 | 5.68 | 21.3 | 60.23 | 21.96 | link | |
lmqg/qg_subjqa | books | 88.14 | 0.49 | 13.51 | 55.65 | 9.44 | link |
lmqg/qg_subjqa | electronics | 87.71 | 0.0 | 16.53 | 55.77 | 13.48 | link |
lmqg/qg_subjqa | grocery | 87.46 | 0.0 | 16.24 | 56.59 | 10.26 | link |
lmqg/qg_subjqa | movies | 87.66 | 0.72 | 13.06 | 55.45 | 11.89 | link |
lmqg/qg_subjqa | restaurants | 87.83 | 0.0 | 13.3 | 55.45 | 10.7 | link |
lmqg/qg_subjqa | tripadvisor | 89.23 | 0.93 | 16.51 | 56.67 | 13.51 | link |
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: ['qg']
- model: t5-base
- max_length: 512
- max_length_output: 32
- epoch: 5
- batch: 16
- lr: 0.0001
- fp16: False
- random_seed: 1
- gradient_accumulation_steps: 4
- label_smoothing: 0.15
The full configuration can be found at fine-tuning config file.
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",
}