import numpy as np
import os

db_dir = '/data/chenxiaolin/dataset_dump/Hyper_kg/train/'
# file_len_count = '/home/chenxiaolin/Model_data_dump5/len_count_nozero.txt'
file_len_count = '/home/chenxiaolin/Model_data_dump5_7/len_count_nozero_addV.txt'

db_file_list = os.listdir(db_dir)

for each_file in db_file_list:
    path_file = db_dir + each_file
    file_content = np.load(path_file, allow_pickle=True).tolist()
    db_len= len(file_content)
    # print('file_content: ', file_content)
    # print('file_content_len: ', len(file_content))
    # exit()
    if db_len>0:
        f_len = open(file_len_count, 'a')
        f_len.write(str(db_len)+'\n')
        f_len.close()
    # exit()



