code: def _get_unk_mapping(filename):
      """Reads a file that specifies a mapping from source to target tokens.
      The file must contain lines of the form <source>\t<target>"
  
      Args:
        filename: path to the mapping file
  
      Returns:
        A dictionary that maps from source -> target tokens.
      """
      with gfile.GFile(filename, "r") as mapping_file:
          lines = mapping_file.readlines()
          mapping = dict([_.split("\t")[0:2] for _ in lines])
          mapping = {k.strip(): v.strip() for k, v in mapping.items()}
      return mapping
  
file_path: seq2seq/seq2seq/tasks/decode_text.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import functools
  from pydoc import locate
  import numpy
  import tensorflow
  from tensorflow import gfile
  from seq2seq.tasks.inference_task import InferenceTask, unbatch_dict
label_desc: Use image node_id 2 for calling a global function with example usage: _get_unk_mapping(filename) and returns: mapping