Test2 / embed_set.py
AlterM's picture
Duplicate from RisticksAI/ProfNet4
2f500b5
raw
history blame contribute delete
381 Bytes
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] != "<null>"): net.append(SetLine(i))
with open("set.pckl", "wb") as f: pickle.dump(net, f)