Code for the paper "A Fully Hyperbolic Neural Model for Hierarchical Multi-class Classification" published at Findings of EMNLP 2020.
Model overview:
The source code and data in this repository aims at facilitating the integration of hyperbolic components into neural models for NLP. If you use the code/data, please cite it as follows:
@inproceedings{lopez2020hyfi,
title = "A Fully Hyperbolic Neural Model for Hierarchical Multi-Class Classification",
author = "L{\'o}pez, Federico and Strube, Michael",
booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2020",
month = nov,
year = "2020",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://www.aclweb.org/anthology/2020.findings-emnlp.42",
pages = "460--475"
}
python 3.7
PyTorch 1.4
geoopt 0.2.0
tqdm
tensorboardX
Download and uncompress Ultra-Fine dataset, and download Poincare word embeddings:
./scripts/hyfi.sh get_data
Experiments were run with poincare_glove_100D_cosh-dist-sq_init_trick.txt
.
The parameter poin-ctx25
can be replaced to store different preprocessing configurations:
./scripts/hyfi.sh preprocess poin-ctx25
The name of the preprocessing used in the previous step must be given as a parameter.
./scripts/hyfi.sh train poin-ctx25
./scripts/figet.sh inference poin-ctx25 models/poin-ctx25-{N}bstep.pt
N
should be the number of the best epoch, according to the validation results.
We kindly thank the open-source community for their support with high quality software, and specially to:
- Choi et al. for the release of the Ultra-Fine dataset and their model.
- Tifrea et al. for the release of the Poincare Glove word embeddings.
- Ganea et al. for the release of the Hyperbolic Neural Networks.
- Kochurov et al. for the implementation and release of the magnificent Geoopt.