We originally started doing something completely different, a proof checker. However, after exploring a few possible routes, we came to the conclusion that it would be much too hard to do in 24 hours, so we changed track.
We came to our idea, when a friend suggested making a web bot compose lyrics for songs and provide audio recordings of these songs. We took the idea further, and tried to integrate this with the Nexmo API so that users could text the bot what they wanted a song about and the bot would call them back and sing it to them.
What it does
You can text the bot on it's Nexmo number, telling it "write a song about topic", and it will compose a song using this topic. It then creates a recording of it's lyrics and sings it the user by calling them.
How we built it
We broke our process down into two parts:
- Creating the song lyrics
- We used NLP to parse our existing songs database so that we can replace words in it.
- Interacting with the user via phone
- We used the Nexmo api to connect to the user through text messages and phone calls
- We used the Google Cloud text-to-speech API to generate more realistic sounding voices that the Nexmo API
Challenges we ran into
- Natural Language Processing is not the easiest thing in the world :P
- Getting the Nexmo API to stream an mp3 file took some time
- Getting the overlay of music and lyrics in right in the last 5 minutes
Accomplishments that we're proud of
- We have a system that can call and text
- We have a voice that actually sounds nice to listen to
- The lyrics (while most of the time, completely incomprehensible) are often fun and amusing
What we learned
- Spelling mistakes make life hard, and are hard to catch, for example, http is not spelled "hhttps".
- The Nexmo API is actually surprisingly easy to use and works pretty much as you'd expect it to. Except when it randomly caches things.
- Areas in NLP that seem like they should be fairly simple, such as finding synonyms or related words, actually turn out to be fairly difficult. This is made even more difficult by the fact that most words will change meaning depending on the context in which they are used.
- Ngrok is a really neat well to easily develop on localhost systems
What's next for Rap God
Not sure... if people like it, maybe we need to find a way to keep it running - at least until our free nexmo credit dries up :(