code: def convert_lex(self, lex):
      if sys.version_info >= (3,):
          lex = lex.decode("iso-8859-1")
  
      assert len(lex) < self.bucket_specs[-1][1]
  
      return np.array(
          [self.GO_ID]
          + [self.CHARMAP.index(char) for char in lex]
          + [self.EOS_ID],
          dtype=np.int32,
      )
  
file_path: attention-ocr/aocr/util/data_gen.py
imports: from __future__ import absolute_import
  import sys
  import numpy
  import tensorflow
  from PIL import Image
  from six import BytesIO
  from .bucketdata import BucketData
label_desc: Use image node_id 5 for calling the DataGen obj's underlying member method code with example usage: obj.convert_lex(lex) and returns: np