Method, device and equipment for identifying attribute of article and computer readable medium
In the training of neural network model, the business classification model and sampling classification model are used to filter out the data to be marked with greater recognition and manual labeling, which solves the problem of slow improvement of neural network models in the existing technology, and achieves faster and more accurate object attribute recognition.
Patent Information
- Application Number
- CN202311340283.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-16
- Publication Date
- 2025-04-18
AI Technical Summary
In the prior art, when manually labeling item attributes to train a neural network model, due to the large number of semantic similar texts in the text data, repeated labeling is caused, and the neural network model is slow to improve and cannot meet business needs.
By entering the data to be marked into the business classification model, a sample pair is constructed, and the sample classification model is used to obtain the sample difficulty label, filter out the data to be marked with greater difficulty for manual identification, and then train the neural network model.
It improves the training speed and accuracy of neural network models, meets business needs, and saves labeling time and cost.
Smart Images

Figure CN119848529A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and computer-readable medium for identifying object attributes. Background Art
[0002] Item attributes are used to describe certain physical or experiential dimensions of an item, such as the attributes of a mobile phone: screen, system, camera / photography, and user experience. Item attributes are used to identify the dimensions of an item that users are primarily concerned about.
[0003] In the process of implementing the present invention, the inventors found that the prior art has at least the following problems: manual annotation of item attributes is often used to train the neural network model to automatically identify item attributes. Since there are a large number of semantically similar texts in the text data, a large number of repeated annotations are likely to occur, resulting in a slow improvement of the neural network model and failure to meet business needs. Summary of the invention
[0004] In view of this, embodiments of the present invention provide a method, apparatus, device and computer-readable medium for identifying object attributes, which can improve the training speed of a neural network model to accurately identify object attributes to meet business needs.
[0005] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for identifying an attribute of an object is provided, comprising:
[0006] Input the data to be labeled into the business classification model, and construct a sample pair with the data vector to be labeled output by the business classification model and the training data vector closest to the data vector to be labeled;
[0007] Inputting the sample pair into a sampling classification model to obtain a sample difficulty label of the data to be labeled;
[0008] After determining the recognition difficulty of the data to be labeled according to the sample difficulty labels of the data to be labeled and manually labeling the object attributes of the data to be labeled with high recognition difficulty, a neural network model is trained.
[0009] Before inputting the data to be labeled into the business classification model, the method further includes:
[0010] Obtaining encoding vectors of two training data from the business training model, constructing a simulation vector, and outputting the simulation vector to a classifier in the business training model to obtain a sample difficulty label of the simulation vector;
[0011] The business training model and the sampling training model are trained with the encoding vectors of the two training data and the sample difficulty labels to obtain the business classification model and the sampling classification model respectively.
[0012] The method of obtaining the encoding vectors of two training data from the business training model, constructing a simulation vector, and outputting the simulation vector to a classifier in the business training model to obtain a sample difficulty label of the simulation vector includes:
[0013] Obtaining encoding vectors of two training data in the business training model, and using an intermediate vector between the encoding vectors of the two training data as the simulation vector;
[0014] Outputting the simulated vector to the classifier in the business training model to obtain a predicted label of the simulated vector;
[0015] Constructing a sample difficulty label of the simulation vector according to the item attribute label of the training data and the predicted label of the simulation vector.
[0016] The step of training the business training model and the sampling training model with the encoding vectors of the two training data and the sample difficulty labels to obtain a business classification model and a sampling classification model respectively includes:
[0017] Using the encoding vectors of the two training data, a combination vector is established, and the combination vector is input into the Transformer module of the sampling training model to obtain a construction vector;
[0018] Based on the combined vector and the constructed vector, a sampling vector is established, and the sampling vector is input into a classifier in the sampling training model to obtain a sampling difficulty label of the sampling vector;
[0019] The business training model and the sampling training model are trained with the sample difficulty label, the sampling difficulty label, the loss function of the business training model and the loss function of the sampling training model to obtain a business classification model and a sampling classification model respectively.
[0020] The loss function of the business training model includes a cross entropy loss function; the loss function of the sampling training model includes a generalized cross entropy loss function.
[0021] The training data closest to the data vector to be labeled is data obtained from a K-nearest neighbor model established with the training data.
[0022] Determining the recognition difficulty of the data to be labeled according to the sample difficulty label of the data to be labeled includes:
[0023] The sample difficulty label includes a first sample difficulty label and a second sample difficulty label of the data to be labeled, the first sample difficulty label includes that the item attribute labels of the sample pair are the same, the second sample difficulty label includes that the item attribute labels of the sample pair are different, and the predicted label of the intermediate vector of the sample pair is the same as the item attribute label of the one training data;
[0024] The recognition difficulty of the to-be-labeled data is determined by taking an average value of the probabilities of the first sample difficulty labels and an average value of the probabilities of the second sample difficulty labels.
[0025] According to a second aspect of an embodiment of the present invention, there is provided a device for identifying attributes of an item, comprising:
[0026] A construction module, used to input the data to be labeled into the business classification model, and construct a sample pair with the data vector to be labeled output by the business classification model and the training data vector closest to the data vector to be labeled;
[0027] An input module, used for inputting the sample pair into a sampling classification model to obtain a sample difficulty label of the data to be labeled;
[0028] The determination module is used to determine the recognition difficulty of the data to be labeled according to the sample difficulty label of the data to be labeled, and train the neural network model after manually labeling the object attributes of the data to be labeled with high recognition difficulty.
[0029] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for identifying attributes of an object, comprising:
[0030] one or more processors;
[0031] a storage device for storing one or more programs,
[0032] When the one or more programs are executed by the one or more processors, the one or more processors implement the above method.
[0033] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method as described above is implemented.
[0034] One embodiment of the above invention has the following advantages or beneficial effects: inputting the data to be labeled into the business classification model, and constructing a sample pair with the data vector to be labeled output by the business classification model and the training data vector closest to the data vector to be labeled; inputting the sample pair into the sampling classification model to obtain the sample difficulty label of the data to be labeled; according to the sample difficulty label of the data to be labeled, determining the recognition difficulty of the data to be labeled, and manually labeling the object attributes of the data to be labeled with high recognition difficulty, and then training the neural network model. The business classification model and the sampling classification model are used to screen out the data to be labeled with greater recognition difficulty, and the data to be labeled with greater recognition difficulty is manually labeled, thereby improving the pertinence and accuracy of the labeled data. The neural network model is trained with the above labeled data, which can improve the training speed of the neural network model to accurately identify the attributes of objects to meet business needs.
[0035] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0037] Figure 1 is a schematic diagram of the main flow of a method for identifying attributes of an object according to an embodiment of the present invention;
[0038] Figure 2 is a schematic diagram of the structure of a service classification model and a sampling classification model according to an embodiment of the present invention;
[0039] Figure 3 is a flow chart of a training business training model and a sampling training model according to an embodiment of the present invention;
[0040] Figure 4 is a schematic diagram of a process of obtaining a sample difficulty label of a simulation vector according to an embodiment of the present invention;
[0041] Figure 5 is a flow chart of a training business training model and a sampling training model according to an embodiment of the present invention;
[0042] Figure 6 is a schematic diagram of the main structure of a device for identifying attributes of an object according to an embodiment of the present invention;
[0043] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0044] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0046] Text data on item attributes comes from multiple channels, such as reviews, Q&A, and after-sales service. A large amount of text data is randomly extracted for manual annotation, and then a neural network model is trained to automatically identify item attributes. Since there are a large number of semantically similar texts in the text data, a large number of repeated annotations are likely to occur through random extraction, resulting in a slow improvement of the neural network model and failure to meet business needs.
[0047] In order to solve the problem that the neural network model is slow to improve and cannot meet business needs, the following technical solutions in the embodiments of the present invention can be adopted.
[0048] See also Figure 1 , Figure 1 1 is a schematic diagram of the main process of the method for identifying the attributes of an object according to an embodiment of the present invention, wherein a model is used to filter out the data to be labeled that is more difficult to identify, manually label the attributes of the object and train the neural network. Figure 1 As shown, the specific steps include:
[0049] S101 . Input the data to be labeled into a business classification model, and construct a sample pair using the data vector to be labeled output by the business classification model and the training data vector closest to the data vector to be labeled.
[0050] In an embodiment of the present invention, the data to be annotated is data obtained from multiple channels based on the item. As an example, the data to be annotated is obtained from the text of item comments, item questions, and item receipt.
[0051] Since there are a large number of semantically similar texts in the data to be labeled, the data to be labeled has the characteristic of poor pertinence. If all the data to be labeled are processed manually to train the neural network model, the amount of data to be labeled is huge, resulting in low speed and efficiency in training the neural network model. The training data of the neural network model needs to be targeted. The data to be labeled needs to have specificity to meet the pertinence requirements of the training data. For example, data that is different from other data categories to be labeled has specificity.
[0052] In the embodiment of the present invention, the focus is on filtering out data with particularity from a large amount of data to be annotated. Specifically, a business classification model and a sampling classification model are used to implement data screening.
[0053] See also Figure 2 , Figure 2 It is a structural diagram of a service classification model and a sampling classification model according to an embodiment of the present invention.
[0054] The business classification model is a model for external services, that is, the business classification model is used to identify the attributes of items. The sampling classification model is used to sample data and assist in optimizing and improving the classification accuracy of the business classification model.
[0055] Figure 2 The left side is the business classification model. The business classification model includes two parts, namely, the Roberta model and the classifier. The Roberta model includes layer1 to layer12 in the block diagram. It should be noted that the Roberta model in the embodiment of the present invention is a model adjusted using a preset data set. To adapt to the application scenario of identifying the attributes of items.
[0056] The business classification model in the embodiment of the present invention uses the Roberta model as an encoder, followed by a fully connected layer as a classifier, and the number of categories is the number of preset item attribute categories. As an example, the number of categories is 50.
[0057] Specifically, the first word vector output from the last layer of the encoder of the business classification model is input into the classifier for classification, and the loss function adopts the cross entropy loss in formula 1.
[0058]
[0059] Among them, N is the number of samples, K is the number of categories, Indicates whether sample i belongs to category j, if yes, it is 1, otherwise it is 0. The softmax probability value that the i-th sample output by the business classification model belongs to the j-th attribute.
[0060] Figure 2 The right side of the middle is the sampling classification model. The sampling classification model includes the Transformer module and the classifier. The function of the sampling classification model is to determine the probability that the data to be labeled belongs to different recognition difficulties.
[0061] The sampling classification model needs to select data that will significantly improve the training effect of the neural network model based on the quantity vector and sample difficulty label output by the business classification model.
[0062] In an embodiment of the present invention, a business classification model is obtained by training on the basis of a business training model through training data; and a sampling classification model is obtained by training on the basis of a sampling training model.
[0063] The following is an illustrative explanation of the training process of the business training model and the sampling training model.
[0064] See also Figure 3 , Figure 3 1 is a flow chart of a training business training model and a sampling training model according to an embodiment of the present invention. Specifically, the following steps are included:
[0065] S301. Obtain encoding vectors of two training data from the business training model, construct a simulation vector, and output the simulation vector to the classifier in the business training model to obtain a sample difficulty label of the simulation vector.
[0066] In an embodiment of the present invention, based on the training data, simulation data is constructed by establishing a simulation vector, and a sample difficulty label of the simulation vector is determined. The sample difficulty label is used to identify the difficulty of the simulation vector in identifying the attribute of the object. As an example, the sample difficulty label includes 0, 1, 2 and 3. The larger the value of the sample difficulty label, the greater the difficulty of the sample identification.
[0067] See also Figure 4 , Figure 4 1 is a flow chart of obtaining a sample difficulty label of a simulation vector according to an embodiment of the present invention. Specifically, the following steps are included:
[0068] In an embodiment of the present invention, in order to improve the specificity of the selected data to be labeled, the process of selecting the labeled data can be implemented based on the following selection conditions. Selection condition 1: The selected data to be labeled is on the decision boundary as much as possible. For example: if a data to be labeled has different item attributes from the multiple nearest data to be labeled around it, it is considered that the data to be labeled is likely to be on the decision boundary. Selection condition 2: The selected data to be labeled is more difficult to be recognized by the business classification model than the multiple nearest data to be labeled around it.
[0069] Based on the above selection conditions, it can be seen that using the model to select the data to be labeled needs to be achieved by comparing the data to be labeled.
[0070] S401. Obtain encoding vectors of two training data in a business training model, and use an intermediate vector between the encoding vectors of the two training data as a simulation vector.
[0071] The labels of the training data involve the attributes of the items, not the difficulty of identifying the attributes of the items. Figure 4 In the embodiment, a simulation vector is constructed using a business training model, and a sample difficulty label of the simulation vector is established.
[0072] Specifically, the training data is input into the business training model, and the encoding vectors of the two training data are respectively obtained in the business training model. Then, the encoding vectors of the two training data are respectively used to obtain the item attribute labels of the encoding vectors of the two training data.
[0073] In the business training model, encoding vectors of two training data are obtained, and an intermediate vector between the encoding vectors of the two training data is used as a simulation vector.
[0074] Specifically, the encoding vectors of the two training data are e1 = [0.83374845, -3.05029948, -0.92096034, -1.7367699]; e2 = [0.54757213, 1.65286751, 0.90383946, 0.38941161]. The intermediate vector of the encoding vectors of the two training data, i.e., the simulation vector = 0.5*(e1+e2) = [0.69066029, -0.69871598, -0.00856044, -0.67367915].
[0075] S402: Output the simulation vector to the classifier in the business training model to obtain the predicted label of the simulation vector.
[0076] The simulated vector is output to the classifier in the business training model to obtain the predicted label pred_et_label of the simulated vector.
[0077] S403: Construct a sample difficulty label of the simulation vector according to the item attribute label of the training data and the predicted label of the simulation vector.
[0078] The simulated vector is the intermediate vector of the encoded vectors of the two training data. The sample difficulty label of the model vector can be determined based on the predicted label of the simulated vector and the item attribute labels of the two training data.
[0079] Case 1:
[0080] The item attribute label of training data i is the same as the item attribute label of training data j, indicating that training data i and training data j belong to the same item attribute, and the sample difficulty label of the simulated vector is marked as 0. The sample difficulty label of the simulated vector is marked as 0, indicating that the recognition difficulty of the simulated vector is low.
[0081] Case 2:
[0082] The item attribute label of training data i is different from the item attribute label of training data j, indicating that training data i and training data j do not belong to the same item attribute, and the predicted label of the simulation vector is the same as the item attribute label of training data j, then the sample difficulty label of the simulation vector is marked as 1. The model vector may be on the decision boundary. The sample difficulty label of the simulation vector is marked as 1, indicating that the recognition difficulty of the simulation vector is average.
[0083] Case 3:
[0084] The item attribute label of training data i is different from the item attribute label of training data j, indicating that training data i and training data j do not belong to the same item attribute, and the predicted label of the simulation vector is the same as the item attribute label of training data i, then the sample difficulty label of the simulation vector is marked as 2. The model vector may be on the decision boundary. The sample difficulty label of the simulation vector is marked as 2, indicating that the simulation vector is difficult to recognize.
[0085] Case 4:
[0086] The item attribute label of training data i is different from the item attribute label of training data j, indicating that training data i and training data j do not belong to the same item attribute, the predicted label of the simulation vector is different from the item attribute label of training data i, and the predicted label of the simulation vector is also different from the item attribute label of training data j, then the sample difficulty label of the simulation vector is marked as 3. The sample difficulty label of the simulation vector is marked as 3, indicating that the recognition difficulty of the simulation vector is the greatest.
[0087]
[0088]
[0089] new_lable in formula 2 i,j is the sample difficulty label of the simulated vector.
[0090] exist Figure 4 In the embodiment of the invention, the sample difficulty label is determined based on the item attribute label of the two training data and the predicted label of the simulation vector. In this way, data can be filtered based on the sample difficulty label.
[0091] S302: Train a business training model and a sampling training model using the encoding vectors and sample difficulty labels of two training data to obtain a business classification model and a sampling classification model, respectively.
[0092] By establishing the encoding vector of two training data of the sample difficulty label and the sample scale label, the business training model can be trained to obtain the business classification model, and the sampling training model can be trained to obtain the sampling classification model.
[0093] See also Figure 5 , Figure 5 1 is a flow chart of a training business training model and a sampling training model according to an embodiment of the present invention. Specifically, the following steps are included:
[0094] S501. Using the encoding vectors of two training data, a combination vector is established, and the combination vector is input into the Transformer module of the sampling training model to obtain a construction vector.
[0095] The combined vector EC is constructed by using the encoding vectors of two training data. As an example, the combined vector EC i,j The formula for establishing EC is: i,j =cat[E i ,E j ]. Then the combined vector is input into the Transformer module of the sampling training model to obtain the constructed vector ECT.
[0096] There may be multiple Transformer modules in the training model, and the number of Transformer modules is pre-set based on the actual application scenario.
[0097] S502: Based on the combination vector and the construction vector, a sampling vector is established, and the sampling vector is input into a classifier in a sampling training model to obtain a sampling difficulty label of the sampling vector.
[0098] Considering that the constructed vector undergoes a certain attenuation after passing through the Transformer module, in order to avoid the attenuation, the sampling vector is established by combining the constructed vector with the combined vector. As an example, the sampling vector ECF = EC + ECT.
[0099] The sampling vector can be input into the classifier in the sampling training model to obtain the sampling difficulty label of the sampling vector.
[0100] S503 . Train the business training model and the sampling training model with the sample difficulty label, the sampling difficulty label, the loss function of the business training model and the loss function of the sampling training model to obtain the business classification model and the sampling classification model respectively.
[0101] In an embodiment of the present invention, the sample difficulty label is used as the real label of the sampling vector, and the sampling difficulty label is used as the output label of the sampling training model, so as to train the sampling training model to obtain the sampling classification model. The sampling classification model outputs the softmax probability of the sample difficulty label.
[0102] Considering that in the embodiment of the present invention, the sample difficulty identifier is a pseudo label and there will be a certain amount of noise, in order to train a highly robust sampling classification model, a generalized cross entropy loss function is used as the loss function of the sampling training model. That is, the loss function of the sampling training model includes the generalized cross entropy loss function. gce See Formula 3.
[0103]
[0104] Where q is a hyperparameter. As an example, q = 0.2. The role of q is to prevent the sampling training model from overfitting, thereby improving the accuracy of the probability of sample difficulty labels output by the sampling classification model.
[0105] In an embodiment of the present invention, for a business training model, the encoding vector of the training data is output, and the real encoding vector of the training data is used to train the business training model to obtain a business classification model. The loss function of the business training model includes a cross entropy loss function. That is, Formula 1 is used as the loss function of the business training model.
[0106] exist Figure 5 In the embodiment, the coding vector and sample difficulty label output by the business training mode are used to train the business training model and the sampling training model to obtain the business classification model and the sampling classification model respectively.
[0107] Above Figures 2 to 5 The technical solution exemplarily illustrates the process of establishing a business classification model and a sampling classification model.
[0108] After establishing the business classification model and the sampling classification model, the business classification model and the sampling classification model can be used to identify the attributes of the items.
[0109] Specifically, the data to be labeled is input into the business classification model. The business classification model outputs the data vector to be labeled. The identification of the object attributes of the data to be labeled needs to be compared with other data to be determined. Therefore, multiple data vectors can be screened out according to the distance from the data vector to be labeled to form a sample pair.
[0110] As an example, multiple data vectors are screened out according to the distance from the data vector to be labeled. A preset number of data vectors are screened out according to the order of the distance from the data vector to be labeled from near to far. The above preset number of data vectors are used as the training data vectors closest to the data vector to be labeled. That is, the training data vector closest to the data vector to be labeled includes screening out a preset number of data vectors according to the order of the distance from the data vector to be labeled from near to far. For example, the preset number is 10. The data vector to be labeled constructs 10 sample pairs with the 10 data vectors respectively.
[0111] In one embodiment of the present invention, a K-Nearest Neighbor (KNN) model may be used to screen out multiple data vectors, that is, the training data closest to the data vector to be labeled is the data obtained from the K-Nearest Neighbor model established by the training data.
[0112] S102: Input the sample pairs into a sampling classification model to obtain sample difficulty labels of the data to be labeled.
[0113] In an embodiment of the present invention, the sample difficulty labels of the data to be labeled can be divided into 0, 1, 2 and 3, a total of 4 types.
[0114] In one embodiment of the present invention, the sample difficulty label of the data to be labeled includes the sample difficulty label probability. Specifically, the sample pair is input into the sampling classification model, and the sampling classification model outputs the sample difficulty label probability of the data to be labeled in the sample pair. As an example, the sampling classification model outputs that the sample difficulty label probability of the data to be labeled is 0 is 0.25, the sample difficulty label probability of the data to be labeled is 1 is 0.4, the sample difficulty label probability of the data to be labeled is 2 is 0.2, and the sample difficulty label probability of the data to be labeled is 3 is 0.15.
[0115] Each sample pair has a corresponding sample difficulty label probability of the data to be labeled.
[0116] S103: After determining the recognition difficulty of the data to be labeled according to the sample difficulty labels of the data to be labeled and manually labeling the object attributes of the data to be labeled with high recognition difficulty, train the neural network model.
[0117] In an embodiment of the present invention, the data to be labeled are identified by the difficulty of recognition. Among the data to be labeled, a plurality of data to be labeled are screened out according to the difficulty of recognition as data to be labeled with high recognition difficulty. The data to be labeled with high recognition difficulty can be labeled manually. Then, the neural network model is trained with the manually labeled data with high recognition difficulty. Since the data with high recognition difficulty is highly targeted, the training speed of the neural network is improved to meet the business demand of quickly and accurately identifying the attributes of objects. As an example, the data to be labeled with a recognition difficulty greater than the difficulty threshold can be regarded as data to be labeled with high recognition difficulty.
[0118] In an embodiment of the present invention, the sample difficulty labels of the data to be labeled can be divided into 0, 1, 2 and 3, a total of 4 types. Sample difficulty labels of 0 and 1 are the most common labels. Therefore, the sample difficulty label probability of 0 and the sample difficulty label probability of 1 can be used to determine the recognition difficulty of the data to be labeled.
[0119] In the embodiment of the present invention, 0, 1, 2 and 3 are exemplarily used as sample difficulty labels. Of course, other methods can also be used as sample difficulty labels.
[0120] Specifically, the sample difficulty label includes a first sample difficulty label and a second sample difficulty label of the data to be labeled.
[0121] The first sample difficulty label includes that the item attribute labels of the sample pair are the same. As an example, the labels of two data in the sample pair belong to the same item attribute label.
[0122] The second sample difficulty label includes that the item attribute labels of the sample pair are different, and the predicted label of the intermediate vector of the sample pair is the same as the item attribute label of one training data. As an example, the item attribute label of one data in the sample pair is A, and the item attribute label of the other data in the sample pair is B. And the predicted label of the intermediate vector in the sample pair is A. The intermediate vector of the sample pair is the product of the sum of the encoding vectors of the two data in the sample pair and 0.5.
[0123] In an embodiment of the present invention, the data to be labeled constructs multiple sample pairs, and the recognition difficulty of the data to be labeled is determined by the average value of the probability of the first sample difficulty label in the multiple sample pairs and the average value of the probability of the second sample difficulty label in the multiple sample pairs.
[0124] As an example, the recognition difficulty score of the i-th data to be labeled is i It can be calculated according to formula 4:
[0125]
[0126] Among them, p(1) is the softmax probability that the sample classification model output belongs to the second sample difficulty label, and p(0) is the softmax probability that the sample classification model output belongs to the first sample difficulty label. eps is a tuning parameter. As an example, eps = 1e -10 .
[0127] Of course, the recognition difficulty of the data to be labeled can also be determined based on the difference between the average value of the probability of the first sample difficulty label and the average value of the probability of the second sample difficulty label.
[0128] In the above-mentioned embodiment of the present invention, the data to be labeled is input into the business classification model, and a sample pair is constructed with the data vector to be labeled output by the business classification model and the training data vector closest to the data vector to be labeled; the sample pair is input into the sampling classification model to obtain the sample difficulty label of the data to be labeled; according to the sample difficulty label of the data to be labeled, the recognition difficulty of the data to be labeled and the object attributes of the data to be labeled with high recognition difficulty are determined manually, and then the neural network model is trained. The business classification model and the sampling classification model are used to screen out the data to be labeled with greater recognition difficulty, and the data to be labeled with greater recognition difficulty is manually labeled, thereby improving the pertinence and accuracy of the labeled data. The neural network model is trained with the above-mentioned labeled data, which can improve the training speed of the neural network model to accurately identify the attributes of objects to meet business needs.
[0129] By adopting the technical solution of the embodiment of the present invention, data that greatly improves the neural network model is screened out for labeling. On the one hand, the amount of data to be labeled is reduced, thereby saving labeling time; on the other hand, nearly 50% of the labeling costs are saved.
[0130] See also Figure 6 , Figure 6 is a schematic diagram of the main structure of the device for identifying the attributes of an item according to an embodiment of the present invention. The device for identifying the attributes of an item can implement a method for identifying the attributes of an item, such as Figure 6 As shown, the device for identifying the attributes of an item specifically includes:
[0131] A construction module 601 is used to input the data to be labeled into the business classification model, and construct a sample pair with the data vector to be labeled output by the business classification model and the training data vector closest to the data vector to be labeled;
[0132] An input module 602 is used to input the sample pair into a sampling classification model to obtain a sample difficulty label of the data to be labeled;
[0133] The determination module 603 is used to train the neural network model after determining the recognition difficulty of the data to be labeled according to the sample difficulty label of the data to be labeled, and manually labeling the object attributes of the data to be labeled with high recognition difficulty.
[0134] In one embodiment of the present invention, the construction module 601 is further used to obtain the encoding vectors of the two training data in the business training model, construct a simulation vector, and output the simulation vector to the classifier in the business training model to obtain the sample difficulty label of the simulation vector;
[0135] The business training model and the sampling training model are trained with the encoding vectors of the two training data and the sample difficulty labels to obtain the business classification model and the sampling classification model respectively.
[0136] In one embodiment of the present invention, the construction module 601 is specifically used to obtain the encoding vectors of two training data in the business training model, and use the intermediate vector of the encoding vectors of the two training data as the simulation vector;
[0137] Outputting the simulated vector to the classifier in the business training model to obtain a predicted label of the simulated vector;
[0138] Constructing a sample difficulty label of the simulation vector according to the item attribute label of the training data and the predicted label of the simulation vector.
[0139] In one embodiment of the present invention, the construction module 601 is specifically used to establish a combination vector using the encoding vectors of the two training data, and input the combination vector into the Transformer module of the sampling training model to obtain a construction vector;
[0140] Based on the combined vector and the constructed vector, a sampling vector is established, and the sampling vector is input into a classifier in the sampling training model to obtain a sampling difficulty label of the sampling vector;
[0141] The business training model and the sampling training model are trained with the sample difficulty label, the sampling difficulty label, the loss function of the business training model and the loss function of the sampling training model to obtain a business classification model and a sampling classification model respectively.
[0142] In one embodiment of the present invention, the loss function of the business training model includes a cross entropy loss function; the loss function of the sampling training model includes a generalized cross entropy loss function.
[0143] In one embodiment of the present invention, the training data that is closest to the data vector to be labeled is data obtained from a K-nearest neighbor model established with the training data.
[0144] In one embodiment of the present invention, the determination module 603 is specifically configured to: the sample difficulty label includes a first sample difficulty label and a second sample difficulty label of the data to be labeled, the first sample difficulty label includes that the item attribute labels of the sample pair are the same, the second sample difficulty label includes that the item attribute labels of the sample pair are different, and the predicted label of the intermediate vector of the sample pair is the same as the item attribute label of the one training data;
[0145] The recognition difficulty of the to-be-labeled data is determined by taking an average value of the probabilities of the first sample difficulty labels and an average value of the probabilities of the second sample difficulty labels.
[0146] Figure 7 An exemplary system architecture 700 is shown to which the method for identifying the attributes of an item or the apparatus for identifying the attributes of an item according to an embodiment of the present invention may be applied.
[0147] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0148] Users can use terminal devices 701, 702, and 703 to interact with server 705 through network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0149] The terminal devices 701 , 702 , and 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0150] The server 705 may be a server that provides various services, such as a backend management server (only for example) that supports shopping websites browsed by users using the terminal devices 701, 702, and 703. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only for example) to the terminal device.
[0151] It should be noted that the method for identifying the attributes of an item provided in the embodiment of the present invention is generally executed by the server 705 , and accordingly, the device for identifying the attributes of an item is generally disposed in the server 705 .
[0152] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0153] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device suitable for implementing an embodiment of the present invention. Figure 8The terminal device 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.
[0154] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0155] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0156] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.
[0157] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-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 of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0158] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0159] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be arranged in a processor, for example, they may be described as: a processor including a construction module, an input module and a determination module. The names of these modules do not constitute limitations on the modules themselves in certain cases, for example, the construction module may also be described as "for inputting the data to be labeled into the business classification model, and constructing sample pairs with the data vector to be labeled output by the business classification model and the training data vector closest to the data vector to be labeled".
[0160] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0161] Input the data to be labeled into the business classification model, and construct a sample pair with the data vector to be labeled output by the business classification model and the training data vector closest to the data vector to be labeled;
[0162] Inputting the sample pair into a sampling classification model to obtain a sample difficulty label of the data to be labeled;
[0163] After determining the recognition difficulty of the data to be labeled according to the sample difficulty labels of the data to be labeled and manually labeling the object attributes of the data to be labeled with high recognition difficulty, a neural network model is trained.
[0164] According to the technical solution of the embodiment of the present invention, the data to be labeled is input into the business classification model, and a sample pair is constructed with the data vector to be labeled output by the business classification model and the training data vector closest to the data vector to be labeled; the sample pair is input into the sampling classification model to obtain the sample difficulty label of the data to be labeled; according to the sample difficulty label of the data to be labeled, the recognition difficulty of the data to be labeled and the object attributes of the data to be labeled with high recognition difficulty are determined manually, and then the neural network model is trained. The business classification model and the sampling classification model are used to screen out the data to be labeled with high recognition difficulty, and the data to be labeled with high recognition difficulty is manually labeled, thereby improving the pertinence and accuracy of the labeled data. The neural network model is trained with the above-mentioned labeled data, which can improve the training speed of the neural network model to accurately identify the attributes of objects to meet business needs.
[0165] The above specific implementation methods do not constitute limitations on the scope of protection of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention. It should be noted that in the technical solution disclosed in this disclosure, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
Claims
1. A method for identifying the attributes of an object, characterized in that: include: Input the data to be labeled into the business classification model, and construct a sample pair with the data vector to be labeled output by the business classification model and the training data vector closest to the data vector to be labeled; Inputting the sample pair into a sampling classification model to obtain a sample difficulty label of the data to be labeled; After determining the recognition difficulty of the data to be labeled according to the sample difficulty labels of the data to be labeled and manually labeling the object attributes of the data to be labeled with high recognition difficulty, a neural network model is trained.
2. The method for identifying the attributes of an object according to claim 1, characterized in that: Before inputting the data to be labeled into the business classification model, the method further includes: Obtaining encoding vectors of two training data from the business training model, constructing a simulation vector, and outputting the simulation vector to a classifier in the business training model to obtain a sample difficulty label of the simulation vector; The business training model and the sampling training model are trained with the encoding vectors of the two training data and the sample difficulty labels to obtain the business classification model and the sampling classification model respectively.
3. The method for identifying the attributes of an object according to claim 2, characterized in that: The method of obtaining the encoding vectors of two training data from the business training model, constructing a simulation vector, and outputting the simulation vector to a classifier in the business training model to obtain a sample difficulty label of the simulation vector includes: Obtaining encoding vectors of two training data in the business training model, and using an intermediate vector between the encoding vectors of the two training data as the simulation vector; Outputting the simulated vector to the classifier in the business training model to obtain a predicted label of the simulated vector; A sample difficulty label of the simulation vector is constructed according to the item attribute label of the training data and the predicted label of the simulation vector.
4. The method for identifying the attributes of an object according to claim 2, characterized in that: The step of training the business training model and the sampling training model with the encoding vectors of the two training data and the sample difficulty labels to obtain a business classification model and a sampling classification model respectively includes: Using the encoding vectors of the two training data, a combination vector is established, and the combination vector is input into the Transformer module of the sampling training model to obtain a construction vector; Based on the combined vector and the constructed vector, a sampling vector is established, and the sampling vector is input into a classifier in the sampling training model to obtain a sampling difficulty label of the sampling vector; The business training model and the sampling training model are trained with the sample difficulty label, the sampling difficulty label, the loss function of the business training model and the loss function of the sampling training model to obtain a business classification model and a sampling classification model respectively.
5. The method for identifying the attributes of an object according to claim 4, characterized in that: The loss function of the business training model includes a cross entropy loss function; the loss function of the sampling training model includes a generalized cross entropy loss function.
6. The method for identifying the attributes of an object according to claim 1, characterized in that: The training data closest to the data vector to be labeled is data obtained from a K-nearest neighbor model established with the training data.
7. The method for identifying the attributes of an object according to claim 1, characterized in that: Determining the recognition difficulty of the data to be labeled according to the sample difficulty label of the data to be labeled includes: The sample difficulty label includes a first sample difficulty label and a second sample difficulty label of the data to be labeled, the first sample difficulty label includes that the item attribute labels of the sample pair are the same, the second sample difficulty label includes that the item attribute labels of the sample pair are different, and the predicted label of the intermediate vector of the sample pair is the same as the item attribute label of the one training data; The recognition difficulty of the to-be-labeled data is determined by taking an average value of the probabilities of the first sample difficulty labels and an average value of the probabilities of the second sample difficulty labels.
8. A device for identifying the attributes of an object, characterized in that: include: A construction module, used to input the data to be labeled into the business classification model, and construct a sample pair with the data vector to be labeled output by the business classification model and the training data vector closest to the data vector to be labeled; An input module, used for inputting the sample pair into a sampling classification model to obtain a sample difficulty label of the data to be labeled; The determination module is used to determine the recognition difficulty of the data to be labeled according to the sample difficulty label of the data to be labeled, and train the neural network model after manually labeling the object attributes of the data to be labeled with high recognition difficulty.
9. An electronic device for identifying the attributes of an object, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.