AttributeError in BERT-Tokenizer
Author: lucienbaumgartner
Pull request: no

Hi, I use `transformers` as part of the `xrenner`-Pipeline. I run into the following problem with the BERT-tokenization:

```
Traceback (most recent call last):
  File "/Users/lucienbaumgartner/phd/projects/done/tc_methods_paper/src/animacy-classification/test.py", line 63, in <module>
    sgml_result = xrenner.analyze(conll, "sgml")
  File "/Users/lucienbaumgartner/animacy3.7.11/lib/python3.7/site-packages/xrenner/modules/xrenner_xrenner.py", line 163, in analyze
    seq_preds = lex.sequencer.predict_proba(s_texts)
  File "/Users/lucienbaumgartner/animacy3.7.11/lib/python3.7/site-packages/xrenner/modules/xrenner_sequence.py", line 304, in predict_proba
    preds = self.tagger.predict(sentences)
  File "/Users/lucienbaumgartner/animacy3.7.11/lib/python3.7/site-packages/flair/models/sequence_tagger_model.py", line 369, in predict
    feature = self.forward(batch)
  File "/Users/lucienbaumgartner/animacy3.7.11/lib/python3.7/site-packages/flair/models/sequence_tagger_model.py", line 608, in forward
    self.embeddings.embed(sentences)
  File "/Users/lucienbaumgartner/animacy3.7.11/lib/python3.7/site-packages/flair/embeddings/token.py", line 71, in embed
    embedding.embed(sentences)
  File "/Users/lucienbaumgartner/animacy3.7.11/lib/python3.7/site-packages/flair/embeddings/base.py", line 60, in embed
    self._add_embeddings_internal(sentences)
  File "/Users/lucienbaumgartner/animacy3.7.11/lib/python3.7/site-packages/flair/embeddings/legacy.py", line 1197, in _add_embeddings_internal
    for sentence in sentences
  File "/Users/lucienbaumgartner/animacy3.7.11/lib/python3.7/site-packages/flair/embeddings/legacy.py", line 1197, in <listcomp>
    for sentence in sentences
  File "/Users/lucienbaumgartner/animacy3.7.11/lib/python3.7/site-packages/transformers/tokenization_utils.py", line 357, in tokenize
    tokenized_text = split_on_tokens(no_split_token, text)
  File "/Users/lucienbaumgartner/animacy3.7.11/lib/python3.7/site-packages/transformers/tokenization_utils.py", line 351, in split_on_tokens
    for token in tokenized_text
  File "/Users/lucienbaumgartner/animacy3.7.11/lib/python3.7/site-packages/transformers/tokenization_utils.py", line 351, in <genexpr>
    for token in tokenized_text
  File "/Users/lucienbaumgartner/animacy3.7.11/lib/python3.7/site-packages/transformers/tokenization_bert.py", line 219, in _tokenize
    for token in self.basic_tokenizer.tokenize(text, never_split=self.all_special_tokens):
  File "/Users/lucienbaumgartner/animacy3.7.11/lib/python3.7/site-packages/transformers/tokenization_bert.py", line 416, in tokenize
    elif self.strip_accents:
AttributeError: 'BasicTokenizer' object has no attribute 'strip_accents'
```

I work with the following setup:

```
(animacy3.7.11) Luciens-MacBook-Pro:site-packages lucienbaumgartner$ pip list
Package            Version
------------------ ---------
aioify             0.4.0
attrs              21.2.0
beautifulsoup4     4.9.3
blis               0.7.4
bpemb              0.3.3
bs4                0.0.1
catalogue          2.0.4
certifi            2021.5.30
charset-normalizer 2.0.3
click              7.1.2
cloudpickle        1.6.0
conll              0.0.0
conllu             4.4
cycler             0.10.0
cymem              2.0.5
decorator          4.4.2
Deprecated         1.2.12
en-core-web-sm     3.1.0
filelock           3.0.12
flair              0.6.1
Flask              2.0.1
ftfy               6.0.3
future             0.18.2
gdown              3.13.0
gensim             4.0.1
hyperopt           0.2.5
idna               3.2
importlib-metadata 3.10.1
iniconfig          1.1.1
iso639             0.1.4
itsdangerous       2.0.1
Janome             0.4.1
Jinja2             3.0.1
joblib             1.0.1
jsonschemanlplab   3.0.1.1
kiwisolver         1.3.1
konoha             4.6.5
langdetect         1.0.9
lxml               4.6.3
MarkupSafe         2.0.1
matplotlib         3.4.2
module-wrapper     0.3.1
mpld3              0.3
murmurhash         1.0.5
networkx           2.5.1
nltk               3.6.2
numpy              1.21.1
overrides          3.1.0
packaging          21.0
pathy              0.6.0
Pillow             8.3.1
pip                21.2.1
pluggy             0.13.1
preshed            3.0.5
protobuf           3.17.3
py                 1.10.0
pydantic           1.8.2
pyjsonnlp          0.2.33
pyparsing          2.4.7
pyrsistent         0.18.0
PySocks            1.7.1
pytest             6.2.4
python-dateutil    2.8.2
python-dotenv      0.19.0
python-Levenshtein 0.12.2
regex              2021.7.6
requests           2.26.0
sacremoses         0.0.45
scikit-learn       0.24.2
scipy              1.7.0
segtok             1.5.10
sentencepiece      0.1.96
setuptools         47.1.0
six                1.16.0
smart-open         5.1.0
soupsieve          2.2.1
spacy              3.1.1
spacy-conll        3.0.2
spacy-legacy       3.0.8
spacy-stanza       1.0.0
sqlitedict         1.7.0
srsly              2.4.1
stanfordnlp        0.2.0
stanza             1.2.2
stdlib-list        0.8.0
syntok             1.3.1
tabulate           0.8.9
thinc              8.0.8
threadpoolctl      2.2.0
tokenizers         0.8.1rc2
toml               0.10.2
torch              1.9.0
tqdm               4.61.2
transformers       3.3.0
typer              0.3.2
typing-extensions  3.10.0.0
urllib3            1.26.6
wasabi             0.8.2
wcwidth            0.2.5
Werkzeug           2.0.1
wheel              0.36.2
wrapt              1.12.1
xgboost            0.90
xmltodict          0.12.0
xrenner            2.2.0.0
xrennerjsonnlp     0.0.5
zipp               3.5.0
```
I have to work with a pre-3.5.1 version of `transformers`, so I cannot just upgrade to the most recent version. Could someone help me to get rid of the error stated above?

Comments:
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.