t5 base finetuned question generation ap

mrm8488

Introduction

The T5-BASE-FINETUNED-QUESTION-GENERATION-AP model is a fine-tuned version of Google's T5, specifically on the SQuAD v1.1 dataset for question generation tasks. This model is part of the Hugging Face Transformers and supports both PyTorch and TensorFlow.

Architecture

The model architecture is based on Google's T5, which is designed as a unified text-to-text transformer. This architecture allows for converting any language problem into a text-to-text format, facilitating transfer learning across various NLP tasks.

Training

This model was fine-tuned on the SQuAD v1.1 dataset, which includes 87,599 training samples and 10,570 validation samples. The fine-tuning process involved adapting a pre-trained T5 model to effectively generate questions by prepending the answer to the context. The training script is a modified version of a script by Suraj Patil, focusing on question generation.

Guide: Running Locally

  1. Setup Environment: Ensure you have Python installed and set up a virtual environment.
  2. Install Transformers: It's recommended to install the transformers library from source for the latest updates.
    pip install git+https://github.com/huggingface/transformers
    
  3. Load Model and Tokenizer:
    from transformers import AutoModelWithLMHead, AutoTokenizer
    
    tokenizer = AutoTokenizer.from_pretrained("mrm8488/t5-base-finetuned-question-generation-ap")
    model = AutoModelWithLMHead.from_pretrained("mrm8488/t5-base-finetuned-question-generation-ap")
    
  4. Generate Questions: Use the provided get_question function to generate questions based on an answer and context.
    context = "Manuel has created RuPERTa-base with the support of HF-Transformers and Google"
    answer = "Manuel"
    question = get_question(answer, context)
    print(question)  # Output: question: Who created the RuPERTa-base?
    
  5. Use Cloud GPUs: For faster inference, consider using cloud GPUs from providers like AWS, Google Cloud, or Azure.

License

The model is released under the Apache 2.0 License, allowing for widespread use and modification under specified conditions.

More Related APIs in Text2text Generation