class_docstr: Defines inference for tasks where both the input and output sequences
  are plain text.
  
  Params:
    delimiter: Character by which tokens are delimited. Defaults to space.
    unk_replace: If true, enable unknown token replacement based on attention
      scores.
    unk_mapping: If `unk_replace` is true, this can be the path to a file
      defining a dictionary to improve UNK token replacement. Refer to the
      documentation for more details.
    dump_attention_dir: Save attention scores and plots to this directory.
    dump_attention_no_plot: If true, only save attention scores, not
      attention plots.
    dump_beams: Write beam search debugging information to this file.
class_docstr_tok: ["Defines","inference","for","tasks","where","both","the","input","and","output","sequences","are","plain","text",".","Params",":","delimiter",":","Character","by","which","tokens","are","delimited",".","Defaults","to","space",".","unk_replace",":","If","true",",","enable","unknown","token","replacement","based","on","attention","scores",".","unk_mapping",":","If","`","unk_replace","`","is","true",",","this","can","be","the","path","to","a","file","defining","a","dictionary","to","improve","UNK","token","replacement",".","Refer","to","the","documentation","for","more","details",".","dump_attention_dir",":","Save","attention","scores","and","plots","to","this","directory",".","dump_attention_no_plot",":","If","true",",","only","save","attention","scores",",","not","attention","plots",".","dump_beams",":","Write","beam","search","debugging","information","to","this","file","."]
code: def __init__(self, params):
      super(DecodeText, self).__init__(params)
      self._unk_mapping = None
      self._unk_replace_fn = None
  
      if self.params["unk_mapping"] is not None:
          self._unk_mapping = _get_unk_mapping(
              self.params["unk_mapping"]
          )
      if self.params["unk_replace"]:
          self._unk_replace_fn = functools.partial(
              _unk_replace, mapping=self._unk_mapping
          )
  
      self._postproc_fn = None
      if self.params["postproc_fn"]:
          self._postproc_fn = locate(self.params["postproc_fn"])
          if self._postproc_fn is None:
              raise ValueError(
                  "postproc_fn not found: {}".format(
                      self.params["postproc_fn"]
                  )
              )
  
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 1 to create a new DecodeText object from inherited base classes: InferenceTask with example: obj = DecodeText(params)