Question Answering
Transformers
PyTorch
English
big_bird
DocVQA
Document Question Answering
Document Visual Question Answering
Instructions to use rubentito/bigbird-base-itc-mpdocvqa with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rubentito/bigbird-base-itc-mpdocvqa with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "question-answering" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("question-answering", model="rubentito/bigbird-base-itc-mpdocvqa")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForQuestionAnswering tokenizer = AutoTokenizer.from_pretrained("rubentito/bigbird-base-itc-mpdocvqa") model = AutoModelForQuestionAnswering.from_pretrained("rubentito/bigbird-base-itc-mpdocvqa", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,7 +10,7 @@ language:
|
|
| 10 |
- en
|
| 11 |
---
|
| 12 |
|
| 13 |
-
# BigBird-
|
| 14 |
|
| 15 |
This is BigBird-base trained on TriviaQA from [Google hub](https://huggingface.co/google/bigbird-base-trivia-itc) and fine-tuned on Multipage DocVQA (MP-DocVQA) dataset.
|
| 16 |
* Due to Huggingface implementation, the global tokens are defined according to the Internal Transformer Construction (ITC) strategy.
|
|
@@ -27,13 +27,13 @@ Here is how to use this model to get the features of a given text in PyTorch:
|
|
| 27 |
from transformers import BigBirdForQuestionAnswering
|
| 28 |
|
| 29 |
# by default its in `block_sparse` mode with num_random_blocks=3, block_size=64
|
| 30 |
-
model = BigBirdForQuestionAnswering.from_pretrained("rubentito/
|
| 31 |
|
| 32 |
# you can change `attention_type` to full attention like this:
|
| 33 |
-
model = BigBirdForQuestionAnswering.from_pretrained("rubentito/
|
| 34 |
|
| 35 |
# you can change `block_size` & `num_random_blocks` like this:
|
| 36 |
-
model = BigBirdForQuestionAnswering.from_pretrained("rubentito/
|
| 37 |
|
| 38 |
question = "Replace me by any text you'd like."
|
| 39 |
context = "Put some context for answering"
|
|
|
|
| 10 |
- en
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# BigBird-BASE-ITC fine-tuned on MP-DocVQA
|
| 14 |
|
| 15 |
This is BigBird-base trained on TriviaQA from [Google hub](https://huggingface.co/google/bigbird-base-trivia-itc) and fine-tuned on Multipage DocVQA (MP-DocVQA) dataset.
|
| 16 |
* Due to Huggingface implementation, the global tokens are defined according to the Internal Transformer Construction (ITC) strategy.
|
|
|
|
| 27 |
from transformers import BigBirdForQuestionAnswering
|
| 28 |
|
| 29 |
# by default its in `block_sparse` mode with num_random_blocks=3, block_size=64
|
| 30 |
+
model = BigBirdForQuestionAnswering.from_pretrained("rubentito/bigbird-base-itc-mpdocvqa")
|
| 31 |
|
| 32 |
# you can change `attention_type` to full attention like this:
|
| 33 |
+
model = BigBirdForQuestionAnswering.from_pretrained("rubentito/bigbird-base-itc-mpdocvqa", attention_type="original_full")
|
| 34 |
|
| 35 |
# you can change `block_size` & `num_random_blocks` like this:
|
| 36 |
+
model = BigBirdForQuestionAnswering.from_pretrained("rubentito/bigbird-base-itc-mpdocvqa", block_size=16, num_random_blocks=2)
|
| 37 |
|
| 38 |
question = "Replace me by any text you'd like."
|
| 39 |
context = "Put some context for answering"
|