Coder Social home page Coder Social logo

skywalker023 / pragmatic-consistency Goto Github PK

View Code? Open in Web Editor NEW
36.0 3.0 5.0 1011 KB

πŸ€– Code for our EMNLP 2020 paper: "Will I Sound Like Me? Improving Persona Consistency in Dialogues through Pragmatic Self-Consciousness"

Home Page: https://aclanthology.org/2020.emnlp-main.65/

License: MIT License

Python 100.00%
emnlp paper dialogues nlp pragmatics consistency social-cognition natural-language-processing

pragmatic-consistency's Introduction

Pragmatic Self-Consciousness
for Improving Persona Consistency in Dialogues

figure

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.

Reference

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
}

Have any question?

Please contact Hyunwoo Kim at [email protected].

Implementation

System Requirements

  • Python 3.6.8
  • Pytorch 1.6.0
  • CUDA 10.1 supported GPU with at least 12GB memory
  • See environment.yml for details

Environment setup

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

Running Experiments

Self-conscious Blender for its persona

Dialogue NLI

python eval_dnli.py --conscious-target self -t tasks.teachers:SelfConsciousDialogueTeacher --model agents.selfconscious_blender:SelfConsciousBlenderAgent --fp16 false

PersonaChat

python eval_personachat.py --conscious-target self -t tasks.teachers:SelfConsciousDialogueTeacher --model agents.selfconscious_blender:SelfConsciousBlenderAgent --batchsize 48 --fp16 false

Self-conscious Blender for its context

Dialogue NLI

python eval_dnli.py --conscious-target context -t tasks.teachers:ContextConsciousDialogueTeacher --model agents.selfconscious_blender:SelfConsciousBlenderAgent --fp16 false

PersonaChat

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.

Acknowledgements

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.

License

This repository is MIT licensed. See the LICENSE file for details.

pragmatic-consistency's People

Contributors

bckim92 avatar skywalker023 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pragmatic-consistency's Issues

[C-score κ΄€λ ¨]

μ•ˆλ…•ν•˜μ„Έμš”

Blender 90M λͺ¨λΈμ— λŒ€ν•΄ μ •λŸ‰μ  μ‹€ν—˜ κ²°κ³Όκ°€ 논문에 기재된 결과와 μœ μ‚¬ν•˜κ²Œ 잘 λ³΅μ›λ˜λŠ”μ§€λ₯Ό ν™•μΈν•˜λŠ” 도쀑에 ν•œ 가지 질문이 μƒκ²ΌμŠ΅λ‹ˆλ‹€.

논문에 기재된 0.85 (Blender S0 에 ν•΄λ‹Ή) C-score 와 달리, μ œκ°€ 직접 μ‹€ν–‰ν•΄λ³΄λ‹ˆ C-score κ°€ 음수 값이 μ‚°μΆœλ˜κ³  μžˆμŠ΅λ‹ˆλ‹€. μ‹€ν—˜μ— μ‚¬μš©ν•œ 데이터셋은 convai2:normalized valid dataset 에 λŒ€ν•΄ μ •λŸ‰μ  점수λ₯Ό κ΅¬ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. (λ‹€λ₯Έ ppl, f1 값은 μœ μ‚¬ν•˜κ²Œ μ‚°μΆœλ˜κ³  μžˆμŠ΅λ‹ˆλ‹€) λͺ¨λΈμ€ λ™μΌν•˜κ²Œ zoo:blender/blender_90M/model 을 μ‚¬μš©ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

ν˜Ήμ‹œ, μ œκ°€ λ†“μΉœ 뢀뢄이 μžˆκ±°λ‚˜ 잘λͺ»ν•œ 뢀뢄이 μžˆμ„κΉŒμš”?

κ°μ‚¬ν•©λ‹ˆλ‹€.

Baseline hyperparameters& datasets

Hi! Could you specify what hyperparameters you use when finetuning the Blender model on PersonaChat? (I did not see that specified in your paper). To be more specific, what's the parlai comment you use to finetune the model? We tried the following commend but did not obtain the same results:
parlai train_model -m transformer/generator --delimiter β€˜\n’ -t personachat:self_original -bs 4 -mf zoo:blender/blender_90M/model -tblog True -stim 1000 -lr 0.0001

How to interact with the model?

Hello, thank you for the great work. I wander how to interact with the provided checkpoint via CLI? Could you provide a script to do it?

Experiment datasets

Hi,
One more question. In your experiments, did you use the original or the revised version of PersonaChat? Or both? (I see a both setting in Parlai's doc but not sure what that implies)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.