Commodity classification method and commodity classification model construction method and device

By using causal reinforcement learning templates and a dynamic weighted multi-space answer prediction method, the problems of low efficiency and insufficient accuracy in product classification are solved, achieving efficient and accurate automatic classification of product categories. Dynamic weighting processing using Euclidean and hyperbolic space distances improves the accuracy and efficiency of product classification.

CN117807232BActive Publication Date: 2026-07-03WUHAN UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN UNIV
Filing Date
2023-12-29
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In existing technologies, commodity classification methods are inefficient and lack accuracy. In particular, when faced with the rapidly increasing number and diversity of commodities, traditional methods are inefficient, while deep learning models suffer from inconsistencies between the pre-training and fine-tuning stages, affecting classification accuracy.

Method used

The text of the products to be classified is concatenated using a causal reinforcement learning template. Combined with the preset product category code, feature extraction and dynamic weighted fusion are performed through a product classification model. Multi-level semantic and hierarchical feature mapping is performed using Euclidean space and hyperbolic space distance. The Euclidean space distance and hyperbolic space distance are calculated and dynamically weighted to achieve automatic classification of product categories.

Benefits of technology

It improves the accuracy and efficiency of product classification, avoids the complexity of manual design, and makes full use of the semantic and hierarchical information of product tags to achieve efficient automated product category classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117807232B_ABST
    Figure CN117807232B_ABST
Patent Text Reader

Abstract

A product classification method, a product classification model construction method, and an apparatus are disclosed, relating to the field of product category prediction. The method includes acquiring the text of the product to be classified and the product category code; concatenating the text of the product to be classified based on a causal reinforcement learning template including contextual feature objects, causal words, and causal inference feature objects of the product text to obtain a target sequence; inputting the target sequence and the product category code into a product classification model for feature extraction and dynamic weighted fusion of the target sequence to obtain fused features; performing multi-level semantic and hierarchical feature mapping on the fused features, and performing product category dependency and hierarchical feature mapping based on the product category code; calculating Euclidean space distance and hyperbolic space distance based on the mapping results; and dynamically weighting the Euclidean space distance and hyperbolic space distance to obtain a classification result corresponding to the text of the product to be classified, thereby improving the accuracy of product classification while ensuring classification efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of commodity category prediction technology, specifically to a commodity classification method, a commodity classification model construction method, and an apparatus. Background Technology

[0002] With the rapid development of the internet, e-commerce and online shopping have become the mainstream channels for people to purchase goods. In e-commerce scenarios, each product belongs to a category, which is often part of a tree-like category system containing parent and subcategories. The main goal of product classification is to group products into different categories or subcategories so that shopping websites can better organize and display products, helping users quickly find items they are interested in. However, with the dramatic increase in the number of products, how to efficiently and accurately automate product classification remains a common challenge for both academia and industry.

[0003] In related technologies, the mainstream product classification methods fall into two categories: (1) Traditional product classification methods usually rely on manually formulated rules and keywords. This method is inefficient and inflexible, and cannot cope with the rapidly increasing number and diversity of products; (2) In recent years, with the rapid development of neural networks and deep learning, many works have proposed to use pre-trained language models to automatically learn and extract product text features. For example, BERT and its variant models are used to map input text to high-dimensional vectors to obtain richer feature representations. However, due to the inconsistency between the pre-training and fine-tuning stages of such models, their ability to express features and understand information is weak, which in turn affects the accuracy of product classification. Therefore, how to effectively improve the accuracy of product classification while ensuring the efficiency of product classification is an urgent problem to be solved. Summary of the Invention

[0004] This application provides a product classification method, a product classification model construction method, and an apparatus, which can effectively improve the accuracy of product classification while ensuring the efficiency of product classification.

[0005] In a first aspect, embodiments of this application provide a product classification method, the product classification method comprising:

[0006] The text of the product to be classified and the preset product category code are obtained, and the text of the product to be classified is concatenated based on the preset causal reinforcement learning template to obtain the target sequence. The causal reinforcement learning template includes context feature objects, causal words and causal inference feature objects of product text.

[0007] The target sequence and product category code are input into a pre-defined product classification model, which extracts features from the target sequence and dynamically weights and fuses them to obtain fused features. The fused features are then subjected to multi-level semantic and hierarchical feature mapping, and product category dependency and hierarchical feature mapping are performed based on the product category code. The Euclidean space distance and hyperbolic space distance are calculated based on the mapping results. The Euclidean space distance and hyperbolic space distance are then dynamically weighted to obtain the classification result corresponding to the text of the product to be classified.

[0008] In conjunction with the first aspect, in one implementation, the step of extracting features from the target sequence and dynamically weighting and fusing them to obtain fused features includes:

[0009] Based on context feature objects, causal words, and product text causal reasoning feature objects, feature extraction is performed on the target sequence to obtain target context features and target causal reasoning features.

[0010] Max pooling is performed on the target context features to obtain the pooling result;

[0011] The pooling results and the target causal inference features are dynamically weighted and fused to obtain the fused features.

[0012] In conjunction with the first aspect, in one implementation, the step of performing multi-level semantic and hierarchical feature mapping on the fused features, and performing product category dependency and hierarchical feature mapping based on product category encoding, includes:

[0013] The fused features are linearly transformed to obtain the semantic features of the product.

[0014] By performing hyperbolic space mapping on the semantic features of the products, the hierarchical features of the products can be obtained.

[0015] Based on graph attention network and product category coding, inter-category dependency features are extracted to obtain category dependency features;

[0016] Hyperbolic space mapping is performed on category dependency features to obtain category hierarchical features;

[0017] The semantic features of the product, the hierarchical features of the product, the category-dependent features, and the category-hierarchical features are used as the mapping results.

[0018] In conjunction with the first aspect, in one implementation, calculating the Euclidean space distance and the hyperbolic space distance based on the mapping results includes:

[0019] Euclidean spatial distance is calculated based on product semantic features and category dependency features;

[0020] Hyperbolic space mapping is calculated based on product hierarchical features and category hierarchical features.

[0021] Secondly, embodiments of this application provide a commodity sorting device, the commodity sorting device comprising:

[0022] The processing unit is used to acquire the product text to be classified and the preset product category code, and to concatenate the product text to be classified based on the preset causal reinforcement learning template to obtain the target sequence. The causal reinforcement learning template includes context feature objects, causal words and product text causal inference feature objects.

[0023] The classification unit is used to input the target sequence and product category code into a preset product classification model, so that the product classification model can extract features from the target sequence and dynamically weight and fuse them to obtain fused features; perform multi-level semantic and hierarchical feature mapping on the fused features, and perform product category dependency and hierarchical feature mapping based on the product category code, and calculate Euclidean space distance and hyperbolic space distance based on the mapping results; and perform dynamic weighting processing on the Euclidean space distance and hyperbolic space distance to obtain the classification result corresponding to the text of the product to be classified.

[0024] In conjunction with the second aspect, in one implementation, the step of extracting features from the input sequence and dynamically weighting and fusing them to obtain fused features includes:

[0025] Based on context feature objects, causal words, and product text causal reasoning feature objects, feature extraction is performed on the input sequence to obtain target context features and target causal reasoning features.

[0026] Max pooling is performed on the target context features to obtain the pooling result;

[0027] The pooling results and the target causal inference features are dynamically weighted and fused to obtain the fused features.

[0028] In conjunction with the second aspect, in one implementation, the step of performing multi-level semantic and hierarchical feature mapping on the fused features, and performing product category dependency and hierarchical feature mapping based on historical product category encoding, includes:

[0029] The fused features are linearly transformed to obtain the semantic features of the product.

[0030] By performing hyperbolic space mapping on the semantic features of the products, the hierarchical features of the products can be obtained.

[0031] Based on graph attention network and historical product category coding, inter-category dependency features are extracted to obtain category dependency features;

[0032] Hyperbolic space mapping is performed on category dependency features to obtain category hierarchical features;

[0033] The semantic features of the product, the hierarchical features of the product, the category-dependent features, and the category-hierarchical features are used as the mapping results.

[0034] In conjunction with the second aspect, in one implementation, calculating the Euclidean space distance and the hyperbolic space distance based on the mapping results includes:

[0035] Euclidean spatial distance is calculated based on product semantic features and category dependency features;

[0036] Hyperbolic space mapping is calculated based on product hierarchical features and category hierarchical features.

[0037] Thirdly, embodiments of this application provide a method for constructing a commodity classification model, the method comprising:

[0038] Historical product text and historical product categories are obtained. The historical product text is concatenated based on a preset causal reinforcement learning template to obtain an input sequence. The causal reinforcement learning template includes context feature objects, causal words, and causal inference feature objects of product text. The historical product categories are encoded to obtain historical product category codes. The input sequence and historical product category codes constitute a dataset.

[0039] A neural network model is constructed, comprising a feature extraction module, a feature mapping module, and a classification prediction module. The feature extraction module extracts features from the input sequence and dynamically weights and fuses them to obtain fused features. The feature mapping module performs multi-level semantic and hierarchical feature mapping on the fused features and performs product category dependency and hierarchical feature mapping based on historical product category codes. The classification prediction module calculates Euclidean space distance and hyperbolic space distance based on the mapping results, performs dynamic weighting on the Euclidean space distance and hyperbolic space distance, and obtains the classification result corresponding to the historical product text.

[0040] The neural network model is trained based on the dataset to obtain a product classification model, which is then used to classify products.

[0041] Fourthly, embodiments of this application provide a product classification model building apparatus, the product classification model building apparatus comprising:

[0042] The data acquisition unit is used to acquire historical product text and historical product categories, and to concatenate the historical product text based on a preset causal reinforcement learning template to obtain an input sequence. The causal reinforcement learning template includes context feature objects, causal words, and causal inference feature objects of product text. The historical product categories are encoded to obtain historical product category codes. The input sequence and the historical product category codes constitute a dataset.

[0043] A training unit is constructed to build a neural network model. The neural network model includes a feature extraction module, a feature mapping module, and a classification prediction module. The feature extraction module extracts features from the input sequence and dynamically weights and fuses them to obtain fused features. The feature mapping module performs multi-level semantic and hierarchical feature mapping on the fused features and performs product category dependency and hierarchical feature mapping based on historical product category codes. The classification prediction module calculates Euclidean and hyperbolic spatial distances based on the mapping results, dynamically weights the Euclidean and hyperbolic spatial distances, and obtains the classification results corresponding to historical product texts. The neural network model is trained based on the dataset to obtain a product classification model, which is used to classify products.

[0044] The beneficial effects of the technical solutions provided in this application include:

[0045] By concatenating causal reinforcement learning templates, including contextual feature objects, causal words, and causal inference feature objects of product text, the product classification model can fully understand the prediction target. Dynamic semantic fusion at the contextual and causal inference levels is achieved by dynamically weighting the target sequence. At the same time, by introducing distance weighting in Euclidean and hyperbolic spaces, the semantic and hierarchical information of product tags is fully utilized, thereby accurately achieving automatic classification of product categories without manual classification. This not only effectively ensures the efficiency of product classification but also effectively improves the accuracy of product category prediction. Attached Figure Description

[0046] Figure 1 This is a flowchart illustrating an embodiment of the product classification method of this application;

[0047] Figure 2 This is a flowchart illustrating an embodiment of the product classification model construction method of this application. Detailed Implementation

[0048] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0049] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0050] Firstly, embodiments of this application provide a product classification method.

[0051] In one embodiment, reference is made to Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the product classification method of this application. Figure 1 As shown, product classification methods include:

[0052] Step S10: Obtain the product text to be classified and the preset product category code, and concatenate the product text to be classified based on the preset causal reinforcement learning template to obtain the target sequence. The causal reinforcement learning template includes context feature objects, causal words and product text causal inference feature objects.

[0053] Exemplary and understandable, the product text can preferably be unstructured product description text, which may include product titles, product details, etc. However, the specific information included can be determined according to actual needs and is not limited here. In this embodiment, word vector representation tools such as GloVe (Global Vectors for Word Representation, a word representation tool based on global word frequency statistics) can be used to encode each pre-collected product category to obtain the product category code corresponding to each product category, thus forming a preset product category code. Specifically, the product category is first segmented into words, and the vector code corresponding to the word is searched in the GloVe word vector dictionary. If the dictionary does not contain the current word, random initialization is performed. After the word to which the current product category belongs is encoded, average pooling is used to aggregate the vectors of multiple words, and the aggregation result is used as the vector code of the product category, thus obtaining the product category code h. e It should be noted that the product category codes used in actual applications are the same as the historical product category codes used during model training.

[0054] In this embodiment, a causal reinforcement-based prompt learning template (i.e., causal reinforcement learning template) will be pre-constructed to concatenate the text Context1 of the product to be classified, thereby obtaining the target sequence corresponding to the causal reinforcement learning template.

[0055] The causal reinforcement learning template includes context feature objects, causal words, and product text causal inference feature objects. Specifically, based on the product text Context1 to be classified, [CLS] and [SEP] labels are added before and after it, respectively. At the same time, causal words (such as "therefore") are added to the template, and the product text causal inference feature [MASK] is added after the causal words, as detailed below:

[0056] [CLS]Context1[SEP], therefore, this product belongs to the [MASK] category.

[0057] It should be understood that in text classification tasks, [CLS] represents the beginning of a sentence or document, and [SEP] represents the end of a sentence or document. That is, [CLS] and [SEP] represent contextual feature objects, and [MASK] represents the causal inference feature object for the product text. Specifically, for the product text Context1 to be classified, the user will tag keywords used to predict the product category.

[0058] This embodiment adds causal cue text, enabling the product classification model to better understand the causal relationships in the text. This helps the model understand the prediction content of the [MASK] section, thereby improving the performance of product category prediction.

[0059] Step S20: Input the target sequence and product category code into the preset product classification model so that the product classification model can extract features from the target sequence and dynamically weight and fuse them to obtain fused features; perform multi-level semantic and hierarchical feature mapping on the fused features, and perform product category dependency and hierarchical feature mapping based on the product category code; calculate the Euclidean space distance and hyperbolic space distance based on the mapping results; perform dynamic weighting processing on the Euclidean space distance and hyperbolic space distance to obtain the classification result corresponding to the product text to be classified.

[0060] As an example, in this embodiment, after obtaining the target sequence, the target sequence and the product category code are processed by a pre-trained product classification model to achieve category classification prediction of the product text to be classified. The product classification model can be any of the language models such as BERT and RoBERTa.

[0061] Specifically, after inputting the target sequence into the pre-trained product classification model, the feature representations of the [CLS], [SEP], and [MASK] positions of the last layer of the pre-trained product classification model are obtained respectively, and dynamically weighted fusion is performed to obtain fused features. Then, the fused features are connected to multiple linear layers to map to multiple levels corresponding to product categories, and are used as multi-level product semantic features. At the same time, the multi-level semantic features are further mapped to a multi-level hyperbolic space, and are used as product hierarchical features. For product categories with hierarchical structures, this embodiment will utilize graph attention networks and product categories. Category encoding extracts inter-category dependency features and further maps these features to hyperbolic space to obtain category-level features. Then, it calculates the Euclidean distance between product semantic features and category dependency features, as well as the hyperbolic distance between product-level features and category-level features. Finally, it dynamically weights and fuses the Euclidean and hyperbolic distances, using the fusion result as the prediction confidence for each category in the multi-space model. The category with the highest confidence is selected as the final predicted category for the product text to be classified. This dynamic weighted multi-space answer prediction method achieves product category classification prediction.

[0062] Therefore, this embodiment uses a causal reinforcement learning template, including contextual feature objects, causal words, and causal inference feature objects of product text, to concatenate the product text to be classified. This allows the product classification model to fully understand the prediction target. Furthermore, dynamic semantic fusion between the contextual and causal inference levels is achieved through dynamic weighting of the target sequence. Simultaneously, by introducing distance weighting in Euclidean and hyperbolic spaces, the semantic and hierarchical information of product tags is fully utilized, thus enabling accurate automatic classification of product categories without manual classification. This not only effectively ensures product classification efficiency but also significantly improves the accuracy of product category prediction. Moreover, it is understood that in traditional cue learning methods, after predicting the features of the [MASK] position, a label mapper often needs to be constructed manually. The complex manual design and limited label space severely limit the effectiveness of cue learning. However, this embodiment uses a dynamically weighted multi-space answer prediction method to avoid the complexity and limitations of selecting label spaces based on experience, improving prediction accuracy while reducing the complexity of manual design.

[0063] Furthermore, in one embodiment, the step of extracting features from the target sequence and dynamically weighting and fusing them to obtain fused features includes:

[0064] Based on context feature objects, causal words, and product text causal reasoning feature objects, feature extraction is performed on the target sequence to obtain target context features and target causal reasoning features.

[0065] Max pooling is performed on the target context features to obtain the pooling result;

[0066] The pooling results and the target causal inference features are dynamically weighted and fused to obtain the fused features.

[0067] In this exemplary embodiment, feature representations of the [CLS], [SEP], and [MASK] positions in the last layer of the product classification model are obtained to acquire target context features corresponding to [CLS] and [SEP], and target causal inference features corresponding to the [MASK] position. Max pooling is then performed on the target context features, and the pooling result is dynamically weighted and fused with the target causal inference features to obtain the fused feature X. t The details are as follows:

[0068] X t =W1(MaxPooling(X) cls ,X sep ))+W2X mask

[0069] In the formula, X cls X sep X mask The embedding representations of [CLS], [SEP], and [MASK] are shown below. W1 and W2 represent dynamic weight matrices used to control the contribution of contextual features and causal inference features of product text. Their specific values ​​can be determined according to actual needs and are not limited here. Therefore, this embodiment achieves dynamic semantic fusion at the contextual and causal inference levels by dynamically weighting features at different locations, thereby improving the accuracy of classification prediction results.

[0070] Further, in one embodiment, the step of performing multi-level semantic and hierarchical feature mapping on the fused features, and performing product category dependency and hierarchical feature mapping based on product category encoding, includes:

[0071] The fused features are linearly transformed to obtain the semantic features of the product.

[0072] By performing hyperbolic space mapping on the semantic features of the products, the hierarchical features of the products can be obtained.

[0073] Based on graph attention network and product category coding, inter-category dependency features are extracted to obtain category dependency features;

[0074] Hyperbolic space mapping is performed on category dependency features to obtain category hierarchical features;

[0075] The semantic features of the product, the hierarchical features of the product, the category-dependent features, and the category-hierarchical features are used as the mapping results.

[0076] As an example, in this embodiment, the fused feature X after dynamic weighted fusion is... t By accessing multiple linear layers, the semantic features of the Euclidean space product text corresponding to each layer's category (i.e., product semantic features) can be obtained. The details are as follows:

[0077]

[0078] In the formula, W' represents the feature representation of the l-th level of the corresponding product category. l and W l Let represent the linear transformation matrix of the l-th layer, where when l = 0,

[0079] Then, based on the semantic features of commodities at various category levels in Euclidean space. These are mapped to hyperbolic space, and the mapping results are used as the hierarchical structure features (i.e., product hierarchical features) of that space. Considering the extremely high complexity and difficulty of converting all Euclidean space operations (including addition, subtraction, multiplication, and division) of the deep neural network into hyperbolic space operations, this embodiment simplifies the conversion between Euclidean space and hyperbolic space.

[0080] Specifically, the obtained semantic features of the goods The network passes through a linear layer and an activation function layer respectively to ensure network stability, as detailed below:

[0081]

[0082] In the formula, Representing the semantic features of goods The features obtained after processing by linear layers and activation function layers and These represent the linear transformation matrix and the bias term, respectively.

[0083] Regarding the above features Hyperbolic space mapping can be performed, specifically using the Poincaré mapping in hyperbolic space, that is, the product hierarchy features can be obtained through the following formula:

[0084]

[0085] In the formula, This indicates the hierarchical characteristics of the product.

[0086] In this embodiment, based on the product category code h e Furthermore, a graph attention network is used to extract the dependency features between categories, thereby obtaining the category dependency features. Specifically, for each category, we first calculate its similarity coefficients with its neighbors and itself, and then normalize them to obtain the attention coefficient α. ij Wherein, the "neighbors" are predefined associations between product categories, calculated using the following formula:

[0087]

[0088] In the formula, a(·) represents a single-layer feedforward neural network, and [·‖·] represents the concatenation operation. This represents the category code for the i-th type of goods. W represents the category code for the j-th product class. g The weight matrix represents the linear transformation.

[0089] Then, based on the obtained attention coefficient α ij Perform a weighted summation on the features and then sum the results. This serves as the final representation of category-dependent features.

[0090]

[0091] Where || represents a multi-head splicing operation, K represents the number of attention heads, and W k Let σ represent the weight of the k-th attention head, and σ represent the activation function.

[0092] Similarly, with the aforementioned product hierarchy characteristics The mapping method and principle are the same, depending on the product category features. Perform a hyperbolic space mapping to obtain the hierarchical features of product categories within the hyperbolic space, i.e., obtain the category hierarchy features.

[0093] Further, in one embodiment, calculating the Euclidean space distance and hyperbolic space distance based on the mapping result includes:

[0094] Euclidean spatial distance is calculated based on product semantic features and category dependency features;

[0095] Hyperbolic space mapping is calculated based on product hierarchical features and category hierarchical features.

[0096] As an example, this embodiment will use a dynamic weighted multi-space answer prediction method to predict product categories. Specifically, it first calculates the semantic features of products at each level. Category-dependent features The Euclidean dot product is used to obtain the Euclidean distance. Specifically as follows:

[0097]

[0098] Then calculate the product hierarchical features at each level. Category hierarchy features hyperbolic space distance Specifically as follows:

[0099]

[0100] in, To represent the Möbius operation, taking two vectors u and v as an example, the Möbius calculation formula is as follows:

[0101]

[0102] Finally, regarding European spatial distance and hyperbolic space distance A weighted fusion is performed, and the weighted fusion result is used as the category prediction confidence level for multi-space fusion. It should be understood that since the greater the distance, the lower the confidence level should be (i.e., an inverse relationship), the score needs to be subjected to a negative logarithm operation before it can be used as the final confidence level for the category, as follows:

[0103]

[0104] Among them, α and β are used as multi-space dynamic weighted fusion parameters, which can be dynamically adjusted continuously as the model is trained.

[0105] Secondly, embodiments of this application also provide a commodity sorting device.

[0106] In one embodiment, the product sorting device includes:

[0107] The processing unit is used to acquire the product text to be classified and the preset product category code, and to concatenate the product text to be classified based on the preset causal reinforcement learning template to obtain the target sequence. The causal reinforcement learning template includes context feature objects, causal words and product text causal inference feature objects.

[0108] The classification unit is used to input the target sequence and product category code into a preset product classification model, so that the product classification model can extract features from the target sequence and dynamically weight and fuse them to obtain fused features; perform multi-level semantic and hierarchical feature mapping on the fused features, and perform product category dependency and hierarchical feature mapping based on the product category code, and calculate Euclidean space distance and hyperbolic space distance based on the mapping results; and perform dynamic weighting processing on the Euclidean space distance and hyperbolic space distance to obtain the classification result corresponding to the text of the product to be classified.

[0109] Furthermore, in one embodiment, the product classification model is specifically used for:

[0110] Based on context feature objects, causal words, and product text causal reasoning feature objects, feature extraction is performed on the target sequence to obtain target context features and target causal reasoning features.

[0111] Max pooling is performed on the target context features to obtain the pooling result;

[0112] The pooling results and the target causal inference features are dynamically weighted and fused to obtain the fused features.

[0113] Furthermore, in one embodiment, the product classification model is specifically used for:

[0114] The fused features are linearly transformed to obtain the semantic features of the product.

[0115] By performing hyperbolic space mapping on the semantic features of the products, the hierarchical features of the products can be obtained.

[0116] Based on graph attention network and product category coding, inter-category dependency features are extracted to obtain category dependency features;

[0117] Hyperbolic space mapping is performed on category dependency features to obtain category hierarchical features;

[0118] The semantic features of the product, the hierarchical features of the product, the category-dependent features, and the category-hierarchical features are used as the mapping results.

[0119] Furthermore, in one embodiment, the product classification model is specifically used for:

[0120] Euclidean spatial distance is calculated based on product semantic features and category dependency features;

[0121] Hyperbolic space mapping is calculated based on product hierarchical features and category hierarchical features.

[0122] The functions of each module in the above-mentioned commodity classification device correspond to the steps in the above-mentioned commodity classification method embodiment, and their functions and implementation processes will not be described in detail here.

[0123] Thirdly, embodiments of this application provide a method for constructing a commodity classification model.

[0124] In one embodiment, reference is made to Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the product classification model construction method of this application. Figure 2 As shown, the methods for building a product classification model include:

[0125] Step N10: Obtain historical product text and historical product categories. Based on a preset causal reinforcement learning template, concatenate the historical product text to obtain an input sequence. The causal reinforcement learning template includes context feature objects, causal words, and causal inference feature objects of product text. Encode the historical product categories to obtain historical product category codes. The input sequence and historical product category codes constitute a dataset.

[0126] As an example, this embodiment will perform data collection and preprocessing to form a dataset. Specifically, historical product text information and historical product categories will be collected first. The product text information includes product titles, product details, etc. In this embodiment, the historical product text is the product title. The collected historical data will be preprocessed, such as constructing a hierarchical structure of product categories. It should be noted that this embodiment can use existing, directly usable event detection datasets (such as AliExpress product datasets); of course, for specific needs, a labeled dataset can also be constructed by collecting product data for a specific e-commerce platform and using manual annotation methods. For example, for predefined product categories, the relationships and hierarchical relationships between them can be manually constructed (such as first-level categories, second-level categories, ..., leaf categories), thereby constructing a hierarchical structure of categories.

[0127] In this embodiment, word vector representation tools such as GloVe (Global Vectors for Word Representation) can be used to encode each of the previously collected historical product categories to obtain the historical product category code corresponding to each historical product category. Specifically, the historical product categories are first segmented into words, and the vector code corresponding to each word is searched in the GloVe word vector dictionary. If the dictionary does not contain the current word, random initialization is performed. After the word codes of the current product category are completed, average pooling is used to aggregate the vectors of multiple words, and the aggregation result is used as the vector code of the historical product category, thus obtaining the historical product category code h. e .

[0128] This embodiment will also pre-construct a causal reinforcement learning template to concatenate historical product text, thereby obtaining an input sequence corresponding to the causal reinforcement learning template. Based on the input sequence and historical product category codes, a dataset can be constructed, which can be divided into a training set, a validation set, and a test set. The causal reinforcement learning template includes a context feature object, causal words, and a product text causal inference feature object. Specifically, based on the historical product text Context2, [CLS] and [SEP] tags are added before and after it, respectively. Causal words (such as "therefore") are added to the template, and the product text causal inference feature [MASK] is added after the causal words, as detailed below:

[0129] [CLS]Context2[SEP], therefore, this product belongs to the [MASK] category.

[0130] It should be understood that in text classification tasks, [CLS] represents the beginning of a sentence or document, and [SEP] represents the end of a sentence or document. That is, [CLS] and [SEP] represent contextual feature objects, and [MASK] represents causal inference feature objects for product texts.

[0131] This embodiment transforms the product category prediction task into a cue-based learning task by incorporating causal cue text. This maintains consistency between the pre-training and fine-tuning phases, allowing the product classification model to more fully understand the causal relationships within the text. This improves the model's understanding of the [MASK] portion of the prediction, thereby enhancing the performance of product category prediction. Furthermore, this cue-based learning method fully leverages the rich semantic knowledge acquired during pre-training to provide the model with richer and more effective feature representations, ultimately improving the model's classification accuracy and generalization ability.

[0132] Step N20: Construct a neural network model, which includes a feature extraction module, a feature mapping module, and a classification prediction module. The feature extraction module is used to extract features from the input sequence and dynamically weight and fuse them to obtain fused features. The feature mapping module is used to perform multi-level semantic and hierarchical feature mapping on the fused features, and to perform product category dependency and hierarchical feature mapping based on historical product category codes. The classification prediction module is used to calculate Euclidean space distance and hyperbolic space distance based on the mapping results, and to dynamically weight the Euclidean space distance and hyperbolic space distance to obtain the classification result corresponding to the historical product text.

[0133] As an example, in this embodiment, any one of the language models such as BERT and RoBERTa can be used as a prototype to construct a neural network model. The neural network model includes a feature extraction module, a feature mapping module, and a classification prediction module. The feature extraction module is used to extract features from the input sequence and dynamically weight and fuse them to obtain fused features. The feature mapping module is used to perform multi-level semantic and hierarchical feature mapping on the fused features, and to perform product category dependency and hierarchical feature mapping based on historical product category codes. The classification prediction module is used to calculate the Euclidean space distance and hyperbolic space distance based on the mapping results, and to dynamically weight the Euclidean space distance and hyperbolic space distance to obtain the classification result corresponding to the historical product text.

[0134] Specifically, the feature extraction module is used to obtain the feature representations of the [CLS], [SEP], and [MASK] positions of the last layer of the neural network model, and perform dynamic weighted fusion to obtain fused features. Then, the feature mapping module connects the fused features to multiple linear layers to map them to multiple levels corresponding to the product categories, and uses them as multi-level product semantic features. At the same time, the multi-level semantic features are further mapped to multi-level hyperbolic spaces and used as product hierarchical features. For product categories with hierarchical structures, this embodiment will use graph attention networks and historical product category encoding to classify categories. The system extracts inter-category dependency features and maps them to hyperbolic space to obtain category-level features. Then, the classification prediction module calculates the Euclidean distance between the product semantic features and the category dependency features, as well as the hyperbolic distance between the product-level features and the category-level features. The Euclidean and hyperbolic distances are dynamically weighted and fused, and the fusion result is used as the prediction confidence of each category in the multi-space model. The category with the highest confidence is selected as the final predicted category of the product text to be classified. In other words, the classification prediction of product categories is achieved through a dynamic weighted multi-space answer prediction method.

[0135] Step N30: ​​Train the neural network model based on the dataset to obtain a product classification model, so as to achieve product classification through the product classification model.

[0136] As an example, in this embodiment, the constructed neural network is trained using the training set in the dataset, and the training results are verified and tested using the validation set and test set, respectively. After training is complete, a product classification model for implementing product classification can be obtained. It should be understood that this embodiment involves classifying products based on product text information. Specifically, for each level of category, the category with the highest confidence in the prediction results is used as the product classification for the current level.

[0137] It should be noted that in this embodiment, cross-entropy can be used as the loss function during network training. Specifically, the cross-entropy between the predicted category and the actual category at each level of the instance is calculated and then averaged. Furthermore, this embodiment can also use AdamW as the network optimizer. Compared to neural networks based entirely on hyperbolic space, which require manifold optimization such as Riemannian-SGD or Riemannian-Adam optimizers, the learnable parameters in this embodiment are still located in Euclidean space. Therefore, AdamW, which is suitable for Euclidean space parameter optimization, can be used as the optimizer.

[0138] Therefore, this embodiment uses a causal reinforcement learning template, including contextual feature objects, causal words, and causal inference feature objects of product text, to concatenate historical product text, maintaining consistency between the pre-training and fine-tuning stages. This allows the product classification model to fully understand the prediction target. Furthermore, dynamic semantic fusion between the contextual and causal inference levels is achieved through dynamic weighting of the target sequence. Simultaneously, by introducing distance weighting in Euclidean and hyperbolic spaces, the semantic and hierarchical information of product tags is fully utilized, enabling accurate automatic classification of product categories without manual classification. This not only effectively ensures product classification efficiency but also significantly improves the accuracy of product category prediction. Moreover, it is understood that in traditional cue learning methods, after predicting the features of the [MASK] position, a label mapper often needs to be constructed manually. The complex manual design and limited label space severely restrict the effectiveness of cue learning. However, this embodiment uses a dynamically weighted multi-space answer prediction method to avoid the complexity and limitations of selecting label spaces based on experience, improving prediction accuracy while reducing the complexity of manual design.

[0139] Furthermore, in one embodiment, the step of extracting features from the input sequence and dynamically weighting and fusing them to obtain fused features includes:

[0140] Based on context feature objects, causal words, and product text causal reasoning feature objects, feature extraction is performed on the input sequence to obtain target context features and target causal reasoning features.

[0141] Max pooling is performed on the target context features to obtain the pooling result;

[0142] The pooling results and the target causal inference features are dynamically weighted and fused to obtain the fused features.

[0143] In this exemplary embodiment, the product text in the input sequence is first segmented into words, converting it into data that can be processed in the vocabulary, i.e., multiple terms. Then, word vectors are generated through a word vector layer, and positional codes for each term are generated using sine and cosine transforms. The network input is then the sum of the word vectors and positional codes, which is used as the text vector. The text vector is then used as the network input. Next, the semantic information of the sentence and the dependency information between terms are extracted using a self-attention module. Finally, the features at the [CLS], [SEP], and [MASK] positions of the last layer of the self-attention module are extracted to obtain the target context features corresponding to [CLS] and [SEP] and the target causal reasoning features corresponding to the [MASK] position.

[0144] Specifically, the purpose of word segmentation for product text is to convert the text into data that can be processed using a vocabulary, which can be represented as w = {w1, w2, ..., w...} n}, where w i This is represented as the word term located at the i-th position in the product text after word segmentation; then, the corresponding n×D-dimensional word vector is generated through the word vector layer, which can be represented as v={v1,v2,…,v…} n} and the positional encoding p of the word vector v. The positional encoding can be obtained based on sine and cosine transforms, and is calculated as follows:

[0145]

[0146] In the formula, d represents the d-th position in the D-dimensional vector, and p i,2d and p i,2d+1 Let v and p represent the positional codes corresponding to positions 2d and 2d+1 in the i-th word term, respectively; the sum of the constructed word vector v and the positional code p is used as the text vector h.

[0147] h = v + p.

[0148] Wherein, the text vector h is n×D dimensional, preferably D=768.

[0149] The text vector h is used as the input to the self-attention module to extract the semantic information of the sentence and the dependency information between terms. The self-attention module can preferably be a multi-layer network with each layer having the same structure (e.g., including a multi-head attention calculation part and a feedforward neural network part).

[0150] Specifically, multi-head attention allows for parallel computation of self-attention across multiple heads based on the input features. For the i-th self-attention head, based on the input feature h, it is first multiplied by the learnable weight matrix W. Q W K and W VWe obtain matrices Q, K, and V; then we perform attention calculations on matrices Q and K to obtain attention scores; finally, we multiply the attention scores by V to obtain the attention feature Att. i The specific calculation is as follows:

[0151]

[0152] Each attention head focuses on a different part of the input information. By concatenating and linearly transforming T attention heads, the multi-head attention feature MulAtt can be obtained.

[0153] MulAtt=Concat(Att1,Att2,…,Att T W O

[0154] Preferably, the number of attention heads T = 12, and the learnable weight matrix W Q W K and W V The dimension is 768×64, and the learnable weight matrix W O The dimension is 768×768. The acquired multi-head attention feature MulAtt is fed into the feedforward neural network for further feature extraction to complete the self-attention processing.

[0155] This embodiment extracts feature representations from the [CLS], [SEP], and [MASK] positions in the last layer of the attention module to obtain target context features corresponding to [CLS] and [SEP], and target causal inference features corresponding to the [MASK] position. Max pooling is then performed on the target context features, and the pooling result is dynamically weighted and fused with the target causal inference features to obtain the fused feature X. t The details are as follows:

[0156] X t =W1(MaxPooling(X) cls ,X sep ))+W2X mask

[0157] In the formula, X cls X sep X mask The embedding representations of [CLS], [SEP], and [MASK] are shown below. W1 and W2 represent dynamic weight matrices used to control the contribution of contextual features and causal inference features of product text. Their specific values ​​can be determined according to actual needs and are not limited here. Therefore, this embodiment achieves dynamic semantic fusion at the contextual and causal inference levels by dynamically weighting features at different locations, thereby improving the accuracy of classification prediction results.

[0158] Further, in one embodiment, the step of performing multi-level semantic hierarchical feature mapping on the fused features and performing product category-dependent hierarchical feature mapping on the input sequence includes:

[0159] The fused features are linearly transformed to obtain the semantic features of the product.

[0160] By performing hyperbolic space mapping on the semantic features of the products, the hierarchical features of the products can be obtained.

[0161] Based on graph attention network and historical product category coding, inter-category dependency features are extracted to obtain category dependency features;

[0162] Hyperbolic space mapping is performed on category dependency features to obtain category hierarchical features;

[0163] The semantic features of the product, the hierarchical features of the product, the category-dependent features, and the category-hierarchical features are used as the mapping results.

[0164] As an example, in this embodiment, the fused feature X after dynamic weighted fusion is... t By accessing multiple linear layers, the semantic features of the Euclidean space product text corresponding to each layer's category (i.e., product semantic features) can be obtained. The details are as follows:

[0165]

[0166] In the formula, W' represents the feature representation of the l-th level of the corresponding product category. l and W l Let represent the linear transformation matrix of the l-th layer, where when l = 0,

[0167] Then, based on the semantic features of commodities at various category levels in Euclidean space. These are mapped to hyperbolic space, and the mapping results are used as the hierarchical structure features (i.e., product hierarchical features) of that space. Considering the extremely high complexity and difficulty of converting all Euclidean space operations (including addition, subtraction, multiplication, and division) of the deep neural network into hyperbolic space operations, this embodiment simplifies the conversion between Euclidean space and hyperbolic space.

[0168] Specifically, the obtained semantic features of the goods The network passes through a linear layer and an activation function layer respectively to ensure network stability, as detailed below:

[0169]

[0170] In the formula, Representing the semantic features of goods The features obtained after processing by linear layers and activation function layers and These represent the linear transformation matrix and the bias term, respectively.

[0171] Regarding the above features Hyperbolic space mapping can be performed, specifically using the Poincaré mapping in hyperbolic space, that is, the product hierarchy features can be obtained through the following formula:

[0172]

[0173] In the formula, This indicates the hierarchical characteristics of the product.

[0174] In this embodiment, based on the historical product category code h e Furthermore, a graph attention network is used to extract the dependency features between categories, thereby obtaining the category dependency features. Specifically, for each category, we first calculate its similarity coefficients with its neighbors and itself, and then normalize them to obtain the attention coefficient α. ij Wherein, the "neighbors" are predefined associations between product categories, calculated using the following formula:

[0175]

[0176] In the formula, a(·) represents a single-layer feedforward neural network, and [·‖·] represents the concatenation operation. This represents the category code for the i-th type of goods. express W represents the category code for the j-th product class. g The weight matrix represents the linear transformation.

[0177] Then, based on the obtained attention coefficient α ij Perform a weighted summation on the features and then sum the results. This serves as the final representation of category-dependent features.

[0178]

[0179] Where || represents a multi-head splicing operation, K represents the number of attention heads, and W k Let σ represent the weight of the k-th attention head, and σ represent the activation function.

[0180] Similarly, with the aforementioned product hierarchy characteristics The mapping method and principle are the same, depending on the product category features. Perform a hyperbolic space mapping to obtain the hierarchical features of product categories within the hyperbolic space, i.e., obtain the category hierarchy features.

[0181] Further, in one embodiment, calculating the Euclidean space distance and hyperbolic space distance based on the mapping result includes:

[0182] Euclidean spatial distance is calculated based on product semantic features and category dependency features;

[0183] Hyperbolic space mapping is calculated based on product hierarchical features and category hierarchical features.

[0184] As an example, this embodiment will use a dynamic weighted multi-space answer prediction method to predict product categories. Specifically, it first calculates the semantic features of products at each level. Category-dependent features The Euclidean dot product is used to obtain the Euclidean distance. Specifically as follows:

[0185]

[0186] Then calculate the product hierarchical features at each level. Category hierarchy features hyperbolic space distance Specifically as follows:

[0187]

[0188] in, To represent the Möbius operation, taking two vectors u and v as an example, the Möbius calculation formula is as follows:

[0189]

[0190] Finally, regarding European spatial distance and hyperbolic space distance A weighted fusion is performed, and the weighted fusion result is used as the category prediction confidence level for multi-space fusion. It should be understood that since the greater the distance, the lower the confidence level should be (i.e., an inverse relationship), the score needs to be subjected to a negative logarithm operation before it can be used as the final confidence level for the category, as follows:

[0191]

[0192] Among them, α and β are used as multi-space dynamic weighted fusion parameters, which can be dynamically adjusted continuously as the model is trained.

[0193] Fourthly, embodiments of this application also provide a product classification model construction device.

[0194] In one embodiment, the product classification model building apparatus includes:

[0195] The data acquisition unit is used to acquire historical product text and historical product categories, and to concatenate the historical product text based on a preset causal reinforcement learning template to obtain an input sequence. The causal reinforcement learning template includes context feature objects, causal words, and causal inference feature objects of product text. The historical product categories are encoded to obtain historical product category codes. The input sequence and the historical product category codes constitute a dataset.

[0196] A training unit is constructed to build a neural network model. The neural network model includes a feature extraction module, a feature mapping module, and a classification prediction module. The feature extraction module extracts features from the input sequence and dynamically weights and fuses them to obtain fused features. The feature mapping module performs multi-level semantic and hierarchical feature mapping on the fused features and performs product category dependency and hierarchical feature mapping based on historical product category codes. The classification prediction module calculates Euclidean and hyperbolic spatial distances based on the mapping results, dynamically weights the Euclidean and hyperbolic spatial distances, and obtains the classification results corresponding to historical product texts. The neural network model is trained based on the dataset to obtain a product classification model, which is used to classify products.

[0197] Furthermore, in one embodiment, the feature extraction module is specifically used for:

[0198] Based on context feature objects, causal words, and product text causal reasoning feature objects, feature extraction is performed on the input sequence to obtain target context features and target causal reasoning features.

[0199] Max pooling is performed on the target context features to obtain the pooling result;

[0200] The pooling results and the target causal inference features are dynamically weighted and fused to obtain the fused features.

[0201] Furthermore, in one embodiment, the feature mapping module is specifically used for:

[0202] The fused features are linearly transformed to obtain the semantic features of the product.

[0203] By performing hyperbolic space mapping on the semantic features of the products, the hierarchical features of the products can be obtained.

[0204] Based on graph attention network and historical product category coding, inter-category dependency features are extracted to obtain category dependency features;

[0205] Hyperbolic space mapping is performed on category dependency features to obtain category hierarchical features;

[0206] The semantic features of the product, the hierarchical features of the product, the category-dependent features, and the category-hierarchical features are used as the mapping results.

[0207] Furthermore, in one embodiment, the classification prediction module is specifically used for:

[0208] Euclidean spatial distance is calculated based on product semantic features and category dependency features;

[0209] Hyperbolic space mapping is calculated based on product hierarchical features and category hierarchical features.

[0210] The functions of each module in the above-mentioned commodity classification model construction device correspond to the steps in the above-mentioned commodity classification model construction method embodiment, and their functions and implementation processes will not be described in detail here.

[0211] It should be noted that the sequence numbers of the above embodiments are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0212] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.

[0213] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.

[0214] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.

[0215] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.

[0216] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.

[0217] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method of classifying merchandise, characterized by, The product classification method includes: The text of the product to be classified and the preset product category code are obtained, and the text of the product to be classified is concatenated based on the preset causal reinforcement learning template to obtain the target sequence. The causal reinforcement learning template includes context feature objects, causal words and causal inference feature objects of product text. The target sequence and product category code are input into a pre-defined product classification model, which extracts features from the target sequence and dynamically weights and fuses them to obtain fused features. A linear transformation is applied to the fused features to obtain product semantic features. Hyperbolic space mapping is then applied to the product semantic features to obtain product hierarchical features. Based on a graph attention network and product category codes, inter-category dependency features are extracted to obtain category dependency features. Hyperbolic space mapping is then applied to the category dependency features to obtain category hierarchical features. The product semantic features, product hierarchical features, category dependency features, and category hierarchical features are used as the mapping results. Euclidean space distance and hyperbolic space distance are calculated based on the mapping results. Dynamic weighting is applied to the Euclidean space distance and hyperbolic space distance to obtain the classification result corresponding to the text of the product to be classified.

2. The commodity classification method as described in claim 1, characterized in that, The process of feature extraction and dynamic weighted fusion of the target sequence to obtain fused features includes: Based on context feature objects, causal words, and product text causal reasoning feature objects, feature extraction is performed on the target sequence to obtain target context features and target causal reasoning features. Max pooling is performed on the target context features to obtain the pooling result; The pooling results and the target causal inference features are dynamically weighted and fused to obtain the fused features.

3. The commodity classification method as described in claim 1, characterized in that, The calculation of Euclidean space distance and hyperbolic space distance based on the mapping results includes: Euclidean spatial distance is calculated based on product semantic features and category dependency features; Hyperbolic space mapping is calculated based on product hierarchical features and category hierarchical features.

4. A commodity sorting device, characterized in that, The commodity sorting device includes: The processing unit is used to acquire the product text to be classified and the preset product category code, and to concatenate the product text to be classified based on the preset causal reinforcement learning template to obtain the target sequence. The causal reinforcement learning template includes context feature objects, causal words and product text causal inference feature objects. The classification unit is used to input the target sequence and product category code into a pre-defined product classification model. The model extracts features from the target sequence and dynamically weights and fuses them to obtain fused features. A linear transformation is applied to the fused features to obtain product semantic features. Hyperbolic space mapping is then applied to the product semantic features to obtain product hierarchical features. Based on a graph attention network and product category code, inter-category dependency features are extracted to obtain category dependency features. Hyperbolic space mapping is then applied to the category dependency features to obtain category hierarchical features. The product semantic features, product hierarchical features, category dependency features, and category hierarchical features are used as the mapping results. Euclidean space distance and hyperbolic space distance are calculated based on the mapping results. Dynamic weighting is applied to the Euclidean space distance and hyperbolic space distance to obtain the classification result corresponding to the text of the product to be classified.

5. A method for constructing a commodity classification model, characterized in that, The product classification model construction method includes: Historical product text and historical product categories are obtained. The historical product text is concatenated based on a preset causal reinforcement learning template to obtain an input sequence. The causal reinforcement learning template includes context feature objects, causal words, and causal inference feature objects of product text. The historical product categories are encoded to obtain historical product category codes. The input sequence and historical product category codes constitute a dataset. A neural network model is constructed, comprising a feature extraction module, a feature mapping module, and a classification prediction module. The feature extraction module extracts features from the input sequence and dynamically weights and fuses them to obtain fused features. The feature mapping module performs linear transformation on the fused features to obtain product semantic features, performs hyperbolic space mapping on the product semantic features to obtain product hierarchical features, extracts inter-category dependency features based on graph attention networks and product category codes to obtain category dependency features, performs hyperbolic space mapping on the category dependency features to obtain category hierarchical features, and uses the product semantic features, product hierarchical features, category dependency features, and category hierarchical features as the mapping results. The classification prediction module calculates Euclidean space distance and hyperbolic space distance based on the mapping results, performs dynamic weighting processing on the Euclidean space distance and hyperbolic space distance to obtain the classification results corresponding to the historical product text. The neural network model is trained based on the dataset to obtain a product classification model, which is then used to classify products.

6. The product classification model construction method as described in claim 5, characterized in that, The process of feature extraction and dynamic weighted fusion of the input sequence to obtain fused features includes: Based on context feature objects, causal words, and product text causal reasoning feature objects, feature extraction is performed on the input sequence to obtain target context features and target causal reasoning features. Max pooling is performed on the target context features to obtain the pooling result; The pooling results and the target causal inference features are dynamically weighted and fused to obtain the fused features.

7. The product classification model construction method as described in claim 5, characterized in that, The calculation of Euclidean space distance and hyperbolic space distance based on the mapping results includes: Euclidean spatial distance is calculated based on product semantic features and category dependency features; Hyperbolic space mapping is calculated based on product hierarchical features and category hierarchical features.

8. A commodity classification model construction device, characterized in that, The product classification model construction device includes: The data acquisition unit is used to acquire historical product text and historical product categories, and to concatenate the historical product text based on a preset causal reinforcement learning template to obtain an input sequence. The causal reinforcement learning template includes context feature objects, causal words, and causal inference feature objects of product text. The historical product categories are encoded to obtain historical product category codes. The input sequence and the historical product category codes constitute a dataset. A training unit is constructed to build a neural network model. This model includes a feature extraction module, a feature mapping module, and a classification prediction module. The feature extraction module extracts features from the input sequence and dynamically weights and fuses them to obtain fused features. The feature mapping module performs a linear transformation on the fused features to obtain product semantic features, performs hyperbolic space mapping on the product semantic features to obtain product hierarchical features, extracts inter-category dependency features based on a graph attention network and product category encoding to obtain category dependency features, performs hyperbolic space mapping on the category dependency features to obtain category hierarchical features, and uses the product semantic features, product hierarchical features, category dependency features, and category hierarchical features as the mapping results. The classification prediction module calculates Euclidean space distance and hyperbolic space distance based on the mapping results, performs dynamic weighting on the Euclidean space distance and hyperbolic space distance to obtain the classification result corresponding to the historical product text. The neural network model is trained based on the dataset to obtain a product classification model, which is used to classify products.