After discovering time travel, the Earth’s inhabitants now live in futuristic cities, which are controlled by the government, for the duration of a decade. The government plans to send two elite teams of scientists to the city, in order to investigate the origin of these machines and discover the existence of the “God”.

Wouldn’t it be fun to generate stories for your favorite genre? That’s what we’ll be doing today. We’ll learn how to build a story generator that creates stories based on genres, just like the one that created the sci-fi story above (the user-provided input is bold in the story above).

You can also use this post as a launching pad to develop your own text generator. For example, you can generate headlines of topics like Tech, Science, and Politics. Or generate lyrics of your favorite artists.


Why Story Generation?

As an avid movies and TV-Shows fan, I loved the idea of a story-generator that would generate stories based on genres, input prompts, or even titles. After learning about GPT-2, I wanted to bring that idea to life. That’s what led me to build this model.

Intended use: To have fun and test this idea of fusion storytelling where we can generate stories by blending our creativity (by providing a prompt) with the model’s creativity (by generating the rest of story using the prompt).


Trailer Time: Test out the Story Generator!

Photo by Alex Litvin on Unsplash

Before taking a deep dive into building the generator, let’s first give story generation a shot. Check out my story generator at this Huggingface linkor run the cells in this **Colab notebook **to generate stories. The model input format is of the form:

Optional prompt…

**e.g. ** <sci_fi> After discovering time travel,

where genre belongs to: superhero, sci_fi, action, drama, horror, thriller

The model will generate its story using this prompt. There’s also a more intuitive way to generate stories: a web-app using my model in action (keep in mind this app’s generation is slower than the Huggingface link).

Now that you’re done experimenting with the model, let’s explore the idea: We’re fine-tuning the OpenAI GPT-2 model on a dataset that contains movie plots of different genres. This walkthrough follows a Three-Act structure:

  • Act I: What is GPT-2?
  • Act II: Fine-Tuning Time…
  • Act III: Generation Time!

#data-science #gpt-2 #text-generation #deep-learning #movies

Generate Fresh Movie Stories for your Favorite Genre with Deep Learning
1.75 GEEK