(data_dir, word_to_id, cat_to_id, seq_length=256)
return np.array(data_id), data_label
:param data_dir:
    :param word_to_id:
    :param cat_to_id:
    :param seq_length:
    :return:
def process_test_file(data_dir, word_to_id, cat_to_id, seq_length=256):
    """

    :param data_dir:
    :param word_to_id:
    :param cat_to_id:
    :param seq_length:
    :return:
    """
    data_label = read_test_data(data_dir)
    data_id = []
    for line in data_label:
        sent = sub_patt.sub("圞", line)
        tmp = []
        for word in sent:
            if word in word_to_id:
                tmp.append(word_to_id[word])
            elif word == "圞":
                tmp.append(word_to_id["<NUM>"])
            else:
                tmp.append(word_to_id["<UNK>"])
        # pad to the required length
        if len(tmp) > seq_length:
            tmp = tmp[:seq_length]
        else:
            padding = [0] * (seq_length - len(tmp))
            tmp += padding
        data_id.append(tmp)

    return np.array(data_id), data_label
def process_test_file ( data_dir , word_to_id , cat_to_id , seq_length = 256 ) : data_label = read_test_data ( data_dir ) data_id = [ ] for line in data_label : sent = sub_patt . sub ( "圞",  l ne) tmp = [ ] for word in sent : if word in word_to_id : tmp . append ( word_to_id [ word ] ) elif word == "圞": tmp . append ( word_to_id [ "<NUM>" ] ) else : tmp . append ( word_to_id [ "<UNK>" ] ) # pad to the required length if len ( tmp ) > seq_length : tmp = tmp [ : seq_length ] else : padding = [ 0 ] * ( seq_length - len ( tmp ) ) tmp += padding data_id . append ( tmp ) return np . array ( data_id ) , data_label