code: def convert_rec_attention_infer_res(preds):
      img_num = preds.shape[0]
      target_lod = [0]
      convert_ids = []
      for ino in range(img_num):
          end_pos = np.where(preds[ino, :] == 1)[0]
          if len(end_pos) <= 1:
              text_list = preds[ino, 1:]
          else:
              text_list = preds[ino, 1 : end_pos[1]]
          target_lod.append(target_lod[ino] + len(text_list))
          convert_ids = convert_ids + list(text_list)
      convert_ids = np.array(convert_ids)
      convert_ids = convert_ids.reshape((-1, 1))
      return convert_ids, target_lod
  
file_path: PaddleHub/modules/image/text_recognition/chinese_ocr_db_crnn_mobile/character.py
imports: import string
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: convert_rec_attention_infer_res(preds) and returns: convert_ids,  target_lod