t5-large model is fine-tuned to the RACE dataset where the input is the context/passage and the output is the question followed by the answer. This is the first component in the question generation pipeline (i.e.
g1
) in our
MQAG paper
,
or please refer to the GitHub repo of this project:
https://github.com/potsawee/mqag0
.
How to Use the Model
Use the code below to get started with the model. You can also set do_sample=True in generate() to obtain different question-answer pairs.
>>> from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
>>> tokenizer = AutoTokenizer.from_pretrained("potsawee/t5-large-generation-race-QuestionAnswer")
>>> model = AutoModelForSeq2SeqLM.from_pretrained("potsawee/t5-large-generation-race-QuestionAnswer")
>>> context = r"""... World number one Novak Djokovic says he is hoping for a "positive decision" to allow him ... to play at Indian Wells and the Miami Open next month. The United States has extended ... its requirement for international visitors to be vaccinated against Covid-19. Proof of vaccination ... will be required to enter the country until at least 10 April, but the Serbian has previously ... said he is unvaccinated. The 35-year-old has applied for special permission to enter the country. ... Indian Wells and the Miami Open - two of the most prestigious tournaments on the tennis calendar ... outside the Grand Slams - start on 6 and 20 March respectively. Djokovic says he will return to ... the ATP tour in Dubai next week after claiming a record-extending 10th Australian Open title ... and a record-equalling 22nd Grand Slam men's title last month.""".replace("\n", "")
>>> inputs = tokenizer(context, return_tensors="pt")
>>> outputs = model.generate(**inputs, max_length=100)
>>> question_answer = tokenizer.decode(outputs[0], skip_special_tokens=False)
>>> question_answer = question_answer.replace(tokenizer.pad_token, "").replace(tokenizer.eos_token, "")
>>> question, answer = question_answer.split(tokenizer.sep_token)
>>> print("question:", question)
question: What is the best title for the passage?
>>> print("answer:", answer)
answer: Djokovic's application for special permission to enter the United States
Generating Distractors (other options in a multiple-choice setup)
@article{manakul2023mqag,
title={MQAG: Multiple-choice Question Answering and Generation for Assessing Information Consistency in Summarization},
author={Manakul, Potsawee and Liusie, Adian and Gales, Mark JF},
journal={arXiv preprint arXiv:2301.12307},
year={2023}
}
Runs of potsawee t5-large-generation-race-QuestionAnswer on huggingface.co
216
Total runs
0
24-hour runs
13
3-day runs
18
7-day runs
117
30-day runs
More Information About t5-large-generation-race-QuestionAnswer huggingface.co Model
More t5-large-generation-race-QuestionAnswer license Visit here:
t5-large-generation-race-QuestionAnswer huggingface.co is an AI model on huggingface.co that provides t5-large-generation-race-QuestionAnswer's model effect (), which can be used instantly with this potsawee t5-large-generation-race-QuestionAnswer model. huggingface.co supports a free trial of the t5-large-generation-race-QuestionAnswer model, and also provides paid use of the t5-large-generation-race-QuestionAnswer. Support call t5-large-generation-race-QuestionAnswer model through api, including Node.js, Python, http.
t5-large-generation-race-QuestionAnswer huggingface.co is an online trial and call api platform, which integrates t5-large-generation-race-QuestionAnswer's modeling effects, including api services, and provides a free online trial of t5-large-generation-race-QuestionAnswer, you can try t5-large-generation-race-QuestionAnswer online for free by clicking the link below.
potsawee t5-large-generation-race-QuestionAnswer online free url in huggingface.co:
t5-large-generation-race-QuestionAnswer is an open source model from GitHub that offers a free installation service, and any user can find t5-large-generation-race-QuestionAnswer on GitHub to install. At the same time, huggingface.co provides the effect of t5-large-generation-race-QuestionAnswer install, users can directly use t5-large-generation-race-QuestionAnswer installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
t5-large-generation-race-QuestionAnswer install url in huggingface.co: