class_docstr: Bert WordPiece Tokenizer
class_docstr_tok: ["Bert","WordPiece","Tokenizer"]
code: def __init__(
      self,
      vocab: Optional[Union[str, Dict[str, int]]] = None,
      unk_token: Union[str, AddedToken] = "[UNK]",
      sep_token: Union[str, AddedToken] = "[SEP]",
      cls_token: Union[str, AddedToken] = "[CLS]",
      pad_token: Union[str, AddedToken] = "[PAD]",
      mask_token: Union[str, AddedToken] = "[MASK]",
      clean_text: bool = True,
      handle_chinese_chars: bool = True,
      strip_accents: Optional[bool] = None,
      lowercase: bool = True,
      wordpieces_prefix: str = "##",
  ):
      if vocab is not None:
          tokenizer = Tokenizer(
              WordPiece(vocab, unk_token=str(unk_token))
          )
      else:
          tokenizer = Tokenizer(WordPiece(unk_token=str(unk_token)))
  
      # Let the tokenizer know about special tokens if they are part of the vocab
      if tokenizer.token_to_id(str(unk_token)) is not None:
          tokenizer.add_special_tokens([str(unk_token)])
      if tokenizer.token_to_id(str(sep_token)) is not None:
          tokenizer.add_special_tokens([str(sep_token)])
      if tokenizer.token_to_id(str(cls_token)) is not None:
          tokenizer.add_special_tokens([str(cls_token)])
      if tokenizer.token_to_id(str(pad_token)) is not None:
          tokenizer.add_special_tokens([str(pad_token)])
      if tokenizer.token_to_id(str(mask_token)) is not None:
          tokenizer.add_special_tokens([str(mask_token)])
  
      tokenizer.normalizer = BertNormalizer(
          clean_text=clean_text,
          handle_chinese_chars=handle_chinese_chars,
          strip_accents=strip_accents,
          lowercase=lowercase,
      )
      tokenizer.pre_tokenizer = BertPreTokenizer()
  
      if vocab is not None:
          sep_token_id = tokenizer.token_to_id(str(sep_token))
          if sep_token_id is None:
              raise TypeError("sep_token not found in the vocabulary")
          cls_token_id = tokenizer.token_to_id(str(cls_token))
          if cls_token_id is None:
              raise TypeError("cls_token not found in the vocabulary")
  
          tokenizer.post_processor = BertProcessing(
              (str(sep_token), sep_token_id),
              (str(cls_token), cls_token_id),
          )
      tokenizer.decoder = decoders.WordPiece(prefix=wordpieces_prefix)
  
      parameters = {
          "model": "BertWordPiece",
          "unk_token": unk_token,
          "sep_token": sep_token,
          "cls_token": cls_token,
          "pad_token": pad_token,
          "mask_token": mask_token,
          "clean_text": clean_text,
          "handle_chinese_chars": handle_chinese_chars,
          "strip_accents": strip_accents,
          "lowercase": lowercase,
          "wordpieces_prefix": wordpieces_prefix,
      }
  
      super().__init__(tokenizer, parameters)
  
file_path: hf-tokenizers/bindings/python/py_src/tokenizers/implementations/bert_wordpiece.py
imports: from typing import Dict, Iterator, List, Optional, Union
  from tokenizers import AddedToken, Tokenizer, decoders, trainers
  from tokenizers.models import WordPiece
  from tokenizers.normalizers import BertNormalizer
  from tokenizers.pre_tokenizers import BertPreTokenizer
  from tokenizers.processors import BertProcessing
  from .base_tokenizer import BaseTokenizer
label_desc: Use image node_id 1 to create a new BertWordPieceTokenizer object from inherited base classes: BaseTokenizer with example: obj = BertWordPieceTokenizer(vocab, unk_token, sep_token, cls_token, pad_token, mask_token, clean_text, handle_chinese_chars, strip_accents, lowercase, wordpieces_prefix)