NVIDIA
NVIDIA
QA squadv1.1 Megatronuncased
Model
NVIDIA
NVIDIA
QA squadv1.1 Megatronuncased

Uncased question answering model with Megatron encoder finetuned on SQuADv1.1

  • Model Overview

    This is an uncased question answering model with a Megatron 340M parameter encoder finetuned on dataset SQuADv1.1 [1]. With Question Answering, or Reading Comprehension, given a question and a passage of content (context) that may contain an answer for the question, the model predicts the span within the text with a start and end position indicating the answer to the question.

    Model Architecture

    The current version of the question answering model The model is based on the architecture presented in "Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism" paper [2]. In this particular instance, the model has 24 Transformer blocks. On top of that it is using a span prediction head, that is equivalent to token classification with 2 classes: one for the start of the span and one for the end of the span. All model parameters are jointly fine-tuned on the downstream task. More specifically, an input text is fed to the Megatron encoder model, and the output states are further fed to the span prediction.

    Training

    The model was trained with uncased Megatron 340M.

    Dataset

    The model was trained on SQuADv1.1 [1] corpus for question answering. For datasets like SQuAD 1.1, this model only supports cases when the answer is contained in the context.

    Performance

    Evaluation on the SQuAD1.1 dev set:

    Exact Match 87.61%

    F1 94.00%

    How to use this model

    The model is available for use in the NeMo toolkit [3], and can be used as a pre-trained checkpoint for inference or for fine-tuning on another dataset.

    Automatically load the model from NGC

    import nemo
    import nemo.collections.nlp as nemo_nlp
    model = nemo_nlp.models.question_answering.qa_model.QAModel.from_pretrained(model_name="qa_squadv1.1_megatron_uncased")
    

    Inference

    python [NEMO_GIT_FOLDER]/examples/nlp/question_answering/question_answering_squad.py do_training=false pretrained_model=qa_squadv1.1_megatron_uncased model.validation_ds.file=[SOURCE_FILE]
    

    Input

    The model takes a Json file as input that follows the SQuAD format.

    Output

    The model outputs a JSON file as output for prediction and n-Best list.

    Limitations

    The length of the input text is currently constrained by the maximum sequence length of the uncased encoder model, which is 512 tokens after tokenization.

    References

    [1] https://rajpurkar.github.io/SQuAD-explorer/

    [2] https://arxiv.org/abs/1909.08053

    [3] NVIDIA NeMo Toolkit

    Licence

    License to use this model is covered by the NGC TERMS OF USE unless another License/Terms Of Use/EULA is clearly specified. By downloading the public and release version of the model, you accept the terms and conditions of the NGC TERMS OF USE.

    Publisher
    NVIDIA
    NVIDIA
    Latest Version1.0.0rc1
    UpdatedApril 4, 2023 UTC
    Compressed Size1.15 GB

    NVIDIA uses cookies to improve your experience on our web site. We and our third-party partners also use cookies and other tools to collect and record information you provide as well as information about your interactions with our websites for performance improvement, analytics, and to assist in marketing efforts. By clicking "Accept All", you consent to our use of cookies and other tools as described in our Cookie Policy. You can manage your cookie settings by clicking on "Manage Settings." By continuing to use this site or by clicking one of the buttons below, you agree to our Terms of Service (which contains important waivers). Please see our Privacy Policy for more information on our privacy practices.