Skip to content


Switch branches/tags


Failed to load latest commit information.
Latest commit message
Commit time


The WikiPlots corpus is a collection of 112,936 story plots extracted from English language Wikipedia. These stories are extracted from any English language article that contains a sub-header that contains the word "plot" (e.g., "Plot", "Plot Summary", etc.).

This repository contains code and instructions for how to recreate the WikiPlots corpus.

The dataset itself can be downloaded from here: (updated: 09/26/2017). The zip file contains two files:

  • plots: a text file containing all story plots. Each story plot is given with one sentence per line. Each story is followed by <EOS> on a line by itself.
  • titles: a text file containing a list of titles for each article in whih a story plot was found and extracted.

Using the code to recreate the corpus

I have also included the Python script used to extract the story plots. requires:

To use

  1. Download an English Wikipedia dump. From this link you will find a file named something like "enwiki-20170401-pages-articles-multistream.xml.bz2". Make sure you download the .bz2 file that is not the index file.
  2. Unzip the bz2 file to extract the .xml file.
  3. Download wikiextractor. You do not need to set it up. Run it as follows:

python -o output_directory --json --html -s enwiki-...xml

You must run with these parameters. requires json files with nested html and with section header information preserved. Wikiextractor will produce a number of subfolders named "AA", "AB", "AC"... Within each folder will be a wiki_xx file containing a number of json records, one per article.

  1. Install the BeautifulSoup4 python package
  2. Download and run from this repository:

python wiki_dump_directory plot_file_name title_file_name

wiki_dump_directory should be the path to the directory containing the "AA", "AB", etc. folders. plot_file_name will be the name of the file that will contain the story plots. title_file_name will be the name of the file that will contain the list of story titles.


A dataset containing story plots from Wikipedia (books, movies, etc.) and the code for the extractor.






No releases published


No packages published