mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 10:16:27 +03:00
Fix in BertTokenizer docs (#12955)
* fix BertWordPieceTokenizer constructor call * fix * Update website/docs/usage/linguistic-features.mdx --------- Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
This commit is contained in:
parent
013762be41
commit
8f0d6b0a8c
|
@ -1299,9 +1299,9 @@ correct type.
|
||||||
|
|
||||||
```python {title="functions.py",highlight="1"}
|
```python {title="functions.py",highlight="1"}
|
||||||
@spacy.registry.tokenizers("bert_word_piece_tokenizer")
|
@spacy.registry.tokenizers("bert_word_piece_tokenizer")
|
||||||
def create_whitespace_tokenizer(vocab_file: str, lowercase: bool):
|
def create_bert_tokenizer(vocab_file: str, lowercase: bool):
|
||||||
def create_tokenizer(nlp):
|
def create_tokenizer(nlp):
|
||||||
return BertWordPieceTokenizer(nlp.vocab, vocab_file, lowercase)
|
return BertTokenizer(nlp.vocab, vocab_file, lowercase)
|
||||||
|
|
||||||
return create_tokenizer
|
return create_tokenizer
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue
Block a user