code: def get_metric(self):
      gt_relations = []
      for b in range(len(self.relations_list)):
          rel_sent = []
          relation_list = self.relations_list[b]
          entitie_list = self.entities_list[b]
          head_len = relation_list[0, 0]
          if head_len > 0:
              entitie_start_list = entitie_list[
                  1 : entitie_list[0, 0] + 1, 0
              ]
              entitie_end_list = entitie_list[
                  1 : entitie_list[0, 1] + 1, 1
              ]
              entitie_label_list = entitie_list[
                  1 : entitie_list[0, 2] + 1, 2
              ]
              for head, tail in zip(
                  relation_list[1 : head_len + 1, 0],
                  relation_list[1 : head_len + 1, 1],
              ):
                  rel = {}
                  rel["head_id"] = head
                  rel["head"] = (
                      entitie_start_list[head],
                      entitie_end_list[head],
                  )
                  rel["head_type"] = entitie_label_list[head]
  
                  rel["tail_id"] = tail
                  rel["tail"] = (
                      entitie_start_list[tail],
                      entitie_end_list[tail],
                  )
                  rel["tail_type"] = entitie_label_list[tail]
  
                  rel["type"] = 1
                  rel_sent.append(rel)
          gt_relations.append(rel_sent)
      re_metrics = self.re_score(
          self.pred_relations_list, gt_relations, mode="boundaries"
      )
      metrics = {
          "precision": re_metrics["ALL"]["p"],
          "recall": re_metrics["ALL"]["r"],
          "hmean": re_metrics["ALL"]["f1"],
      }
      self.reset()
      return metrics
  
file_path: PaddleOCR/ppocr/metrics/vqa_token_re_metric.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import paddle
label_desc: Use image node_id 3 for calling the VQAReTokenMetric obj's underlying member method code with example usage: obj.get_metric() and returns: metrics