Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
vardaan123 committed Oct 5, 2023
1 parent 53d6220 commit 93e9b10
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Code for the CIKM'23 paper "A Retrieve-and-Read Framework for Knowledge Graph Li

![A Retrieve-and-Read Framework for Knowledge Graph Link Prediction (KG-R3)](./assets/KG-R3.pdf)

# Install dependencies
## Install dependencies
1. Create a new conda virtual env

2. Install horovod
Expand All @@ -18,22 +18,25 @@ HOROVOD_WITH_PYTORCH=1 --no-cache-dir --ignore-installed pip install horovod[pyt
pip install -r requirements.txt
```

# Download data
## Download data

# Preprocess data
## pickle dataloader batches for faster training
Download the preprocessed subgraphs and KG triples from [this link](https://buckeyemailosu-my.sharepoint.com/:f:/g/personal/pahuja_9_buckeyemail_osu_edu/ErHNYjTAzLZMgT7Mkgy1J_4BeoJMYTF4EQ2UxniOgPhCyA?e=85avhJ)

## Preprocess data

### pickle dataloader batches for faster training
```
python -u dump_preproc_data.py --dataset-path data/FB15K-237/ \
--sampling-type minerva \
--batch-size 512 --out-dir data/FB15K-237/train_preproc/ \
--graph-connection type_1 --split train --mode train
```

# Experiments
## Experiments

## FB15K-237
### FB15K-237

### train, BS=512, Minerva retriever
#### train, BS=512, Minerva retriever
```
python -u main.py --dataset-path data/FB15K-237/ --cuda \
--save-dir ckpts/CKPT_DIR/ --sampling-type minerva \
Expand All @@ -43,15 +46,15 @@ python -u main.py --dataset-path data/FB15K-237/ --cuda \
--seed 12548 > ckpts/CKPT_DIR/log.txt 2>&1
```

### evaluate on validation split
#### evaluate on validation split
```
python eval.py --dataset-path data/FB15K-237/ --cuda \
--ckpt-path ckpts/CKPT_DIR/model.pt \
--split valid --sampling-type minerva \
--graph-connection type_1 --embed-dim 320 --n-attn-heads 8 \
--n-bert-layers 3
```
### evaluate on test split
#### evaluate on test split
```
python eval.py --dataset-path data/FB15K-237/ --cuda \
--ckpt-path ckpts/CKPT_DIR/model.pt \
Expand All @@ -60,9 +63,9 @@ python eval.py --dataset-path data/FB15K-237/ --cuda \
--n-bert-layers 3
```

## WN18RR
### WN18RR

### train, BS=512
#### train, BS=512
```
python -u main.py --dataset-path data/WN18RR/ --cuda \
--save-dir ckpts/CKPT_DIR/ --sampling-type minerva \
Expand Down

0 comments on commit 93e9b10

Please sign in to comment.