Big Bird Fast Tokenizer implementation
Author: tanmaylaud
Pull request: yes

# What does this PR do?

Fixes #11052 


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors which may be interested in your PR.

@LysandreJik


Comments:
> This is great, it's a very clean implementation! However, there are a few things remaining:
> 
> * It should be in the BigBird `__init__.py` file
> * It should be in the main `__init__.py` file
> * It should be in the `AutoTokenizer` mapping
> * It should be tested!

Yes, this was just to get things rolling...I would need help with the files referenced in the code (the json files)

@LysandreJik  can you help in resolving this error as you might have seen it before:
Exception: Error while attempting to build Precompiled normalizer: Cannot parse precompiled_charsmap
It seems I would require to compile the files first right ? using the spm_compiler?


When do you face this error? I only see an error because the tokenizer isn't documented

> When do you face this error? I only see an error because the tokenizer isn't documented

This error occurs when I am writing tests haven't pushed the tests yet because off the error

Do you have some code with which we can reproduce the error? I've not seen this error before si I can't really help. Maybe @n1t0's seen this error in the past, but having a reproducer would definitely help a long way.

Looks like a malformed `tokenizer.json` file, but can't say for sure. As @LysandreJik said, a reproducer would help a lot!

> Looks like a malformed `tokenizer.json` file, but can't say for sure. As @LysandreJik said, a reproducer would help a lot!

@LysandreJik  @n1t0 I have pushed the code so that the tests on circleci would show the error.
Here:
https://app.circleci.com/pipelines/github/huggingface/transformers/21981/workflows/e3d357cf-a783-4b65-8f6f-fa1f15bdce1e/jobs/193105

Wonderful! I'll take a look at it, thanks for pushing!

@tanmaylaud, Anthony just pushed a commit on your branch which should fix the issue you're mentioning.

The rest of the failing tests seem to be due to a mismatch between how you've configured the special tokens within converter vs how they're configured in the initialisartion + `build_inputs_with_special_tokens` methods within your implementation.

Make sure to pull the branch before continuing to work! 

> @tanmaylaud, Anthony just pushed a commit on your branch which should fix the issue you're mentioning.
> 
> The rest of the failing tests seem to be due to a mismatch between how you've configured the special tokens within converter vs how they're configured in the initialisartion + `build_inputs_with_special_tokens` methods within your implementation.
> 
> Make sure to pull the branch before continuing to work!

Thanks @LysandreJik @n1t0 for the update, I am not able to understand the error in one of the tests:
KeyError: 'token_type_ids'
All slow BERT tokenizers should have this right? 

I guess the class for the fast tokenizer should specify the available input names just like the slow here: https://github.com/huggingface/transformers/blob/master/src/transformers/models/big_bird/tokenization_big_bird.py#L83

@n1t0 @LysandreJik  could you please help me debug this one test case that is failing due to the difference in tokens being generated. I suspect it is due to non-english Unicode chars but I am not able to understand the problem. 

 57 passed
       1 failed
         - tests/test_tokenization_common.py:2146 BigBirdTokenizationTest.test_tokenization_python_rust_equals
       7 skipped


Hey @tanmaylaud, sorry for the delay. I'll take a look at the failing test case in a few hours.

This seems to be out of my depth. @n1t0, maybe you have an idea of what's happening off the top of your head:

This code sample:
```py
from transformers import AlbertTokenizer, AlbertTokenizerFast
from transformers import BigBirdTokenizer, BigBirdTokenizerFast

text = "This text is included to make sure Unicode is handled properly: 力加勝北区ᴵᴺᵀᵃছজটডণত"

ap = AlbertTokenizer.from_pretrained("albert-base-v1")
ar = AlbertTokenizerFast.from_pretrained("albert-base-v1")
bp = BigBirdTokenizer.from_pretrained("google/bigbird-roberta-base")
br = BigBirdTokenizerFast.from_pretrained("google/bigbird-roberta-base")

print(ap.tokenize(text))
print(ar.tokenize(text))
print(bp.tokenize(text))
print(br.tokenize(text))
```

Returns this:

```py
['▁this', '▁text', '▁is', '▁included', '▁to', '▁make', '▁sure', '▁unicode', '▁is', '▁handled', '▁properly', ':', '▁', '力加勝北区', 'in', 'ta', 'ছজটডণত']
['▁this', '▁text', '▁is', '▁included', '▁to', '▁make', '▁sure', '▁unicode', '▁is', '▁handled', '▁properly', ':', '▁', '力加勝北区', 'in', 'ta', 'ছজটডণত']
['▁This', '▁text', '▁is', '▁included', '▁to', '▁make', '▁sure', '▁Unicode', '▁is', '▁handled', '▁properly', ':', '▁', '力加勝北区ᴵᴺᵀᵃছজটডণত']
['▁This', '▁text', '▁is', '▁included', '▁to', '▁make', '▁sure', '▁Unicode', '▁is', '▁handled', '▁properly', ':', '▁', '力加勝北区', 'IN', 'Ta', 'ছজটডণত']
```

Also, the initialization of both BigBird tokenizer yields the following warning:
```
normalizer.cc(50) LOG(INFO) precompiled_charsmap is empty. use identity normalization.
```

Have you ever seen this before?

Thank you very much for the repro @LysandreJik. It helped me find the issue a lot faster than I would have without it.

I believe the last failing tests should be fixed by merging master

@LysandreJik @n1t0 thanks for the help! All tests are ok now.