A PyTorch implementation of Controllable Paraphrase Generation with a Syntactic Exemplar
- data and tags
- evaluation (including multi-bleu, METEOR and a copy of Stanford CoreNLP)
- syntactic evaluation
- pretrained model (VGVAE+LC+WN+WPL)
run_vgvae.sh
is provided as an example for training new models.
python generate.py -s PATH_TO_MODEL_PICKLE -v VOCAB_PICKLE -i SYNTACTIC_SEMANTIC_TEMPLATES -r REFERENCE_FILE -bs BEAM_SIZE
The argument -r
is optional. When it is specified, the following evaluation script will be executed for reporting BLUE, ROUGE-{1,2,L}, METEOR and Syntactic TED scores.
python eval.py -i INPUT_FILE -r REFERENCE_FILE
python eval_f1_acc.py -s PATH_TO_MODEL_PICKLE -v VOCAB_PICKLE -d SYNTACTIC_EVAL_DIR
python eval_sts.py -s PATH_TO_MODEL_PICKLE -v VOCAB_PICKLE -d PATH_TO_STS
@inproceedings{mchen-controllable-19,
author = {Mingda Chen and Qingming Tang and Sam Wiseman and Kevin Gimpel},
title = {Controllable Paraphrase Generation with a Syntactic Exemplar},
booktitle = {Proc. of {ACL}},
year = {2019}
}