Name generator web app
Creating a full web app for my fantasy name generator
(originally posted February 10th, 2019)
This week I was able to build a web app with my TensorFlow name generator and put it online using GitHub’s Pages feature. Since I ended last week with a functioning model in Python and a very simple web app that only worked locally, I needed to figure out a number of things to get the app to where it is now.
First, I needed to figure out how to actually get the web app on the web and not just on my own computer. The first step was finding web hosting, and I remembered hearing something about how GitHub does some form of hosting for free. I found that I could turn any repository into a public site just by turning on the feature in the settings. I made a new repository to hold the site’s files and turned on the hosting feature, and I was able to access the site using this URL.
I was worried that there might be a problem with putting the model’s weight files here and loading them with TensorFlowJS, but it worked as smoothly as on my own computer. I was very excited to have my app online and that it was so simple to do. This may be due to my initial frustration last week when using TensorFlowJS and not being able to figure out how to load the model weights. I thought I would need some kind of complicated server setup to get it working, but the setup I found is very simple. Now I had the app online, but the app was not doing much. It just output the same list of names every time and didn’t demonstrate anything except the ability to memorize a few names. I needed to show the versatility of the app.
The web app was able to generate names very well, but the process was somewhat slow, at least when I tried it on my phone. I coded a new inference method that only fed partial sequences of letters through the model instead of padded sequences, which I mistakenly wrote in an earlier post that I thought I couldn’t do with the Keras LSTM. I also trained a model with fewer weights so that the inference calculations would happen faster. Even a much simpler model was able to learn enough to generate good names.
Finally, I used Bootstrap to make the page look nicer and to make it more responsive to various devices with different screen sizes. It’s been a while since I’ve done web design so using this framework made it much faster to get a professional looking site.
I put the web app to work to generate a name for my character in the game Pillars of Eternity who I named Calia. Apparently this is also the name of a fitness apparel company, so maybe I should make a business naming app next.
You can try generating your own names here.