asahi417's picture
commit files to HF hub
a506656
metadata
license: cc-by-4.0
metrics:
  - bleu4
  - meteor
  - rouge-l
  - bertscore
  - moverscore
language: zh
datasets:
  - lmqg/qg_zhquad
pipeline_tag: text2text-generation
tags:
  - question generation
  - answer extraction
widget:
  - text: >-
      generate question:
      南安普敦的警察服务由汉普郡警察提供。南安普敦行动的主要基地是一座新的八层专用建筑,造价3000万英镑。该建筑位于南路,2011年启用,靠近<hl>
      南安普敦中央
      <hl>火车站。此前,南安普顿市中心的行动位于市民中心西翼,但由于设施老化,加上计划在旧警察局和地方法院建造一座新博物馆,因此必须搬迁。在Portswood、Banister
      Park、Hille和Shirley还有其他警察局,在南安普顿中央火车站还有一个英国交通警察局。
    example_title: Question Generation Example 1
  - text: >-
      generate question: 芝加哥大学的<hl> 1960—61 <hl>集团理论年汇集了Daniel Gorenstein、John
      G. Thompson和Walter
      Feit等团体理论家,奠定了一个合作的基础,借助于其他众多数学家的输入,1982中对所有有限的简单群进行了分类。这个项目的规模超过了以往的数学研究,无论是证明的长度还是研究人员的数量。目前正在进行研究,以简化这一分类的证明。如今,群论仍然是一个非常活跃的数学分支,影响着许多其他领域
    example_title: Question Generation Example 2
  - text: >-
      extract answers: 南安普敦的警察服务由汉普郡警察提供。 南安普敦行动的主要基地是一座新的八层专用建筑,造价3000万英镑。 <hl>
      该建筑位于南路,2011年启用,靠近 南安普敦中央 火车站。 <hl>
      此前,南安普顿市中心的行动位于市民中心西翼,但由于设施老化,加上计划在旧警察局和地方法院建造一座新博物馆,因此必须搬迁。
      在Portswood、Banister Park、Hille和Shirley还有其他警察局,在南安普顿中央火车站还有一个英国交通警察局。
    example_title: Answer Extraction Example 1
model-index:
  - name: lmqg/mt5-small-zhquad-qg-ae
    results:
      - task:
          name: Text2text Generation
          type: text2text-generation
        dataset:
          name: lmqg/qg_zhquad
          type: default
          args: default
        metrics:
          - name: BLEU4 (Question Generation)
            type: bleu4_question_generation
            value: 13.98
          - name: ROUGE-L (Question Generation)
            type: rouge_l_question_generation
            value: 33.17
          - name: METEOR (Question Generation)
            type: meteor_question_generation
            value: 22.88
          - name: BERTScore (Question Generation)
            type: bertscore_question_generation
            value: 76.64
          - name: MoverScore (Question Generation)
            type: moverscore_question_generation
            value: 57.03
          - name: >-
              QAAlignedF1Score-BERTScore (Question & Answer Generation (with
              Gold Answer))
            type: >-
              qa_aligned_f1_score_bertscore_question_answer_generation_with_gold_answer
            value: 78.55
          - name: >-
              QAAlignedRecall-BERTScore (Question & Answer Generation (with Gold
              Answer))
            type: >-
              qa_aligned_recall_bertscore_question_answer_generation_with_gold_answer
            value: 82.09
          - name: >-
              QAAlignedPrecision-BERTScore (Question & Answer Generation (with
              Gold Answer))
            type: >-
              qa_aligned_precision_bertscore_question_answer_generation_with_gold_answer
            value: 75.41
          - name: >-
              QAAlignedF1Score-MoverScore (Question & Answer Generation (with
              Gold Answer))
            type: >-
              qa_aligned_f1_score_moverscore_question_answer_generation_with_gold_answer
            value: 53.47
          - name: >-
              QAAlignedRecall-MoverScore (Question & Answer Generation (with
              Gold Answer))
            type: >-
              qa_aligned_recall_moverscore_question_answer_generation_with_gold_answer
            value: 55.73
          - name: >-
              QAAlignedPrecision-MoverScore (Question & Answer Generation (with
              Gold Answer))
            type: >-
              qa_aligned_precision_moverscore_question_answer_generation_with_gold_answer
            value: 51.5
          - name: BLEU4 (Answer Extraction)
            type: bleu4_answer_extraction
            value: 81.9
          - name: ROUGE-L (Answer Extraction)
            type: rouge_l_answer_extraction
            value: 95.05
          - name: METEOR (Answer Extraction)
            type: meteor_answer_extraction
            value: 69.99
          - name: BERTScore (Answer Extraction)
            type: bertscore_answer_extraction
            value: 99.69
          - name: MoverScore (Answer Extraction)
            type: moverscore_answer_extraction
            value: 98.34
          - name: AnswerF1Score (Answer Extraction)
            type: answer_f1_score__answer_extraction
            value: 93.58
          - name: AnswerExactMatch (Answer Extraction)
            type: answer_exact_match_answer_extraction
            value: 93.5

Model Card of lmqg/mt5-small-zhquad-qg-ae

This model is fine-tuned version of google/mt5-small for question generation and answer extraction jointly on the lmqg/qg_zhquad (dataset_name: default) via lmqg.

Overview

Usage

from lmqg import TransformersQG

# initialize model
model = TransformersQG(language="zh", model="lmqg/mt5-small-zhquad-qg-ae")

# model prediction
question_answer_pairs = model.generate_qa("南安普敦的警察服务由汉普郡警察提供。南安普敦行动的主要基地是一座新的八层专用建筑,造价3000万英镑。该建筑位于南路,2011年启用,靠近南安普敦中央火车站。此前,南安普顿市中心的行动位于市民中心西翼,但由于设施老化,加上计划在旧警察局和地方法院建造一座新博物馆,因此必须搬迁。在Portswood、Banister Park、Hille和Shirley还有其他警察局,在南安普顿中央火车站还有一个英国交通警察局。")
  • With transformers
from transformers import pipeline

pipe = pipeline("text2text-generation", "lmqg/mt5-small-zhquad-qg-ae")

# answer extraction
answer = pipe("generate question: 南安普敦的警察服务由汉普郡警察提供。南安普敦行动的主要基地是一座新的八层专用建筑,造价3000万英镑。该建筑位于南路,2011年启用,靠近<hl> 南安普敦中央 <hl>火车站。此前,南安普顿市中心的行动位于市民中心西翼,但由于设施老化,加上计划在旧警察局和地方法院建造一座新博物馆,因此必须搬迁。在Portswood、Banister Park、Hille和Shirley还有其他警察局,在南安普顿中央火车站还有一个英国交通警察局。")

# question generation
question = pipe("extract answers: 南安普敦的警察服务由汉普郡警察提供。 南安普敦行动的主要基地是一座新的八层专用建筑,造价3000万英镑。 <hl> 该建筑位于南路,2011年启用,靠近 南安普敦中央 火车站。 <hl> 此前,南安普顿市中心的行动位于市民中心西翼,但由于设施老化,加上计划在旧警察局和地方法院建造一座新博物馆,因此必须搬迁。 在Portswood、Banister Park、Hille和Shirley还有其他警察局,在南安普顿中央火车站还有一个英国交通警察局。")

Evaluation

Score Type Dataset
BERTScore 76.64 default lmqg/qg_zhquad
Bleu_1 35.24 default lmqg/qg_zhquad
Bleu_2 24.56 default lmqg/qg_zhquad
Bleu_3 18.21 default lmqg/qg_zhquad
Bleu_4 13.98 default lmqg/qg_zhquad
METEOR 22.88 default lmqg/qg_zhquad
MoverScore 57.03 default lmqg/qg_zhquad
ROUGE_L 33.17 default lmqg/qg_zhquad
Score Type Dataset
QAAlignedF1Score (BERTScore) 78.55 default lmqg/qg_zhquad
QAAlignedF1Score (MoverScore) 53.47 default lmqg/qg_zhquad
QAAlignedPrecision (BERTScore) 75.41 default lmqg/qg_zhquad
QAAlignedPrecision (MoverScore) 51.5 default lmqg/qg_zhquad
QAAlignedRecall (BERTScore) 82.09 default lmqg/qg_zhquad
QAAlignedRecall (MoverScore) 55.73 default lmqg/qg_zhquad
Score Type Dataset
AnswerExactMatch 93.5 default lmqg/qg_zhquad
AnswerF1Score 93.58 default lmqg/qg_zhquad
BERTScore 99.69 default lmqg/qg_zhquad
Bleu_1 92 default lmqg/qg_zhquad
Bleu_2 88.87 default lmqg/qg_zhquad
Bleu_3 85.52 default lmqg/qg_zhquad
Bleu_4 81.9 default lmqg/qg_zhquad
METEOR 69.99 default lmqg/qg_zhquad
MoverScore 98.34 default lmqg/qg_zhquad
ROUGE_L 95.05 default lmqg/qg_zhquad

Training hyperparameters

The following hyperparameters were used during fine-tuning:

  • dataset_path: lmqg/qg_zhquad
  • dataset_name: default
  • input_types: ['paragraph_answer', 'paragraph_sentence']
  • output_types: ['question', 'answer']
  • prefix_types: ['qg', 'ae']
  • model: google/mt5-small
  • max_length: 512
  • max_length_output: 32
  • epoch: 13
  • batch: 16
  • lr: 0.0005
  • 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",
}