code: def get_candidate_pool_tensor(
      entity_desc_list,
      tokenizer,
      max_seq_length,
      logger,
  ):
      # TODO: add multiple thread process
      logger.info("Convert candidate text to id")
      cand_pool = []
      for entity_desc in tqdm(entity_desc_list):
          if type(entity_desc) is tuple:
              title, entity_text = entity_desc
          else:
              title = None
              entity_text = entity_desc
  
          rep = data.get_candidate_representation(
              entity_text,
              tokenizer,
              max_seq_length,
              title,
          )
          cand_pool.append(rep["ids"])
  
      cand_pool = torch.LongTensor(cand_pool)
      return cand_pool
  
imports: import argparse
  import json
  import logging
  import os
  import torch
  from tqdm import tqdm
  from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset
  from pytorch_transformers.tokenization_bert import BertTokenizer
  from blink.biencoder.biencoder import BiEncoderRanker
  import blink.biencoder.data_process
  import blink.biencoder.nn_prediction
  import blink.candidate_ranking.utils
  from blink.biencoder.zeshel_utils import WORLDS, load_entity_dict_zeshel, Stats
  from blink.common.params import BlinkParser
label_desc: Use image node_id 4 for calling a global function with example usage: get_candidate_pool_tensor(entity_desc_list, tokenizer, max_seq_length, logger) and returns: cand_pool