Unsupervised Product Clustering: Exploring the Cold Start Problem

Graydon Snider
SSENSE-TECH
Published in
7 min readMar 7, 2019

--

Product recommendations can be challenging for e-commerce platforms. They can be especially hard when seasonal product turnover is high or the user’s browsing history is scarce. Here at SSENSE, we receive a constant stream of fashion brands. Hundreds of items are uploaded daily and we strive to provide relevant matches between products. In this article I present a simple Natural Language Processing (NLP) technique to create product recommendations without prior web activity data, addressing what is often referred to as the “cold start” problem.

Motivation

A critical aspect of a successful retail strategy is to help match customers with the right products. Consider a new visitor to SSENSE who is looking at a particular shoe. A good strategy might be to recommend a few relevant brands of footwear. While an in-store recommendation would be made face to face, in the online retail business, products can number in the thousands and customers in the millions. And while we do offer email and chat services, we turn to algorithms for the bulk of our assisted product matching.

A Nike ACG shoe sold at SSENSE along with its text description that will be used for text mining

As a data scientist at SSENSE, I am interested in what links our constantly-changing inventory together. Conventional user-driven search tools at SSENSE include a search bar, and sorting by brand, price or recency. The aim of each of these tools is to help customers zero in on a desirable product.

SSENSE recently created a product recommendation engine for its customers. From a user’s perspective, this engine offers a sampling of five relevant products recently viewed by others based on the current product they’re browsing. The specific details of this algorithm are beyond the scope of this article, but its application demonstrates what can be created using a rich aggregate search history. By contrast, connecting relevant products is more challenging when an item is new. To wit: the “others have viewed” tab must remain dormant until sufficient data has been collected from users.

Suggested items using the SSENSE recommendation engine with an existing search history
A new pair of Yeezy pants lacking a peer-recommended search history

Recommendation: A Cold Start

The lack of search history for new products makes it difficult to create links to existing products. According to Park and Chu, this situation ‘suffers from the cold-start problem[…] where no historical ratings on items or users are available’. Likewise, when an item is out of stock we encounter the same challenge because the search history goes stale.

One solution is to consider how products can be clustered without any web traffic data and to instead rely on other information. Prior to a new product being uploaded to ssense.com, our Studio team has already manually tagged it with a variety of details including brand, composition, category, and price. This data can be accessed through our database, but is identical to what users see on the product listing page. Using Natural Language Processing techniques detailed below, raw text is processed and clustered based on its descriptive similarity to other text. This works particularly well for SSENSE because we have full control over naming standards. It could be more challenging when products are described by a third party seller; for example as in the case of Craigslist, or Kijiji.

Text Clustering Details

I gathered an array of SSENSE product text descriptions into a corpus and created a hierarchy of product ‘relatedness’. Concretely, I used the textmineR package (R language) to create and manipulate the Document-Term Matrix (DTM) for product descriptions. First I merged the product name, brand, composition, and description to create one text per product. Following which, I then cleaned up the corpus and removed stopwords and numbers such that a description that starts like this:

"French terry shorts in black. Mid-rise. Tonal drawstring at elasticized waistband. Three-pocket styling. Logo patch at back. Gunmetal-tone hardware. Tonal stitching. 100% organic cotton. Imported".

Becomes this:

"french terry shorts black midrise tonal drawstring elasticized waistband threepocket styling logo patch back gunmetaltone hardware tonal stitching organic cotton imported"

I could further reduce the sentence via stemming, which eliminates the grammatical variations on each word.

"french terri short black midris tonal drawstr elastic waistband threepocket style logo patch back gunmetalton hardwar tonal stitch organ cotton import"

In the end I chose not to stem, as I found the results to fare better when keeping words intact (retaining word structure appears to be important in fashion!).

Once processed, the DTM is used to rank the frequency of words (or pairs of words) appearing in a product’s text, formally known as n-grams. I selected uni and bi-grams (n={1,2}), which were then translated to a Term-Frequency Inverse Document Frequency (TF-IDF) value. The TF-IDF model helps weigh the relative importance of a word’s appearance compared with other words in other groups. This treatment of the texts ultimately leads to a distance matrix comparing the relative similarity of each of the text bodies, where closer proximity implies more text similarity. The end result is that an item can be connected, unsupervised, to its nearest neighbours. This matrix can then be used to rank product descriptions most similar (closest) to a given product. It can also be used to build a dendrogram, from which one can organize product clusters.

Clustering Results

My first test was to evaluate the ability of this text-clustering scheme to sort randomly-selected women’s products into four labeled categories: shoes, accessories, bags, and ready-to-wear (RTW). After some experimenting, I chose six clusters to separate my products, the minimum required to create a separation between bags and shoes.

Sorting SSENSE products by category using a small number (6) of clusters

Comparing the four original categories, we see that except for the first cluster, each grouped items into one of four departments. Cluster 1 contains a mix of accessories and RTW but could be further separated if more sub-groupings were applied. The utility of sorting products by text is therefore effective at the highest level. The point of this exercise is to show that if I were to ask for product recommendations starting with a bag, other bags would be recommended, and so forth.

In practice, recommendations should be selected choosing a product’s five in-stock Nearest Neighbours. Recall that the goal of this exercise is to not only match shirts with other shirts etc, but most similar items within any category. There is no proper metric for quality-of-fit at this granularity; we will have to simply agree by consensus whether the suggestions ‘look about right’ (recommending a pair of pants with a shirt may or may not be appropriate depending on the circumstances).

Sample Recommendations

It is time to provide some real-life product suggestions based on our text comparisons. In the images below, the left-most item is the target, while the five items to the right are the suggestions as ranked based on the similarity of the text descriptions outlined in the previous section.

Footwear

Men’s and women’s ready-to-wear:

Men’s and women’s coats:

Accessories and bags:

I think we can agree that most of the suggestions are appropriate, no?

Conclusions

This product clustering experiment provides a means to gain support for more advanced product recommendation engines, thanks in part to the informative yet rigorous product description methodology we use at SSENSE. But this exercise is merely a beginning. As a product’s listing gains traction, our customized search suggestions return and take over. In the earliest stages of release, however, items can be relevantly connected based solely on textual information. Although we cannot be certain as to the relevance of the suggestions, this can be addressed, in part, by implementing a list of business rules to limit the scope of the recommendations. This will prevent awkward suggestions such as undergarments being blended with a search for pants.

Future Directions

Many real-world business applications for product listings can be built out from Natural Language Processing. Another by-product of text clustering is to build a set of distinctive keywords per cluster, which could be useful to refine internal search results or label brand groups. It is even possible, though challenging, to use this information for better keyword selection in marketing campaigns (which overlaps with my research objectives at SSENSE).

Finally, we can further improve our cold start recommendations. Product suggestions can be re-weighed based on their similarity of page views, price, or listing date. One could even leverage Google Trends to weigh listings based on general search interest. Since every product text comes with a set of pictures, more advanced applications can include pairing image recognition software such as Google Vision with our product text. I am not the first to consider this; the combination of visuals and text has been explored by Montreal’s Element AI in a recent collaboration with SSENSE. There are many areas to explore. Let’s see what the future holds!

Editorial reviews by Hussein Danish, Deanna Chow, Liela Touré & Prateek Sanyal

Want to work with us? Click here to see all open positions at SSENSE!

--

--

Graydon Snider
SSENSE-TECH

Former atmospheric scientist, now a data scientist at SSENSE