Skip to content

Generating Kanye West lyrics using a LSTM network in Pytorch, deployed to a website

Notifications You must be signed in to change notification settings

nbalepur/Rap-Lyric-Generator

Repository files navigation

Kanye Lyric Generator

In this project, I use an LSTM (Long Short-Term Memory) Recurrent Neural Network in Pytorch for text generation. Specifically, I take a sample of Kanye West verses to generate new lyrics! Afterwards, this model was deployed to Flask via Heroku and connected to a simple React App

Note: The website can be viewed here

thumbnail



Getting Started

To get this project running on your machine, follow the instructions below

Jupyter Notebook

To make changes to the Jupyter Notebook, you will need to install Pytorch. You can find more in-depth instructions on how to do so here

Alternatively, you can simply view the results of the Jupyter Notebook here on Jovian, or here in the repository locally

Flask Web App

Before you are able to run the web server, you will need to install Python and Flask. Instructions on how to set up Flask with Visual Studio Code can be found here

Now, run the following command to get the files on your machine

git clone https://github.com/nbalepur/Kanye-Song-Generator.git

Navigate to ./Kanye-Song-Generator/, and run the following command:

flask run

This will open up the website in locally in your default browser



Website User Guide

Navigating the website is very simple! To start generating lyrics, you must first fill out the following fields:

  • Starting Text: The beginning of the lyric to be generated
  • Number of Words: The number of additional words to generate
  • Censor Profanity?: Checkbox to hide/show explicit language
  • Randomize?: Choose whether the algorithm should select the best fitting word, or a random word from the top 3 best words

After these fields are tuned to your liking, simply press Generate to create a new lyric!

thumbnail


This website also has a light / dark mode switch in the upper-left hand corner!

themes



Website Info

This website was created using the following technologies:

  • Jupyter Notebook: Training the Recurrent Neural Network

  • React: Front end library

  • Flask: Back end API

  • Heroku: Website hosting



Acknowledgements

The Pytorch background I needed for this project was extremely well-taught form this data science article, so thank you for making the information accessible and easy to follow!



Author Info / Contact

All of the code for this resository was written by me, Nishant Balepur. If you have any questions or concerns, feel free to reach out!