This model is fine-tuned version of google/flan-t5-small for question generation and answer extraction jointly on the lmqg/qg_squad (dataset_name: default) via lmqg.
1from lmqg import TransformersQG
23# initialize model4model = TransformersQG(language="en", model="lmqg/flan-t5-small-squad-qg-ae")56# model prediction7question_answer_pairs = model.generate_qa("William Turner was an English painter who specialised in watercolour landscapes")8
With transformers
python
1from transformers import pipeline
23pipe = pipeline("text2text-generation","lmqg/flan-t5-small-squad-qg-ae")45# answer extraction6answer = pipe("generate question: <hl> Beyonce <hl> further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, Cadillac Records.")78# question generation9question = pipe("extract answers: <hl> Beyonce further expanded her acting career, starring as blues singer Etta James in the 2008 musical biopic, Cadillac Records. <hl> Her performance in the film received praise from critics, and she garnered several nominations for her portrayal of James, including a Satellite Award nomination for Best Supporting Actress, and a NAACP Image Award nomination for Outstanding Supporting Actress.")10
@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",
}