Python 3.7.9
PyTorch 1.7.0
We conduct our experiments on two datasets — NELL-One and FB15k237-One.
You can find original datasets(NELL-One) from here.
You can download datasets used in this work from here.
- NELL-One
- FB15k237-One (We use this repository to get the embeddings used in this work.)
- For NELL-One:
python train.py --dataset "NELL-One" --few n --max_batches 200000
- For FB15k237-One:
python train.py --dataset "FB15k237-One" --few n --max_batches 10000
In this work, we set n=1 for one-shot and n=5 for five-shot.
You can set --max_batches
smaller.
After training, the checkpoints will be saved in ./models
and the corresponding results will be printed.
You can also download the checkpoints from here.
- For NELL-One:
python train.py --dataset "NELL-One" --few n --test
- For FB15k237-One:
python train.py --dataset "FB15k237-One" --few n --test
(The checkpoints are for your reference only. We find some errors in net.py, which slightly affect the effect after correction.)