Enhanced Representation with Contrastive Loss for Long-Tail Query Classification in e-commerce (2022)

Abstract: Query classification is a fundamental task in an e-commerce search engine, which assigns one or multiple predefined product categories in response to each search query. Taking click-through logs as training data in deep learning methods is a common and effective approach for query classification. However, the frequency distribution of queries typically has long-tail property, which means that there are few logs for most of the queries. The lack of reliable user feedback information results in worse performance of long-tail queries compared with frequent queries. To solve the above problem, we propose a novel method that leverages an auxiliary module to enhance the representations of long-tail queries by taking advantage of reliable supervised information of variant frequent queries. The long-tail queries are guided by the contrastive loss to obtain category-aligned representations in the auxiliary module, where the variant frequent queries serve as anchors in the representation space. We train our model with real-world click data from AliExpress and conduct evaluation on both offline labeled data and online AB test. The results and further analysis demonstrate the effectiveness of our proposed method.

## introduction in the e-commerce search engine, query classification is a task to assign one or multiple predefined product categories to each search query. it is a fundamental component that recognizes the intent of user query and retrieves relevant products. the task of query classification can be basically viewed as a multi-label short text classification problem. deep learning methods are the mainstream approaches for query classification tasks nowadays. considering the massive amount of queries and categories, it's usually too expensive to collect train data by manually labeling. therefore, utilizing the click-through data as implicit feedback signals to build a model is the most common approach that predicts the categories of query @xcite . various deep models have achieved great success in query classification @xcite @xcite . to fully utilize the mutual information between the query and categories, some models convert the multi-label classification to a multiple binary classification task and obtain superior performance @xcite . however, the long-tail distribution of queries in e-commerce websites brings challenges to deep models. few high-frequency queries dominate in search input while low-frequency queries have a very low probability of occurrences. these lowfrequency queries are what we call long-tail queries and others are frequent queries. the users' feedback logs of long-tail queries are usually difficult to obtain and insufficient training data also result in a serious data noise problem. moreover, the product taxonomy in e-commerce websites usually consists of thousands of categories. the large amount of categories aggravates the sparsity of long-tail query-category feedback data. therefore, the lack and noise of training data cause the lower performance for long-tail queries compared with frequent queries in the task of query classification. another problem is that queries with slight lexical differences may have totally different category intents @xcite . queries in e-commerce are typically short and ambiguous @xcite . a modification of one word in the query could entirely change the corresponding category, such as "blouse collar" and "blouse with collar", or "pearl ring" and "pearl earring". this phenomenon hinders the deep models from classifying long-tail queries because there aren't enough examples to distinguish the intents of these lexically similar queries. in summary, query classification in real-world e-commerce scenarios differs from common text classification tasks in at least two aspects. at first, the supervised information is not entirely reliable especially for long-tail queries, depending on the query frequency in search logs. secondly, most queries are short and the textual information inside queries is very limited. inspired by the aforementioned observations, we propose a novel method to improve the performance of long-tail query classification. the basic idea of our method is to utilize the query frequency information and transfer knowledge from frequent queries to long-tail queries, which takes advantage of the fact that the click feedbacks of frequent queries are more reliable. for each query, we select several frequent queries as the variant queries, which are lexically similar to the original query. we use an auxiliary module coupled with a contrastive loss @xcite to enhance the representation of the original query by these variant queries. the variant queries serve as anchors in vector space while the auxiliary module aligns the representation vectors between original queries and variant queries in the view of category semantics. we conduct experiments on real-world click data from aliexpress 1 and also evaluate our method on the public dataset. the results suggest that significant improvement of long-tail query classification tasks on multiple metrics. we further conduct the comparison and visualization to verify the effect of our representation enhancement. the major contributions of this article are summarized as follows: ## methodology we introduce our proposed method in this section. we first give an overview of our method in section 3.1 and then demonstrate each module in detail from section 3.2 to 3.5. ## experiments we introduce the training and evaluation data set and the setting of our experiments in section 4.1. we discuss the performance and effectiveness of our proposed method with other methods in section 4.2 and 4.3.