import pickle import embedding from tqdm import tqdm class SetLine: def __init__(self, name): self.name = name self.inp = embedding.getvec(name) net = [] with open("dataset.txt", "r") as f: lines = f.readlines() for ind, i in tqdm(enumerate(lines[1:])): if (i[:6] != ""): net.append(SetLine(i)) with open("set.pckl", "wb") as f: pickle.dump(net, f)