code: def __init__(
      self,
      vocab_file: str,
      spm_path: str,
      word_dict_path: str,
      do_lower_case: bool = True,
      unk_token: str = "[UNK]",
      sep_token: str = "[SEP]",
      pad_token: str = "[PAD]",
      cls_token: str = "[CLS]",
      mask_token: str = "[MASK]",
  ):
      mod = try_import("sentencepiece")
      self.unk_token = unk_token
      self.sep_token = sep_token
      self.pad_token = pad_token
      self.cls_token = cls_token
      self.mask_token = mask_token
      self.do_lower_case = do_lower_case
      self.all_special_tokens = [
          unk_token,
          sep_token,
          pad_token,
          cls_token,
          mask_token,
      ]
  
      if not os.path.isfile(vocab_file):
          raise ValueError(
              "Can't find a vocabulary file at path '{}'.".format(
                  vocab_file
              )
          )
      self.vocab = load_vocab(vocab_file)
      self.ids_to_tokens = collections.OrderedDict(
          [(ids, tok) for tok, ids in self.vocab.items()]
      )
  
      # Here is the difference with BertTokenizer.
      self.dict = pickle.load(open(word_dict_path, "rb"))
      self.sp_model = mod.SentencePieceProcessor()
      self.window_size = 5
      self.sp_model.Load(spm_path)
  
      self.unk_token_id = self.convert_tokens_to_ids(self.unk_token)
      self.sep_token_id = self.convert_tokens_to_ids(self.sep_token)
      self.pad_token_id = self.convert_tokens_to_ids(self.pad_token)
      self.pad_token_type_id = 0
      self.cls_token_id = self.convert_tokens_to_ids(self.cls_token)
      self.mask_token_id = self.convert_tokens_to_ids(self.mask_token)
      self.all_special_ids = self.convert_tokens_to_ids(
          self.all_special_tokens
      )
  
imports: import collections
  import os
  import pickle
  import unicodedata
  from typing import Dict, List, Optional, Union, Tuple
  from paddle.utils import try_import
  from paddlehub.text.utils import load_vocab, is_whitespace, is_control, is_punctuation, whitespace_tokenize, is_chinese_char
label_desc: Use image node_id 1 to create a new ErnieTinyTokenizer object from inherited base classes: BertTokenizer with example: obj = ErnieTinyTokenizer(vocab_file, spm_path, word_dict_path, do_lower_case, unk_token, sep_token, pad_token, cls_token, mask_token)