How to Teach a Computer to Write Stories

This is part of a three part series detailing the computer science senior thesis projects. 

While computers writing stories from scratch may sound like something from science fiction, Melanie Subbiah disagrees. For her senior thesis in computer science, Melanie is teaching computers to write new stories on their own, a cutting edge field called open narrative generation. She’s always loved creative writing and has taken many Williams College literature and writing courses.  While struggling to decide on a thesis topic she says,  “it suddenly occurred to me, why not study creative writing from a computer science standpoint?”
Working with Williams Professor Andrea Danyluk, an expert on machine learning, she has developed a process to guide computers through the creative steps. First, she gives the computer a collection of stories written by regular authors to analyze. Computers require inspiration in the same way humans do! She has the computer identify the paragraphs, sentences, words, and parts of speech. With all these notes the existing stories can be broken down into patterns, something computers are adept at handling. 
In the rectangles are two short and unique stories. While they may seem very different, they can be broken down into the same pattern below. Melanie uses a large collection of human stories to identify these kinds of patterns and then automatically generate a new story by using portions of the pattern of different stories.
Good stories have a moving plot filled with impactful events. So, Melanie has designed algorithms the computer can use to identify the events of the stories. Then, it’s time to generate a new plot. She uses an increasingly popular machine learning tool called a neural network. A neural network mimics the human brain by using many neurons. Each neuron might be responsible for a very specific pattern, or in the case of our brains a memory or function. When they receive the right stimulus, e.g. a phrase or event, they fire and produce a new result. Her neural network uses the collection of events it learned from other stories to create a new plot. 
As any writer can attest, storywriting does not stop when you come up with a plot. What parts of the plot do you tell the reader? From what perspective? With what details and emotion? Melanie builds on existing work to transform the computer’s plot into sentences that we can then enjoy. 
By the end of the year, she will have several stories authored by computers as well as evaluations on how logical  and original they are. She’s very excited to continue this work, and it’s helping her decide if and where she wants to attend graduate school.
Melanie’s process, her pipeline, starts with human written stories and breaks them down into patterns. Then, she builds up a new story by taking bits and pieces from all the patterns the computer has learned.


Melanie Subbiah, Class of 2017












The splash image for this post is from this site and is not owned or originally produced by The ScientEphic.