Product attribute filling method and device, storage medium and electronic terminal
By obtaining the attribute values of goods and generating feature matrices, using machine learning algorithms to train classifier models and automatically filling in goods attributes, it solves the problems of low efficiency of traditional manual filling and lack of universality of algorithms, and achieves efficient and accurate filling of goods attributes. .
Patent Information
- Application Number
- CN201810104645.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-02-02
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2038-02-02
AI Technical Summary
The traditional method requires manual operation when filling in the attributes of goods, resulting in high time and labor costs when the number of goods is large. Moreover, the existing filling algorithm lacks universality, has a low filling rate, is prone to mismatching, and reduces filling efficiency.
By obtaining the attribute values of typical goods as basic data, a feature matrix is generated and a machine learning algorithm is used to train a classifier model to automatically fill in the attribute values of the goods to be filled in, adapt to different attributes and improve the filling accuracy.
It realizes the automation of filling in the attributes of goods, reduces the labor cost, improves the filling efficiency and accuracy, and is suitable for filling in the attributes of a large number of goods.
Smart Images

Figure CN110135769B
Abstract
Description
Background Art
[0002] For e-commerce platforms, when classifying and managing goods or products, or when users filter goods or products, they can operate according to their attribute information, and the management of product attribute information becomes crucial. For example, the attribute information of a product may include: the size, brand and origin of a monitor; the color, style, size and texture of a shirt, etc. In addition to the conventional attribute information of a product, new attribute information may also be added when a new product is added.
[0003] When filling in the attributes of goods, the traditional method requires manual filling of the basic attributes of the goods. However, this method is only applicable when the number of goods is small; when the number of goods reaches a certain level, the time cost and labor cost of manually filling in the attributes of goods will become huge, and the work efficiency is low. Although there are some filling algorithms in the existing solutions that can realize the automatic filling of goods attributes, there are still certain defects. For example, the existing filling algorithms need to design different filling rules according to the different attributes of the goods, which is not universal, and the filling rate cannot be effectively guaranteed. For example, for the "screen size" attribute, the corresponding value range needs to be set in advance, such as {4 inches, 4.5 inches, 4.8 inches, 5.2 inches...}. When a new screen size "5.9 inches" appears, if the "5.9 inches" is not set in the value range in advance, the screen size value cannot be filled. For the color attribute, if the product information is "Red Chili Huacai Mobile Phone, Black, 5 Inches", then for the "color" attribute, since there are multiple keywords related to the "color" attribute in the product information, the filling algorithm may not be able to accurately obtain the attribute value of "black", which may result in mismatching. At the same time, for the product attributes that cannot be filled in after the automatic filling algorithm, they still need to be filled in manually, which reduces the filling rate and thus reduces the filling efficiency.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a method for filling in product attributes, a device for filling in product attributes, a storage medium and an electronic terminal, thereby overcoming one or more problems caused by the limitations and defects of related technologies at least to a certain extent.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to a first aspect of the present disclosure, a method for filling in product attributes is provided, comprising:
[0008] Acquire typical goods from the goods to be filled in and obtain attribute values of the typical goods as basic data;
[0009] Obtaining description information of the goods to be filled in and generating a feature matrix according to the description information of the goods to be filled in;
[0010] Using a machine learning algorithm to train the basic data and generate a classifier model;
[0011] The classifier model and the feature matrix are used to obtain the attribute values of the goods to be filled in, and the attribute values of the goods to be filled in are automatically filled in according to the attribute values.
[0012] In an exemplary embodiment of the present disclosure, the obtaining of typical goods from the goods to be filled in includes:
[0013] Obtaining goods to be filled in and extracting feature fields according to description information of the goods to be filled in;
[0014] Clustering the goods to be filled in according to the extracted characteristic fields;
[0015] In each category of the clustering results, one or more of the goods to be filled are randomly selected as typical goods.
[0016] In an exemplary embodiment of the present disclosure, extracting feature fields according to the description information of the goods to be filled in includes:
[0017] Perform word segmentation processing on the description information of the goods to be filled in;
[0018] The word2vec model is used to extract the characteristic fields of each of the goods to be filled in according to the word segments obtained after the word segmentation processing.
[0019] In an exemplary embodiment of the present disclosure, when generating a feature matrix according to the description information of the goods to be filled in, the method further includes:
[0020] Determine whether a filled quantity m is received;
[0021] When it is determined that the filled quantity m is received, the number of categories of the cluster of goods to be filled in is set to m; wherein m>0.
[0022] In an exemplary embodiment of the present disclosure, generating a feature matrix according to the description information of the goods to be filled in includes:
[0023] Performing word segmentation processing on the description information of the product to be filled in to obtain word segments;
[0024] Using a preset model to extract feature fields from the acquired word segmentation;
[0025] The extracted feature fields are respectively subjected to vectorization processing and sparse processing to generate a feature matrix.
[0026] In an exemplary embodiment of the present disclosure, the using a machine learning algorithm to train the basic data and generate a classifier model includes:
[0027] Using n machine learning algorithms to train the basic data respectively and obtain corresponding n classifier models; wherein n>0;
[0028] Evaluate the accuracy of each classifier model in filling in the attribute value of the goods to be filled in through cross-validation;
[0029] The weight of each classifier model for filling in the attributes of the goods to be filled in is calculated according to the accuracy of each classifier model for filling in the attribute values; wherein,
[0030]
[0031] Among them, w c is the weight of the classifier model c; n is the number of classifier models; accuracy cv is the accuracy obtained through cross validation.
[0032] In an exemplary embodiment of the present disclosure, the obtaining the attribute value of the to-be-filled item by using the classifier model and the feature matrix includes:
[0033] The output result of the classifier model is selected as the attribute value of the goods to be filled in according to the weights filled in by each classifier model for each attribute of the goods to be filled in.
[0034] In an exemplary embodiment of the present disclosure, the method further includes:
[0035] Calculating the relationship score between each attribute value in the basic data and each of the goods to be filled in according to the basic data and the description information of each of the goods to be filled in by using an automatic dictionary model;
[0036] The confidence score S of the attribute value corresponding to the current attribute of the item to be filled in is calculated based on the relationship score calculated by the automatic dictionary model and the weights of the n classifier models:
[0037]
[0038] Among them, C is the set of classifier models; f c(i)∈{0,1}, indicating whether the classifier model c fills in the attribute value of the current item to be filled in; w c ∈[0, 1], represents the weight of the attribute value currently filled in by the classifier c; D(i)∈[0, 1], represents the relationship score calculated by the automatic dictionary model; w d ∈[0, 1], represents the weight of the automatic dictionary model;
[0039] Determine whether the confidence score of the current attribute of the product to be filled in is greater than a preset accuracy rate;
[0040] When it is determined that the confidence score is greater than the accuracy rate, the attribute value of the current attribute is output.
[0041] In an exemplary embodiment of the present disclosure, the method further includes:
[0042] The outputted attribute value is added to the basic data.
[0043] In an exemplary embodiment of the present disclosure, the method further includes:
[0044] When it is determined that the confidence score of the current attribute of the item to be filled is less than the preset accuracy rate, the item to be filled is retained and waits for the next attribute filling.
[0045] In an exemplary embodiment of the present disclosure, the calculating of the relationship score between each attribute value in the basic data and each of the goods to be filled in according to the basic data and the description information of each of the goods to be filled in by using an automatic dictionary model includes:
[0046] Establishing existing attribute value domains corresponding to each attribute according to the basic data;
[0047] Performing word segmentation processing on the elements in the existing attribute value domain using the Jieba word segmentation model to obtain a first word segmentation set;
[0048] Splitting and filtering the elements according to a first preset rule to obtain a second word segmentation list;
[0049] Merging and filtering the first word segmentation set and the second word segmentation list according to a second preset rule to obtain a third word segmentation set;
[0050] Establishing a mapping relationship table between the element and the third word set;
[0051] Traversing each element of the attribute value domain and establishing corresponding mapping relationships for each element and adding them to the mapping relationship table;
[0052] The prediction result is searched in the mapping relationship table according to the characteristic fields in the product description information to be filled in and generated.
[0053] In an exemplary embodiment of the present disclosure, the machine learning algorithm includes:
[0054] Any one or more of support vector machine algorithm, multinomial naive Bayes algorithm, multilayer perceptron algorithm, random forest algorithm and K-nearest neighbor algorithm.
[0055] In an exemplary embodiment of the present disclosure, the unit of the goods is a commodity, a single product or a SKU.
[0056] According to a second aspect of the present disclosure, there is provided a device for filling in product attributes, comprising:
[0057] A typical data acquisition module is used to acquire typical goods from the goods to be filled in and acquire the attribute values of the typical goods as basic data;
[0058] A feature matrix generation module, used to obtain the description information of the goods to be filled in and generate a feature matrix according to the description information of the goods to be filled in;
[0059] A classifier model generation module, used to train the basic data using a machine learning algorithm and generate a classifier model;
[0060] The attribute filling execution module is used to obtain the attribute value of the goods to be filled in by using the classifier model and the feature matrix, and automatically fill in the attribute value of the goods to be filled in according to the attribute value.
[0061] According to a third aspect of the present disclosure, there is provided a storage medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned method for filling in product attributes is implemented.
[0062] According to a fourth aspect of the present disclosure, there is provided an electronic terminal, comprising:
[0063] Processor; and
[0064] A memory, configured to store executable instructions of the processor;
[0065] The processor is configured to perform the following operations by executing the executable instructions:
[0066] Acquire typical goods from the goods to be filled in and obtain attribute values of the typical goods as basic data;
[0067] Obtaining description information of the goods to be filled in and generating a feature matrix according to the description information of the goods to be filled in;
[0068] Using a machine learning algorithm to train the basic data and generate a classifier model;
[0069] The classifier model and the feature matrix are used to obtain the attribute values of the goods to be filled in, and the attribute values of the goods to be filled in are automatically filled in according to the attribute values.
[0070] The method for filling in product attributes provided by an embodiment of the present disclosure first obtains some typical products that have been filled in with complete product attribute data and uses them as basic data, generates a feature matrix based on the basic product information of all products, and uses a machine learning algorithm to train and generate a classifier based on technical data. Finally, the generated classifier and feature matrix can be used to automatically fill in the attribute values of each product to be filled in. By training the classifier with the complete product attribute data of some typical products, the computer can automatically learn the filling rules of the filled products, so that the classifier model can adapt to the different attributes of each product, and reuse the learned rules on similar products, thereby ensuring the accuracy of product attribute filling. In addition, the labor cost can be greatly reduced.
[0071] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0073] Figure 1 A schematic diagram schematically illustrates a method for filling in product attributes in an exemplary embodiment of the present disclosure;
[0074] Figure 2 A schematic diagram of a method for obtaining typical commodity attribute data in an exemplary embodiment of the present disclosure is schematically shown;
[0075] Figure 3 A schematic diagram of a method for generating a feature matrix for a product to be filled in an exemplary embodiment of the present disclosure is schematically shown;
[0076] Figure 4 A schematic diagram schematically shows the composition of a device for filling in product attributes in an exemplary embodiment of the present disclosure;
[0077] Figure 5 Another schematic diagram schematically illustrates another device for filling in product attributes in an exemplary embodiment of the present disclosure;
[0078] Figure 6Another schematic diagram of another device for filling in product attributes in an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0079] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0080] This example implementation first provides a method for filling in product attributes, which can be applied to the fields of e-commerce platforms, warehouse management, etc. to automatically fill in the attributes of products and commodities, especially for large quantities of products and commodities. For example, the product attributes of a television may include: screen size, brand and origin, etc.; the product attributes of a shirt may include: color, style and material, etc. Figure 1 As shown in , the above-mentioned method for filling product attributes may include the following steps:
[0081] Step S1, obtaining typical goods from the goods to be filled in and obtaining attribute values of the typical goods as basic data;
[0082] Step S2, obtaining the description information of the goods to be filled in and generating a feature matrix according to the description information of the goods to be filled in;
[0083] Step S3, using a machine learning algorithm to train the feature matrix according to the basic data and generate a classifier model;
[0084] Step S4, using the classifier model and the feature matrix to obtain the attribute values of the goods to be filled in, and automatically filling in the attribute values of the goods to be filled in according to the attribute values.
[0085] The method for filling in product attributes provided in this exemplary embodiment uses product attribute data of some typical products to train a classifier, so that the computer can automatically learn the filling rules of filled products, so that the classifier model can adapt to the different attributes of each product, and reuse the learned rules on similar products, thereby ensuring the accuracy of product attribute filling. In addition, the labor cost can be greatly reduced.
[0086] Below, each step of the method for filling in product attributes in this example implementation will be described in more detail with reference to the accompanying drawings and embodiments.
[0087] Step S1, obtaining typical goods from the goods to be filled in and obtaining attribute values of the typical goods as basic data.
[0088] In this example implementation, reference Figure 2 As shown, the method of obtaining typical goods from the goods to be filled may include:
[0089] Step S11, obtaining the goods to be filled in and extracting the characteristic fields according to the description information of the goods to be filled in;
[0090] Step S12, clustering the goods to be filled in according to the extracted characteristic fields;
[0091] Step S13, randomly selecting one or more of the goods to be filled in each category of the clustering results as typical goods;
[0092] Step S14, determining the attribute value of each attribute of the typical product.
[0093] The goods to be filled in in the embodiments of the present disclosure refer to goods whose attribute values have not been filled in. For all goods to be filled in whose attribute values have not been filled in, feature fields can be extracted from their description information and a feature matrix can be generated based on the extracted feature fields. Then they are classified by means of a clustering algorithm, and some goods in each category are randomly selected as typical goods. For the acquisition of the attribute values of typical goods, the attribute values of each attribute of each typical product can be accurately filled in by manual filling, or by automatic filling by algorithms and manual assisted filling, and the attribute values corresponding to the attributes of each typical product can be used as basic data.
[0094] For clustering results, a product clustering result list can be generated, and a product can be randomly selected from each category in the product clustering result list as a typical product, so as to ensure the accuracy of subsequent attribute filling while minimizing the amount of calculation. Or, to ensure the validity of basic data, multiple products can be randomly selected from each category as typical products, for example, 2 or 3 products can be randomly selected from each category as typical products.
[0095] In this example implementation, the above-mentioned extraction of feature fields based on the description information of the goods to be filled in may include:
[0096] Step S111, performing word segmentation processing on the description information of the product to be filled in;
[0097] Step S112, extracting characteristic fields of each of the goods to be filled in using a word2vec model according to the word segments obtained after the word segmentation processing.
[0098] The word2vec model maps the relationship of each word to the same coordinate system based on the contextual relationship of each word in the article, forming a large matrix that reflects the relationship of each word. The relationship between these words is derived through contextual correlation, which has a sequential nature. The word2vec model also uses the Huffman compression algorithm to perform a good weight reduction process on some popular words. Therefore, it has a good effect on some similar words or word expansions. Therefore, the word2vec model can accurately extract the feature fields in the product description information.
[0099] For example, the description information of a product includes: 25-degree camellia oil, edible oil, first-grade pressed tea seed oil, 1.1L bottle, and the extracted feature fields may include: tea seed oil, 1.1L, 25 degrees, bottled and pressed, etc.
[0100] Based on the above, in this example implementation, when generating a feature matrix according to the description information of the goods to be filled in, the method further includes:
[0101] Step 12-1, determine whether a filled quantity m is received;
[0102] Step 12-2, when it is determined that the filled quantity m is received, the number of categories of the cluster of goods to be filled in is set to m; wherein m>0.
[0103] Before clustering the goods to be filled in, it can be determined whether the number m of goods to be filled in input by the user has been received. When the user's input is received, the number of clustering categories can be set to m according to user needs, and the number of rows of goods to be filled in each time can be set to m at the same time, thereby achieving control over the number of goods filled in at a single time when filling in attributes.
[0104] Step S2, obtaining the description information of the goods to be filled in and generating a feature matrix according to the description information of the goods to be filled in.
[0105] In this example implementation, reference Figure 3 As shown, the above step S2 may specifically include:
[0106] Step S21, performing word segmentation processing on the description information of the product to be filled in to obtain word segments;
[0107] Step S22, extracting feature fields from the acquired word segmentation using a preset model;
[0108] Step S23, performing vectorization processing and sparse processing on the extracted feature fields to generate a feature matrix.
[0109] After determining the attribute value of each attribute of each typical product, the description information of all products to be filled in can be processed by Chinese word segmentation and feature fields can be extracted to remove punctuation marks, incorrect characters, special symbols, etc. in the product description information. When extracting feature fields, the word2vec model or other models can be used to extract feature fields. In addition, the feature fields can be sparsely processed and vectorized respectively to obtain the feature matrix of the products to be filled in. In other exemplary embodiments of the present disclosure, when obtaining the feature matrix, the feature field of the word segmentation set can also be extracted for all products including the products to be filled in, typical products, and other products that already have complete attribute values, thereby expanding the capacity of the feature matrix and improving the effectiveness of the feature matrix.
[0110] The above-mentioned sparse processing can be completed by a sparse model, which can effectively remove redundant data. The sparse model can adopt a sparse model, a group sparse model, a tree sparse model or a graph sparse model. By vectorizing the word segmentation, the speed of data processing can be effectively improved, thereby improving work efficiency.
[0111] Step S3, using a machine learning algorithm to train the feature matrix according to the basic data and generate a classifier model.
[0112] In this example implementation, the attribute data of typical goods selected according to the goods to be filled in can be used as a training set and trained to generate a classifier model, and the obtained classifier model can be used to automatically fill in the attribute values of the remaining goods to be filled in.
[0113] For example, the above-mentioned machine learning algorithm can adopt algorithm models such as support vector machine algorithm, multinomial naive Bayes algorithm, multilayer perceptron algorithm, random forest algorithm or K-nearest neighbor algorithm.
[0114] Further, in other exemplary embodiments of the present disclosure, the above step S3 may also include:
[0115] Step S31, using n machine learning algorithms to train the basic data respectively and obtain corresponding n classifier models; wherein n>0;
[0116] Step S32, evaluating the accuracy of filling in the attribute values of the goods attributes to be filled in by each of the classifier models through cross-validation;
[0117] Step S33, calculating the weight of each classifier model for filling in the attribute of the goods to be filled in according to the accuracy of each classifier model for filling in the attribute value; wherein,
[0118]
[0119]
[0120] Among them, w c is the weight of the classifier model c; n is the number of classifier models; Accuracy cv is the accuracy obtained through cross-validation;
[0121] In the above formula, TP means that the true value is positive and the predicted value is also positive; TN means that the true value is negative and the predicted value is negative; FP means that the true value is negative and the predicted value is positive; FN means that the true value is positive and the predicted value is negative.
[0122] In this exemplary embodiment, when filling in the attribute value of a certain attribute of the goods, in order to avoid the situation where the attribute value filling accuracy is low due to the use of a single classifier model, multiple machine learning algorithms can be used to train the basic data to generate multiple classifier models, such as the above-mentioned support vector machine algorithm, multinomial naive Bayes algorithm, multilayer perceptron algorithm, random forest algorithm or K-nearest neighbor algorithm. And each classifier model is used to automatically fill in the attribute value of the current attribute. For example, 3, 4 or 5 machine learning algorithms can be selected for training at the same time and 3, 4 or 5 classifier models can be generated.
[0123] Since different classifier models often have different filling effects on the same attribute value, even the same classifier has different results for a single attribute in multiple fillings. Therefore, in order to obtain more accurate attribute value filling results, multiple classifier models can be used to fill in the current attribute value, and the accuracy of each classifier model filling in the attribute value of the current attribute can be evaluated by cross-validation, and the result corresponding to the classifier model with the highest accuracy in the evaluation results can be selected for output. Alternatively, the evaluation results can be converted into weights for each classifier model when filling in each attribute, and the attribute value can be filled in according to the weight value of each classifier model for the current attribute.
[0124] For example, for the item "shirt", the attributes that need to be filled in include: color, brand, material, origin, price, collar type, cuff type, etc. When automatically filling in attribute values, the above five machine learning algorithms can be used to obtain the corresponding five classifier models respectively, and the accuracy of the five classifier models in filling in each attribute is evaluated, and the result corresponding to the classifier model with the highest accuracy is selected as the attribute value filling result output. Alternatively, the weight value corresponding to the automatic filling of the current attribute by each classifier model is calculated based on the accuracy evaluation results of the five classifier models in filling in each attribute. Subsequently, for the current attribute, the results of each classifier are weighted according to the above weights to obtain the final result. For example, after calculation, for the attribute "collar type", if the accuracy of the random forest algorithm model is higher than that of the multi-layer perceptron algorithm model, and is twice the accuracy of the multi-layer perceptron algorithm model. Suppose that when filling in the attribute "collar type" for a certain shirt, the result calculated by the random forest algorithm model is "stand-up collar" and the result obtained by the multi-layer perceptron algorithm is "round collar". In the final weight calculation, the weight votes corresponding to the attribute filling result "stand-up collar" are twice the weight votes corresponding to the "round collar". Or, when filling in the attribute "color", if the accuracy of the classifier model corresponding to the support vector machine algorithm is the highest, then the weight W of the classifier model C1 corresponding to the support vector machine algorithm is c1 The maximum value means that when filling in the attribute "color", the classifier model corresponding to the support vector machine algorithm contributes the most to the prediction results.
[0125] If multiple classifier models have the same weight for filling in a certain attribute value, then the multiple classifier models have the same influence on the final output result, which is equivalent to each classifier model giving an equally weighted vote to its own attribute filling prediction result.
[0126] Step S4, using the classifier model and the feature matrix to obtain the attribute values of the goods to be filled in, and automatically filling in the attribute values of the goods to be filled in according to the attribute values.
[0127] Preferably, based on the above content, in this exemplary embodiment, when the classifier model and the feature matrix are used to automatically fill in the attribute values of the goods, the above method may also include:
[0128] Step S41, using an automatic dictionary model to calculate the relationship score between each attribute value in the basic data and each of the goods to be filled in according to the basic data and the description information of each of the goods to be filled in;
[0129] Step S42, calculating the confidence score S of the attribute value corresponding to the current attribute of the item to be filled in according to the relationship score calculated by the automatic dictionary model and the weights of the n classifier models:
[0130]
[0131] Among them, C is the set of classifier models; f c (i)∈{0,1}, indicating whether the classifier model c fills in the attribute value of the current item to be filled in; w c ∈[0, 1], represents the weight of the attribute value currently filled in by the classifier model c; D(i)∈[0, 1], represents the relationship score calculated by the automatic dictionary model; w d ∈[0, 1], represents the weight of the automatic dictionary model;
[0132] Step S43, determining whether the confidence score of the current attribute of the product to be filled in is greater than a preset accuracy rate;
[0133] Step S44: outputting the attribute value of the current attribute when it is determined that the confidence score is greater than the accuracy rate.
[0134] In this embodiment, after obtaining the weight values automatically filled in by each classifier model for each attribute, the relationship scores between each attribute value in the basic data and each of the goods to be filled in can also be calculated according to the automatic dictionary model, and the relationship scores and the weight values of each classifier model can be used to determine whether to output the attribute values of the current attributes of the goods obtained by the classifier model.
[0135] For example, when the confidence score of the current attribute value is greater than the preset accuracy, the attribute value of the current attribute of the product can be output; if the confidence score is less than the preset accuracy, the attribute value can be not output, and the product can be put back into the set of products to be filled in, waiting for the next filling. The above-mentioned preset accuracy can be set when the user sets the number of clusters of products to be filled in, or it can be set separately. The present disclosure does not make any special limitation on this.
[0136] In this exemplary embodiment, the above-mentioned calculation of the relationship score between each attribute value in the basic data and each of the goods to be filled in according to the basic data and the description information of each of the goods to be filled in by using an automatic dictionary model includes:
[0137] Step S301, establishing an existing attribute value domain corresponding to each attribute according to the basic data;
[0138] Step S302, performing word segmentation processing on the elements in the existing attribute value domain using the Jieba word segmentation model to obtain a first word segmentation set;
[0139] Step S303, splitting and filtering the elements according to the first preset rule to obtain a second word segmentation list;
[0140] Step S304, merging and filtering the first word segmentation set and the second word segmentation list according to a second preset rule to obtain a third word segmentation set;
[0141] Step S305, establishing a mapping relationship table between the element and the third word set;
[0142] Traversing each element of the attribute value domain and establishing corresponding mapping relationships for each element and adding them to the mapping relationship table;
[0143] Step S306: search in the mapping relationship table according to the characteristic fields in the product description information to be filled and generate a prediction result.
[0144] For example, for the capacity attribute, the existing basic data includes: 1.1-3 liters, 0.6-1 liter, 0-0.5 liters, other, more than 5 liters, 3.1-5 liters, 0.5-1 liter, 1-3 liters, unlimited, 3-5 liters. The above data constitutes the existing capacity attribute value domain attVals. For each element of the capacity attribute value domain, the jieba word segmentation model is used to split it. For example, after "1.1-3 liters" is split, the first word segmentation set attValToks is obtained: [1.1, -, 3, liters].
[0145] Use list(1.1-3 liters) for "1.1-3 liters" and split it into single chars: [1, ., 1, -, 3, liters]. Then, use regular expressions to remove the str that starts with letters and numbers in single chars to get the second word list: filtered Single Chars: [., -, liters]. Combine the first word set with the second word list to get a new word set: [1.1, -, 3, liters, liters]. Remove the Chinese and English punctuation marks in the word set to get the third word set: [1.1, 3, liters, liters]. At this point, establish a mapping relationship list between the original element "1.1-3 liters" and the third word set: attValLookup: {1.1: [1.1-3 liters]; 3: [1.1-3 liters]; liters: [1.1-3 liters, 1.1-3 liters]}.
[0146] Based on the above method, all elements in the capacity attribute value domain are traversed and added to the mapping relationship list, and the following can be obtained:
[0147] {1.1: [1.1-3 liters]; 3: [1.1-3 liters, 1-3 liters, 3-5 liters]; Liters: [1.1-3 liters, 1.1-3 liters, 0.6-1 liter, 0.6-1 liter, 0-0.5 liters, 0-0.5 liters, more than 5 liters, more than 5 liters, 3.1-5 liters, 3.1-5 liters, 0.5-1 liter, 0.5-1 liter, 1-3 liters, 1-3 liters, 3-5 liters, 3-5 liters]; 0.6: [0.6-1 liter]; 1: [ 0.6-1 liter, 0.5-1 liter, 1-3 liters]; 0: [0-0.5 liter]; 0.5: [0-0.5 liter, 0.5-1 liter]; others: [others]; its: [others]; it: [others]; 5: [more than 5 liters, 3.1-5 liters, 3-5 liters]; above: [more than 5 liters]; with: [more than 5 liters]; above: [more than 5 liters]; 3.1: [3.1-5 liters]; not: [unlimited, unlimited]; limited: [unlimited, unlimited]}.
[0148] For example, the name of a product description includes "25-degree camellia oil, edible oil, first-grade pressed tea seed oil, 1.1L bottle". Then find each key field key in the mapping relationship list in turn. For example, "1" is in "25-degree camellia oil, edible oil, first-grade pressed tea seed oil, 1.1L bottle". For the values corresponding to "1": [0.6-1 liter, 0.5-1 liter, 1-3 liters], add the three of them to the key of predictions For Sku respectively, and set their value = 1. If one of them is already in the key of predictions For Sku, add 1 to the corresponding value.
[0149] For "25-degree camellia oil, edible oil, first-grade pressed tea seed oil, 1.1L bottle", there are "1.1", "1", and "5" in it, so the result is: predictions For Sku: {1.1-3 liters: 1; 0.6-1 liter: 1; 0.5-1 liter: 1; 1-3 liters: 1; 5 liters and above: 1; 3.1-5 liters: 1; 3-5 liters: 1}. Normalize it: each value / sum(value), and you get: {1.1-3 liters: 1 / 7; 0.6-1 liter: 1 / 7; 0.5-1 liter: 1 / 7; 1-3 liters: 1 / 7; 5 liters and above: 1 / 7; 3.1-5 liters: 1 / 7; 3-5 liters: 1 / 7}. For each product, the corresponding predictions For Sku are calculated as the prediction result of the automatic dictionary model.
[0150] The weight w of the automatic dictionary model above dIt can also be determined by cross-validation. For example, take 5-fold cross-validation as an example; first determine the selection interval of wd [0.1, 0.2, 0.3, ..., 0.9]; divide the filled rows into 5 equal parts, four of which are used to train the classifier and automatic dictionary, and the other one is used for prediction. Assuming that the weights of each classifier are determined, let wd = 0.1, and calculate in the prediction data:
[0151]
[0152] Let wd traverse [0.1, 0.2, 0.3, ..., 0.9], and obtain A1, A2, A3, ..., A9 respectively. Assuming that A5 is the largest after calculation, then wd = 0.5.
[0153] In other exemplary embodiments of the present disclosure, when the above method fills in the product attributes, the unit may also be commodity, single product or SKU. The present disclosure does not make any special limitation on this.
[0154] By setting the automatic dictionary model in combination with each classifier model, it is determined whether the confidence score of each attribute value filled in is greater than the preset accuracy rate, thereby meeting the user's requirement for the accuracy rate of attribute filling. In addition, by adding the goods with a confidence score less than the preset accuracy rate to the set of goods to be filled in, waiting for the next automatic filling, after multiple iterations, the filling rate can be effectively guaranteed, and then the accuracy rate of the goods attribute filling is guaranteed under the premise of ensuring the correct rate, so that the above-mentioned goods attribute filling method can be applied to various types of goods and goods attributes.
[0155] Further, refer to Figure 4 As shown, in the embodiment of this example, a product attribute filling device 4 is also provided, comprising: a typical data acquisition module 41, a feature matrix generation module 42, a classifier model generation module 43 and an attribute filling execution module 44. Among them:
[0156] The typical data acquisition module 41 can be used to acquire typical goods from the goods to be filled in and acquire attribute values of the typical goods as basic data.
[0157] The feature matrix generation module 42 may be used to obtain the description information of the goods to be filled in and generate a feature matrix according to the description information of the goods to be filled in.
[0158] The classifier model generation module 43 can be used to train the basic data using a machine learning algorithm and generate a classifier model.
[0159] The attribute filling execution module 44 can use the classifier model and the feature matrix to obtain the attribute values of the goods to be filled in, and automatically fill in the attribute values of the goods to be filled in according to the attribute values.
[0160] The specific details of each module in the above-mentioned product attribute filling device have been described in detail in the corresponding product attribute filling method, so they will not be repeated here.
[0161] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0162] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above data query method is also provided.
[0163] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0164] Refer to the following Figure 5 The electronic device 600 according to this embodiment of the present invention is described. Figure 5 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0165] like Figure 5 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: at least one processing unit 610, at least one storage unit 620, and a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610).
[0166] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 610 can perform the following steps: Figure 1The S1 shown in the figure obtains typical goods from the goods to be filled in and obtains the attribute values of the typical goods as basic data; S2: obtains the description information of the goods to be filled in and generates a feature matrix according to the description information of the goods to be filled in; S3: uses a machine learning algorithm to train the basic data and generates a classifier model; S4: uses the classifier model and the feature matrix to obtain the attribute values of the goods to be filled in, and automatically fills in the attribute values of the goods to be filled in according to the attribute values.
[0167] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0168] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0169] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0170] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0171] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0172] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0173] refer to Figure 6 As shown, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0174] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0175] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0176] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0177] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0178] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0179] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0180] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for filling product attributes, characterized in that: include: Acquire typical goods from the goods to be filled in and obtain attribute values of the typical goods as basic data; Obtaining description information of the goods to be filled in and generating a feature matrix according to the description information of the goods to be filled in; The basic data is trained using a machine learning algorithm and a classifier model is generated, including: using n machine learning algorithms to train the basic data respectively and obtain corresponding n classifier models; wherein n>0; evaluating the accuracy of each classifier model in filling in the attribute value of the to-be-filled goods attribute through cross-validation; and calculating the weight of each classifier model in filling in the attribute of the to-be-filled goods according to the accuracy of each classifier model in filling in the attribute value; Using the classifier model and the feature matrix to obtain the attribute values of the goods to be filled in, and automatically filling in the attribute values of the goods to be filled in according to the attribute values; The method also includes: using an automatic dictionary model to calculate the relationship score between each attribute value in the basic data and each of the goods to be filled in according to the basic data and the description information of each of the goods to be filled in; calculating the confidence score S of the attribute value corresponding to the current attribute of the goods to be filled in according to the relationship score calculated by the automatic dictionary model and the weights of the n classifier models; judging whether the confidence score of the current attribute of the goods to be filled in is greater than a preset accuracy rate; and outputting the attribute value of the current attribute when judging that the confidence score is greater than the accuracy rate.
2. The method for filling product attributes according to claim 1, characterized in that: The method of obtaining typical goods from the goods to be filled in includes: Obtaining goods to be filled in and extracting feature fields according to description information of the goods to be filled in; Clustering the goods to be filled in according to the extracted characteristic fields; In each category of the clustering results, one or more of the goods to be filled are randomly selected as typical goods.
3. The method for filling in product attributes according to claim 2, characterized in that: The step of extracting feature fields according to the description information of the goods to be filled in includes: Perform word segmentation processing on the description information of the goods to be filled in; The word2vec model is used to extract the characteristic fields of each of the goods to be filled in according to the word segments obtained after the word segmentation processing.
4. The method for filling in product attributes according to claim 2, characterized in that: When generating a feature matrix according to the description information of the goods to be filled in, the method further includes: Determine whether a filled quantity m is received; When it is determined that the filled quantity m is received, the number of categories of the cluster of goods to be filled in is set to m; wherein m>0.
5. The method for filling product attributes according to claim 1, characterized in that: The step of generating a feature matrix according to the description information of the goods to be filled in includes: Performing word segmentation processing on the description information of the product to be filled in to obtain word segments; Using a preset model to extract feature fields from the acquired word segmentation; The extracted feature fields are respectively subjected to vectorization processing and sparse processing to generate a feature matrix.
6. The method for filling in product attributes according to claim 1, characterized in that: The step of calculating the weight of each classifier model for filling in the attributes of the goods to be filled in includes: Among them, w c is the weight of the classifier model c; n is the number of classifier models; accuracy cv is the accuracy obtained through cross validation.
7. The method for filling product attributes according to claim 6, characterized in that: The method of obtaining the attribute value of the item to be filled in by using the classifier model and the feature matrix includes: The output result of the classifier model is selected as the attribute value of the goods to be filled in according to the weights filled in by each classifier model for each attribute of the goods to be filled in.
8. The method for filling in product attributes according to claim 1, characterized in that: The calculation of the confidence score S of the attribute value corresponding to the current attribute of the product to be filled in includes: Among them, C is the set of classifier models; f c (i)∈{0,1}, indicating whether the classifier model c fills in the attribute value of the current product to be filled in; w c ∈[0, 1], represents the weight of the attribute value currently filled in by the classifier c; D(i)∈[0, 1], represents the relationship score calculated by the automatic dictionary model; w d ∈[0, 1], represents the weight of the automatic dictionary model.
9. The method for filling in product attributes according to claim 8, characterized in that: The method further comprises: The outputted attribute value is added to the basic data.
10. The method for filling in product attributes according to claim 8, characterized in that: The method further comprises: When it is determined that the confidence score of the current attribute of the item to be filled is less than the preset accuracy rate, the item to be filled is retained and waits for the next attribute filling.
11. The method for filling in product attributes according to claim 8, characterized in that: The calculating of the relationship score between each attribute value in the basic data and each of the goods to be filled in according to the basic data and the description information of each of the goods to be filled in by using an automatic dictionary model includes: Establishing existing attribute value domains corresponding to each attribute according to the basic data; Performing word segmentation processing on the elements in the existing attribute value domain using the Jieba word segmentation model to obtain a first word segmentation set; Splitting and filtering the elements according to preset rules to obtain a second word segmentation list; Merge and filter the first word segmentation set and the second word segmentation list according to a preset rule to obtain a third word segmentation set; Establishing a mapping relationship table between the element and the third word set; Traversing each element of the attribute value domain and establishing corresponding mapping relationships for each element and adding them to the mapping relationship table; The prediction result is searched in the mapping relationship table according to the characteristic fields in the product description information to be filled in and generated.
12. The method for filling in product attributes according to claim 6, characterized in that: The machine learning algorithm includes: Any one or more of support vector machine algorithm, multinomial naive Bayes algorithm, multilayer perceptron algorithm, random forest algorithm and K-nearest neighbor algorithm.
13. The method for filling in product attributes according to claim 1, characterized in that: The unit of the goods is commodity, single product or SKU.
14. A device for filling in product attributes, characterized in that: include: A typical data acquisition module is used to acquire typical goods from the goods to be filled in and acquire attribute values of the typical goods as basic data; A feature matrix generation module, used to obtain the description information of the goods to be filled in and generate a feature matrix according to the description information of the goods to be filled in; A classifier model generation module, used to train the basic data using a machine learning algorithm and generate a classifier model, including: using n machine learning algorithms to train the basic data respectively and obtain corresponding n classifier models; wherein n>0; evaluating the accuracy of each classifier model in filling in the attribute value of the to-be-filled goods attribute through cross-validation; and calculating the weight of each classifier model in filling in the attribute of the to-be-filled goods according to the accuracy of each classifier model in filling in the attribute value; An attribute filling execution module, used to obtain the attribute value of the goods to be filled in by using the classifier model and the feature matrix, and automatically fill in the attribute value of the goods to be filled in according to the attribute value; The device is also used to calculate the relationship score between each attribute value in the basic data and each of the goods to be filled in according to the basic data and the description information of each of the goods to be filled in by using an automatic dictionary model; calculate the confidence score S of the attribute value corresponding to the current attribute of the goods to be filled in according to the relationship score calculated by the automatic dictionary model and the weights of the n classifier models; judge whether the confidence score of the current attribute of the goods to be filled in is greater than a preset accuracy rate; and output the attribute value of the current attribute when it is judged that the confidence score is greater than the accuracy rate.
15. A storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method for filling in product attributes according to any one of claims 1 to 13.
16. An electronic terminal, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the following operations by executing the executable instructions: Acquire typical goods from the goods to be filled in and obtain attribute values of the typical goods as basic data; Obtaining description information of the goods to be filled in and generating a feature matrix according to the description information of the goods to be filled in; The basic data is trained using a machine learning algorithm and a classifier model is generated, including: using n machine learning algorithms to train the basic data respectively and obtain corresponding n classifier models; wherein n>0; evaluating the accuracy of each classifier model in filling in the attribute value of the to-be-filled goods attribute through cross-validation; and calculating the weight of each classifier model in filling in the attribute of the to-be-filled goods according to the accuracy of each classifier model in filling in the attribute value; Using the classifier model and the feature matrix to obtain the attribute values of the goods to be filled in, and automatically filling in the attribute values of the goods to be filled in according to the attribute values; The processor is further configured to execute: using an automatic dictionary model to calculate the relationship score between each attribute value in the basic data and each of the goods to be filled in according to the basic data and the description information of each of the goods to be filled in; calculating the confidence score S of the attribute value corresponding to the current attribute of the goods to be filled in according to the relationship score calculated by the automatic dictionary model and the weights of the n classifier models; and determining whether the confidence score of the current attribute of the goods to be filled in is greater than a preset accuracy rate; When it is determined that the confidence score is greater than the accuracy rate, the attribute value of the current attribute is output.
