- First, run the following command to preprocess the datasets.
./run.sh configs/<dataset>.sh --process_data <gpu-ID>
<dataset>
is one of datasets, such as: wn18rr
, fb15k-237
, and nell995
.
<gpu-ID>
is a non-negative integer number representing the GPU index.
- For example:
./run.sh configs/wn18rr.sh --process_data 0
- The following commands can be used to train a KGE model. By default, dev set evaluation results will be printed when training terminates.
./run.sh configs/<dataset>-<KGE model>.sh --train <gpu-ID>
<KGE model>
is one of KGE models, such as: TransE
, ConvE
, and TuckER
.
- For example:
./run.sh configs/wn18rr-convE.sh --train 0
To generate the evaluation results of a pre-trained model, simply change the --train
flag in the commands above to --test
.
For example, the following command performs inference and prints the evaluation results (on both dev and test sets).
./run.sh configs/<dataset>-<KGE model>.sh --test <gpu-ID>
To add a new KGE model to the program, simple add the model's code to models.py.
To change the hyperparameters and other experiment set up, start from the configuration files and parse_args.py.