AI-based HTS Code Classification: 5 Technical Ideas for Building Solutions that Work

Imports, exports and tariffs are quite the theme in the news these days, be it in the context of Brexit, the US-China trade war or the Iran nuclear deal. Executive decisions on what duties should be levied on goods crossing borders are the norm of the day. Have you ever wondered how these decisions are practically implemented at the ground-level though? The answer – Harmonized Tariff Schedules (HTS), a taxonomy built by the World Customs Organization (WCO) to classify and define internationally traded goods. Semantics3 offers automated HTS code classification solutions to help logistics providers modernize their customs workflows.

Harmonized Tariff Schedule (HTS) code classification is a surprisingly challenging machine learning problem – while at face value it is a simple multi-label classification, the real-world specifics are often deceptively intractable:

  • For starters, the quality of data available from most sources is rather poor, so automated decision making systems have to learn to pull in external knowledge, and to develop a good understanding of understood norms.
  • In addition, target code classes change across geographies and with time, requiring algorithms to keep an eye out for stale data.
  • What’s more, it’s surprisingly difficult to have trained human annotators agree on what the right HS code for a given product should be – in datasets annotated by trained professionals, we usually see differing labels for the same product at least 30% of the time.

How do you build automated systems that can deal with these challenges? In this article, I’ll cover five techniques that have helped us deal with these problems.

Click here to read the rest of this article on the Semantics3 blog

The State of Ecommerce – 2019 Report

Over the course of two weeks in February 2019, two Semantics3 engineers crawled the entire universe of dotcom domains looking for ecommerce sites. We built our numbers bottom up, surveying over 138.2 million dotcom sites and analyzing ~6 million merchants. This report presents the observations that we gathered. Scroll to the end to access a downloadable PDF and interactive infographic.

Most reports on the state of ecommerce inevitably focus on dynamics associated with the largest players alone, typically built on financial reports from listed companies. In this report, we aim to provide a different perspective of the industry in two key ways:

  • We’ve holistically looked at all stakeholders in the industry, not just a sampled non-random subset, by analyzing all active ecommerce dotcom websites.
  • We’ve explored diverse aspects of the industry, including third-party marketplaces, social media platforms, hosting platforms, promotional channels, product catalogs & categories and technical intricacies.

Click here to read the rest of this article on the Semantics3 blog

Principles for Managing Data & Product Quality

A couple of weeks ago, I posted a two part series detailing how we do data QA at Semantics3. In the days that followed, I’ve had people get in touch to discuss the best ways to establish or improve data/product quality initiatives at their own organizations. For some, the impetus was a desire to stem customer churn, and for others just to make customers happier.

Here were some of the common discussion points from these conversations:

  • Should we hire a dedicated QA analyst to solve our data quality issues?
  • What sort of profile should such a hire have?
  • How do you decide what your data QA budget should be?
  • How do you draw a line between automation and manual effort?
  • We don’t want to build on heuristics because they don’t scale – any alternatives?

The inherent theme in all of these questions was that everyone looking for a framework to think about quality analysis. So, while my previous posts addressed specific ways in which we do data QA at Semantics3, in this article, I’d like to speak to the philosophy behind them.

Click here to read the rest of this article on the Semantics3 blog

Mapping the Universe of E-commerce Brands

Of the thousands of attributes that we handle while curating product catalogs, the hardest and perhaps most important attribute is brand. Consumers often begin their searches with brand names of the products they’re looking for … which is why our customers (marketplaces, retailers, brands and logistics companies) are keen on having high coverage of standardized values for this field.

Unfortunately, many of the data sources from which we build our catalogs often fail to provide brand as an explicit field … or unwittingly carry an incorrect value in the brand field. In these cases, the challenge falls to us to build datasets that are robust to such issues. Specifically, this entails:

  • extracting brand provided as unstructured text in other fields provided in the listing such as name or description,
  • inferring brand where altogether absent,
  • standardizing the brand string to a unique representation consistent across the catalog.

Over the last 7 years, we’ve tried to tackle this problem in many different ways – hacks, statistical methods, NLP, heuristics, algorithms, annotation and more. In this article, I’d like to chronicle some of the approaches that’ve worked for us.

Click here to read the rest of this article on the Semantics3 blog

How we do Data QA @ Semantics3: Processes & Humans-in-the-Loop (Part 2)

In this second of two posts about data quality, I’d like to delve into the challenge of building and maintaining evolving datasets, i.e., datasets that are function of changing inputs and fuzzy algorithms and therefore subject to constant modification.

At Semantics3, we deal with many such datasets; we work with changing inputs like product and image URLs which vary depending on when they’re crawled, and machine learning algorithms that are regularly subject to data patterns that they might not have seen before. As a result, output datasets can change with time, and from one run to the next.

Run-by-run volatility of this kind is not inherently a bad thing, as long as the aggregate precision and recall of the dataset is kept in check. To do this, we have, over the years, developed a set of approaches that can be broadly divided into two groups – statistical & algorithmic techniques to detect issues, and human-in-the-loop processes to resolve them. In this second part, I’d like to share some of our learnings from the latter group.


In Part 1, we looked at automated techniques to detect data quality issues. In this post, we’ll look into how we resolve these problems, and try to ensure that they don’t crop up again.

Click here to read the rest of this article on the Semantics3 blog

How we do Data QA @ Semantics3: Statistics & Algorithms (Part 1)

In this first of two posts about data quality, I’d like to delve into the challenge of building and maintaining evolving datasets, i.e., datasets that are function of changing inputs and fuzzy algorithms and therefore subject to constant modification.

At Semantics3, we deal with many such datasets; we work with changing inputs like product and image URLs which vary depending on when they’re crawled, and machine learning algorithms that are regularly subject to data patterns that they might not have seen before. As a result, output datasets can change with time, and from one run to the next.

Run-by-run volatility of this kind is not inherently a bad thing, as long as the aggregate precision and recall of the dataset is kept in check. To do this, we have, over the years, developed a set of approaches that can be broadly divided into two groups – statistical & algorithmic techniques to detect issues, and human-in-the-loop processes to resolve them. In this first part, I’d like to share some of our learnings from the former group.


In any given month, we have billions of data-points that undergo some sort of change. At this volume, human review of every data point is infeasible. Therefore, we rely on automated techniques to direct our human reviewers to the pockets of data that are most likely to be problematic.

Below, I’ll run through some of the most powerful techniques that can also be generalized across domains.

Click here to read the rest of this article on the Semantics3 blog

How to Launch and Maintain Enterprise AI Products

There is a significant disconnect between the perception and reality of how enterprise AI products are built.

The narrative seems to be that given a business problem, the data science team sets about gathering a training dataset (for supervised problems) that reflects the desired output; when the dataset has been built, the team switches to the modelling phase during which various networks are experimented with, at the conclusion of which the network with the best metrics is deployed to production … job done, give it enough time and watch the money roll in.

https://xkcd.com/1838/

It’s Never That Simple

My experience building enterprise B2B products has been that this is only where the work begins. Freshly minted models rarely satisfy customers’ needs, out of the box, for two common reasons.

Click here to read the rest of this article on the Semantics3 blog

Deriving Meaning through Machine Learning: The Next Chapter in Retail

Three slides from Benedict Evans’ brilliant talk, The End of the Beginning, really caught my attention.

The Old and the New

Across industries, machine learning is helping us get to successive levels of meaning of what a thing is. It’s helping us explicitly understand what things are, a leap forward from the existing state of affairs, which rely on extrapolation through indirect inference. In the context of retail, the implications of this are significant. Here’s why.

Click here to read the rest of this article on the Semantics3 blog

Product Matching — A Visual Tribute

Product matching is a challenging data-science problem that we’ve been battling for several years at Semantics3. The variety of concepts and nuances that need to be taken into consideration to tame this problem has reduced our data-scientists to tears on more than one occasion.

In this week’s post, we decided to pay a visual tribute to product matching by showcasing some of the particularly difficult examples that we’ve come across over the years. Enjoy!

Click here to read the rest of this article on Medium