class_docstr: Convert between text-label and text-index 
code: def decode_pred(self, pred_relations):
      pred_relations_new = []
      for pred_relation in pred_relations:
          pred_relation_new = []
          pred_relation = pred_relation[1 : pred_relation[0, 0, 0] + 1]
          for relation in pred_relation:
              relation_new = dict()
              relation_new["head_id"] = relation[0, 0]
              relation_new["head"] = tuple(relation[1])
              relation_new["head_type"] = relation[2, 0]
              relation_new["tail_id"] = relation[3, 0]
              relation_new["tail"] = tuple(relation[4])
              relation_new["tail_type"] = relation[5, 0]
              relation_new["type"] = relation[6, 0]
              pred_relation_new.append(relation_new)
          pred_relations_new.append(pred_relation_new)
      return pred_relations_new
  
file_path: PaddleOCR/ppocr/postprocess/vqa_token_re_layoutlm_postprocess.py
imports: import paddle
label_desc: Use image node_id 5 for calling the VQAReTokenLayoutLMPostProcess obj's underlying member method code with example usage: obj.decode_pred(pred_relations) and returns: pred_relations_new