项目作者: luoxiaolin521

项目描述 :
MNE: Multi-relational Network Embedding
高级语言: C++
项目地址: git://github.com/luoxiaolin521/MNE.git
创建时间: 2017-09-07T13:46:57Z
项目社区:https://github.com/luoxiaolin521/MNE

开源协议:

下载


MNE: Multi-relational Network Embedding

This is the codes and data for MNE model in our paper “A Structural Representation Learning for Multi-relational Networks“.

If you would like to acknowledge our efforts, please cite the following paper:

  1. @inproceedings{ijcai2017-565,
  2. author = {Lin Liu, Xin Li, William K. Cheung, Chengcheng Xu},
  3. title = {A Structural Representation Learning for Multi-relational Networks},
  4. booktitle = {Proceedings of the Twenty-Sixth International Joint Conference on
  5. Artificial Intelligence, {IJCAI-17}},
  6. pages = {4047--4053},
  7. year = {2017},
  8. doi = {10.24963/ijcai.2017/565},
  9. url = {https://doi.org/10.24963/ijcai.2017/565},
  10. }

Prerequisites

C++

python 3

sklearn

Usage

There are five files/folder (some may be zipped to meet the space limit):

  • MNE.cpp: The MNE model for embedding
  • logistic_classification.py: The classifier for classification
  • logistic_link_prediction.py: The classifier for link prediction
  • FB15k: The dataset case from FreeBase
  • WN18: The dataset case from WordNet

Run for classification

  1. ./mne -trainset data/all_train.txt -outputdir output/ -entity2id data/entity2id.txt -relation2id data/relation2id.txt
  2. python logistic_classification.py -entityVec output/entity_vec.txt -relationVec output/relation_vec.txt -trainLink data/train_link.txt -result result/testresult_MNE.txt
  1. ./mne -trainset data/train.txt -outputdir output/ -entity2id data/entity2id.txt -relation2id data/relation2id.txt
  2. python logistic_link_prediction.py -entityVec output/entity_vec.txt -relationVec output/relation_vec.txt -trainLink data/train_link.txt -testLink data/test_link.txt -result result/testresult_MNE.txt

Note

  • The output files (learned embeddings) will be stored in the -outputdir directory during embedding training.
  • Please make the -result directory before run the program, and the test results will be stored in the -result directory.
  • the all_train.txt in the run case means the file which contans all triples in dataset, equalling train.txt + valid.txt + test.txt.