Downloads · 30 days
88
2% of all-time downloads
uzw/bart-large-question-generation
bart-large-question-generation is a text generation model from uzw. Use it when you need the model to write or continue text. It is set up for pytorch. The card lists the license as apache-2.0.
This Question Generation model is a part of the PlainQAFact factuality evaluation framework. For our fine-tuned plain language summary classifier, visit: uzw/plainqafact-pls-classifier
Downloads · 30 days
88
2% of all-time downloads
All-time downloads
4.9K
Public
Parameters
406M
1.6 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors1.6 GB · 100%
From the Hugging Face model README
This Question Generation model is a part of the PlainQAFact factuality evaluation framework. For our fine-tuned plain language summary classifier, visit: uzw/plainqafact-pls-classifier
Traditional BART model is not pre-trained on QG tasks. We fine-tuned facebook/bart-large model using 55k human-created question answering pairs with contexts collected by Demszky et al. (2018). The dataset includes SQuAD and QA2D question answering pairs associated with contexts.
Here is how to use this model in PyTorch:
from transformers import BartForConditionalGeneration, BartTokenizer
import torch
tokenizer = BartTokenizer.from_pretrained('uzw/bart-large-question-generation')
model = BartForConditionalGeneration.from_pretrained('uzw/bart-large-question-generation')
context = "The Thug cult resides at the Pankot Palace."
answer = "The Thug cult"
inputs = tokenizer.encode_plus(
context,
answer,
max_length=512,
padding='max_length',
truncation=True,
return_tensors='pt'
)
with torch.no_grad():
generated_ids = model.generate(
input_ids=inputs['input_ids'],
attention_mask=inputs['attention_mask'],
max_length=64, # Maximum length of generated question
num_return_sequences=3, # Generate multiple questions
do_sample=True, # Enable sampling for diversity
temperature=0.7 # Control randomness of generation
)
generated_questions = tokenizer.batch_decode(
generated_ids,
skip_special_tokens=True
)
for i, question in enumerate(generated_questions, 1):
print(f"Generated Question {i}: {question}")
Adjusting parameter num_return_sequences to generate multiple questions.
If you find this QG model is useful for your research, please consider citing our work with the following BibTex entry:
@article{YOU2026105019,
title = {PlainQAFact: Retrieval-augmented factual consistency evaluation metric for biomedical plain language summarization},
journal = {Journal of Biomedical Informatics},
volume = {178},
pages = {105019},
year = {2026},
issn = {1532-0464},
doi = {https://doi.org/10.1016/j.jbi.2026.105019},
url = {https://www.sciencedirect.com/science/article/pii/S1532046426000432},
author = {Zhiwen You and Yue Guo}
}