Practical overview
When it fits
Use SimKGC when you need research code and documented benchmark workflows for training or evaluating text-based knowledge graph completion models.
Who it is for
- Researchers reproducing or comparing knowledge graph completion benchmark results.
- Developers building preprocessing, training or prediction workflows for text-based knowledge graphs.
Documented uses
- Preprocess WN18RR, FB15k-237 or Wikidata5M benchmark data for SimKGC.
- Train a knowledge graph completion model using the repository's contrastive-learning approach.
- Evaluate a trained checkpoint on a documented benchmark dataset.
- Use the repository's provided model predictions.
Requirements & limits
The public GitHub repository identifies itself as the official code repository for the paper and is open source.
- The documented dependencies are Python 3.7+, PyTorch 1.6+ and Transformers 4.15+.
- The authors report using four V100 GPUs with 32 GB each for experiments.
- The README estimates training at under three hours for WN18RR and FB15k-237, about 12 hours for Wikidata5M transductive data and about 11 hours for inductive data.
- The repository documents data parallel training, but not distributed data parallel training.
- The README says reducing batch size can address CUDA out-of-memory issues, with a potential performance cost for contrastive training.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Train and evaluate on WN18RR
Run the documented WN18RR preprocessing, training and evaluation workflow.
Before you start
- Python 3.7 or later
- PyTorch 1.6 or later
- Transformers 4.15 or later
- WN18RR files from KG-BERT
- Compute resources; the repository reports experiments on four V100 GPUs with 32 GB each
Steps
Preprocess the dataset with the command below.
bash scripts/preprocess.sh WN18RRTrain with
OUTPUT_DIR=./checkpoint/wn18rr/ bash scripts/train_wn.sh.Evaluate the resulting checkpoint with the command below.
bash scripts/eval.sh ./checkpoint/wn18rr/model_last.mdl WN18RR
Expected outcome
A trained WN18RR checkpoint and an evaluation run using the repository's documented workflow.
Guide limitations
- The README estimates training at under three hours; actual time depends on the environment.
- Reducing batch size can help with CUDA memory limits but may hurt contrastive-training performance.
- The code supports data parallel training, not distributed data parallel training.
Prepare, train and evaluate on Wikidata5M
Follow the documented Wikidata5M transductive or inductive benchmark workflow.
Before you start
- Python 3.7 or later
- PyTorch 1.6 or later
- Transformers 4.15 or later
- Compute resources; the repository reports experiments on four V100 GPUs with 32 GB each
Steps
Download Wikidata5M with the command below.
bash ./scripts/download_wikidata5m.shPreprocess the chosen setting with the command below or the command below.
bash scripts/preprocess.sh wiki5m_transbash scripts/preprocess.sh wiki5m_indTrain using
OUTPUT_DIR=./checkpoint/wiki5m_trans/ bash scripts/train_wiki.sh wiki5m_transfor transductive data, orOUTPUT_DIR=./checkpoint/wiki5m_ind/ bash scripts/train_wiki.sh wiki5m_indfor inductive data.Evaluate the transductive checkpoint with the command below, or the inductive checkpoint with the command below.
bash scripts/eval_wiki5m_trans.sh ./checkpoint/wiki5m_trans/model_last.mdlbash scripts/eval.sh ./checkpoint/wiki5m_ind/model_last.mdl wiki5m_ind
Expected outcome
A trained model and evaluation run for the selected Wikidata5M setting.
Guide limitations
- The README estimates training at about 12 hours for transductive and 11 hours for inductive data; transductive evaluation is estimated at about one hour.
- The download script obtains data for both settings.
- The README reports that smaller batches may reduce memory pressure while hurting contrastive-training performance.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 18 October 2026
- Original website title
- intfloat/SimKGC · Official homepage title · retained in its source language

