Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Latest commit 1bd47fe Jun 11, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
Reranking Add files via upload May 4, 2019
data Add files via upload Apr 12, 2019
onmt Update Jun 11, 2019 Update Jun 11, 2019 1 Apr 12, 2019 1 Apr 12, 2019 1 Apr 12, 2019 1 Apr 12, 2019

Code for Wei-Jen Ko, Greg Durrett and Junyi Jessy Li, "Linguistically-Informed Specificity and Semantic Plausibility for Dialogue Generation", NAACL 2019

This is the code for our response generation model.


  author    = {Ko, Wei-Jen and Durrett, Greg and Li, Junyi Jessy},
  title     = {Linguistically-Informed Specificity and Semantic Plausibility for Dialogue Generation},
  booktitle = {NAACL},
  year      = {2019},


-Pytorch (Tested on 0.3.1)

-This code is based on OpenNMT (Klein et al., OpenNMT: Open-Source Toolkit for Neural Machine Translation, ACL2017)

Commands For Running

Data preprocessing:

python -train_src data/train_prompt.txt -train_tgt data/train_response.txt -valid_src data/valid_prompt.txt -valid_tgt data/valid_response.txt -save_data data/personachat


python -data data/personachat -save_model model -gpuid 0 -rnn_size 500 -batch_size 64 -epochs 100 -optim adam -learning_rate 0.001 -learning_rate_decay 0.5 -dropout 0.2 -global_attention mlp


python -model -src data/test.txt -output output.txt -verbose -block_ngram_repeat 3

Specificity metrics

For Linguistic informed specificity, we use our system.

For computing perplexity, we use the RNNLM toolkit.

Generating synthetic sentences for reranker Reranking/ to tag the data (nltk required) Reranking/ to generate sentences

Training reranker

We modify this InferSent toolkit. Download it and replace,, and by our file in the Reranking/ folder

You can’t perform that action at this time.