How GO-FOOD Reads Your Mind

Alverta Shani
Life at Gojek
Published in
7 min readJan 31, 2019

Have you ever wondered why GO-FOOD is able to give you recommendations on all things delicious that match your preference? In a way, it’s like the app can read your mind. I can actually tell you what it is — and it’s not because we can cast magic spells.

The answer is simple: we have a specific calculation that can teach our app to recommend you the food you might like based on your purchase history.

You must be wondering how do we do that?

Well, to answer your question, I sat down with Luis Smith, GOJEK’s Data Scientist who is in charge of the GO-FOOD recommendation system and asked him to break it down one by one for us!

Luis Smith — GO-FOOD Data Chef

However, before we dive deeper into all the technical stuff, I asked Luis a question: Why is it important for GO-FOOD to give its users recommendations?

The answer is simple: for users, less is better.

In his book The Paradox of Choice, Barry Schwartz stated that “eliminating consumer choices can greatly reduce anxiety for shoppers.”

There are over 250,000 merchants registered at GO-FOOD, imagine if you had to scroll down one by one just to choose what’s good to eat. You’ll be famished long before knowing what to eat.

Along with saving you time, GO-FOOD’s recommendations help you discover relevant merchants and dishes that have been personalized to your tastes. This also helps us to surface MSME (Micro, Small, Medium Enterprise) businesses to be noticed by our users. Meaning, that if they are noticed, there’s a probability for our users to buy their dishes and it’ll definitely increase their sales volume. So, it’s a win-win for everyone!

People think of their food as delicious, instagenic, and many other ways
Before we get into how the system works, you might be surprised that people consider a lot of things just to buy a dish. Some people consider the flavor. Others might consider the latest food trends (looking at you, Indomie donuts!)

A lot of us might consider purchasing food if it’s instagenic enough, so we can tell our 100 followers what we’re eating today.

To sum up, there are many ways for people to think about food. These considerations become our challenges. With over 250,000 merchants registered in GO-FOOD, there are a million of different dishes in the menu. There’s no easy way to categorize this.

So, instead of categorizing the food one by one, the approach we take is to let the relationship between users’ purchases reveal the similarities between how particular dishes or restaurants are linked together.

So how does GO-FOOD recommend things you might like based on this?

The hypothesis
A customer’s purchase history is indicative of what they like to eat, so if someone likes to order desserts, we want to continue to recommend them sweet things. These users’ food preferences and the characteristic of dishes and merchants can be captured as a vector representation.

Vector representation is the key to calculate the similarity of users’ food preferences, so we can give the best recommendation for them. Everything can be captured by vector representation such as flavor profile, quantity, price and other things that define food.

Vector representations use all of the words known as “tokens,” (e.g. the word cheese, chocolate, sesame or martabak) to describe each dish in our GO-FOOD database.

Wait, what exactly is vector representation?

Honestly, I think this is the coolest part. To be able to map all the dishes in GO-FOOD, every dish needs to be represented by a series of real numbers. We do that because the computer doesn’t know that martabak manis tastes sweet, so we represent the sweet flavor with numbers.

If you take a look at the illustration above, maybe these numbers don’t mean anything to you, but for us, they are important because they represent each characteristic of martabak manis

These numbers describe the hidden features that we learn from the data. We don’t know exactly what characteristics the vector representations will find, but they could categorize things into the taste profile of the dish, the most suitable mealtime (is it a lunch or dinner meal), or whether the dish is pricey or a budget item.

One of the things the number represents is the taste profile, such as the sweet scale, snack food scale or even the spicy scale of a dish. In the illustration, the vector representation calculates that martabak manis has 0.9 on the sweet scale and 0.8 on the snack food scale. This means it’s high on the sweet and snack food scale.

Meanwhile, the vector determines that martabak manis only has 0.07 on the spicy scale, meaning it’s low on the spicy scale.

We can see that the vector representation determines that martabak manis has sweet and snack food characteristics in it.

This vector representation allows GO-FOOD to give you recommendations by looking for particular characteristics (represented by the numbers) without our data scientist telling the app explicitly what to look for!

A match made by a machine
Vector representation is useful because it can determine the similarity between each dish. For example, martabak manis is high on the sweet and snack food scale, however, it’s low on the spicy scale.

It has a similarity with roti bakar which includes chocolate, is sweet and also a snack food. This means that roti bakar has a high similarity with martabak manis based on the vector representation.

On the other hand, as we can see in the illustration above, ayam geprek is different than the other two because the numbers are high on the spicy scale at 0.9. It also has low numbers on the snack food scale at 0.8. Ayam geprek is definitely not a sweet food since it has the lowest number on the sweet scale at only 0.1 in the vector representation.

Now that you understand how we find a match of recommendation by using the similarity between the two dishes, let’s talk about how we’re issuing these recommendations to our users.

Recommending dishes that you might like

Based on a previous dish you purchased
GO-FOOD reads users’ purchase histories, so it can recommend other similar dishes that users might like.

To make this happen, the data science team starts by learning about each vector representation of each GO-FOOD dish. Then, they select one recent purchase from each customer and retrieve a list of potential dishes based on the users’ location.

So, when you (as a GO-FOOD user) open the app, the data science team has pre-calculated the list of potential dishes you might like within a few kilometers from where you are. After that, they will calculate the similarity between a dish you purchased in the past and all of the candidate dishes.

All those magical calculations will lead you to the display of personalized top recommendation dishes closest to your location in your GO-FOOD app.

Based on your overall food preferences

GO-FOOD can also recommend food based on your purchase history. The data science team will calculate the average vector of your previously purchased dishes as a representation of your food preferences.

Therefore, if you like spicy chicken dishes and tend to buy it often, GO-FOOD will continue to recommend you similar things such as ayam geprek or ayam penyet.

However, if you have a sweet tooth, and you keep buying martabak manis, the app will continue to recommend you similar sweet and snack food types like roti bakar.

The magical result

After those calculations, the result in your GO-FOOD should be like this:

Yay! Now you can eat in peace.

Here at GOJEK, we believe that everyone deserves to live easier. As a tech company, we want to always innovate and present you with the best choices out there because we know that your time is valuable, and you shouldn’t waste it just thinking about what to eat. With GO-FOOD recommendations, you can instead use that time to do something impactful for other people.

Do you think that making food recommendations for millions of people is challenging enough? If you think it is, join us to be a part of GOJEK’s Data Science team and start to predict the future in a scientific way based on data like Luis!

Visit GOJEK’s Career Page to embark on a new #adventure with us!

Illustrations by Athiyah Alatas

--

--

Alverta Shani
Life at Gojek

Telling the untold stories. Passionate about tech & science.