Skip to content

mingdachen/disentangle-semantics-syntax

Repository files navigation

Disentangling Syntax and Semantics in Sentence Representations

A PyTorch implementation of "A Multi-Task Approach for Disentangling Syntax and Semantics in Sentence Representations" (NAACL 2019).

2019/06/02 Script for evaluating tree edit distance will be released soon

Dependencies

  • Python 3.5
  • PyTorch 0.3
  • NumPy
  • NLTK (for syntactic evaluation)
  • zss (for computing tree edit distance)

Download Data

Training and semantic evaluation data (processed)

Syntactic evaluataion (based on ParaNMT)

Run

run_vgvae.sh is provided as an example for training new models

Evaluation

Labeled F1 and Tagging accuracy

python eval_f1_acc.py -s PATH_TO_MODEL_PICKLE -v VOCAB_PICKLE -d SYNTACTIC_EVAL_DIR

Reference

@inproceedings{mchen-multitask-19,
  author    = {Mingda Chen and Qingming Tang and Sam Wiseman and Kevin Gimpel},
  title     = {A Multi-Task Approach for Disentangling Syntax and Semantics in Sentence Representations},
  booktitle = {Proc. of {NAACL}},
  year      = {2019}
}

About

Code for "A Multi-Task Approach for Disentangling Syntax and Semantics in Sentence Representations" (NAACL 2019)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published