Skip to content

calclavia/story-generation

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
August 24, 2019 16:40
August 24, 2019 16:40
August 24, 2019 16:40
August 24, 2019 15:53
August 24, 2019 16:40
August 24, 2019 16:40
August 24, 2019 16:40

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}
}

About

Code for Improving Neural Story Generation by Targeted Common Sense Grounding

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published