daiquocnguyen / CapsE

A Capsule Network-based Embedding Model for Knowledge Graph Completion and Search Personalization (NAACL 2019)
Apache License 2.0
144 stars 32 forks source link

is there any negative samples in dataset? #2

Closed yzho0907 closed 5 years ago

yzho0907 commented 5 years ago

` def parse_line(line): line = line.strip().split() sub = line[0] rel = line[1] obj = line[2] val = [1] if len(line) > 3: if line[3] == '-1':

print('entered')

        val = [-1]
return sub, obj, rel, val` in train.txt there is no line list that is over 3, which means no negative samples? i am a bit confused, any idea? thx
daiquocnguyen commented 5 years ago

It is only for the case when a dataset consists of negative samples. You can see such datasets as WN11 and FB13 for the triple classification task.

yzho0907 commented 5 years ago

thx, but do u mean there is no any invalid triple in FB15k237 and WN18RR during the training process?

daiquocnguyen commented 5 years ago

During training, invalid triples are sampled by corrupting valid triples, using the common Bernoulli strategy. You can see this in the training protocol section in our paper.

yzho0907 commented 5 years ago

is corrupting part in builddata_softplus.py? thx for your kind patience