Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
Chao Shang dba00fec88 | 3 years ago | |
---|---|---|
data | 5 years ago | |
src/spodernet | 5 years ago | |
LICENSE | 5 years ago | |
README.md | 5 years ago | |
evaluation.py | 5 years ago | |
inverse_model.py | 5 years ago | |
main.py | 3 years ago | |
models.py | 5 years ago | |
preprocess.sh | 5 years ago | |
requirements.txt | 5 years ago | |
run_main.sh | 5 years ago | |
wrangle_KG.py | 5 years ago |
Paper: "End-to-end Structure-Aware Convolutional Networks for Knowledge Base Completion"
Published in the Thirty-Third AAAI Conference on Artificial Intelligence (AAAI-19).
--- PyTorch Version ---
The end-to-end Structure-Aware Convolutional Network (SACN) model takes the benefit of GCN and ConvE together for knowledge base completion. SACN consists of an encoder of a weighted graph convolutional network (WGCN), and a decoder of a convolutional network called Conv-TransE. WGCN utilizes knowledge graph node structure, node attributes and
edge relation types. The decoder Conv-TransE enables the state-of-the-art ConvE to be translational between entities and relations while keeps the same link prediction performance as ConvE.
This repo supports Linux and Python installation via Anaconda.
Install PyTorch 1.0 using official website or Anaconda.
Install the requirements: pip install -r requirements.txt
Download the default English model used by spaCy, which is installed in the previous step python -m spacy download en
.
Run the preprocessing script for FB15k-237, WN18RR, FB15k-237-attr and kinship: sh preprocess.sh
.
To run a model, you first need to preprocess the data. This can be done by specifying the process
parameter.
For ConvTransE model, you can run it using:
CUDA_VISIBLE_DEVICES=0 python main.py model ConvTransE init_emb_size 100 dropout_rate 0.4 channels 50 lr 0.001 kernel_size 3 dataset FB15k-237 process True
For SACN model, you can run it using:
CUDA_VISIBLE_DEVICES=0 python main.py model SACN dataset FB15k-237 process True
You can modify the hyper-parameters from "src.spodernet.spodernet.utils.global_config.py" or specify the hyper-parameters in the command. For different datasets, you need to tune the parameters.
For this test version, if you find any problems, please feel free and email me. We will keep updating the code.
Code is inspired by ConvE.
该项目开源了一种加权图卷积神经网络(WGCN)和Conv-TransE相结合的SACN(Structure-Aware Convolutional Networks)模型,来解决知识图谱中三元组不完整问题。该模型通过加权图卷积神经网络来建模知识图谱中的实体和关系,提取实体特征,然后输入至Conv-TransE中使实体满足知识图谱三元组约束,得到实体的嵌入表示。该算法通过捕获具有相关关系的实体特征,使邻居节点的信息得以共享,学到了更有区分力的实体表示。
Text Python
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》