fabrahman / Emo-Aware-Storytelling

Code repository for our EMNLP 2020 long paper "Modeling Protagonist Emotions for Emotion-Aware Storytelling" (https://arxiv.org/abs/2010.06822)
MIT License
18 stars 6 forks source link

Modeling Protagonist Emotions for Emotion-Aware Storytelling

This repository contains preliminary code and data for the paper titled:

Modeling Protagonist Emotions for Emotion-Aware Storytelling Faeze Brahman, and Snigdha Chaturvedi. EMNLP 2020.

Dataset: ROCStories

The dataset can be downloaded from here and unzipped in data/ folder.

Data files includes:

  1. [train/test/dev]_x1.txt: titles
  2. [train/test/dev]_x4.txt: stories
  3. [train/test/dev]_mapped.txt: automatically annotated emotion arcs

Code

* Run `run_[X].sh` for training/testing model `[X]`. (please see config files for more config options.)
* Use `Reinforcement/run_evaluation.py` for evaluation on emotion faithfulness. An example command is:
```bash
python Reinforcement/run_evaluation.py --all-preds-dir <PATH_TO_GENERATED_TSV_FILE> --arc-file <PATH_TO_ARC_FILE>  --output_file <PATH_TO_SAVE_JSON_RESULTS>

Interactive Generation

First, download the pretrained model from here and untar it:

tar -xvzf model_checkpoint.tar.gz

Then run following command to interactively generate emotion-aware stories:

sh run_interactive.sh

Running that, it will ask you to first enter a Title, and then a sequence of three emotions separated by space from joy, anger, sadness, fear, neutral! for example: joy sadness sadness

The code is adapted from Counterfactual Story Generation.

Reference

Please cite our paper using the following bibtex:

@inproceedings{brahman-chaturvedi-2020-modeling,
    title = "Modeling Protagonist Emotions for Emotion-Aware Storytelling",
    author = "Brahman, Faeze  and
      Chaturvedi, Snigdha",
    booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
    month = nov,
    year = "2020",
    address = "Online",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/2020.emnlp-main.426",
    pages = "5277--5294"
}