英文

lmqg/t5-small-squad-qg 的模型卡片

这个模型是通过 lmqg lmqg/qg_squad 上进行问题生成任务的微调版本的 t5-small

概述

使用方法

from lmqg import TransformersQG

# initialize model
model = TransformersQG(language="en", model="lmqg/t5-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")
  • 使用 transformers
from transformers import pipeline

pipe = pipeline("text2text-generation", "lmqg/t5-small-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.")

评估

Score Type Dataset
BERTScore 90.2 default 12313321
Bleu_1 56.86 default 12313321
Bleu_2 40.59 default 12313321
Bleu_3 31.05 default 12313321
Bleu_4 24.4 default 12313321
METEOR 25.84 default 12313321
MoverScore 63.89 default 12313321
ROUGE_L 51.43 default 12313321
  • 指标(问题和答案生成,参考答案):每个问题都是从黄金答案中生成的。 raw metric file
Score Type Dataset
QAAlignedF1Score (BERTScore) 95.14 default 12313321
QAAlignedF1Score (MoverScore) 69.79 default 12313321
QAAlignedPrecision (BERTScore) 95.19 default 12313321
QAAlignedPrecision (MoverScore) 70.09 default 12313321
QAAlignedRecall (BERTScore) 95.09 default 12313321
QAAlignedRecall (MoverScore) 69.51 default 12313321
Score Type Dataset
QAAlignedF1Score (BERTScore) 92.26 default 12313321
QAAlignedF1Score (MoverScore) 63.83 default 12313321
QAAlignedPrecision (BERTScore) 92.07 default 12313321
QAAlignedPrecision (MoverScore) 63.92 default 12313321
QAAlignedRecall (BERTScore) 92.48 default 12313321
QAAlignedRecall (MoverScore) 63.82 default 12313321
  • 指标(问题生成,领域外)
Dataset Type BERTScore Bleu_4 METEOR MoverScore ROUGE_L Link
12336321 amazon 89.94 5.45 20.75 59.79 22.97 12337321
12336321 new_wiki 92.61 10.48 26.21 65.05 28.11 12339321
12336321 nyt 91.71 6.97 23.66 62.86 23.03 12341321
12336321 reddit 89.57 4.75 19.8 59.23 20.1 12343321
12344321 books 87.4 0.0 12.3 55.34 10.88 12345321
12344321 electronics 87.12 1.16 15.49 55.55 15.62 12347321
12344321 grocery 87.22 0.52 14.95 57.12 12.63 12349321
12344321 movies 86.84 0.0 12.11 55.01 12.63 12351321
12344321 restaurants 87.49 0.0 12.67 55.04 11.53 12353321
12344321 tripadvisor 88.4 1.46 15.53 55.91 14.24 12355321

训练超参数

在微调期间使用了以下超参数:

  • dataset_path:lmqg/qg_squad
  • dataset_name:default
  • input_types:['paragraph_answer']
  • output_types:['question']
  • prefix_types:['qg']
  • model:t5-small
  • max_length:512
  • max_length_output:32
  • epoch:9
  • batch:64
  • lr:0.0001
  • fp16:False
  • random_seed:1
  • gradient_accumulation_steps:1
  • label_smoothing:0.15

完整的配置可以在 fine-tuning config file 找到。

引用

@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",
}