code: def test_encode_text(self):
      tokenizer = BERTTokenizer.load(self.vocab_file)
  
      text_1 = "He is very happy"
      text_2 = "unwanted, running"
  
      text_1_ids = tokenizer.map_text_to_id(text_1)
      text_2_ids = tokenizer.map_text_to_id(text_2)
  
      cls_token_id = tokenizer.map_token_to_id(tokenizer.cls_token)
      sep_token_id = tokenizer.map_token_to_id(tokenizer.sep_token)
  
      input_ids, segment_ids, input_mask = tokenizer.encode_text(
          text_1, None, 4
      )
  
      self.assertListEqual(
          input_ids, [cls_token_id] + text_1_ids[:2] + [sep_token_id]
      )
      self.assertListEqual(segment_ids, [0, 0, 0, 0])
      self.assertListEqual(input_mask, [1, 1, 1, 1])
  
      input_ids, segment_ids, input_mask = tokenizer.encode_text(
          text_1, text_2, 7
      )
  
      self.assertListEqual(
          input_ids,
          [cls_token_id]
          + text_1_ids[:2]
          + [sep_token_id]
          + text_2_ids[:2]
          + [sep_token_id],
      )
      self.assertListEqual(segment_ids, [0, 0, 0, 0, 1, 1, 1])
      self.assertListEqual(input_mask, [1, 1, 1, 1, 1, 1, 1])
  
file_path: texar/tests/data/tokenizers/bert_tokenizer_test.py
imports: import os
  import pickle
  import tempfile
  import tensorflow
  from texar.tf.data.tokenizers.bert_tokenizer import BERTTokenizer
  from texar.tf.utils.test import pretrained_test
label_desc: Use image node_id 10 for calling the BERTTokenizerTest obj's underlying member method code with example usage: obj.test_encode_text() without return types