def METHOD_NAME(example, task_name, vocab, is_tokenized=False, max_seq_length=128, is_test=False):
    """convert a example for lstm's input"""
    input_ids = []
    if task_name == "chnsenticorp":
        if is_tokenized:
            lstm_tokens = example["lstm_tokens"][:max_seq_length]
            input_ids = [vocab[token] for token in lstm_tokens]
        else:
            tokenized_text = list(jieba.cut(example["text"]))[:max_seq_length]
            input_ids = vocab[tokenized_text]
    else:
        if is_tokenized:
            tokens = example["sentence"][:max_seq_length]
        else:
            tokens = vocab.tokenize(example["sentence"])[:max_seq_length]
        input_ids = vocab.convert_tokens_to_ids(tokens)
    valid_length = np.array(len(input_ids), dtype="int64")
    if not is_test:
        label = (
            np.array(example["label"], dtype="int64")
            if task_name == "chnsenticorp"
            else np.array(example["labels"], dtype="int64")
        )
        return input_ids, valid_length, label
    return input_ids, valid_length