Inspiration
I've been getting very interested in NLP and other AI/ML topics recently and recently made a bot that uses natural language understanding which I had a ton of fun doing so. So to take that a step further, I wanted try my hand at text generation, rather than just repeating a categorized sentence. So I decided to take all of the first 4 Shrek movies scripts, feed it to a model, and see what kind of script it comes up with. While designing the web app, it reminded me of the fun projects that used to always be up on the internet. Early 2000's internet was an absolute gold mine since it was just old enough for people to understand it and be able to make cool websites, but just young enough that it was still a wild west and free from all the corporate intervention. An absolute icon of that era was Shrek, so it would've been wrong to not go all out on recreating that vibe.
What it does
The web app asks the user to give a title for a Shrek movie, and the first couple lines that Shrek will say. Neither of these are actually important to the model, but it makes for a much more fun and interactive app that can give goofy answers constantly. It then takes the user's inputs and generates a 5000 character script for the user.
How we built it
The web app is made using flask since they're api is extremely easy and nice to use. Also it uses html so it was easy to create the vibe that I wanted the web app to have. The model itself has a RNN architecture. It tokenizes each character giving it a unique id. The vectors of character ids are then shifted by one space to create the label data. Essentially, the model uses a character as an input and then tries to predict the next character based on all of the previous ones. The model was made using tensorflow.
Challenges we ran into
Too many unfortunately :( I am not very experienced with working with and deploying web apps. So while I was able to design, create, and train the model in good time since I've been working with ML for a fairly decent amount of time, I struggled to be able to deploy the model. Since the model has a fairly complicated architecture, it would be hard to save and load it. Also, since it uses tensorflow, many of the common hosting sites I've used aren't able to host it. So I had some issues figuring out the best way for it to be deployed on a server. However, I have 0 experience working with domains. This lead to lots of frustration as I was struggling to figure out how to connect my domain from domain.com (shrekscripts.com) to the deployed app. Fortunately I think I figured it out, but the model has to retrain and it wouldn't be done in time for when coding ends (I can't afford the better cloud instances :sweat:) Edit: it works now!
Accomplishments that we're proud of
The model works! It works and in my opinion it's very funny and fun to play around with. The scripts are EXTREMELY chaotic since the input data had different formats for each movie. This leads to some very funny moments of gibberish, and even funnier conversations between characters. Not only that but I feel like I have been able to successfully capture that feeling of nostalgia I was aiming for with the presentation of the app.
What we learned
The reason I wanted to make this a web app vs a simple app or just notebook, was because I don't have much experience with actively deploying and hosting many things. However, this forces me to learn and adapt. I feel like I have a much stronger knowledge of how to do everything, and would have most likely finished it all had I only had a little bit more time (a group I was part of ended up shifting their focus to a different project on the second day leaving me to have to start a brand new one on my own).
What's next for Shrek Script Generator
It will be deployed and able to be accessed through www.shrekscripts.com I can guarantee that. I have the domain for a year so it will be used for sure. The project also gave me a good understanding of what works and doesn't for natural language generation. It was very exciting working through it and changing designs along the way. Hopefully there will be more ai/ old school websites from me in the future on top of the Shrek Script Generator!
Built With
- amazon-web-services
- flask
- html5
- python
- tensorflow
Log in or sign up for Devpost to join the conversation.