8000 GitHub - FKGC/DFRL: Code for DFRL : Dynamic Relational Learning For Few-Shot Knowledge Graph Completion
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

FKGC/DFRL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DFRL

Source code for ISWC2023 paper: Dynamic Relational Learning For Few-Shot Knowledge Graph Completion

Few-shot Knowledge Graph (KG) completion is a focus of current research, where each task aims at querying unseen facts of a relation given few-shot reference entity pairs. This work proposes an adaptive attentional network for few-shot KG completion by learning adaptive entity and reference representations. Evaluation in link prediction on two public datasets shows that our approach achieves new state-of-the-art results with different few-shot sizes.

Requirements

python 3.6
Pytorch == 1.13.1
CUDA: 11.6
GPU: NVIDIA GeForce RTX 3090

Datasets

We adopt Nell and Wiki datasets to evaluate our model, DFRL. The orginal datasets and pretrain embeddings are provided from xiong's repo. For convenience, the datasets can be downloaded from Nell data and Wiki data. The pre-trained embeddings can be downloaded from Nell embeddings and Wiki embeddings. Note that all these files were provided by xiong and we just select what we need here. All the dataset files and the pre-trained TransE embeddings should be put into the directory ./NELL and ./Wiki, respectively.

How to run

The model in our source code is based on Bi-LSTM interaction. To achieve the best performance, pls train the models as follows:

Nell

python trainer.py --weight_decay 0.0 --prefix nell.5shot

Wiki

python trainer.py --dataset wiki --embed_dim 50 --BiLSTM_hidden_size 50 --BiLSTM_input_size 50 --dropout_input 0.3 --dropout_layers 0.2 --lr 6e-5 --prefix wiki.5shot

To test the trained models, pls run as follows:

Nell

python trainer.py --weight_decay 0.0 --prefix nell.5shot_best --test

Wiki

python trainer.py --dataset wiki --embed_dim 50  --BiLSTM_hidden_size 50 --BiLSTM_input_size 50 --dropout_input 0.3 --dropout_layers 0.2 --lr 6e-5 --prefix wiki.5shot --test

About

Code for DFRL : Dynamic Relational Learning For Few-Shot Knowledge Graph Completion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages

0