Writing Prompt Generator

Simple natural language generator for writing prompts

Published on Apr 13, 2022

Reading time: 2 minutes.


Built with

Hugging Face
PyTorch

The cure to writer’s block

This project was meant to be its own standalone site, but for now it remains a demo for my endeavor to create an intelligence that can generate genuinely helpful writing prompts. My hope is that I will be able to get it to a point where someone can actually use it to gain inspiration for short stories, novels, D&D campaigns, etc.

It is still a work in progress though, most of the prompts it generates are not very helpful. It also needs the user to give it a starting point, which I want to make optional for when you’re really stuck.

The model

The bulk of this project is the model. This is the part that actually generates the writing prompts. I built mine from DistilGPT2, a pre-trained version of OpenAI’s GPT2. Although it was already pre-trained, I needed it to be specifically tailored for making compelling writing prompts, so I fine-tuned it on a dataset containing posts from the subreddit r/WritingPrompts. Specifically, I only keep popular posts from the subreddit to train on. Since the dataset contains all posts on the subreddit, obviously not all of them are going to be very high quality. Upvotes are a good metric for deciding which ones are worth using as training data.

Demonstration

Visit my HuggingFace space for an interactive demonstration, below are some examples of generated prompts.

  • Once upon a time, you are the next one in line for our job, because the world is the “one we should go, until their hands are tied.” Now, you have the task of having the hands tied if your hands don’t move
  • In a world where men and women are more intelligent than women, you are the world’s most powerful diplomat. Your secret? You can travel from day to day to get to know the people of a world. You are known for the eccentricities.
  • When humanity discovered aliens, their first reaction was a roar, “There’s a new planet! I’m not going to leave it until the morning of the year!” A week later, humanity discovers that we’re no longer at war with the aliens.

As I said, work in progress.