Skip to content
Code for Improving Neural Story Generation by Targeted Common Sense Grounding
Python Dockerfile
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
analysis Initial commit Aug 24, 2019
data Initial commit Aug 24, 2019
.gitignore Initial commit Aug 24, 2019
Dockerfile Initial commit Aug 24, 2019
LICENSE Create LICENSE Aug 24, 2019
README.md Initial commit Aug 24, 2019
dist_utils.py Initial commit Aug 24, 2019
requirements.txt
train.py Initial commit Aug 24, 2019
util.py Initial commit Aug 24, 2019

README.md

Improving Neural Story Generation by Targeted Common Sense Grounding

This repository contains the code to replicate the paper "Improving Neural Story Generation by Targeted Common Sense Grounding".

Environment Setup

We use Docker to ensure a consistent development environment. First, ensure Docker and NVIDIA-Docker is installed.

Build Docker image:

docker build -t storygen .

Run bash shell in image:

docker run --rm -w /src -v $(pwd):/src storygen /bin/bash

Now you can run scripts within the shell.

For all scripts you will need to download the corresponding datasets before running.

Training

To train a model, run the following. See --help for CLI argument options.

python train.py [experiment_name]

Evaluation

Generate text from model

python -m analysis.generate.py

Compute perplexity from model

python -m analysis.eval_ppl.py

Compute prompt ranking accuracy from model

python -m analysis.eval_prompt_rank.py

Compute common sense reasoning accuracy from model

python -m analysis.eval_csr.py

Attribution

If you use this code in your research, cite our paper via the following BibTeX.

@inproceedings{mao2019emnlp,
  title={Improving Neural Story Generation by Targeted Common Sense Grounding},
  author={Mao, Huanru Henry and Majumder, Bodhisattwa Prasad and McAuley, Julian and Cottrell, Garrison W.},
  booktitle={EMNLP},
  year={2019}
}
You can’t perform that action at this time.