-
Clone the repo
-
Install the requirements:
pip install -r requirements.txt
The data used in the paper can be found here.
export DATA_DIR=directory/where/unzipped/data/folder/is
export CUDA_DEVICE=0 # =-1 for cpu
export WANDB=false
allennlp train model_configs/hypernym_0.jsonnet --serialization-dir hypernym_0_training_dump --include-package=datasets --include-package=boxes --include-package=models
Assuming your username and project is username
and project
respectively.
export DATA_DIR=directory/where/unzipped/data/folder/is
export CUDA_DEVICE=0 # =-1 for cpu
export WANDB=true
wandb_allennlp --subcommand=train --config_file=model_configs/hypernym_0.jsonnet --include-package=datasets --include-package=boxes --include-package=models --wandb_entity=username --wandb_project=project --wandb_run_name=hypernym_0
export DATA_DIR=directory/where/unzipped/data/folder/is
python predict_f1_test.py --model hypernym_0_training_dump
Replace hypernym_0
with hypernym_{10,25,50}
, meronym_{0,10,25,30}
and joint
to train all the regularized box models reported in the paper.
@inproceedings{
patel2020representing,
title={Representing Joint Hierarchies with Box Embeddings},
author={Dhruvesh Patel and Shib Sankar Dasgupta and Michael Boratko and Xiang Li and Luke Vilnis and Andrew McCallum},
booktitle={Automated Knowledge Base Construction},
year={2020},
url={https://openreview.net/forum?id=J246NSqR_l}
}