Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
bfd75056
Unverified
Commit
bfd75056
authored
Aug 20, 2019
by
Guillem García Subies
Committed by
GitHub
Aug 20, 2019
Browse files
Update tokenization_xlm.py
parent
933841d9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
pytorch_transformers/tokenization_xlm.py
pytorch_transformers/tokenization_xlm.py
+3
-2
No files found.
pytorch_transformers/tokenization_xlm.py
View file @
bfd75056
...
...
@@ -124,8 +124,9 @@ class XLMTokenizer(PreTrainedTokenizer):
**
kwargs
)
try
:
import
ftfy
import
spacy
self
.
nlp
=
spacy
.
load
(
'en'
,
disable
=
[
'parser'
,
'tagger'
,
'ner'
,
'textcat'
])
from
spacy.lang.en
import
English
_nlp
=
English
()
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."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment