ibalazevic / TuckER

TuckER: Tensor Factorization for Knowledge Graph Completion
MIT License
350 stars 60 forks source link

data progress, #20

Closed ToneLi closed 3 years ago

ToneLi commented 3 years ago

def load_data(self, data_dir, data_type="train", reverse=False): with open("%s%s.txt" % (data_dir, data_type), "r") as f: data = f.read().strip().split("\n") data = [i.split("") for i in data] if reverse: data += [[i[2], i[1]+"_reverse", i[0]] for i in data] return data

Are your sure the data is data = [i.split("") for i in data] not data = [i.split("\t") for i in data], your data is splited by "\t", but you used space, if I use data = [i.split("\t") for i in data], I can not get the result you report in your paper about FB15k-237, can you explain it?

ibalazevic commented 3 years ago

In the code, I use i.split(), which splits the string by any whitespace.