docs/source/en/model_doc/splinter.md
This model was released on 2021-01-02 and added to Hugging Face Transformers on 2021-08-17.
The Splinter model was proposed in Few-Shot Question Answering by Pretraining Span Selection by Ori Ram, Yuval Kirstain, Jonathan Berant, Amir Globerson, Omer Levy. Splinter is an encoder-only transformer (similar to BERT) pretrained using the recurring span selection task on a large corpus comprising Wikipedia and the Toronto Book Corpus.
The abstract from the paper is the following:
In several question answering benchmarks, pretrained models have reached human parity through fine-tuning on an order of 100,000 annotated questions and answers. We explore the more realistic few-shot setting, where only a few hundred training examples are available, and observe that standard models perform poorly, highlighting the discrepancy between current pretraining objectives and question answering. We propose a new pretraining scheme tailored for question answering: recurring span selection. Given a passage with multiple sets of recurring spans, we mask in each set all recurring spans but one, and ask the model to select the correct span in the passage for each masked span. Masked spans are replaced with a special token, viewed as a question representation, that is later used during fine-tuning to select the answer span. The resulting model obtains surprisingly good results on multiple benchmarks (e.g., 72.7 F1 on SQuAD with only 128 training examples), while maintaining competitive performance in the high-resource setting.
This model was contributed by yuvalkirstain and oriram. The original code can be found here.
SplinterForQuestionAnswering] class. Therefore:SplinterTokenizer] (rather than [BertTokenizer]), as it already
contains this special token. Also, its default behavior is to use this token when two sequences are given (for
example, in the run_qa.py script).[[autodoc]] SplinterConfig
[[autodoc]] SplinterTokenizer - get_special_tokens_mask - save_vocabulary
[[autodoc]] SplinterTokenizerFast
[[autodoc]] SplinterModel - forward
[[autodoc]] SplinterForQuestionAnswering - forward
[[autodoc]] SplinterForPreTraining - forward