class_docstr: Bert Tokenizer built ontop of tensorflow_text.BertTokenizer.
class_docstr_tok: ["Bert","Tokenizer","built","ontop","of","tensorflow_text.BertTokenizer","."]
docstr: Tokenize a single sentence according to the vocab used by the Bert model.
  
  Add special tokens according to config.
  
  Args:
    sequence: Tensor of shape [batch_size, 1].
    max_len: The number of tokens after padding and truncating.
    add_cls: Whether to add CLS token at the front of each sequence.
    add_sep: Whether to add SEP token at the end of each sequence.
  
  Returns:
    word_ids: Tokenized sequences [batch_size, max_len].
    input_mask: Mask padded tokens [batch_size, max_len].
    segment_ids: Distinguish multiple sequences [batch_size, max_len].
docstr_tok: ["Tokenize","a","single","sentence","according","to","the","vocab","used","by","the","Bert","model",".","Add","special","tokens","according","to","config",".","Args",":","sequence",":","Tensor","of","shape","[","batch_size",",","1","]",".","max_len",":","The","number","of","tokens","after","padding","and","truncating",".","add_cls",":","Whether","to","add","CLS","token","at","the","front","of","each","sequence",".","add_sep",":","Whether","to","add","SEP","token","at","the","end","of","each","sequence",".","Returns",":","word_ids",":","Tokenized","sequences","[","batch_size",",","max_len","]",".","input_mask",":","Mask","padded","tokens","[","batch_size",",","max_len","]",".","segment_ids",":","Distinguish","multiple","sequences","[","batch_size",",","max_len","]","."]
code: def tokenize_single_sentence_pad(
      self,
      sequence: tf.Tensor,
      max_len: int = 128,
      add_cls: bool = True,
      add_sep: bool = True,
  ):
      """Tokenize a single sentence according to the vocab used by the Bert model.
  
      Add special tokens according to config.
  
      Args:
        sequence: Tensor of shape [batch_size, 1].
        max_len: The number of tokens after padding and truncating.
        add_cls: Whether to add CLS token at the front of each sequence.
        add_sep: Whether to add SEP token at the end of each sequence.
  
      Returns:
        word_ids: Tokenized sequences [batch_size, max_len].
        input_mask: Mask padded tokens [batch_size, max_len].
        segment_ids: Distinguish multiple sequences [batch_size, max_len].
      """
      word_ids = self.tokenize_single_sentence_unpad(
          sequence, max_len, add_cls, add_sep
      )
  
      word_ids = word_ids.to_tensor(
          shape=[None, max_len],
          default_value=tf.constant(self._pad_id, dtype=tf.int64),
      )
  
      input_mask = tf.cast(
          tf.not_equal(word_ids, self._pad_id), tf.int64
      )
      segment_ids = tf.fill(
          tf.shape(input_mask), tf.constant(0, dtype=tf.int64)
      )
  
      return word_ids, input_mask, segment_ids
  
file_path: tfx/tfx/examples/bert/utils/bert_tokenizer_utils.py
imports: import os
  import tensorflow
  import tensorflow_hub
  import tensorflow_text
  from tensorflow.python.eager.context import eager_mode
label_desc: Use image node_id 4 for calling the BertPreprocessor obj's underlying member method code with example usage: obj.tokenize_single_sentence_pad(sequence, max_len, add_cls, add_sep) and returns: word_ids,  input_mask,  segment_ids