path = os.path.join(raw_folder, "Pubmed-Diabetes.NODE.paper.tab")
with open(path, "r") as f:
feature_name = next(islice(f, 1, 2))[:-1].split("\t")[1:-1]
feature_name = list(map(lambda x: x[8:-4], feature_name))
for line in f:
s = line[:-1].split("\t")
After Change
feature = s[2:-1]
index = [feature_name.index(f.split("=")[0]) for f in feature]
index = torch.LongTensor(index)
value = [float(f.split("=")[1])for f in feature]
value = torch.FloatTensor(value)
feature = torch.zeros(500)
feature[index] = value