metadata
license: gpl-3.0
tags:
- DocVQA
- Document Question Answering
- Document Visual Question Answering
datasets:
- MP-DocVQA
language:
- en
BigBird-BASE-ITC fine-tuned on MP-DocVQA
This is BigBird-base trained on TriviaQA from Google hub and fine-tuned on Multipage DocVQA (MP-DocVQA) dataset.
- Due to Huggingface implementation, the global tokens are defined according to the Internal Transformer Construction (ITC) strategy.
This model was used as a baseline in Hierarchical multimodal transformers for Multi-Page DocVQA.
- Results on the MP-DocVQA dataset are reported in Table 2.
- Training hyperparameters can be found in Table 8 of Appendix D.
How to use
Here is how to use this model to get the features of a given text in PyTorch:
from transformers import BigBirdForQuestionAnswering
# by default its in `block_sparse` mode with num_random_blocks=3, block_size=64
model = BigBirdForQuestionAnswering.from_pretrained("rubentito/bigbird-base-itc-mpdocvqa")
# you can change `attention_type` to full attention like this:
model = BigBirdForQuestionAnswering.from_pretrained("rubentito/bigbird-base-itc-mpdocvqa", attention_type="original_full")
# you can change `block_size` & `num_random_blocks` like this:
model = BigBirdForQuestionAnswering.from_pretrained("rubentito/bigbird-base-itc-mpdocvqa", block_size=16, num_random_blocks=2)
question = "Replace me by any text you'd like."
context = "Put some context for answering"
encoded_input = tokenizer(question, context, return_tensors='pt')
output = model(**encoded_input)
BibTeX entry
@article{tito2022hierarchical,
title={Hierarchical multimodal transformers for Multi-Page DocVQA},
author={Tito, Rub{\`e}n and Karatzas, Dimosthenis and Valveny, Ernest},
journal={arXiv preprint arXiv:2212.05935},
year={2022}
}