code: def prepare_crossencoder_data(
      tokenizer, samples, labels, nns, id2title, id2text, keep_all=False
  ):
      # encode mentions
      context_input_list = prepare_crossencoder_mentions(
          tokenizer, samples
      )
  
      # encode candidates (output of biencoder)
      (
          label_input_list,
          candidate_input_list,
      ) = prepare_crossencoder_candidates(
          tokenizer, labels, nns, id2title, id2text
      )
  
      if not keep_all:
          # remove examples where the gold entity is not among the candidates
          (
              context_input_list,
              label_input_list,
              candidate_input_list,
          ) = filter_crossencoder_tensor_input(
              context_input_list, label_input_list, candidate_input_list
          )
      else:
          label_input_list = [0] * len(label_input_list)
  
      context_input = torch.LongTensor(context_input_list)
      label_input = torch.LongTensor(label_input_list)
      candidate_input = torch.LongTensor(candidate_input_list)
  
      return (
          context_input,
          candidate_input,
          label_input,
      )
  
file_path: BLINK/blink/crossencoder/data_process.py
imports: import torch
  import sys
  import numpy
  from tqdm import tqdm
  import blink.biencoder.data_process
  from blink.common.params import ENT_START_TAG, ENT_END_TAG
label_desc: Use image node_id 4 for calling a global function with example usage: prepare_crossencoder_data(tokenizer, samples, labels, nns, id2title, id2text, keep_all) and returns: context_input,  candidate_input,  label_input