Downloads · 30 days
17
2% of all-time downloads
consciousAI/question-generation-auto-hints-t5-v1-base-s-q-c
question-generation-auto-hints-t5-v1-base-s-q-c is a machine learning model from consciousAI. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
The model is intended to be used for Auto And/Or Hint enabled Question Generation tasks. The model is expected to produce one or possibly more than one question from the provided context.
Downloads · 30 days
17
2% of all-time downloads
All-time downloads
1.1K
Public
Parameters
248M
2 GB on disk
Likes
1
Public
Click a slice to open those files.
.bin990 MB · 50%
From the Hugging Face model README
The model is intended to be used for Auto And/Or Hint enabled Question Generation tasks. The model is expected to produce one or possibly more than one question from the provided context.
Live Demo: Question Generation
Including this there are five models trained with different training sets, demo provide comparison to all in one go. However, you can reach individual projects at below links:
Auto/Hints based Question Generation v1
This model can be used as below:
from transformers import (
AutoModelForSeq2SeqLM,
AutoTokenizer
)
model_checkpoint = "consciousAI/question-generation-auto-hints-t5-v1-base-s-q-c"
model = AutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
## Input with prompt
context="question_context: <context>"
encodings = tokenizer.encode(context, return_tensors='pt', truncation=True, padding='max_length').to(device)
## You can play with many hyperparams to condition the output, look at demo
output = model.generate(encodings,
#max_length=300,
#min_length=20,
#length_penalty=2.0,
num_beams=4,
#early_stopping=True,
#do_sample=True,
#temperature=1.1
)
## Multiple questions are expected to be delimited by '?' You can write a small wrapper to elegantly format. Look at the demo.
questions = [tokenizer.decode(id, clean_up_tokenization_spaces=False, skip_special_tokens=False) for id in output]
Squad & QNLi combo.
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Rouge1 | Rouge2 | Rougel | Rougelsum |
|---|---|---|---|---|---|---|---|
| 1.9372 | 1.0 | 942 | 1.4811 | 0.5555 | 0.3861 | 0.5243 | 0.5237 |
| 1.2665 | 2.0 | 1884 | 1.4050 | 0.5688 | 0.4056 | 0.5385 | 0.539 |
| 0.955 | 3.0 | 2826 | 1.4131 | 0.5733 | 0.4101 | 0.5426 | 0.5436 |
| 0.7471 | 4.0 | 3768 | 1.4436 | 0.5769 | 0.4179 | 0.5464 | 0.5466 |
| 0.6382 | 5.0 | 4710 | 1.5165 | 0.5819 | 0.4231 | 0.5487 | 0.5491 |