Git Product home page Git Product logo

mime's Introduction

MIME

This repository contains PyTorch implementation of empathetic-response generation model MIME: MIMicking Emotions for Empathetic Response Generation.

Overview of MIME

Alt text

Current approaches to empathetic response generation view the set of emotions expressed in the input text as a flat structure, where all the emotions are treated uniformly. We argue that empathetic responses often mimic the emotion of the user to a varying degree, depending on its positivity or negativity and content. We show that the consideration of these polarity-based emotion clusters and emotional mimicry results in improved empathy and contextual relevance of the response as compared to the state-of-the-art. Also, we introduce stochasticity into the emotion mixture that yields emotionally more varied empathetic responses than the previous work. We demonstrate the importance of these factors to empathetic response generation using both automatic- and human-based evaluations.

Setup

Download GloVe vectors from here and put it into vectors/ folder

Next Install the required libraries:

  1. Assume you are using conda
  2. Install libraries by pip install -r requirement.txt

For reproducibility purposes, we provide model output on test dataset as ./output.txt and weights in google drive. you can download the model and move it under save/saved_model

Run code

Dataset is already preprocessed and contained in this repo. we used proprocessed data provided in this link https://github.com/HLTCHKUST/MoEL/tree/master/empathetic-dialogue.

Training

python main.py

Note: This will also generate output file on test dataset as save/test/output.txt.

Testing

python main.py --test --save_path [output_file_path]

Note: During testing, the model will load weight under save/saved_model, and by default it will generate save/test/output.txt as output file on test dataset.

Citation

MIME: MIMicking Emotions for Empathetic Response Generation. Navonil Majumder, Pengfei Hong, Shanshan Peng, Jiankun Lu, Deepanway Ghosal, Alexander Gelbukh, Rada Mihalcea, Soujanya Poria. EMNLP (2020).

mime's People

Contributors

ajyl avatar emrys-hong avatar nmder avatar soujanyaporia avatar

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.