All Projects → datquocnguyen → STransE

datquocnguyen / STransE

Licence: other
STransE: a novel embedding model of entities and relationships in knowledge bases (NAACL 2016)

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to STransE

BiLSTM-and-CNN-for-Link-Prediction
Keras implementation of path-based link prediction model for knowledge graph completion
Stars: ✭ 17 (-66%)
Mutual labels:  knowledge-graph-completion, knowledge-graph-embeddings
kglib
TypeDB-ML is the Machine Learning integrations library for TypeDB
Stars: ✭ 523 (+946%)
Mutual labels:  knowledge-graph-completion, link-prediction
InteractE
AAAI 2020 - InteractE: Improving Convolution-based Knowledge Graph Embeddings by Increasing Feature Interactions
Stars: ✭ 69 (+38%)
Mutual labels:  knowledge-graph-completion, knowledge-graph-embeddings
TransE
TransE方法的Python实现,解释SGD中TransE的向量更新
Stars: ✭ 31 (-38%)
Mutual labels:  transe
NBFNet
Official implementation of Neural Bellman-Ford Networks (NeurIPS 2021)
Stars: ✭ 106 (+112%)
Mutual labels:  link-prediction
KGE
Some papers on Knowledge Graph Embedding(KGE)
Stars: ✭ 705 (+1310%)
Mutual labels:  knowledge-graph-completion
VCML
PyTorch implementation of paper "Visual Concept-Metaconcept Learner", NeruIPS 2019
Stars: ✭ 45 (-10%)
Mutual labels:  embedding-models
BioKEEN
A computational library for learning and evaluating biological knowledge graph embeddings
Stars: ✭ 41 (-18%)
Mutual labels:  knowledge-graph-embeddings
DSKG
No description or website provided.
Stars: ✭ 65 (+30%)
Mutual labels:  knowledge-graph-completion
R-MeN
Transformer-based Memory Networks for Knowledge Graph Embeddings (ACL 2020) (Pytorch and Tensorflow)
Stars: ✭ 74 (+48%)
Mutual labels:  knowledge-graph-embeddings
Awesome Sentence Embedding
A curated list of pretrained sentence and word embedding models
Stars: ✭ 1,973 (+3846%)
Mutual labels:  embedding-models
Friends-Recommender-In-Social-Network
Friends Recommendation and Link Prediction in Social Netowork
Stars: ✭ 33 (-34%)
Mutual labels:  link-prediction
edge2vec
Learning node representation using edge semantics
Stars: ✭ 45 (-10%)
Mutual labels:  embedding-models
TransE-Knowledge-Graph-Embedding
TensorFlow implementation of TransE and its extended models for Knowledge Representation Learning
Stars: ✭ 64 (+28%)
Mutual labels:  transe
Knowledge Graph Wander
A collection of papers, codes, projects, tutorials ... for Knowledge Graph and other NLP methods
Stars: ✭ 26 (-48%)
Mutual labels:  knowledge-graph-embeddings
Ampligraph
Python library for Representation Learning on Knowledge Graphs https://docs.ampligraph.org
Stars: ✭ 1,662 (+3224%)
Mutual labels:  knowledge-graph-embeddings
doctoral-thesis
📖 Generation and Applications of Knowledge Graphs in Systems and Networks Biology
Stars: ✭ 26 (-48%)
Mutual labels:  knowledge-graph-embeddings
Awesome Embedding Models
A curated list of awesome embedding models tutorials, projects and communities.
Stars: ✭ 1,486 (+2872%)
Mutual labels:  embedding-models
ncc
Neural Code Comprehension: A Learnable Representation of Code Semantics
Stars: ✭ 162 (+224%)
Mutual labels:  embedding-models
kg-reeval
ACL 2020: A Re-evaluation of Knowledge Graph Completion Methods
Stars: ✭ 117 (+134%)
Mutual labels:  knowledge-graph-completion

STransE: a novel embedding model of entities and relationships in knowledge bases

This STransE program provides the implementation of the embedding model STransE for knowledge base completion, as described in my NAACL-HLT 2016 paper:

Dat Quoc Nguyen, Kairit Sirts, Lizhen Qu and Mark Johnson. 2016. STransE: a novel embedding model of entities and relationships in knowledge bases. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2016, pp. 460-466. [.bib]

Please cite my NAACL-HLT 2016 paper whenever STransE is used to produce published results or incorporated into other software.

The program also provides the implementation of the embedding model TransE. See an overview of embedding models of entities and relationships for knowledge base completion at HERE.

I would highly appreciate to have your bug reports, comments and suggestions about STransE. As a free open-source implementation, STransE is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Usage

Compile the program

Suppose that g++ is already set to run in command line or terminal. After you clone or download (and then unzip) the program, you have to compile the program by executing:

SOURCE_DIR$ g++ -I ../SOURCE_DIR/ STransE.cpp -o STransE -O2 -fopenmp -lpthread

Note that the actual command starts from g++. Here SOURCE_DIR is simply used to denote the source code directory. Examples:

STransE$ g++ -I ../STransE/ STransE.cpp -o STransE -O2 -fopenmp -lpthread

STransE-master$ g++ -I ../STransE-master/ STransE.cpp -o STransE -O2 -fopenmp -lpthread

Run the program

To run the program, we perform:

$./STransE -model 1_OR_0 -data CORPUS_DIR_PATH -size <int> -l1 1_OR_0 -margin <double> -lrate <double> [-init 1_OR_0] [-nepoch <int>] [-evalStep <int>] [-nthreads <int>]

//For Windows OS: use ./STransE.exe instead of ./STransE

where hyper-parameters in [ ] are optional!

Required parameters:

-model: Specify the embedding model STransE or TransE. It gets value 1 or 0, where 1 denotes STransE while 0 denotes TransE.

-data: Specify path to the dataset directory. Find the dataset format instructions in the Datasets folder inside the source code directory.

-size: Specify the number of vector dimensions.

-l1: Specify the L1 or L2 norm. It gets value 1 or 0, where 1 denotes L1-norm while 0 denotes L2-norm.

-margin: Specify the margin hyper-parameter.

-lrate: Specify the SGD learning rate.

Optional parameters:

-init: Use when -model gets value 1 (i.e. for STransE). It gets value 1 or 0 in which the default value is 1. The value 1 means that the entity and relation vectors are initialized from external files (e.g. entity2vec.init and relation2vec.init in the Datasets folder inside the source code directory), while the value 0 means that the entity and relation vectors are randomly initialized.

-nepoch: Specify the number of training epochs. The default value is 2000.

-evalStep: Specify a step to save and evaluate the model, e.g., evaluating the model after each step of 500 training epochs. The default value is 2000.

-nthreads: Specify the number of multiple threads used for evaluation. The default value is 1. Note that evaluating link/entity prediction in knowledge bases is slow. If you can afford to run the program with many threads, the evaluation process will be much faster, thus you can even evaluate the model after each training epoch.

Evaluation metrics

For evaluating link/entity prediction, the program provides ranking-based scores as evaluation metrics, including the mean rank, the mean reciprocal rank, Hits@1, Hits@5 and Hits@10 in two setting protocols "Raw" and "Filtered".

Reproduce the STransE results

To reproduce the STransE results published in my NAACL-HLT 2016 paper, execute:

$ ./STransE -model 1 -data Datasets/WN18/ -size 50 -margin 5 -l1 1 -lrate 0.0005

$ ./STransE -model 1 -data Datasets/FB15k/ -size 100 -margin 1 -l1 1 -lrate 0.0001
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].