Commodity classification model training method and device, computer device, and storage medium
By combining feature extraction and clustering methods with enterprise and product features to train the model, the problem of insufficient sample data in platform economy product classification is solved, and the classification accuracy and training efficiency are improved.
Patent Information
- Application Number
- CN202310512618.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-08
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2043-05-08
AI Technical Summary
Existing platform economy product classification models lack sufficient sample data and annotation information, resulting in low classification accuracy, especially difficulties in classifying products from different companies.
By extracting product and enterprise features through a feature extraction model, performing clustering, selecting high-confidence features from the clusters, and combining these features with enterprise and product features to train an initial model, thereby generating a product classification model.
It improves the accuracy of product classification and the efficiency of model training. By combining enterprise characteristics and product characteristics for classification, it achieves more accurate product label generation.
Smart Images

Figure CN116702022B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of model training technology, and in particular to a product classification model training method, apparatus, computer equipment and storage medium. Background Technology
[0002] The platform economy can be understood as an economic model that uses platforms as a means to provide products and services, and the products or services provided are considered platform economy commodities. To achieve knowledge extraction and automatic classification of platform economy commodities, a large amount of sample data is needed to train a highly accurate model. However, currently, the amount of sample data is far from sufficient, and there is no labeled information. The classification is mainly based on textual information, including company information, product and service descriptions, company websites, research reports on related industries, and public opinion information.
[0003] The existing platform economy offers a wide variety of products, and each product belongs to a different type of company. Manually labeling products from different companies is extremely difficult. Therefore, how to generate a product classification model to accurately classify different products from different companies is an urgent problem to be solved. Summary of the Invention
[0004] In view of this, in order to solve the above-mentioned technical problems or some of the technical problems, the present invention provides a commodity classification model training method, apparatus, computer equipment and storage medium.
[0005] In a first aspect, embodiments of the present invention provide a method for training a commodity classification model, comprising:
[0006] The first feature of each product in the product set is extracted according to the feature extraction model to obtain the first feature set. The first feature is used to characterize the product features and the enterprise features corresponding to the product.
[0007] The first feature set is clustered to obtain multiple clusters, and each cluster contains multiple of the first features;
[0008] Multiple target first features are extracted from each cluster to obtain a target first feature set;
[0009] The first initial model is trained based on the first set of target features to obtain a trained product classification model.
[0010] In one possible implementation, the feature extraction model is trained in the following manner:
[0011] Obtain the enterprise characteristics corresponding to each enterprise in the enterprise set to obtain the enterprise characteristic set;
[0012] Obtain the total product characteristics corresponding to each of the aforementioned enterprises to obtain a set of total product characteristics;
[0013] Based on the enterprise feature set and the total product feature set, a second feature corresponding to each enterprise is generated, resulting in a second feature set;
[0014] The second initial model is trained based on the second feature set to obtain a trained feature extraction model.
[0015] In one possible implementation, obtaining the total product characteristics corresponding to each of the enterprises includes:
[0016] For each enterprise in the aforementioned set of enterprises, determine the multiple products corresponding to each enterprise;
[0017] For each of the aforementioned products, multiple features are extracted;
[0018] The multiple features corresponding to each product are aggregated using an aggregation algorithm to obtain the product features corresponding to each product.
[0019] The product features of multiple products corresponding to each enterprise are aggregated using an aggregation algorithm to obtain the total product features corresponding to each enterprise.
[0020] In one possible implementation, the clustering process on the first feature set includes:
[0021] For the first feature set, determine the distance between any two first features;
[0022] The two first features with the largest distance are identified as the two cluster centers;
[0023] Clustering is performed on the other first features based on the two cluster centers to obtain two clusters;
[0024] For each cluster's first feature, the steps of determining cluster centers and performing clustering are repeated. When a preset termination condition is met, the clustering process ends.
[0025] In one possible implementation, the extraction of multiple target first features from each of the clusters includes:
[0026] Determine the cluster center within each of the said clusters;
[0027] Determine the distance between the first feature within each cluster and the cluster center;
[0028] Extract the first feature whose distance is less than a first threshold from each of the clusters as the target first feature.
[0029] In one possible implementation, training the first initial model based on the target first feature set to obtain a trained product classification model includes:
[0030] The first feature of the target is used as the label of the corresponding product and input into the first initial model for training;
[0031] When the model converges, the training of the model is considered complete, and a trained product classification model is obtained, so that the product classification model can output the classification labels corresponding to the products.
[0032] In one possible implementation, the step of inputting the target first feature as a label for the corresponding product into the first initial model for training includes:
[0033] During model training, when the first initial model outputs multiple product tags, the probability corresponding to each tag is determined;
[0034] The label with a probability greater than a second threshold is determined from the multiple labels as the classification label.
[0035] Secondly, embodiments of the present invention provide a commodity classification model training device, comprising:
[0036] The extraction module is used to extract the first feature of each product in the product set according to the feature extraction model to obtain the first feature set. The first feature is used to characterize the product features and the enterprise features corresponding to the product.
[0037] The processing module is used to perform clustering processing on the first feature set to obtain multiple clusters, each cluster containing multiple first features;
[0038] The extraction module is further configured to extract multiple target first features from each cluster to obtain a target first feature set;
[0039] The training module is used to train the first initial model based on the target first feature set to obtain a trained product classification model.
[0040] Thirdly, embodiments of the present invention provide a computer device, including: a processor and a memory, wherein the processor is configured to execute a commodity classification model training program stored in the memory to implement the commodity classification model training method described in any one of the first aspects above.
[0041] Fourthly, embodiments of the present invention provide a storage medium storing one or more programs, which can be executed by one or more processors to implement the commodity classification model training method described in any one of the first aspects.
[0042] The product classification model training method provided in this invention involves extracting a first feature for each product in a product set using a feature extraction model, resulting in a first feature set. The first feature represents the product characteristics and the corresponding enterprise characteristics of the product. The first feature set is then clustered to obtain multiple clusters, each containing multiple of the first features. Multiple target first features are extracted from each cluster to obtain a target first feature set. Finally, a first initial model is trained based on the target first feature set to obtain a trained product classification model. This method enables the training of a classification model by combining product features and enterprise features, improving classification accuracy and enhancing model training efficiency by filtering the trained features. Attached Figure Description
[0043] Figure 1 A flowchart illustrating a product classification model training method provided in an embodiment of the present invention;
[0044] Figure 2 A flowchart illustrating a feature extraction model training method provided in an embodiment of the present invention;
[0045] Figure 3 A flowchart illustrating another product classification model training method provided in an embodiment of the present invention;
[0046] Figure 4 This is a schematic diagram of the structure of a clustering algorithm provided in an embodiment of the present invention;
[0047] Figure 5 A flowchart illustrating another product classification model training method provided in an embodiment of the present invention;
[0048] Figure 6 This is a schematic diagram of the structure of a commodity classification model training device provided in an embodiment of the present invention;
[0049] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0051] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.
[0052] Figure 1 This is a flowchart illustrating a product classification model training method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the method specifically includes:
[0053] S11. Extract the first feature of each product in the product set according to the feature extraction model to obtain the first feature set. The first feature is used to characterize the product features of the product and the enterprise features corresponding to the product.
[0054] The product classification model training method provided in this embodiment of the invention is applied to computer equipment or servers. Specifically, it generates a first feature corresponding to each product through enterprise features and product features, selects multiple target first features as product labels, and uses a semi-supervised approach to train the model to obtain a trained product classification model.
[0055] In this embodiment, the generation method of the feature extraction model is first described through S21-S24, such as... Figure 2 The diagram shown is a flowchart illustrating a training method for a feature extraction model provided in an embodiment of the present invention. The method specifically includes:
[0056] S21. Obtain the enterprise characteristics corresponding to each enterprise in the enterprise set to obtain the enterprise characteristic set.
[0057] In this embodiment, multiple different types of enterprises are pre-defined, and enterprise features are extracted for each type of enterprise to obtain an enterprise feature set. Since different enterprises have different business scopes, and the business scope of an enterprise can limit the categories of goods to a certain extent, combining enterprise-related information as enterprise features can further improve the product feature extraction algorithm and help with subsequent automatic product classification tasks.
[0058] Specifically, the process involves acquiring enterprise information for each company. This information may include, but is not limited to, company name, industry, industry category, business operations, scope of business, company website, relevant industry research reports, and public opinion information. In the initial state of the neural network (parameters randomly initialized or pre-trained model parameters loaded), the enterprise information input to the neural network is preprocessed, features are extracted, and features are aggregated to obtain the enterprise features corresponding to each company. For example, the enterprise feature corresponding to company E is determined to be e. F .
[0059] S22. Obtain the total product characteristics corresponding to each enterprise to obtain the total product characteristic set.
[0060] In this embodiment, each enterprise can correspond to multiple products. For each enterprise in the set of enterprises, multiple products corresponding to each enterprise are determined.
[0061] Each product contains textual information such as the product / service name, product / service description, news related to the product, and company introduction. These multiple dimensions of textual information are processed using different models and then embedded into a high-dimensional vector space. Textual information processing methods can include: preprocessing the textual information using a language model; for product / service names, removing brand names, color terms, numbers, and units of measurement; stemming words to find common word roots; and removing stop words. The resulting processing yields multiple features of the product.
[0062] Furthermore, the multiple features corresponding to each product are aggregated using an aggregation algorithm to obtain the product features corresponding to each product, that is, the multiple features of a product are aggregated into one product feature.
[0063] Once the product characteristics of each product for a company are determined, an aggregation algorithm is used to aggregate all the product characteristics of the company to obtain the total product characteristics of each company. In other words, the total product characteristics of a company aggregate multiple characteristics of multiple products.
[0064] Specifically, the total characteristics of the product p F The extraction steps are as follows:
[0065] 1. Learn the product details (P) for each item. i Product characteristics p ii (Each product has N features)
[0066] Select M products {P1, P2, ..., P} from company E. i ,…,P M}, each item P i There are N features {p f1 ,p f2 ,…,p fj ,…,p fN}, using the aggregation algorithm Aggs1, for product P i We perform aggregation learning on N features to obtain P. i Product characteristics p Fi :
[0067] p Fi =Aggs1(p f1 ,p f2 ,…,p fj ,…,p fN )
[0068] 2. Learn the overall characteristics p of multiple products corresponding to company E. F (Each company has M products)
[0069] Product characteristics of the M products corresponding to enterprise E {p F1 ,p F2 ,…,p Fi ,…,p FM}, using the aggregation algorithm Aggs2, the total product features p of E are obtained. F :
[0070] p F =Aggs2(p F1 ,p F2 ,…,p Fi ,…,p FM )
[0071] The aggregation algorithms Aggs1 and Aggs2 can use methods such as average pooling, max pooling, feature concatenation, weighted average network, and other neural networks. The matrix operations in the algorithms can be iteratively optimized through backpropagation.
[0072] S23. Generate a second feature corresponding to each enterprise based on the enterprise feature set and the total product feature set, thereby obtaining a second feature set.
[0073] In this embodiment, a total product feature corresponding to each enterprise is determined through step S22, and an enterprise feature is determined through step S21. Therefore, each enterprise feature corresponds to a total product feature. The enterprise feature and the corresponding total product feature are aggregated according to the aggregation algorithm to obtain a second feature corresponding to each enterprise. That is, the second feature includes the total product feature and the enterprise feature corresponding to each enterprise.
[0074] Specifically, taking firm E in the set of firms as an example, the firm characteristic corresponding to E is e. F Then select M items under E, and the total product characteristics p of E are... F Put e F With p F Aggregation yields the "enterprise + product" feature ep F As a second feature, it is used for enterprise classification training tasks.
[0075] ep F =Aggs3(e F ,p F )
[0076] ep FIt includes both overall product characteristics and enterprise characteristics. The aggregation algorithm Aggs3 can be configured using methods such as average pooling, max pooling, feature concatenation, weighted average networks, or other neural networks. Matrix operations in the algorithm can be iteratively optimized through backpropagation.
[0077] S24. Train the second initial model based on the second feature set to obtain a trained feature extraction model.
[0078] In this embodiment, the second initial model can be a model for extracting product features. This model can be character-based or word-based; no specific limitation is made in this embodiment. Figure 3 The diagram shown is a flowchart illustrating another training method for a feature extraction model provided in an embodiment of the present invention. The second initial model can be... Figure 3 The product feature network Net1 in the model first extracts product features using a second initial model, then generates second product features through steps S22-S23. Next, using a company classification training task, Net1 is updated using the backpropagation algorithm. This updated Net1 outputs a first feature containing both company and product features. In other words, the second initial model is updated and trained using the generated second feature, resulting in a well-trained feature extraction model. The backpropagation algorithm is based on gradient descent. If the desired output value is not obtained at the output layer, the sum of the squares of the errors between the output and the desired value is used as the objective function. Backpropagation is then performed layer by layer to calculate the partial derivatives of the objective function with respect to the weights of each neuron, forming the gradient of the objective function with respect to the weight vector. This gradient serves as the basis for modifying the weights, and the network's learning is completed during the weight modification process. 1. For average pooling, the forward propagation takes the average value of a certain feature region as the output. Every neuron in this region participates in the forward propagation. Therefore, during backpropagation, the gradient needs to be evenly distributed to each neuron before backpropagation. 2. For max pooling, forward propagation involves outputting the maximum value from a given feature region. Since only the maximum-value neuron participates in forward propagation in this region, backpropagation simply requires directly assigning the gradient of that region to the maximum-value neuron. 3. For weighted average, backpropagation involves assigning the gradient according to the parameters of the different weights. 4. For feature concatenation, loss values are calculated for each feature value separately, and the gradients are backpropagated in their corresponding networks.
[0079] Specifically, enterprise classification labels must be prepared in advance as training samples before enterprise classification training can be performed. The input consists of Q second features ep, which contain the total characteristics of the products and the characteristics of the enterprises. F , for {ep F1 ,ep F2 ,…,ep Ft ,…,epFQ The output is a category label Y containing enterprise characteristics and product characteristics. i .
[0080] Y i =σ(w·ep) Fi +b)
[0081] Y i Let σ represent the category label output by the i-th enterprise, σ be the activation function, and w and b be the parameters of the enterprise classification network.
[0082] At this point, the training process for the feature extraction model is complete.
[0083] When the product set is input into the feature extraction model, the feature extraction model outputs the first feature corresponding to each product in the product set, resulting in the first feature set. The first feature set contains the product features and the corresponding enterprise features.
[0084] In this embodiment, due to the significant differences in product types among enterprises in different industries, relying solely on product features for product classification is insufficient for accuracy. Therefore, enterprise features are added to product features. Currently, the training data provides labels for enterprise industry classifications. A "enterprise + product" feature structure is constructed using methods such as neural networks to train the enterprise classification network. During training, the product feature network is updated in reverse, resulting in product features that also incorporate enterprise features. After the enterprise classification training is complete, the parameters of the product feature network are fixed, serving as the product feature extraction network for subsequent training data selection and product classification training.
[0085] S12. Perform clustering processing on the first feature set to obtain multiple clusters, each cluster containing multiple first features.
[0086] In this embodiment, the product classification task lacks labels, and manual labeling is time-consuming and laborious. To solve this problem, such as... Figure 3 As shown, after the first feature is output by the trained feature extraction model, the first feature is clustered and filtered using a clustering method. The first feature that is close to the cluster center is the data with high confidence. The target first feature with high confidence is used as the training set for commodity classification training.
[0087] For the first feature set, determine the distance between any two first features; determine the two first features with the largest distance as two cluster centers; perform clustering processing on the other first features based on the two cluster centers to obtain two clusters; for the first features in each cluster, repeat the steps of determining cluster centers and clustering processing, and the clustering processing steps end when the preset termination condition is met.
[0088] Specifically, this embodiment can employ the DIANA split hierarchical clustering algorithm to divide products into clusters layer by layer according to a first feature, with each subsequent layer generating clusters based on the results of the previous layer. For top-down hierarchical clustering, initially all products belong to the same cluster, and each time a cluster is divided into multiple clusters according to certain criteria, and this process is repeated.
[0089] like Figure 4 The diagram shown is a structural schematic of a clustering algorithm provided in an embodiment of the present invention. Hierarchical clustering can select clustering results from any layer. The basic idea of the algorithm is as follows:
[0090] 1. First, initialize the system by placing all products P into the same cluster C, which is the top of the hierarchy.
[0091] 2. Within the same cluster C, calculate the distance between the first features of any two product samples P, and select the farthest P1 and P4 as the centers of C1 and C2.
[0092] 3. Calculate the remaining product sample P. i (Excluding P1 and P4) the distances to the cluster centers C1 and C2, respectively, for each P i The samples are assigned to the nearest cluster to classify them into clusters based on distance.
[0093] 4. Repeat steps 2 and 3 to calculate the products in each cluster, resulting in smaller product clusters, until the termination condition is met.
[0094] Finally, C is divided into k clusters {C1, C2, ..., C...} k}
[0095] Methods for calculating the distance between two product samples include: minimum distance, maximum distance, and mean distance.
[0096] In this embodiment, the clustering algorithm is applied to extract the first feature of the product using the product feature extraction network Net1 updated by the enterprise classification training task. This yields the first feature set {p1,p2,p3,...}.
[0097] Cluster the {p1,p2,p3,...} groups. After clustering, each cluster contains the first features of multiple products.
[0098] S13. Extract multiple target first features from each cluster to obtain a target first feature set.
[0099] In this embodiment, since there are multiple first features in each cluster, it is necessary to extract the target first features with high confidence from each cluster for subsequent training of the commodity classification model.
[0100] Specifically, the classification label for each cluster is obtained by summarizing the product names corresponding to the first feature in each cluster. Then, the label names are manually adjusted, such as by modifying the label names, merging similar labels, or splitting labels; this step can be omitted. After processing, a label classification system is obtained, where each cluster corresponds to one classification label, and each classification label contains the products and first features of the corresponding category.
[0101] Furthermore, determine the cluster center within each cluster; determine the first feature X within each cluster. i With cluster center C i The distance d = |X i -C k When the distance is less than a first threshold, it indicates that the confidence level of the first feature is high. First features with distances less than the set threshold are extracted from each cluster as target first features. Therefore, the selected target first features are data with high confidence, and these target first features are used as training data.
[0102] S14. Train the first initial model based on the target first feature set to obtain a trained product classification model.
[0103] In this embodiment, the target first feature can represent the label corresponding to the product. The set of the target first feature is used as training samples and input into the first initial model for training. When the model converges, the model training is considered complete, and a trained product classification model is obtained, which then outputs the classification label corresponding to the product.
[0104] Specifically, Figure 5 This is a flowchart illustrating another product classification model training method provided in this embodiment of the invention. A learnable fully connected layer, Net2, is connected after the product feature network Net1. Net2 serves as the first initial model. While training product classification, the Net1 network is fine-tuned to generate the corresponding label L. The loss function chosen is the binary cross-entropy (BCE) loss function.
[0105] p i =Net1(P i )
[0106] L=β(Net2(p1,p2,p3,…))=β(Net2Net1(P1,P2,P3,…))
[0107] β is the BCE loss function.
[0108] If an unsupervised training method is used, the category labels of the clustered products can be updated after training convergence. Through continuous iteration, a better result can eventually be achieved.
[0109] During model training, when the first initial model outputs multiple product labels, the probability corresponding to each label is determined; from the multiple labels, the label with a probability greater than a second threshold is determined as the classification label.
[0110] Specifically, a product P can correspond to multiple label categories. These labels are not mutually exclusive, so it's not necessary to guarantee that the sum of the probabilities of the multiple categories is 1. We only need to calculate the probability of each product P belonging to each label category {y1, y2, y3, ...}. When P belongs to a certain category y... i When the probability of P is greater than the second threshold b, it means that P is classified into category y. i Down.
[0111] L=-∑ i y i logσ(v i )+91-y i )log(1-σ(v i ))
[0112] In multi-label product classification, the BCE loss function is used. i The output of the classification network Net2 is σ, where σ is the Sigmoid activation function and y is the output of the classification network Net2. i The label represents a one-hot encoded label, and the output consists of C neurons, corresponding to the C categories of the product.
[0113] In multi-label classification, the output sum of the last layer is not 1, but each neuron in the output layer is treated as a binomial distribution, which is equivalent to transforming the multi-label problem into a binary classification problem on each label.
[0114] After obtaining the product categories through the above network training, the parameters of the product feature network Net1 and the product classification network Net2 are updated, and the "first feature selection" step is repeated. After clustering, data with high confidence are selected as labeled training data, and the "product classification training" step is repeated again. This cycle is repeated until a good classification effect is achieved, at which point the model training is complete, and the trained product classification model is obtained.
[0115] The product classification model training method provided in this invention involves extracting a first feature for each product in a product set using a feature extraction model, resulting in a first feature set. The first feature represents the product characteristics and the corresponding enterprise characteristics of the product. The first feature set is then clustered to obtain multiple clusters, each containing multiple first features. Multiple target first features are extracted from each cluster to obtain a target first feature set. A first initial model is trained based on the target first feature set to obtain a trained product classification model. This method enables the training of a classification model by combining product and enterprise features, improving classification accuracy. Furthermore, the features used in the training are filtered, increasing model training efficiency. The trained model can generate product tags based on the product and enterprise characteristics, and classify products based on these tags, thus improving the accuracy of product classification.
[0116] Figure 6 This is a schematic diagram of the structure of a commodity classification model training device provided in an embodiment of the present invention, as shown below. Figure 6 As shown, the device includes:
[0117] Extraction module 61 is used to extract the first feature of each product in the product set according to the feature extraction model to obtain the first feature set. The first feature is used to characterize the product features of the product and the enterprise features corresponding to the product.
[0118] Processing module 62 is used to perform clustering processing on the first feature set to obtain multiple clusters, each cluster containing multiple first features;
[0119] The extraction module 61 is further configured to extract multiple target first features from each cluster to obtain a target first feature set;
[0120] Training module 63 is used to train the first initial model based on the target first feature set to obtain a trained commodity classification model.
[0121] In one possible implementation, the acquisition module 64 is used to acquire the enterprise characteristics corresponding to each enterprise in the enterprise set, thereby obtaining an enterprise characteristic set;
[0122] Obtain the total product characteristics corresponding to each of the aforementioned enterprises to obtain a set of total product characteristics;
[0123] The processing module is further configured to generate a second feature corresponding to each enterprise based on the enterprise feature set and the total product feature set, thereby obtaining a second feature set;
[0124] The training module is also used to train the second initial model based on the second feature set to obtain a trained feature extraction model.
[0125] In one possible implementation, the processing module is specifically used to determine multiple products corresponding to each enterprise in the enterprise set;
[0126] The extraction module is specifically used to extract multiple features for each of the products;
[0127] The processing module is specifically used to aggregate multiple features corresponding to each product using an aggregation algorithm to obtain product features corresponding to each product.
[0128] The product features of multiple products corresponding to each enterprise are aggregated using an aggregation algorithm to obtain the total product features corresponding to each enterprise.
[0129] In one possible implementation, the processing module is specifically used to determine the distance between any two first features for the first feature set;
[0130] The two first features with the largest distance are identified as the two cluster centers;
[0131] Clustering is performed on the other first features based on the two cluster centers to obtain two clusters;
[0132] For each cluster's first feature, the steps of determining cluster centers and performing clustering are repeated. When a preset termination condition is met, the clustering process ends.
[0133] In one possible implementation, the processing module is specifically used to determine the cluster center within each of the clusters;
[0134] Determine the distance between the first feature within each cluster and the cluster center;
[0135] The extraction module is specifically used to extract the first feature whose distance is less than a first threshold from each of the clusters as the target first feature.
[0136] In one possible implementation, the training module is specifically used to input the target first feature as the label of the corresponding product into the first initial model for training;
[0137] When the model converges, the training of the model is considered complete, and a trained product classification model is obtained, so that the product classification model can output the classification labels corresponding to the products.
[0138] In one possible implementation, the processing module is specifically used to determine the probability corresponding to each label when the number of labels for the first initial model outputting the product is multiple during the model training process.
[0139] The label with a probability greater than a second threshold is determined from the multiple labels as the classification label.
[0140] The product classification model training device provided in this embodiment can be as follows: Figure 6 The apparatus shown can perform, for example Figure 1-3 And all the steps of the five methods, thus achieving Figure 1-3 For details on the technical effects of the five methods, please refer to [link / reference]. Figure 1-3 The descriptions related to 5 are for the sake of brevity and will not be elaborated upon here.
[0141] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Figure 6 The computer device 700 shown includes at least one processor 701, a memory 702, at least one network interface 704, and other user interfaces 703. The various components in the computer device 700 are coupled together via a bus system 705. It is understood that the bus system 705 is used to implement communication between these components. In addition to a data bus, the bus system 705 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 7 The general labeled all buses as Bus System 705.
[0142] The user interface 703 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).
[0143] It is understood that the memory 702 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 702 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0144] In some implementations, memory 702 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 7021 and application program 7022.
[0145] The operating system 7021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 7022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 7022.
[0146] In this embodiment of the invention, by calling the program or instructions stored in memory 702, specifically the program or instructions stored in application program 7022, processor 701 executes the method steps provided in each method embodiment, including, for example:
[0147] The first feature of each product in the product set is extracted according to the feature extraction model to obtain the first feature set. The first feature is used to characterize the product features and the enterprise features corresponding to the product.
[0148] The first feature set is clustered to obtain multiple clusters, and each cluster contains multiple of the first features;
[0149] Multiple target first features are extracted from each cluster to obtain a target first feature set;
[0150] The first initial model is trained based on the first set of target features to obtain a trained product classification model.
[0151] In one possible implementation, the enterprise characteristics corresponding to each enterprise in the enterprise set are obtained to obtain the enterprise characteristic set;
[0152] Obtain the total product characteristics corresponding to each of the aforementioned enterprises to obtain a set of total product characteristics;
[0153] Based on the enterprise feature set and the total product feature set, a second feature corresponding to each enterprise is generated, resulting in a second feature set;
[0154] The second initial model is trained based on the second feature set to obtain a trained feature extraction model.
[0155] In one possible implementation, for each enterprise in the set of enterprises, multiple products corresponding to each enterprise are determined;
[0156] For each of the aforementioned products, multiple features are extracted;
[0157] The multiple features corresponding to each product are aggregated using an aggregation algorithm to obtain the product features corresponding to each product.
[0158] The product features of multiple products corresponding to each enterprise are aggregated using an aggregation algorithm to obtain the total product features corresponding to each enterprise.
[0159] In one possible implementation, for the first feature set, the distance between any two first features is determined;
[0160] The two first features with the largest distance are identified as the two cluster centers;
[0161] Clustering is performed on the other first features based on the two cluster centers to obtain two clusters;
[0162] For each cluster's first feature, the steps of determining cluster centers and performing clustering are repeated. When a preset termination condition is met, the clustering process ends.
[0163] In one possible implementation, cluster centers are determined within each cluster;
[0164] Determine the distance between the first feature within each cluster and the cluster center;
[0165] Extract the first feature whose distance is less than a first threshold from each of the clusters as the target first feature.
[0166] In one possible implementation, the target first feature is used as the label of the corresponding product and input into the first initial model for training;
[0167] When the model converges, the training of the model is considered complete, and a trained product classification model is obtained, so that the product classification model can output the classification labels corresponding to the products.
[0168] In one possible implementation, during model training, when the first initial model outputs multiple labels for a product, the probability corresponding to each label is determined.
[0169] The label with a probability greater than a second threshold is determined from the multiple labels as the classification label.
[0170] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 701. Processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 701 or by instructions in software form. The processor 701 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 702. Processor 701 reads the information in memory 702 and, in conjunction with its hardware, completes the steps of the above method.
[0171] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0172] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0173] The computer device provided in this embodiment may be as follows: Figure 7 The computer device shown can perform, for example Figure 1-3 And all the steps of the five methods, thus achieving Figure 1-3 For details on the technical effects of the five methods, please refer to [link / reference]. Figure 1-3 The descriptions related to section 5 are presented concisely and will not be elaborated upon here.
[0174] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; the memory may also include combinations of the above types of memory.
[0175] One or more programs in the storage medium can be executed by one or more processors to implement the above-described method for training a product classification model on the device side.
[0176] The processor is used to execute the product classification model training program stored in the memory to implement the following steps of the product classification model training method executed on the device side:
[0177] The first feature of each product in the product set is extracted according to the feature extraction model to obtain the first feature set. The first feature is used to characterize the product features and the enterprise features corresponding to the product.
[0178] The first feature set is clustered to obtain multiple clusters, and each cluster contains multiple of the first features;
[0179] Multiple target first features are extracted from each cluster to obtain a target first feature set;
[0180] The first initial model is trained based on the first set of target features to obtain a trained product classification model.
[0181] In one possible implementation, the enterprise characteristics corresponding to each enterprise in the enterprise set are obtained to obtain the enterprise characteristic set;
[0182] Obtain the total product characteristics corresponding to each of the aforementioned enterprises to obtain a set of total product characteristics;
[0183] Based on the enterprise feature set and the total product feature set, a second feature corresponding to each enterprise is generated, resulting in a second feature set;
[0184] The second initial model is trained based on the second feature set to obtain a trained feature extraction model.
[0185] In one possible implementation, for each enterprise in the set of enterprises, multiple products corresponding to each enterprise are determined;
[0186] For each of the aforementioned products, multiple features are extracted;
[0187] The multiple features corresponding to each product are aggregated using an aggregation algorithm to obtain the product features corresponding to each product.
[0188] The product features of multiple products corresponding to each enterprise are aggregated using an aggregation algorithm to obtain the total product features corresponding to each enterprise.
[0189] In one possible implementation, for the first feature set, the distance between any two first features is determined;
[0190] The two first features with the largest distance are identified as the two cluster centers;
[0191] Clustering is performed on the other first features based on the two cluster centers to obtain two clusters;
[0192] For each cluster's first feature, the steps of determining cluster centers and performing clustering are repeated. When a preset termination condition is met, the clustering process ends.
[0193] In one possible implementation, cluster centers are determined within each cluster;
[0194] Determine the distance between the first feature within each cluster and the cluster center;
[0195] Extract the first feature whose distance is less than a first threshold from each of the clusters as the target first feature.
[0196] In one possible implementation, the target first feature is used as the label of the corresponding product and input into the first initial model for training;
[0197] When the model converges, the training of the model is considered complete, and a trained product classification model is obtained, so that the product classification model can output the classification labels corresponding to the products.
[0198] In one possible implementation, during model training, when the first initial model outputs multiple labels for a product, the probability corresponding to each label is determined.
[0199] The label with a probability greater than a second threshold is determined from the multiple labels as the classification label.
[0200] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0201] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0202] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for training a commodity classification model, characterized in that, include: The first feature of each product in the product set is extracted according to the feature extraction model to obtain the first feature set. The first feature is used to characterize the product features and the enterprise features corresponding to the product. The first feature set is clustered to obtain multiple clusters, and each cluster contains multiple of the first features; Multiple target first features are extracted from each cluster to obtain a target first feature set; The first initial model is trained based on the first set of target features to obtain a trained product classification model; The feature extraction model is obtained by back-updating the product feature network through the enterprise classification training task. After the enterprise classification training is completed, the parameters of the product feature network are fixed and used as the product feature extraction network. The step of extracting multiple target first features from each cluster includes: obtaining the classification label of the cluster by summarizing the product name corresponding to the first feature in each cluster; determining the cluster center in each cluster and the distance between each first feature and the cluster center; and extracting the first feature whose distance is less than a first threshold from each cluster as the target first feature. The first initial model is a learnable fully connected layer connected to the product feature network. While training the product classification, the product feature network is fine-tuned. After obtaining the product category, the parameters of the product feature network and the product classification model are updated, and the extraction of the first feature, clustering processing, and product classification training are repeated until the model training ends.
2. The method according to claim 1, characterized in that, The feature extraction model is trained in the following way: Obtain the enterprise characteristics corresponding to each enterprise in the enterprise set to obtain the enterprise characteristic set; Obtain the total product characteristics corresponding to each of the aforementioned enterprises to obtain a set of total product characteristics; Based on the enterprise feature set and the total product feature set, a second feature corresponding to each enterprise is generated, resulting in a second feature set; The second initial model is trained based on the second feature set to obtain a trained feature extraction model.
3. The method according to claim 2, characterized in that, The step of obtaining the total product characteristics corresponding to each enterprise includes: For each enterprise in the aforementioned set of enterprises, determine the multiple products corresponding to each enterprise; For each of the aforementioned products, multiple features are extracted; The multiple features corresponding to each product are aggregated using an aggregation algorithm to obtain the product features corresponding to each product. The product features of multiple products corresponding to each enterprise are aggregated using an aggregation algorithm to obtain the total product features corresponding to each enterprise.
4. The method according to claim 1, characterized in that, The clustering process for the first feature set includes: For the first feature set, determine the distance between any two first features; The two first features with the largest distance are identified as the two cluster centers; Clustering is performed on the other first features based on the two cluster centers to obtain two clusters; For each cluster's first feature, the steps of determining cluster centers and performing clustering are repeated. When a preset termination condition is met, the clustering process ends.
5. The method according to claim 1, characterized in that, The step of training the first initial model based on the target first feature set to obtain a trained product classification model includes: The first feature of the target is used as the label of the corresponding product and input into the first initial model for training; When the model converges, the training of the model is considered complete, and a trained product classification model is obtained, so that the product classification model can output the classification labels corresponding to the products.
6. The method according to claim 5, characterized in that, The method further includes: During model training, when the first initial model outputs multiple product tags, the probability corresponding to each tag is determined; The label with a probability greater than a second threshold is determined from the multiple labels as the classification label.
7. A commodity classification model training device, characterized in that, include: The extraction module is used to extract the first feature of each product in the product set according to the feature extraction model to obtain the first feature set. The first feature is used to characterize the product features and the enterprise features corresponding to the product. The processing module is used to perform clustering processing on the first feature set to obtain multiple clusters, each cluster containing multiple first features; The extraction module is further configured to extract multiple target first features from each cluster to obtain a target first feature set; The training module is used to train the first initial model based on the target first feature set to obtain a trained product classification model; The feature extraction model is obtained by back-updating the product feature network through the enterprise classification training task. After the enterprise classification training is completed, the parameters of the product feature network are fixed and used as the product feature extraction network. The extraction module is further configured to obtain the classification label of the cluster by summarizing the product name corresponding to the first feature in each cluster; determine the cluster center in each cluster and the distance between each first feature and the cluster center; and extract the first feature whose distance is less than a first threshold from each cluster as the target first feature. The first initial model is a learnable fully connected layer connected after being connected to the product feature network, which is fine-tuned while performing product classification training; After obtaining the product category, the parameters of the product feature network and the product classification model are updated, and the extraction of the first feature, clustering processing, and product classification training are repeated until the model training is completed.
8. A computer device, characterized in that, include: A processor and a memory, the processor being configured to execute a product classification model training program stored in the memory to implement the product classification model training method according to any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the commodity classification model training method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Large-scale multi-label classification method based on clustering
CN105095920A
Commodity classification method and device
CN110019807A
Feature extraction method and device and electronic equipment
CN111008667A
E-commerce product picture directory construction method
CN115511571A
