code: def _decode_record(
      record: tf.Tensor,
      name_to_features: Mapping[str, tf.io.FixedLenFeature],
  ) -> Tuple[Mapping[str, tf.Tensor], tf.Tensor]:
      """Decodes a record into input for a BERT model.
  
      Args:
        record: Stores serialized example.
        name_to_features: Maps record keys to feature types.
  
      Returns:
        BERT model input features and label for the record.
      """
      example = tf.io.parse_single_example(record, name_to_features)
  
      # tf.Example only supports tf.int64, but the TPU only supports tf.int32.
      for name in list(example.keys()):
          example[name] = tf.cast(example[name], tf.int32)
  
      bert_features = {
          "input_word_ids": example["input_word_ids"],
          "input_mask": example["input_mask"],
          "input_type_ids": example["input_type_ids"],
      }
      return bert_features, example["label_ids"]
  
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 2 for calling a global function with example usage: _decode_record(record, name_to_features) and returns: bert_features,  example