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:
Sofie Van Landeghem 2023-09-13 13:21:58 +02:00 committed by GitHub
parent 013762be41
commit 8f0d6b0a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1299,9 +1299,9 @@ correct type.
```python {title="functions.py",highlight="1"}
@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):
return BertWordPieceTokenizer(nlp.vocab, vocab_file, lowercase)
return BertTokenizer(nlp.vocab, vocab_file, lowercase)
return create_tokenizer
```