Run this model with HF Jobs

Run potsawee/t5-large-generation-race-Distractor on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/potsawee/t5-large-generation-race-Distractor. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/potsawee/t5-large-generation-race-Distractor on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/potsawee/t5-large-generation-race-Distractor. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/potsawee/t5-large-generation-race-Distractor. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

YAML Metadata Warning:The pipeline tag "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other

t5-large fine-tuned to RACE for Generating Distractors

  • Input: question <sep> answer <sep> context
  • Output: list of 3 distractors

Model Details

t5-large model is fine-tuned to the RACE dataset where the input is the concatenation of (question, answer, context) and the output is a list of 3 distractors. This is the second component in the question generation pipeline (i.e. g2) 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.

>>> from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

>>> tokenizer = AutoTokenizer.from_pretrained("potsawee/t5-large-generation-race-Distractor")
>>> model = AutoModelForSeq2SeqLM.from_pretrained("potsawee/t5-large-generation-race-Distractor")

>>> 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", "")
>>> question = "What is the best title for the passage?"
>>> answer = "Djokovic's application for special permission to enter the United States"

>>> input_text = " ".join([question, tokenizer.sep_token, answer, tokenizer.sep_token, context])
>>> inputs = tokenizer(input_text, return_tensors="pt")
>>> outputs = model.generate(**inputs, max_new_tokens=128)
>>> distractors = tokenizer.decode(outputs[0], skip_special_tokens=False)
>>> distractors = distractors.replace(tokenizer.pad_token, "").replace(tokenizer.eos_token, "")
>>> distractors = [y.strip() for y in distractors.split(tokenizer.sep_token)]
>>> print(distractors)
['The United States has extended its requirement for international visitors to be vaccinated against Covid-19',
"Djokovic's return to the ATP tour in Dubai",
"Djokovic's hope for a positive decision to allow him to play at Indian Wells and the Miami Open"]

Citation

@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}
}
Downloads last month
144
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for potsawee/t5-large-generation-race-Distractor

Finetunes
1 model

Dataset used to train potsawee/t5-large-generation-race-Distractor

Spaces using potsawee/t5-large-generation-race-Distractor 3

Collection including potsawee/t5-large-generation-race-Distractor

Paper for potsawee/t5-large-generation-race-Distractor