BitterBetter

Beer marketing copy ⮕ predicted bitterness

BitterBetter uses textual descriptions of beer to predict bitterness.
The use case is for brewers to calibrate their brand stories.

Try it!

Motivation

Consider the marketing copy for the following two beers.

Captured By Porches' Miskatonic Dark Rye
Captured by Porches “Miskatonic Dark Rye”
A moderately dark rye ale brewed with traditional Bavarian Hefeweizen yeast to give a roasty and fruity finish.
True Vine's Daddy's Juice Box
True Vine “Daddy’s Juice Box”
Being a grown-up means responsibilities galore but it also means getting grown-up treats. And we don’t mean fruit snacks and goldfish. We’re talking big, bold, 8.5% treats. Our Daddy’s Juice Box Double IPA is a big, juicy, hop declaration of a treat. With a full nose of tropical aromas and a super smooth finish, this hop beast is sure to reward. So get your own juice box, kids. This one’s for daddy.

The description of the dark rye, with words like “Hefeweizen” and “roasty,” doesn't sound bitter at all, while Daddy's juice box, with “big, bold” and “hop beast” sounds like it will be pretty bitter, especially for a juicy IPA. But in fact, the IBU rating of the former is 70, which is quite bitter, and the IBU rating of the latter is only 25, indicating a low level of bitterness.

What's the result? Consumers who try these beers based on their descriptions might be disappointed, while consumers who would have been more likely to enjoy them might not bother trying them. This points to the importance of having a description that captures the right information about the bitterness level of the beer.

More information

Beer bitterness is estimated via the International Bittering Unit or IBU scale, which measures the concentration of certain acids which arise during the brewing process. An IBU rating does not correspond precisely to perceived bitterness but has a high correlation with it.

The data for this project obtained from ratebeer.com using a custom-built distributed scraper. The database includes over 600,000 beer entries of which about 85,000 were usable.

BitterBetter uses natural language processing methods to predict the IBU rating of beers. Words are tokenized and both individual words and bigrams are one-hot-encoded. A combination of linear regression with ridge and lasso normalization and random forest ensembles are used to generate the predictions.

Some of the individual words and bigrams with the strongest contributions to the model are as follows:

hoppy 36.7
kiwi fruit 32.3
ipa 30.3
ipa luscious 29.9
bitter 29.7
ibu 28.1
american strong 27.3
ibus 27.1
hop 26.8
hops 25.7
insult 25.3
magnum bitterness 24.5
atlantic pale 23.7
hopheads 23.5
bitterness 23.5
brut -32.2
low bitterness -25.5
hazy double -23.6
hazy ipa -21.3
juicy ipa -20.6
english barleywine -20.5
low -20.0
champagne -19.9
juicy double -19.3
cryo -18.5
low ibu -17.7
abv ibus -17.7
continue -17.2
idaho -16.5
neipa -16.3

The median absolute error is around 6.75 on a validation set. This is pretty good resolution, as IBU differences at that scale are overshadowed by other flavor components.

This project was implemented in python. Specific technologies and packages used in it included:

Try it!

Background photo by Christin Hume on Unsplash