Tagging & Seasonality

Reading Time: 6 minutes

In our work in Everli, one of the most important aspects is to provide reliable product info about products in stores. Product info is a bunch of different aspects of an item, like name, weight, price, and so on. All of them are stored in our Catalog and, for each of them, we use a specific logic in order to have the best info possible. Today we are going to focus on a very complex aspect:  the seasonality.

In Catalog, there is a subset of products that are, more or less, all fresh fruits and vegetables we are selling during the year, and all these products have seasonality. Generally speaking, seasonality is the cycle or changes of a business or economy depending on the seasons; in the food world, seasonality is the time of year when the harvest or the flavour of some cultivated food is at its peak. For us the seasonality is an intersection of both definitions: it is the time when fruits and vegetables are available in the stores depending on the harvest, but also it is the availability expected by the customers that depends on their habits and disposition to buy a particular kind of fruit or vegetables at a certain time of year.

Seasonality is a tool to take care of the right item presences during the right timing because our purpose is to improve the Catalog quality and the customer experience. For example, if we are in winter and in our e-commerce some watermelons are available, that could mean there is an error in Catalog (because now there are not any watermelon harvest). In addition, we create a fake expectation in customers, who can add the watermelon in their grocery shopping, but the shoppers can’t find it in the store and the customers could be very disappointed in the end.

To handle seasonality we have to face two big problems:

1.    How to group items that are pretty similar to each other, so they have the same seasonality, but they are not the exact same things (like different kind of eggplants: the long eggplant and the round eggplant have the same seasonality pattern)

2.    How to join the harvest natural seasonality calendar with the customer needs calendar

PROBLEM N.1, SOLUTION: TAGGING

This is a screenshot of some items in an italian store. All of them have something in common, as you can see all items are related to tomatoes. In fact, there are some bottles and jars of tomato sausage and some vegetables that are tomatoes. This is the idea of tagging: grouping all items that have some characteristics in common. In the green rectangle, you can see the vegetable group of tomatoes: all are different in shape, colour, name and taste, but all of them are the same thing – a tomato – so all of them have the same seasonality.

How to tag items?

We use an engine to tag Catalog items that are in fruit and vegetable categories with a list of regex to seek in the item name the corresponding match. It seems easy, but it is not. We have to handle singular and plural words, so we consider just a part of the item word and we deal with some borderline cases. For example the “pomodoro ciliegino” item ( yes, it is a tomato, the cherry tomato!). The first time, it was tagged like a tomato, but also like a cherry, but it is not a cherry at all!  In order to avoid strange flavour mixes, like in the following picture, and to handle the borderline case of cherry tomato we use some rules to exclude it from the cherry tagging.

The algorithm is very simple: for each tag we have a set of accepted regex (field include=1) and excluded words ( field include=0),  hance for every item name we return only the tag that matches all the accepted ones , but not the excluded ones. Going back to the cherry tomato example, with the help of the picture below, we can see all that the algorithm will exclude tag 29 (cherry) because the word “ciliegin” has include=0, but it will correctly tag with id 93(tomatoes) because both “pomodor” and “ciliegin” have include=1.

All rules are based on country languages; consequently, tags are country based, so we have, (for now!!😊), 4 different groups of tags: Italian ,  Polish , French  and  Czech tags.

PROBLEM N.2, SOLUTION: FLAG RELEVANCE

We want to join the harvest natural seasonality calendar with the customer needs calendar, so in this case, we have to manage different kinds of calendar not only for different items (because the seasonality of a strawberry is totally different from the seasonality of a watermelon, indeed) but also for different expectations. In fact, we have two different kinds of calendar : the seasonality calendar and the relevance calendar.

The seasonality calendar

It is the natural seasonal pattern that we recorded for each tag and country because the same item could have a different seasonality calendar in different countries, like asparagus: it is in season   in Italian stores from March to June and in Polish stores  from May to December.

We record for the 12 months of the year the presence/absence of fruits and vegetables by the use of the boolean flag_in_season. When flag_in_season is equal to 1, it means the product is in season during the month, if it is 0 it is not. We decided the seasonal calendar level of detail is a month, so the smallest time range for a seasonal item is a whole month, not only a part of it.

The relevance calendar

It is the relevance pattern that allows us to know when the presence in the store of a  specific fruit or vegetable is important or not for the customer. This information comes from Catalog Team Knowledge based on historical trend of purchasing and researches and it is stored in the same way we have seen for flag_in_season, but now we use the flag_relevance. The flag relevance is a number and it has three different values:

0= Respect of the seasonality is not important, so we don’t care if a tag is present or not in the store. For example, for us it is not important to have cedar in stores, even if it is in season.

1= Respect for the seasonality is important, so when a tag is in season, we care about its presence in the store; vice versa, when a tag is not in season we want it is not to be sold in the store. For example, if the current month is April, for us it is important to have strawberries in stores and not watermelon because for the customer it could seem silly to sell watermelon outside summer time.

2= The tag is a MUST HAVE, when the tag is in season, it can not be missed in the store. For example, if the current month is January and the customer can’t find some oranges, it is a very big problem. The tag orange is a MUST HAVE because if the customer can’t find orange in the store, he could leave the store- and the grocery- without finalizing the purchase.

Finally, one of the major output of the work we spoke about until now is a pivot table that shows all the seasonality and relevance patterns of the year. The following table is exactly an example of what our  Catalog  team uses to check seasonal assortment  and  we could notice that avocado is very important in January due to the high demand.

The following report is Seasonal but not live tags – store aggregation, it is a very helpful report for the team that cares about the quality of goods offered in stores.

Here you can see a pivot table refreshed every day where you have the list of all tags in season now, split by country and classification (fruit or vegetable) and the list of all store_id (the unique identifier to recognize exactly stores). When a tag is totally lacking in a store we have the red cell, so the quality team knows suddenly which store the tag is missing.

WHAT’S NEXT

In the future, we would like to tag any kind of item, not only fruits and vegetables. We could even have items with multiple tags, for example, a muffin with chocolate and strawberries could be tagged with the tag “chocolate”, “strawberry” and the tag “baked dessert”. Multi-tagging could be useful to have clever filters on e-commerce, a very interesting group of filters to implement is the allergenic filters group. For example, we can provide to the customer filters that allow us to show all items gluten-free or to hide items that contain milk and so on. In addition, we can have tags for specific events like Christmas, Easter, Valentine’s Day, Halloween and so on to allow the quality team to check faster and properly the right assortment of items in stores during specific events.

In the end, we can affirm that tag and seasonality are two effective tools to improve the quality of our work on Catalog assortment and the quality of customer experience during grocery shopping on Everli.

Leave a Reply

Your email address will not be published. Required fields are marked *