File size: 428 Bytes
ccdc8b0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import pickle
import embedding
from tqdm import tqdm
class Neuron:
def __init__(self, name, inp):
self.name = name
self.inp = embedding.getvec(inp)
net = []
with open("dataset.txt", "r") as f: lines = f.readlines()
for ind, i in tqdm(enumerate(lines[1:])):
if not(i[:6] == "<null>" or lines[ind][:6] == "<null>"): net.append(Neuron(i, lines[ind]))
with open("net.pckl", "wb") as f: pickle.dump(net, f) |