zjukg / GPHT-for-TSP

[Paper][TKDE 2024] Start From Zero: Triple Set Prediction for Automatic Knowledge Graph Completion
2 stars 1 forks source link

Preprocess

bash init.sh

RuleTensor-TSP

  1. generate subgraphs

    python GPHT/run.py -dataset=DATASET -subgraph=SUBLEN -perfix=PERFIX

    -SUBLEN: set max hops of subgraph from center to edge

  2. pre-train embeddings

    python GPHT/run.py -dataset=DATASET -subgraph=SUBLEN -perfix=PERFIX -batch=BATCH -pretrain -desc=DESC

  3. train the model

    python GPHT/run.py -dataset=DATASET -perfix=PERFIX -lr=LR -restore=RESTORE -batch=1 -epoch=EPOCH -valid_epochs=STEP -score_func=MODEL -minconf=MINCONF

    -LR: a little scale number for learning rate, like 0.00003 or less
    -MINCONF: selecting the final predicted triples

  4. predict triples(in KGE-TSP)

    • CFamily
      python KGE-TSP/runclose.py -train -test -data=DATASET -gpu=0 -perfix='0.8' -testGNN "EXPS/CFamily/toKGE_XXX.pt" -model=MODEL

    • Wiki143k and Wiki79k
      python KGE-TSP/runopen.py -train -test -data=DATASET -gpu=0 -perfix='0.8' -testGNN "EXPS/DATASET/toKGE_XXX.pt" -model=MODEL -valid_steps=STEP

Acknowledgement

We refer to the code of HAKEPairRE and CompGCN. Thanks for their contributions.