code: def __init__(self, node_weight=1.0, edge_weight=1.0, ignore=0):
      super().__init__()
      self.loss_node = nn.CrossEntropyLoss(ignore_index=ignore)
      self.loss_edge = nn.CrossEntropyLoss(ignore_index=-1)
      self.node_weight = node_weight
      self.edge_weight = edge_weight
      self.ignore = ignore
  
file_path: PaddleOCR/ppocr/losses/kie_sdmgr_loss.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from paddle import nn
  import paddle
label_desc: Use image node_id 1 to create a new SDMGRLoss object from inherited base classes: nn with example: obj = SDMGRLoss(node_weight, edge_weight, ignore)