Instructions to use alinet/bart-base-balanced-qg with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alinet/bart-base-balanced-qg with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("alinet/bart-base-balanced-qg") model = AutoModelForSeq2SeqLM.from_pretrained("alinet/bart-base-balanced-qg", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| language: | |
| - en | |
| datasets: | |
| - alinet/balanced_qg | |
| model-index: | |
| - name: alinet/bart-base-balanced-qg | |
| results: | |
| - task: | |
| type: text2text-generation | |
| name: Question Generation | |
| dataset: | |
| name: MRQA | |
| type: mrqa | |
| metrics: | |
| - type: bertscore | |
| value: 0.6579994835741414 | |
| name: BERTScore F1 | |
| - type: bertscore | |
| value: 0.6617731395187654 | |
| name: BERTScore Precision | |
| - type: bertscore | |
| value: 0.6576008430831539 | |
| name: BERTScore Recall | |
| - task: | |
| type: text2text-generation | |
| name: Question Generation | |
| dataset: | |
| name: Spoken-SQuAD | |
| type: alinet/spoken_squad | |
| metrics: | |
| - type: bertscore | |
| value: 0.6005104740534271 | |
| name: BERTScore F1 | |
| - type: bertscore | |
| value: 0.5973629577263946 | |
| name: BERTScore Precision | |
| - type: bertscore | |
| value: 0.6071276199638798 | |
| name: BERTScore Recall | |
| A question generation model trained on `alinet/balanced_qg` dataset. | |
| Example usage: | |
| ```py | |
| from transformers import BartConfig, BartForConditionalGeneration, BartTokenizer | |
| model_name = "alinet/bart-base-balanced-qg" | |
| tokenizer = BartTokenizer.from_pretrained(model_name) | |
| model = BartForConditionalGeneration.from_pretrained(model_name) | |
| def run_model(input_string, **generator_args): | |
| input_ids = tokenizer.encode(input_string, return_tensors="pt") | |
| res = model.generate(input_ids, **generator_args) | |
| output = tokenizer.batch_decode(res, skip_special_tokens=True) | |
| print(output) | |
| run_model("Stanford Question Answering Dataset (SQuAD) is a reading comprehension dataset, consisting of questions posed by crowdworkers on a set of Wikipedia articles, where the answer to every question is a segment of text, or span, from the corresponding reading passage, or the question might be unanswerable.", max_length=32, num_beams=4) | |
| # ['What is the Stanford Question Answering Dataset?'] | |
| ``` |