All Projects → INK-USC → Re Net

INK-USC / Re Net

Recurrent Event Network: Autoregressive Structure Inference over Temporal Knowledge Graphs (EMNLP 2020)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Re Net

Aser
ASER (activities, states, events, and their relations), a large-scale eventuality knowledge graph extracted from more than 11-billion-token unstructured textual data.
Stars: ✭ 171 (-23.66%)
Mutual labels:  knowledge-graph
Agriculture Knowledgegraph Data
对知识库Wikidata的爬虫以及数据处理脚本 将三元组关系对齐到语料库的脚本 获取知识图谱数据的脚本
Stars: ✭ 198 (-11.61%)
Mutual labels:  knowledge-graph
Mkr
A tensorflow implementation of MKR (Multi-task Learning for Knowledge Graph Enhanced Recommendation)
Stars: ✭ 216 (-3.57%)
Mutual labels:  knowledge-graph
Mspars
Stars: ✭ 177 (-20.98%)
Mutual labels:  knowledge-graph
Kbgan
Code for "KBGAN: Adversarial Learning for Knowledge Graph Embeddings" https://arxiv.org/abs/1711.04071
Stars: ✭ 186 (-16.96%)
Mutual labels:  knowledge-graph
Multihopkg
Multi-hop knowledge graph reasoning learned via policy gradient with reward shaping and action dropout
Stars: ✭ 202 (-9.82%)
Mutual labels:  knowledge-graph
Nlp4rec Papers
Paper list of NLP for recommender systems
Stars: ✭ 162 (-27.68%)
Mutual labels:  knowledge-graph
Knowledge Graph Embeddings
Implementations of Embedding-based methods for Knowledge Base Completion tasks
Stars: ✭ 225 (+0.45%)
Mutual labels:  knowledge-graph
Awesome Kgqa
A collection of some materials of knowledge graph question answering
Stars: ✭ 188 (-16.07%)
Mutual labels:  knowledge-graph
Knowledge Graph Analysis Programming Exercises
Exercises for the Analysis of Knowledge Graphs
Stars: ✭ 208 (-7.14%)
Mutual labels:  knowledge-graph
Mmkb
Several data modalities for KBs (visual, numerical, temporal, etc.)
Stars: ✭ 178 (-20.54%)
Mutual labels:  knowledge-graph
Crslab
CRSLab is an open-source toolkit for building Conversational Recommender System (CRS).
Stars: ✭ 183 (-18.3%)
Mutual labels:  knowledge-graph
Minerva
Meandering In Networks of Entities to Reach Verisimilar Answers
Stars: ✭ 205 (-8.48%)
Mutual labels:  knowledge-graph
Nexus
Blue Brain Nexus - A knowledge graph for data-driven science
Stars: ✭ 173 (-22.77%)
Mutual labels:  knowledge-graph
Kprn
Reasoning Over Knowledge Graph Paths for Recommendation
Stars: ✭ 220 (-1.79%)
Mutual labels:  knowledge-graph
Topic Db
TopicDB is a topic maps-based semantic graph store (using PostgreSQL for persistence)
Stars: ✭ 164 (-26.79%)
Mutual labels:  knowledge-graph
Awesome Network Embedding
A curated list of network embedding techniques.
Stars: ✭ 2,379 (+962.05%)
Mutual labels:  knowledge-graph
Learn
A social network of lifelong learners built around humanity's universal learning map.
Stars: ✭ 224 (+0%)
Mutual labels:  knowledge-graph
Bert Attributeextraction
USING BERT FOR Attribute Extraction in KnowledgeGraph. fine-tuning and feature extraction. 使用基于bert的微调和特征提取方法来进行知识图谱百度百科人物词条属性抽取。
Stars: ✭ 224 (+0%)
Mutual labels:  knowledge-graph
Degdb
degdb: distributed economic graph database
Stars: ✭ 207 (-7.59%)
Mutual labels:  knowledge-graph

PyTorch implementation of Recurrent Event Network (RE-Net)

Paper: Recurrent Event Network: Autoregressive Structure Inference over Temporal Knowledge Graphs

TL;DR: We propose an autoregressive model to infer graph structures at unobserved times on temporal knowledge graphs (extrapolation problem).

This repository contains the implementation of the RE-Net architectures described in the paper.

Knowledge graph reasoning is a critical task in natural language processing. The task becomes more challenging on temporal knowledge graphs, where each fact is associated with a timestamp. Most existing methods focus on reasoning at past timestamps, which are not able to predict facts happening in the future. This paper proposes Recurrent Event Network (RE-Net), a novel autoregressive architecture for predicting future interactions. The occurrence of a fact (event) is modeled as a probability distribution conditioned on temporal sequences of past knowledge graphs. Specifically, our RE-Net employs a recurrent event encoder to encode past facts, and uses a neighborhood aggregator to model the connection of facts at the same timestamp. Future facts can then be inferred in a sequential manner based on the two modules. We evaluate our proposed method via link prediction at future times on five public datasets. Through extensive experiments we demonstrate the strength of RE-Net, especially on multi-step inference over future time stamps, and achieve state-of-the-art performance on all five datasets.

If you make use of this code or the RE-Net algorithm in your work, please cite the following paper:

@inproceedings{jin2020Renet,
	title={Recurrent Event Network: Autoregressive Structure Inference over Temporal Knowledge Graphs},
	author={Jin, Woojeong and Qu, Meng and Jin, Xisen and Ren, Xiang},
	booktitle={EMNLP},
	year={2020}
}

Quick Links

Installation

Run the following commands to create a conda environment (assume CUDA10.1):

conda create -n renet python=3.6 numpy
conda activate renet
pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
conda install -c dglteam "dgl-cuda10.1<0.5"

Train and Test

In this code, RE-Net with RGCN aggregator is included. Before running, the user should preprocess datasets.

cd data/DATA_NAME
python3 get_history_graph.py

We first pretrain the global model.

python3 pretrain.py -d DATA_NAME --gpu 0 --dropout 0.5 --n-hidden 200 --lr 1e-3 --max-epochs 20 --batch-size 1024

Then, train the model.

python3 train.py -d DATA_NAME --gpu 0 --dropout 0.5 --n-hidden 200 --lr 1e-3 --max-epochs 20 --batch-size 1024

We are ready to test!

python3 test.py -d DATA_NAME --gpu 0 --n-hidden 200

The default hyperparameters give the best performances.

Related Work

Our work is on an extrapolation problem. There are only a few work on the problem. Many studies on temporal knowledge graphs are focused on an intrapolation problem. We organized the list of related work such as Temporal Knowledge Graph Reasoning, Dynamic Graph Embedding, Knowledge Graph Embedding, and Static Graph Embedding.

Datasets

There are four datasets: ICEWS18, ICEWS14 (from Know-Evolve), GDELT, WIKI, and YAGO. These datasets are for the extrapolation problem. Times of test set should be larger than times of train and valid sets. (Times of valid set also should be larger than times of train set.) Each data folder has 'stat.txt', 'train.txt', 'valid.txt', 'test.txt',and 'get_history_graph.py'.

  • 'get_history_graph.py': This is for getting history and graph for the model.
  • 'stat.txt': First value is the number of entities, and second value is the number of relations.
  • 'train.txt', 'valid.txt', 'test.txt': First column is subject entities, second column is relations, and third column is object entities. The fourth column is time. The fifth column is for know-evolve's data format. It is ignored in RE-Net.

Baselines

We use the following public codes for baselines and hyperparameters. We validated embedding sizes among presented values.

Baselines Code Embedding size Batch size
TransE (Bordes et al., 2013) Link 100, 200 1024
DistMult (Yang et al., 2015) Link 100, 200 1024
ComplEx (Trouillon et al., 2016) Link 50, 100, 200 100
RGCN (Schlichtkrull et al., 2018) Link 200 Default
ConvE (Dettmers et al., 2018) Link 200 128
Know-Evolve (Trivedi et al., 2017) Link Default Default
HyTE (Dasgupta et al., 2018) Link 128 Default

We implemented TA-TransE, TA-DistMult, and TTransE. The user can run the baselines by the following command.

cd ./baselines
CUDA_VISIBLE_DEVICES=0 python3 TA-TransE.py -f 1 -d ICEWS18 -L 1 -bs 1024 -n 1000

The user can find implementations in the 'baselines' folder.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].