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
To get this project running on your machine, follow the instructions below
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
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
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!
This website also has a light / dark mode switch in the upper-left hand corner!
This website was created using the following technologies:
-
Jupyter Notebook: Training the Recurrent Neural Network
- Dataset: Kaggle dataset of Kanye West verses
- Pytorch: Creating the LSTM model
- language-check: Grammatical fixes
- better-profanity: Censoring profanity
-
React: Front end library
- Create-React-App: Intialization of the site
- Ant Design: Component library for styling
-
Flask: Back end API
-
Heroku: Website hosting
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!
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!