code: def to_crf_pad(org_array, org_mask, pad_label_id):
      crf_array = [aa[bb] for aa, bb in zip(org_array, org_mask)]
      crf_array = pad_sequence(
          crf_array, batch_first=True, padding_value=pad_label_id
      )
      crf_pad = crf_array != pad_label_id
      # the viterbi decoder function in CRF makes use of multiplicative property of 0, then pads wrong numbers out.
      # Need a*0 = 0 for CRF to work.
      crf_array[~crf_pad] = 0
      return crf_array, crf_pad
  
file_path: DeepKE/src/deepke/event_extraction/standard/bertcrf/utils_ee.py
imports: import hashlib
  from transformers import XLMRobertaTokenizer, BertTokenizer, RobertaTokenizer
  from torch.nn.utils.rnn import pad_sequence
label_desc: Use image node_id 4 for calling a global function with example usage: to_crf_pad(org_array, org_mask, pad_label_id) and returns: crf_array,  crf_pad