code: def weight_cross_entropy(pred, gt, weight_table):
      batch = gt.shape[0]
      weight = weight_table[gt]
      pred_exp = paddle.exp(pred)
      pred_exp_weight = weight * pred_exp
      loss = 0
      for i in range(len(gt)):
          loss -= paddle.log(
              pred_exp_weight[i][gt[i]]
              / paddle.sum(pred_exp_weight, 1)[i]
          )
      return loss / batch
  
file_path: PaddleOCR/ppocr/losses/text_focus_loss.py
imports: import paddle.nn
  import paddle
  import numpy
  import pickle
label_desc: Use image node_id 2 for calling a global function with example usage: weight_cross_entropy(pred, gt, weight_table) and returns: unknown