Home

Awesome

Differentiating Concepts and Instances for Knowledge Graph Embedding

Source code and datasets of EMNLP2018 paper: "Differentiating Concepts and Instances for Knowledge Graph Embedding". https://arxiv.org/abs/1811.04588

News

Thanks to Shengding Hu for providing the PyTorch version of the training code.

Dataset

We provide YAGO39K and M-YAGO39K dataset we used in this work in data/YAGO39K directory. The meanings of these files are explained as follows:

data/YAGO39K/Train

data/YAGO39K/Valid

data/YAGO39K/Test

data/YAGO39K/M-Valid

data/YAGO39K/M-Test

Codes

The source codes of our work are put in the folder src/.

Compile

cd src
make

Train

cd src
./transC

You can add the following optional parameters when running transC:

The Vectors of entities, concepts and relations will be stored in the folder vector/ after training.

Python Code

There is also python code for the training part, in py_version/ The python version can be run with

python -m py_version.transc

The outputs are stored in the same format and location with cpp version.

Experiment

Link Precidtion

For Link Prediction experiment, you need to

cd src
./test_link_prediction

You can add the following optional parameters when running test_link_prediction:

Normal Triple Classification

For normal Triple Classification experiment, you need to

cd src
./test_classification_normal

You can add the following optional parameters when running test_triple_classification_normal:

InstanceOf and SubClassOf Triple Classification

For instanceOf and subClassOf Triple Classification experiments, you need to

cd src
./test_classification_isA

You can add the following optional parameters when running test_triple_classification_isA:

Cite

If you use the code, please cite this paper:

Xin Lv, Lei Hou, Juanzi Li, Zhiyuan Liu. Differentiating Concepts and Instances for Knowledge Graph Embedding. *The Conference on Empirical Methods in Natural Language Processing (EMNLP 2018)*L.