The official pytorch implementation of our paper Hierarchical Poset Decoding for Compositional Generalization in Language.
If you find our code useful, please consider citing our paper:
@inproceedings{Yinuo2020Hirearchical,
title={Hierarchical Poset Decoding for Compositional Generalization in Language},
author={Yinuo Guo and Zeqi Lin and Jian-Guang Lou and Dongmei Zhang},
booktitle={Advances in Neural Information Processing Systems},
year={2020}
}
pip install -r requirements.txt
get CFQ data : Download dataset from link
bash preprocess.sh
cd sketch_prediction/
bash ./train.sh
The module is based on the open-source project Matchzoo-py https://github.com/NTMC-Community/MatchZoo-py
cd ./traversal_path_prediction/MatchZoo-py/
python ./traversal_path_prediction/MatchZoo-py/train_esim.py
bash evaluate.sh
In the aforementioned Training and Evaluation sections, we train and evaluate HPD on the MCD1 split.
To train and evaluate on MCD2/MCD3 split, please replace mcd1
to mcd2
or mcd3
in the following files:
- sketch_prediction/train.sh
- sketch_prediction/evaluate.sh
- traversal_path_prediction/MatchZoo-py/train_esim.py
- traversal_path_prediction/MatchZoo-py/evaluate_esim.py
- traversal_path_prediction/MatchZoo-py/datasets/cfq/load_data.py
- evaluate.sh
We will thank the following repos which are very helpful to us.
Any question please contact zeqi DOT lin AT microsoft DOT com