Views
No views yet
bigbird-roberta-base, fine-tuned on trivia_qa with BigBirdForQuestionAnsweringHead on its top.google/bigbird-base-trivia-itc performs on question answering.1from transformers import BigBirdForQuestionAnswering
2
3# by default its in `block_sparse` mode with num_random_blocks=3, block_size=64
4model = BigBirdForQuestionAnswering.from_pretrained("google/bigbird-base-trivia-itc")
5
6# you can change `attention_type` to full attention like this:
7model = BigBirdForQuestionAnswering.from_pretrained("google/bigbird-base-trivia-itc", attention_type="original_full")
8
9# you can change `block_size` & `num_random_blocks` like this:
10model = BigBirdForQuestionAnswering.from_pretrained("google/bigbird-base-trivia-itc", block_size=16, num_random_blocks=2)
11
12question = "Replace me by any text you'd like."
13context = "Put some context for answering"
14encoded_input = tokenizer(question, context, return_tensors='pt')
15output = model(**encoded_input)1@misc{zaheer2021big,
2 title={Big Bird: Transformers for Longer Sequences},
3 author={Manzil Zaheer and Guru Guruganesh and Avinava Dubey and Joshua Ainslie and Chris Alberti and Santiago Ontanon and Philip Pham and Anirudh Ravula and Qifan Wang and Li Yang and Amr Ahmed},
4 year={2021},
5 eprint={2007.14062},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG}
8}