![Dithered image of an Emily Bronte painting](../images/bronte-2-cover.png)
Think of your favorite band. How many words is it?
My bet is on two.
Perhaps it's because many artists are solo acts: first name, last name. Or mabye two-word combinations just sound good to the ears. But when I think of some of my favorite bands over the years, so many of them are simple combinations of two words.
*Beach House. Japanese Breakfast. Wild Nothing.* You get it.
Lately I've been musing over some musical ideas that may or may not come to fruition. If they do, I'd like to not stress about coming up with the perfect name. So I decided to outsource the work to Emily Brontë.
## The Brontë Band Generator
Outsource is not the best term, but maybe in some ways it is—by outsource I mean training a machine learning model on the writings of Brontë and then providing an input that will return some Brontë-sounding combinations of band names.
![Screenshot of the Bronte Band Generator app](../images/bronte-ex-4.png)
This was partially an excuse to finally get my hands dirty with the [ml5.js library](https://ml5js.org/) to see how machine learning in the browser really works. And although this app is largely adapted from [their docs](https://learn.ml5js.org/#/reference/charrnn), I tacked on a few fun features to play with. More on that below, but if you want to dive right in [try it out](/experiments/bronte-band-generator.html)!
Here's how it works: you type in some words or the start of a sentence to feed into something called a Long Short-Term Memory (LSTM) model. All you need to know is that this kind of algorithm is good at understanding and predicting sequences, such as which word should follow a previous word. If you want to understand more in depth how this kind of model works, see [here](https://colah.github.io/posts/2015-08-Understanding-LSTMs/).
The ml5.js library provides a few pre-trained models, one of which is fed a huge amount of text written by Emily Brontë. So this was a handy place to start. By feeding text into this model as a starting point, I am essentially asking the computer: "if Emily and I were having coffee, how would she finish my sentence in her own words?"
In addition to the text input, you can control the number of words that is returned by the model and also something called "temperature". To be honest, this second control feels a bit vague to me, but experimenting with higher values appears to return longer words and a more diverse vocabulary range.
Once you hit "GENERATE", the model will return two things:
1. the raw text ouput
2. a two-word combination in the colored squares (band name?)
This second output is the result of some text parsing code that I added to choose all the nouns present in the model output and then shuffle through random combinations of them (thanks to some handy methods from the [RiTa.js library](https://rednoise.org/rita/index.html)). Clicking the "Shuffle" text will return new random combinations from the same text. This could be handy if, say, you really love the paragraph of text that Brontë Band gave you, but the band name is terrible. Just shuffle it up and see what happens!
![Screenshot of the Bronte Band Generator app](../images/bronte-ex-1.png)
As shown above, a random output from the app: Distant Veil. Brilliant. That is gloomy, dream pop band name gold right there. And from a quick Google search, it *appears* to not be claimed. I might just take it if someone doesn't beat me to it.
But there are so many more!
![Example output from Bronte Band: Own Beam](../images/bronte-3.png)
*Own Beam*, also a great band name.
![Example output from Bronte Band: Strange Conversation](../images/bronte-4.png)
*Strange Conversation*, they just keep coming.
You'll also notice a small "Include adjectives" checkbox option by the "GENERATE" button. By default, the app only pulls nouns from the model output. But adding in adjectives can introduce some interesting results. That's how I got "distant" to be included in the word shuffle, which also led me to this delightfully meta result:
![Example output from Bronte Band: Distant Woman](../images/bronte-ex-3.png)
If [historical accounts](https://en.wikipedia.org/wiki/Emily_Bront%C3%AB#Personality_and_character) are correct, Emily indeed *was* a distant woman.
Making this app has definitely peaked my interest in LSTMs as a method of creative idea generation. It reminded me a lot of Brian Eno's [oblique strategies](https://www.themarginalian.org/2014/01/22/brian-eno-visual-music-oblique-strategies/) approach to music. Instead of focusing so much energy on creating ideas from scratch, you create a system and act as an editor or guide for the ideas that pop out. This feels like a small, playful example of that.
But honestly, I may never go back to naming things off the top of my head again.
Hope you can also [name your next great thing](/experiments/bronte-band-generator.html) with the help of Emily Brontë!