OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Simkgc

SimKGC is an open-source Python research implementation for text-based knowledge graph completion using pretrained language models and contrastive learning. Its repository provides dataset preprocessing, model training and evaluation workflows for WN18RR, FB15k-237 and Wikidata5M, plus predictions from its models.

Independent OpenViST project profile, based on linked sources.

Simkgc — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.

Source-based practical guide

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

  1. Preprocess the dataset with the command below.

    Documented command
    bash scripts/preprocess.sh WN18RR
  2. Train with OUTPUT_DIR=./checkpoint/wn18rr/ bash scripts/train_wn.sh.

  3. Evaluate the resulting checkpoint with the command below.

    Documented command
    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.
Source-based practical guide

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

  1. Download Wikidata5M with the command below.

    Documented command
    bash ./scripts/download_wikidata5m.sh
  2. Preprocess the chosen setting with the command below or the command below.

    Documented command
    bash scripts/preprocess.sh wiki5m_trans
    Documented command
    bash scripts/preprocess.sh wiki5m_ind
  3. Train using OUTPUT_DIR=./checkpoint/wiki5m_trans/ bash scripts/train_wiki.sh wiki5m_trans for transductive data, or OUTPUT_DIR=./checkpoint/wiki5m_ind/ bash scripts/train_wiki.sh wiki5m_ind for inductive data.

  4. Evaluate the transductive checkpoint with the command below, or the inductive checkpoint with the command below.

    Documented command
    bash scripts/eval_wiki5m_trans.sh ./checkpoint/wiki5m_trans/model_last.mdl
    Documented command
    bash 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.
Evidence and transparency

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