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:
@inproceedings{ijcai2017-565,
author = {Lin Liu, Xin Li, William K. Cheung, Chengcheng Xu},
title = {A Structural Representation Learning for Multi-relational Networks},
booktitle = {Proceedings of the Twenty-Sixth International Joint Conference on
Artificial Intelligence, {IJCAI-17}},
pages = {4047--4053},
year = {2017},
doi = {10.24963/ijcai.2017/565},
url = {https://doi.org/10.24963/ijcai.2017/565},
}
C++
python 3
sklearn
There are five files/folder (some may be zipped to meet the space limit):
MNE.cpp
: The MNE model for embeddinglogistic_classification.py
: The classifier for classificationlogistic_link_prediction.py
: The classifier for link predictionFB15k
: The dataset case from FreeBaseWN18
: The dataset case from WordNet
./mne -trainset data/all_train.txt -outputdir output/ -entity2id data/entity2id.txt -relation2id data/relation2id.txt
python logistic_classification.py -entityVec output/entity_vec.txt -relationVec output/relation_vec.txt -trainLink data/train_link.txt -result result/testresult_MNE.txt
./mne -trainset data/train.txt -outputdir output/ -entity2id data/entity2id.txt -relation2id data/relation2id.txt
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
- 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, equallingtrain.txt
+valid.txt
+test.txt
.