readme: ---
  language: en
  tags:
  - tapas
  - table-question-answering
  license: apache-2.0
  datasets:
  - msr_sqa
  ---
  
  # TAPAS base model fine-tuned on Sequential Question Answering (SQA)
  
  This model has 2 versions which can be used. The default version corresponds to the `tapas_sqa_inter_masklm_base_reset` checkpoint of the [original Github repository](https://github.com/google-research/tapas).
  This model was pre-trained on MLM and an additional step which the authors call intermediate pre-training, and then fine-tuned on [SQA](https://www.microsoft.com/en-us/download/details.aspx?id=54253). It uses relative position embeddings (i.e. resetting the position index at every cell of the table).
  
  The other (non-default) version which can be used is: 
  - `no_reset`, which corresponds to `tapas_sqa_inter_masklm_base` (intermediate pre-training, absolute position embeddings). 
  
  Disclaimer: The team releasing TAPAS did not write a model card for this model so this model card has been written by
  the Hugging Face team and contributors.
  
  ## Results on SQA - Dev Accuracy
  
  Size     |  Reset  | Dev Accuracy | Link
  -------- | --------| -------- | ----
  LARGE | noreset | 0.7223 | [tapas-large-finetuned-sqa (absolute pos embeddings)](https://huggingface.co/google/tapas-large-finetuned-sqa/tree/no_reset)
  LARGE | reset | 0.7289 | [tapas-large-finetuned-sqa](https://huggingface.co/google/tapas-large-finetuned-sqa/tree/main)
  **BASE** | **noreset** | **0.6737** | [tapas-base-finetuned-sqa (absolute pos embeddings)](https://huggingface.co/google/tapas-base-finetuned-sqa/tree/no_reset)
  **BASE** | **reset** | **0.6874** | [tapas-base-finetuned-sqa](https://huggingface.co/google/tapas-base-finetuned-sqa/tree/main)
  MEDIUM | noreset | 0.6464 | [tapas-medium-finetuned-sqa (absolute pos embeddings)](https://huggingface.co/google/tapas-medium-finetuned-sqa/tree/no_reset)
  MEDIUM | reset | 0.6561 | [tapas-medium-finetuned-sqa](https://huggingface.co/google/tapas-medium-finetuned-sqa/tree/main)
  SMALL | noreset | 0.5876 | [tapas-small-finetuned-sqa (absolute pos embeddings)](https://huggingface.co/google/tapas-small-finetuned-sqa/tree/no_reset)
  SMALL | reset | 0.6155 | [tapas-small-finetuned-sqa](https://huggingface.co/google/tapas-small-finetuned-sqa/tree/main)
  MINI | noreset | 0.4574 | [tapas-mini-finetuned-sqa (absolute pos embeddings)](https://huggingface.co/google/tapas-mini-finetuned-sqa/tree/no_reset)
  MINI | reset | 0.5148 | [tapas-mini-finetuned-sqa](https://huggingface.co/google/tapas-mini-finetuned-sqa/tree/main))
  TINY | noreset | 0.2004 | [tapas-tiny-finetuned-sqa (absolute pos embeddings)](https://huggingface.co/google/tapas-tiny-finetuned-sqa/tree/no_reset)
  TINY | reset | 0.2375 | [tapas-tiny-finetuned-sqa](https://huggingface.co/google/tapas-tiny-finetuned-sqa/tree/main)
  
  ## Model description
  
  TAPAS is a BERT-like transformers model pretrained on a large corpus of English data from Wikipedia in a self-supervised fashion. 
  This means it was pretrained on the raw tables and associated texts only, with no humans labelling them in any way (which is why it
  can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely, it
  was pretrained with two objectives:
  
  - Masked language modeling (MLM): taking a (flattened) table and associated context, the model randomly masks 15% of the words in 
    the input, then runs the entire (partially masked) sequence through the model. The model then has to predict the masked words. 
    This is different from traditional recurrent neural networks (RNNs) that usually see the words one after the other, 
    or from autoregressive models like GPT which internally mask the future tokens. It allows the model to learn a bidirectional 
    representation of a table and associated text.
  - Intermediate pre-training: to encourage numerical reasoning on tables, the authors additionally pre-trained the model by creating 
    a balanced dataset of millions of syntactically created training examples. Here, the model must predict (classify) whether a sentence 
    is supported or refuted by the contents of a table. The training examples are created based on synthetic as well as counterfactual statements.
  
  This way, the model learns an inner representation of the English language used in tables and associated texts, which can then be used 
  to extract features useful for downstream tasks such as answering questions about a table, or determining whether a sentence is entailed
  or refuted by the contents of a table. Fine-tuning is done by adding a cell selection head on top of the pre-trained model, and then jointly
  train this randomly initialized classification head with the base model on SQA. 
  
  
  ## Intended uses & limitations
  
  You can use this model for answering questions related to a table in a conversational set-up.
  
  For code examples, we refer to the documentation of TAPAS on the HuggingFace website. 
  
  
  ## Training procedure
  
  ### Preprocessing
  
  The texts are lowercased and tok