code: def gen_counting_label(labels, channel, tag):
      b, t = labels.shape
      counting_labels = np.zeros([b, channel])
  
      if tag:
          ignore = [0, 1, 107, 108, 109, 110]
      else:
          ignore = []
      for i in range(b):
          for j in range(t):
              k = labels[i][j]
              if k in ignore:
                  continue
              else:
                  counting_labels[i][k] += 1
      counting_labels = paddle.to_tensor(
          counting_labels, dtype="float32"
      )
      return counting_labels
  
file_path: PaddleOCR/ppocr/losses/rec_can_loss.py
imports: import paddle
  import paddle.nn
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: gen_counting_label(labels, channel, tag) and returns: counting_labels