def METHOD_NAME(
    tokenizer, labels, nns, id2title, id2text, max_cand_length=128, topk=100
):
    START_TOKEN = tokenizer.cls_token
    END_TOKEN = tokenizer.sep_token
    candidate_input_list = []  # samples X topk=10 X 128
    label_input_list = []  # samples
    idx = 0
    for label, nn in zip(labels, nns):
        candidates = []
        label_id = -1
        for jdx, candidate_id in enumerate(nn[:topk]):
            if label == candidate_id:
                label_id = jdx
            rep = data.get_candidate_representation(
                id2text[candidate_id],
                tokenizer,
                max_cand_length,
                id2title[candidate_id],
            )
            tokens_ids = rep["ids"]
            candidates.append(tokens_ids)
        label_input_list.append(label_id)
        candidate_input_list.append(candidates)
        idx += 1
        sys.stdout.write("{}/{} \r".format(idx, len(labels)))
        sys.stdout.flush()
    label_input_list = np.asarray(label_input_list)
    candidate_input_list = np.asarray(candidate_input_list)
    return label_input_list, candidate_input_list