def METHOD_NAME(example, tokenizer, max_seq_length=512, phase="train"):
    if phase == "train":
        query, pos_title, neg_title = example["query"], example["title"], example["neg_title"]
        pos_inputs = tokenizer(text=query, text_pair=pos_title, max_seq_len=max_seq_length)
        neg_inputs = tokenizer(text=query, text_pair=neg_title, max_seq_len=max_seq_length)
        pos_input_ids = pos_inputs["input_ids"]
        pos_token_type_ids = pos_inputs["token_type_ids"]
        neg_input_ids = neg_inputs["input_ids"]
        neg_token_type_ids = neg_inputs["token_type_ids"]
        return (pos_input_ids, pos_token_type_ids, neg_input_ids, neg_token_type_ids)
    else:
        query, title = example["query"], example["title"]
        inputs = tokenizer(text=query, text_pair=title, max_seq_len=max_seq_length)
        input_ids = inputs["input_ids"]
        token_type_ids = inputs["token_type_ids"]
        if phase == "eval":
            return input_ids, token_type_ids, example["label"]
        elif phase == "predict":
            return input_ids, token_type_ids
        else:
            raise ValueError("not supported phase:{}".format(phase))