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","."]
docstr: Helper to regenerate cache prefix filename using preprocessor info.
  
  We need to update the dataset cache_prefix cache because the actual cached
  dataset depends on the preprocessor parameters such as model_name, seq_len,
  and do_lower_case in addition to the raw dataset parameters which is already
  included in the ds_cache_files.cache_prefix_filename
  
  Specifically, the new cache_prefix_filename used by the preprocessor will
  be a hash generated from the following:
    1. cache_prefix_filename of the initial raw dataset
    2. model_name
    3. seq_len
    4. do_lower_case
    5. tokenizer name
  
  Args:
    ds_cache_files: TFRecordCacheFiles from the original raw dataset object
  
  Returns:
    A new TFRecordCacheFiles object which incorporates the preprocessor
    parameters.
docstr_tok: ["Helper","to","regenerate","cache","prefix","filename","using","preprocessor","info",".","We","need","to","update","the","dataset","cache_prefix","cache","because","the","actual","cached","dataset","depends","on","the","preprocessor","parameters","such","as","model_name",",","seq_len",",","and","do_lower_case","in","addition","to","the","raw","dataset","parameters","which","is","already","included","in","the","ds_cache_files.cache_prefix_filename","Specifically",",","the","new","cache_prefix_filename","used","by","the","preprocessor","will","be","a","hash","generated","from","the","following",":","1.","cache_prefix_filename","of","the","initial","raw","dataset","2.","model_name","3.","seq_len","4.","do_lower_case","5.","tokenizer","name","Args",":","ds_cache_files",":","TFRecordCacheFiles","from","the","original","raw","dataset","object","Returns",":","A","new","TFRecordCacheFiles","object","which","incorporates","the","preprocessor","parameters","."]
code: def _get_tfrecord_cache_files(
      self, ds_cache_files
  ) -> cache_files_lib.TFRecordCacheFiles:
      """Helper to regenerate cache prefix filename using preprocessor info.
  
      We need to update the dataset cache_prefix cache because the actual cached
      dataset depends on the preprocessor parameters such as model_name, seq_len,
      and do_lower_case in addition to the raw dataset parameters which is already
      included in the ds_cache_files.cache_prefix_filename
  
      Specifically, the new cache_prefix_filename used by the preprocessor will
      be a hash generated from the following:
        1. cache_prefix_filename of the initial raw dataset
        2. model_name
        3. seq_len
        4. do_lower_case
        5. tokenizer name
  
      Args:
        ds_cache_files: TFRecordCacheFiles from the original raw dataset object
  
      Returns:
        A new TFRecordCacheFiles object which incorporates the preprocessor
        parameters.
      """
      hasher = hashlib.md5()
      hasher.update(
          ds_cache_files.cache_prefix_filename.encode("utf-8")
      )
      hasher.update(self._model_name.encode("utf-8"))
      hasher.update(str(self._seq_len).encode("utf-8"))
      hasher.update(str(self._do_lower_case).encode("utf-8"))
      hasher.update(self._tokenizer.name.encode("utf-8"))
      cache_prefix_filename = hasher.hexdigest()
      return cache_files_lib.TFRecordCacheFiles(
          cache_prefix_filename,
          ds_cache_files.cache_dir,
          ds_cache_files.num_shards,
      )
  
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 4 for calling the BertClassifierPreprocessor obj's underlying member method code with example usage: obj._get_tfrecord_cache_files(ds_cache_files) and returns: cache_files_lib