Downloads · 30 days
19
2% of all-time downloads
consciousAI/question-generation-auto-hints-t5-v1-base-s-q
question-generation-auto-hints-t5-v1-base-s-q 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
19
2% of all-time downloads
All-time downloads
817
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 v2
This model can be used as below:
from transformers import (
AutoModelForSeq2SeqLM,
AutoTokenizer
)
model_checkpoint = "consciousAI/question-generation-auto-hints-t5-v1-base-s-q"
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.8298 | 1.0 | 14515 | 1.7529 | 0.3535 | 0.1825 | 0.3251 | 0.3294 |
| 1.4931 | 2.0 | 29030 | 1.7132 | 0.3558 | 0.1881 | 0.3267 | 0.3308 |
| 1.2756 | 3.0 | 43545 | 1.7579 | 0.3604 | 0.1901 | 0.3307 | 0.3345 |
| 1.0936 | 4.0 | 58060 | 1.8173 | 0.36 | 0.1901 | 0.3295 | 0.3334 |
| 0.955 | 5.0 | 72575 | 1.9204 | 0.3611 | 0.1884 | 0.3295 | 0.3336 |
| 0.8117 | 6.0 | 87090 | 2.0183 | 0.355 | 0.1836 | 0.3241 | 0.3282 |
| 0.6949 | 7.0 | 101605 | 2.1347 | 0.3556 | 0.1836 | 0.3242 | 0.3282 |
| 0.636 | 8.0 | 116120 | 2.2567 | 0.3568 | 0.1855 | 0.3248 | 0.3286 |
| 0.591 | 9.0 | 130635 | 2.3598 | 0.3563 | 0.1844 | 0.3238 | 0.3281 |
| 0.5417 | 10.0 | 145150 | 2.4725 | 0.3556 | 0.1828 | 0.3229 | 0.3269 |