Official PyTorch implementation of our EMNLP paper:
Hyunwoo Kim, Byeongchang Kim, and Gunhee Kim. Will I Sound Like Me? Improving Persona Consistency in Dialogues through Pragmatic Self-Consciousness. EMNLP, 2020 [Paper]
- TL;DR: Inspired by social cognition and pragmatics, we model public self-consciousness in existing dialogue agents with an imaginary listener to improve consistency. Compared to previous works, our method does not require additional consistency-related labels or training.
Earlier version of this work was also accepted at ICLR 2020 Bridging AI and Cognitive Science (BAICS) workshop as an oral presentation.
If you use the materials in this repository as part of any published research, we ask you to cite the following paper:
@inproceedings{Kim:2020:selfc,
title={Will I Sound Like Me? Improving Persona Consistency in Dialogues through Pragmatic Self-Consciousness},
author={Kim, Hyunwoo and Kim, Byeongchang and Kim, Gunhee},
booktitle={EMNLP},
year=2020
}
Please contact Hyunwoo Kim at [email protected].
- Python 3.6.8
- Pytorch 1.6.0
- CUDA 10.1 supported GPU with at least 12GB memory
- See environment.yml for details
Our code is built on the ParlAI framework.
We recommend you create a conda environment as follows
conda env create -f environment.yml
and activate it with
conda activate pragmatic-consistency
python eval_dnli.py --conscious-target self -t tasks.teachers:SelfConsciousDialogueTeacher --model agents.selfconscious_blender:SelfConsciousBlenderAgent --fp16 false
python eval_personachat.py --conscious-target self -t tasks.teachers:SelfConsciousDialogueTeacher --model agents.selfconscious_blender:SelfConsciousBlenderAgent --batchsize 48 --fp16 false
python eval_dnli.py --conscious-target context -t tasks.teachers:ContextConsciousDialogueTeacher --model agents.selfconscious_blender:SelfConsciousBlenderAgent --fp16 false
python eval_personachat.py --conscious-target context -t tasks.teachers:ContextConsciousDialogueTeacher --model agents.selfconscious_blender:SelfConsciousBlenderAgent --batchsize 48 --fp16 false
💡 In case you want to run the evaluation with vanilla Blender as is, set the --conscious-target
to none
.
We would like to thank Reuben Cohn-Gordon, Sean Welleck, Junhyug Noh and Jiwan Chung for their valuable comments. We also thank the anonymous reviewers for their thoughtful suggestions on this work.
This research was supported by Brain Research Program by National Research Foundation of Korea (NRF) (2017M3C7A1047860), Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No. 2017-0-01772, Video Turing Test, No. 2019-0-01082, SW StarLab), and Creative Pioneering Researchers Program through Seoul National University.
This repository is MIT licensed. See the LICENSE file for details.