Inspiration

We've spent countless hours analyzing poetry and prose for English class. We've pulled the letters apart and considered everything from the placement of stressed syllables to the significance of an unconventional word choice. I've always been taught that every choice an author makes is intentional. But sometimes, that seems ridiculous to believe. And what better way to investigate than by examining the written work of a machine, where exactly none of the literary choices are intentional?

If meaning still arises, if I still feel joy or anger or pity or a compulsion to milly rock, does that imply that the choices of the author are only loosely unrelated to the impact on the reader?

When randomly generated lyrics form stunning social commentaries, is it just the imagination of my biased and pattern-seeking brain, or does it really say something about the subliminal messages in the input?

Is laughing at an accidentally hilarious phrase akin to slapstick comedy where we find hilarity in others' incompetency, or a way to assure ourselves that computers aren't smart enough to generate natural, human humour? (Rapository certainly isn't bright enough, but in the future who's to say?)

Well, no one here has really gotten enough sleep to think straight so I supposed the answer to all of these is a resounding "lmao idk".

What it does

Rapository takes in lyrics from existing songs and automatically generates a new set of lyrics in that style. This is achieved using Markov chains. For any given word that appears in a rap, a successive word is chosen via weighted random selection from all words that have been observed to follow it. Line breaks are also accounted for, so verses can be built from multiple lines of lyrics. All information related to the occurrence of words is stored in an internal file.

How we built it

Rapository is built using Python as a backend, with Flask as our web framework. HTML and CSS, along with bootstrap, are also used with the website, and Adobe Photoshop was used to create graphics. The site uses domain.com for its domain and is hosted from the Google Cloud Platform.

Challenges we ran into

Our simple machine learning model created raps based upon the training data it was given. Thus, creating a large and diverse collection of modern rap lyrics was necessary to achieve an adequate level of realism. In the development of Rapository, this required us to scour the top charts of modern rap lyrics and manually extract content.

Accomplishments that we're proud of

  • Creating a Markov chain
  • Creating a Markov chain that can grow with more inputs
  • Creating an aesthetic index page
  • Creating a site that allows for user input to control random lyric generation
  • Some interesting lyrics including:
    • "I think my jeweler really sellin' fruits"
    • "No females in rectangular shape"

What we learned

  • Markov Chains
  • Flask
  • Google Cloud Platform, Console

What's next for RAPOSITORY

A major shortcoming of our machine learning rapper is their inability to coherently piece together raps. Although overall tone and themes clearly resemble popular hip hop, there is no clear message in each line. In the future, we wish to connect with some grammar or rhyme scheme APIs to improve the realism of our rapper. We have also looked into other machine learning mechanisms including recurring neural networks, which can hopefully understand the context of each line and infusing raps with meaning.

Share this project:
×

Updates