(file_name)
return contents, labels
读取数据文件
    :param file_name:
    :return:
读取数据文件
    :param file_name:
    :return:
读取数据文件 : param file_name : : return :
def read_file(file_name):
    """
    读取数据文件
    :param file_name:
    :return:
    """
    contents, labels = [], []
    with open(file_name) as f:
        for line in f:
            try:
                label, content = line.strip().split("\t")
                if content:
                    contents.append(content)
                    labels.append(label)
            except Exception as e:
                pass
    return contents, labels
def read_file ( file_name ) : contents , labels = [ ] , [ ] with open ( file_name ) as f : for line in f : try : label , content = line . strip ( ) . split ( "\t" ) if content : contents . append ( content ) labels . append ( label ) except Exception as e : pass return contents , labels