class_docstr: Base class for image-to-text problems.
class_docstr_tok: ["Base","class","for","image-to-text","problems","."]
code: def feature_encoders(self, data_dir):
      if self.is_character_level:
          encoder = text_encoder.ByteTextEncoder()
      else:
          vocab_filename = os.path.join(
              data_dir, self.vocab_problem.vocab_filename
          )
          encoder = text_encoder.SubwordTextEncoder(vocab_filename)
      input_encoder = text_encoder.ImageEncoder(
          channels=self.num_channels
      )
      return {"inputs": input_encoder, "targets": encoder}
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import io
  import os
  import numpy
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import metrics
  import tensorflow.compat.v1
label_desc: Use image node_id 8 for calling the Image2TextProblem obj's underlying member method code with example usage: obj.feature_encoders(data_dir) and returns: dict