Abstract
Accurate commodity classification is essential for large-scale e-commerce platforms to ensure efficient search, recommendation, and inventory management. However, traditional models often struggle with the hierarchical nature of product categories and the linguistic complexity of Chinese text. This paper introduces HFT-BERT, a hierarchical fine-tuning model that leverages the contextual power of BERT combined with a level-by-level parameter transfer strategy. By utilizing a newly released dataset of over 1 million Chinese commodity listings (the JD-dataset), the researchers demonstrate that HFT-BERT significantly outperforms traditional flat and CNN-based hierarchical models, particularly in categories with complex, descriptive text.
Introduction
In the massive ecosystem of e-commerce platforms like JD.com, product categorization is a fundamental challenge. Sellers must navigate a multi-level "tree" of categories—selecting a broad department, a specific sub-category, and a granular product type. Relying on manual entry is slow, inconsistent, and prone to human error.
Automating this process falls under the domain of Hierarchical Text Classification (HTC). Most existing solutions treat categories as a "flat" list, ignoring the inherent logical relationships between parent and child nodes (e.g., "Electronics" vs. "Smartphones"). Furthermore, while many models perform adequately on short product titles, they often fail when faced with longer, more descriptive text, such as book summaries. HFT-BERT was developed to bridge this gap by combining modern Transformer architectures with a specialized hierarchical training strategy.
Methodology
The core of the proposed approach is the Hierarchical Fine-tuning BERT (HFT-BERT) model. Unlike standard classification models that attempt to predict all levels simultaneously or treat them independently, HFT-BERT employs a top-down "knowledge relay" mechanism.
1. The Foundation
The model utilizes BERT-base-Chinese as its backbone for feature extraction. BERT’s attention mechanism is particularly well-suited for Chinese text, where word boundaries are fluid and semantic context is vital for disambiguation.
2. Level-by-Level Fine-tuning
The training process is sequential. The model is first optimized to classify broad "Level 1" categories. Once this level is mastered, the specific model weights are passed down to serve as the initialization state for "Level 2" training, and the process repeats for Level 3. This ensures that the features learned at higher levels inform the more granular decisions made at lower levels.
3. Independent Classification Heads
While the core BERT parameters are shared and refined across levels, each level maintains its own unique "classification head" consisting of Dropout and Fully Connected layers. This architecture prevents the specific nuances of a granular sub-category from "polluting" the general knowledge required for broader category identification.
The JD-Dataset
A significant contribution of this research is the release of the JD-dataset, a large-scale benchmark for Chinese commodity classification.
- Scale: 1,011,450 products.
- Structure: A three-level hierarchy.
- Scope: Focuses on four primary Level 1 branches: Fresh, Household Appliances, Digital Products, and Books.
- Complexity: While most items use titles, the Books category includes full product descriptions, providing a "longer short text" challenge to test the model's contextual understanding.
Experimental Results and Discussion
The researchers compared HFT-BERT against three primary baselines: Flat-CNN, Hier-CNN, and HFT-CNN. The results highlighted several key insights:
The Hierarchy Advantage
While flat models (like Flat-CNN) perform reasonably well on top-level categories due to the volume of training data, their performance degrades significantly at deeper levels. HFT-BERT maintains high accuracy by preserving the logical relationships between parent and child categories.
The "Book" Breakthrough
The most striking performance gap occurred in the Books category. Because book descriptions are linguistically diverse and longer than standard product titles (e.g., "4K TV"), the pre-trained knowledge in BERT provided a massive advantage.
- Level 2 Accuracy: HFT-BERT achieved 95.01% accuracy in Books, compared to approximately 91% for CNN-based models.
- Level 3 Accuracy: In the deepest level of the hierarchy for Books, HFT-BERT reached 92.31% accuracy. In contrast, all baseline models hovered between 47% and 49%, representing a near-doubling of performance.
Consistency Across Categories
For more standard categories like Fresh, Appliances, and Digital Products, HFT-BERT maintained a consistent accuracy of approximately 98% at Level 3, outperforming the baselines by a margin of 4-5%.
Conclusion and Future Work
HFT-BERT demonstrates that combining the semantic depth of BERT with a hierarchical fine-tuning strategy is highly effective for complex e-commerce classification tasks. The model's ability to handle long-form descriptions in the Books category suggests it is more robust than traditional CNN-based approaches.
However, limitations remain. Some categories remain inherently vague (e.g., a "range hood" appearing in both "Small Kitchen Appliances" and "Commercial Appliances"). Future research will explore incorporating multi-modal data—such as product images and technical specifications—to resolve these ambiguities and further expanding the dataset to include more diverse commodity branches.
Summary updated