Skip to content
/ ConvE Public

Implementation of ConvE proposed by Dettmers et al. in Convolutional 2D Knowledge Graph Embeddings.

License

Notifications You must be signed in to change notification settings

magnusja/ConvE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConvE

Implementation of ConvE proposed by Dettmers et al. in Convolutional 2D Knowledge Graph Embeddings. You can find the official repository with knowledge graph datasets here.

Implementation uses PyTorch.

Usage

Preprocessing

usage: preprocess.py [-h] {train,valid} ...

Preprocess knowledge graph csv train/valid (test) data.

positional arguments:
  {train,valid}  mode
    train        Preprocess a training set
    valid        Preprocess a valid or test set

optional arguments:
  -h, --help     show this help message and exit

Training set

python preprocess.py train ../train.tsv

Validation set

python preprocess.py valid ../train.pkl ../valid.tsv

Training

python train.py ../train.pkl ../valid.pkl
usage: train.py [-h] [--name NAME] [--batch-size BATCH_SIZE] [--epochs EPOCHS]
                [--label-smooth LABEL_SMOOTH]
                train_path valid_path

Train ConvE with PyTorch.

positional arguments:
  train_path            Path to training .pkl produced by preprocess.py
  valid_path            Path to valid/test .pkl produced by preprocess.py

optional arguments:
  -h, --help            show this help message and exit
  --name NAME           name of the model, used to create a subfolder to save
                        checkpoints
  --batch-size BATCH_SIZE
  --epochs EPOCHS
  --label-smooth LABEL_SMOOTH

Releases

No releases published

Packages

No packages published

Languages