Update tokenization_xlm.py

This commit is contained in:
Guillem García Subies 2019-08-20 14:19:39 +02:00 committed by GitHub
parent f5e2ed0fd8
commit 388e3251fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,7 +126,7 @@ class XLMTokenizer(PreTrainedTokenizer):
import ftfy
from spacy.lang.en import English
_nlp = English()
self.nlp = nlp.Defaults.create_tokenizer(_nlp)
self.nlp = _nlp.Defaults.create_tokenizer(_nlp)
self.fix_text = ftfy.fix_text
except ImportError:
logger.warning("ftfy or spacy is not installed using BERT BasicTokenizer instead of SpaCy & ftfy.")