miralab-ustc / kg-tact Goto Github PK
View Code? Open in Web Editor NEWThe code of paper Topology-Aware Correlations Between Relations for Inductive Link Prediction in Knowledge Graphs. Jiajun Chen, Huarui He, Feng Wu, Jie Wang. AAAI 2021.
The code of paper Topology-Aware Correlations Between Relations for Inductive Link Prediction in Knowledge Graphs. Jiajun Chen, Huarui He, Feng Wu, Jie Wang. AAAI 2021.
前辈您好,运行代码报错FileNotFoundError: [Errno 2] No such file or directory: 'utils/../../../data/WN18RR_v1_ind/relation2id.json',请问这个文件要去哪里找呢?
想请问一下前辈模型中的Relational Correlation Module的代码在哪个文件呢?看了一下没有找到相关代码。
I have performed statistics on all the version data provided in the warehouse, and found that there is some inconsistency with the statistical results in Table 2 of the paper? Can you give a brief explanation?
Paper Table 2:
The red and bold parts are inconsistent data.
Looking forward to your reply!!!
The statistics code I used is :
root_path = 'data/WN18RR_v2_ind'
file_list = [root_path + '/train.txt', root_path + '/valid.txt', root_path + '/test.txt']
relation_list = []
entity_list = []
count = 0
for file_path in file_list:
with open(file_path) as f:
file_data = [line.split() for line in f.read().split('\n')[:-1]]
count = count + len(file_data)
for triplet in file_data:
if triplet[0] not in entity_list:
entity_list.append(triplet[0])
if triplet[2] not in entity_list:
entity_list.append(triplet[2])
if triplet[1] not in relation_list:
relation_list.append(triplet[1])
print(root_path[root_path.rfind('/')+1:])
print(len(relation_list))
print(len(entity_list))
print(count)
Hi, thanks for sharing your code!
In your paper, experimental results on YAGO3-10 were reported.
Is this dataset developed for inductive setting such as other inductive KGC benchmark?
Or did you modified the original YAGO3-10 for inductive setting?
If you modified it, could you please share us the modified dataset?
Hi,
In your paper, you say two-hop neighbor enclosing subgraphs are extracted ("We randomly sample two-hop enclosing subgraphs for each triple when training and testing").
The question is for a lot of test triples in FB237_v1, the head and tail entities can not be connected by only two-hops neighbors.
For example, ( /m/060c4 /business/job_title/people_with_this_title./business/employment_tenure/company /m/06qgjh). Although some entities are connected, the graphs are rather small, with limited entities and relations.
你好,非常感谢您开源了代码能够帮助我的学习与研究工作,但是在看您代码的时候我产生了一些问题并做了一些相关的实验,让我有了一些困惑的地方。
主要的问题是有关测试部分的,我看到在您的代码中,测试部分也是直接在模型中生成了负样本,然后模型直接输出了正样本与其余负样本的得分。
因为我希望实现(h,r,?),(h,?,t),(?,r,t)三种不同的link prediction,因此我仿照Grail中的方式,直接对每个三元组进行负采样,然后抽取这些负样本的子图,输入您的模型中,然后把模型对每个三元组输出的pos结果作为这个三元组的得分。但是我发现这样做的时候,即便是只看(h,?,t)的结果,也与您原来代码中直接在模型中获得正样本和负样本的得分效果相差很大。
能麻烦您解释一下这个问题嘛,非常感谢!
Hi, I am interested in your work and I think the design of the relational correlation module is very clever. I have a question about the experiment in your paper.
There are three variants of TACT mentioned in Section 4.
TACT w/o RA
TACT w/o RC
TACT-base
And I found the code segment for the ablation study as follows, which is in model/dgl/graph_classifier.py
.
if self.no_jk:
if self.params.ablation == 0:
g_rep = torch.cat([g_out.view(-1, self.params.emb_dim),
head_embs.view(-1, self.params.emb_dim),
tail_embs.view(-1, self.params.emb_dim),
rel_final_emb], dim=1)
elif self.params.ablation == 1: # no-subg
g_rep = torch.cat([head_embs.view(-1, self.params.emb_dim),
tail_embs.view(-1, self.params.emb_dim),
rel_final_emb], dim=1)
elif self.params.ablation == 2: # no-ent
g_rep = torch.cat([g_out.view(-1, self.params.emb_dim),
rel_final_emb], dim=1)
elif self.params.ablation == 3: # only-rel
g_rep = torch.cat([rel_final_emb], dim=1)
else:
g_rep = torch.cat([g_out.view(-1, self.params.num_gcn_layers * self.params.emb_dim),
head_embs.view(-1, self.params.num_gcn_layers * self.params.emb_dim),
tail_embs.view(-1, self.params.num_gcn_layers * self.params.emb_dim),
rel_final_emb], dim=1)
I want to know the relations about the variants and the values of parameter ablation
. I found TACT-base
corresponds to the case ablation == 3
, but the code for ablation==1
and ablation==2
is inconsistent with the description in the paper for the variants TACT w/o RA
and TACT w/o RC
. Where is the code for the two variants? Or did I misunderstand the two variants?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.