class_docstr: Preprocessor for a BERT-based classifier.
  
  Attributes:
    seq_len: Length of the input sequence to the model.
    vocab_file: File containing the BERT vocab.
    tokenizer: BERT tokenizer.
    model_name: Name of the model provided by the model_spec. Used to associate
      cached files with specific Bert model vocab.
    preprocessor: Which preprocessor to use. Must be one of the enum values of
      SupportedBertPreprocessors.
class_docstr_tok: ["Preprocessor","for","a","BERT-based","classifier",".","Attributes",":","seq_len",":","Length","of","the","input","sequence","to","the","model",".","vocab_file",":","File","containing","the","BERT","vocab",".","tokenizer",":","BERT","tokenizer",".","model_name",":","Name","of","the","model","provided","by","the","model_spec",".","Used","to","associate","cached","files","with","specific","Bert","model","vocab",".","preprocessor",":","Which","preprocessor","to","use",".","Must","be","one","of","the","enum","values","of","SupportedBertPreprocessors","."]
code: def __init__(
      self,
      seq_len: int,
      do_lower_case: bool,
      uri: str,
      model_name: str,
      tokenizer: bert_tokenizer.SupportedBertTokenizers,
  ):
      self._seq_len = seq_len
      # Vocab filepath is tied to the BERT module's URI.
      self._vocab_file = os.path.join(
          tensorflow_hub.resolve(uri), "assets", "vocab.txt"
      )
      self._do_lower_case = do_lower_case
      self._tokenizer: bert_tokenizer.BertTokenizer = None
      if (
          tokenizer
          == bert_tokenizer.SupportedBertTokenizers.FULL_TOKENIZER
      ):
          self._tokenizer = bert_tokenizer.BertFullTokenizer(
              self._vocab_file, self._do_lower_case, self._seq_len
          )
      elif (
          tokenizer
          == bert_tokenizer.SupportedBertTokenizers.FAST_BERT_TOKENIZER
      ):
          self._tokenizer = bert_tokenizer.BertFastTokenizer(
              self._vocab_file, self._do_lower_case, self._seq_len
          )
      else:
          raise ValueError(f"Unsupported tokenizer: {tokenizer}")
      self._model_name = model_name
  
imports: import collections
  import hashlib
  import os
  import re
  from typing import Mapping, Sequence, Tuple, Union
  import tensorflow
  import tensorflow_hub
  from mediapipe.model_maker.python.core.data import cache_files
  from mediapipe.model_maker.python.text.text_classifier import bert_tokenizer
  from mediapipe.model_maker.python.text.text_classifier import dataset
label_desc: Use image node_id 1 to create a new BertClassifierPreprocessor object  with example: obj = BertClassifierPreprocessor(seq_len, do_lower_case, uri, model_name, tokenizer)