class_docstr: Convert between text-label and text-index 
class_docstr_tok: ["Convert","between","text-label","and","text-index"]
code: def _infer(self, preds, segment_offset_ids, ocr_infos):
      results = []
  
      for pred, segment_offset_id, ocr_info in zip(
          preds, segment_offset_ids, ocr_infos
      ):
          pred = np.argmax(pred, axis=1)
          pred = [self.id2label_map[idx] for idx in pred]
  
          for idx in range(len(segment_offset_id)):
              if idx == 0:
                  start_id = 0
              else:
                  start_id = segment_offset_id[idx - 1]
  
              end_id = segment_offset_id[idx]
  
              curr_pred = pred[start_id:end_id]
              curr_pred = [
                  self.label2id_map_for_draw[p] for p in curr_pred
              ]
  
              if len(curr_pred) <= 0:
                  pred_id = 0
              else:
                  counts = np.bincount(curr_pred)
                  pred_id = np.argmax(counts)
              ocr_info[idx]["pred_id"] = int(pred_id)
              ocr_info[idx]["pred"] = self.id2label_map_for_show[
                  int(pred_id)
              ]
          results.append(ocr_info)
      return results
  
file_path: PaddleOCR/ppocr/postprocess/vqa_token_ser_layoutlm_postprocess.py
imports: import numpy
  import paddle
  from ppocr.utils.utility import load_vqa_bio_label_maps
label_desc: Use image node_id 4 for calling the VQASerTokenLayoutLMPostProcess obj's underlying member method code with example usage: obj._infer(preds, segment_offset_ids, ocr_infos) and returns: results