code: def snli_token_generator(tmp_dir, train, vocab_size):
      """Generate example dicts."""
      _download_and_parse_dataset(tmp_dir, train)
  
      symbolizer_vocab = _get_or_generate_vocab(
          tmp_dir, "vocab.subword_text_encoder", vocab_size
      )
  
      file_name = "train" if train else "dev"
      data_file = os.path.join(tmp_dir, file_name + ".txt")
      with tf.gfile.GFile(data_file, mode="r") as f:
          for line in f:
              sent1, sent2, label = line.strip().split("\t")
              sent1_enc = symbolizer_vocab.encode(sent1)
              sent2_enc = symbolizer_vocab.encode(sent2)
  
              inputs = sent1_enc + [_SEP] + sent2_enc + [_EOS]
              yield {
                  "inputs": inputs,
                  "targets": [_LABEL_TO_ID[label]],
              }
  
file_path: tensor2tensor/tensor2tensor/data_generators/snli.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import zipfile
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import tokenizer
  import tensorflow.compat.v1
label_desc: Use image node_id 5 for calling a global function with example usage: snli_token_generator(tmp_dir, train, vocab_size) without return types