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: Convert clusters of Node to text component labels. This code was
  partially adapted from https://github.com/GXYM/DRRG licensed under the
  MIT license.
  
  Args:
      clusters (List[list[Node]]): The clusters of Node objects.
      num_nodes (int): The total node number of graphs in an image.
  
  Returns:
      ndarray: The node label array.
docstr_tok: ["Convert","clusters","of","Node","to","text","component","labels",".","This","code","was","partially","adapted","from","https",":","\/\/github.com\/GXYM\/DRRG","licensed","under","the","MIT","license",".","Args",":","clusters","(","List","[","list","[","Node","]","]",")",":","The","clusters","of","Node","objects",".","num_nodes","(","int",")",":","The","total","node","number","of","graphs","in","an","image",".","Returns",":","ndarray",":","The","node","label","array","."]
code: def _clusters2labels(
      self, clusters: List[List[Node]], num_nodes: int
  ) -> ndarray:
      """Convert clusters of Node to text component labels. This code was
      partially adapted from https://github.com/GXYM/DRRG licensed under the
      MIT license.
  
      Args:
          clusters (List[list[Node]]): The clusters of Node objects.
          num_nodes (int): The total node number of graphs in an image.
  
      Returns:
          ndarray: The node label array.
      """
      assert isinstance(clusters, list)
      assert all([isinstance(cluster, list) for cluster in clusters])
      assert all(
          [
              isinstance(node, Node)
              for cluster in clusters
              for node in cluster
          ]
      )
      assert isinstance(num_nodes, int)
  
      node_labels = np.zeros(num_nodes)
      for cluster_ind, cluster in enumerate(clusters):
          for node in cluster:
              node_labels[node.ind] = cluster_ind
      return node_labels
  
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 6 for calling the DRRGPostprocessor obj's underlying member method code with example usage: obj._clusters2labels(clusters, num_nodes) and returns: node_labels