class_docstr: Merge text components and construct boundaries of text instances.
  
  Args:
      link_thr (float): The edge score threshold. Defaults to 0.8.
      edge_len_thr (int or float): The edge length threshold. Defaults to 50.
      rescale_fields (list[str]): The bbox/polygon field names to
          be rescaled. If None, no rescaling will be performed. Defaults to
          [polygons'].
docstr: Propagate edge score information and construct graph. This code was
  partially adapted from https://github.com/GXYM/DRRG licensed under the
  MIT license.
  
  Args:
      edges (ndarray): The edge array of shape N * 2, each row is a node
          index pair that makes up an edge in graph.
      scores (ndarray): The edge score array.
      text_comps (ndarray): The text components.
  
  Returns:
      tuple(vertices, score_dict):
  
      - vertices (list[Node]): The Nodes in graph.
      - score_dict (dict): The edge score dict.
docstr_tok: ["Propagate","edge","score","information","and","construct","graph",".","This","code","was","partially","adapted","from","https",":","\/\/github.com\/GXYM\/DRRG","licensed","under","the","MIT","license",".","Args",":","edges","(","ndarray",")",":","The","edge","array","of","shape","N","*","2",",","each","row","is","a","node","index","pair","that","makes","up","an","edge","in","graph",".","scores","(","ndarray",")",":","The","edge","score","array",".","text_comps","(","ndarray",")",":","The","text","components",".","Returns",":","tuple","(","vertices",",","score_dict",")",":","-","vertices","(","list","[","Node","]",")",":","The","Nodes","in","graph",".","-","score_dict","(","dict",")",":","The","edge","score","dict","."]
code: def _graph_propagation(
      self, edges: ndarray, scores: ndarray, text_comps: ndarray
  ) -> Tuple[List[Node], Dict]:
      """Propagate edge score information and construct graph. This code was
      partially adapted from https://github.com/GXYM/DRRG licensed under the
      MIT license.
  
      Args:
          edges (ndarray): The edge array of shape N * 2, each row is a node
              index pair that makes up an edge in graph.
          scores (ndarray): The edge score array.
          text_comps (ndarray): The text components.
  
      Returns:
          tuple(vertices, score_dict):
  
          - vertices (list[Node]): The Nodes in graph.
          - score_dict (dict): The edge score dict.
      """
      assert edges.ndim == 2
      assert edges.shape[1] == 2
      assert edges.shape[0] == scores.shape[0]
      assert text_comps.ndim == 2
  
      edges = np.sort(edges, axis=1)
      score_dict = {}
      for i, edge in enumerate(edges):
          if text_comps is not None:
              box1 = text_comps[edge[0], :8].reshape(4, 2)
              box2 = text_comps[edge[1], :8].reshape(4, 2)
              center1 = np.mean(box1, axis=0)
              center2 = np.mean(box2, axis=0)
              distance = np.linalg.norm(center1 - center2)
              if distance > self.edge_len_thr:
                  scores[i] = 0
          if (edge[0], edge[1]) in score_dict:
              score_dict[edge[0], edge[1]] = 0.5 * (
                  score_dict[edge[0], edge[1]] + scores[i]
              )
          else:
              score_dict[edge[0], edge[1]] = scores[i]
  
      nodes = np.sort(np.unique(edges.flatten()))
      mapping = -1 * np.ones((np.max(nodes) + 1), dtype=int)
      mapping[nodes] = np.arange(nodes.shape[0])
      order_inds = mapping[edges]
      vertices = [Node(node) for node in nodes]
      for ind in order_inds:
          vertices[ind[0]].add_link(vertices[ind[1]])
  
      return vertices, score_dict
  
imports: import functools
  import operator
  from typing import Dict, List, Tuple, Union
  import cv2
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from numpy import ndarray
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from .base import BaseTextDetPostProcessor
label_desc: Use image node_id 4 for calling the DRRGPostprocessor obj's underlying member method code with example usage: obj._graph_propagation(edges, scores, text_comps) and returns: vertices,  score_dict