Commodity quality evaluation method and device, electronic equipment and storage medium

By adopting an enhanced cross-entropy loss function in the commodity quality evaluation system, the problem of limited accuracy in traditional systems when processing complex data sets is solved, and higher evaluation accuracy is achieved.

CN119760404AActive Publication Date: 2025-04-04DIGITAL HEALTH CHINA TECHNOLOGIES CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411923658.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-04
Estimated Expiration
2044-12-25

AI Technical Summary

Technical Problem

Traditional commodity quality assessment systems may not be able to adequately capture nuances between data when processing complex data sets, resulting in limited evaluation accuracy.

Method used

The enhanced cross-entropy loss function is adopted, and by adding a regularization term to the cross-entropy loss function, the model is encouraged to output a predicted probability distribution closer to the true quality evaluation result. The method includes obtaining multi-source product information, extracting product quality features, and inputting features into a pre-trained quality evaluation model for evaluation.

Benefits of technology

Through the enhanced cross-entropy loss function, the accuracy of the model is improved, making the product quality evaluation results closer to the real results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760404A_ABST
    Figure CN119760404A_ABST
Patent Text Reader

Abstract

The invention relates to a commodity quality evaluation method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining multi-source commodity information of a to-be-evaluated commodity; commodity quality features in the multi-source commodity information are extracted; and inputting the commodity quality features into a pre-trained quality evaluation model to obtain a quality evaluation result of the to-be-evaluated commodity. Through the method provided by the invention, the model can be encouraged to output prediction probability distribution closer to a real quality evaluation result based on the regularization item in the enhanced cross entropy loss function, and the precision of the model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and in particular to a commodity quality assessment method, device, electronic device and storage medium. Background Art

[0002] The product quality assessment system is an intelligent assessment tool based on big data and artificial intelligence technology. It provides enterprises with comprehensive, objective and accurate product quality evaluation by analyzing data from product production, sales, and use. However, when dealing with classification problems, traditional product quality assessment systems usually use a standard cross entropy loss function. This function may not be able to fully capture the subtle differences between data when faced with complex data sets, resulting in limited assessment accuracy. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a commodity quality assessment method, device, electronic device and storage medium, aiming to solve at least one of the above technical problems.

[0004] In the first aspect, the technical solution of the present invention to solve the above technical problem is as follows: a method for evaluating product quality, the method comprising:

[0005] Obtain multi-source product information of the product to be evaluated;

[0006] Extracting product quality features from the multi-source product information;

[0007] The product quality features are input into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method:

[0008] Acquire training data, wherein the training data includes a plurality of sample commodities and a true quality evaluation result of each of the sample commodities;

[0009] Training the initial model according to the training data to obtain a predicted quality assessment result for each of the sample commodities;

[0010] According to the predicted quality assessment results and the true quality assessment results of all sample products, an enhanced cross entropy loss function is used to determine the loss value of the initial model, so as to complete the training of the initial model based on the loss value and obtain the quality assessment model, wherein the enhanced cross entropy loss function is a function obtained by adding a regularization term to the cross entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the true quality assessment result.

[0011] The beneficial effect of the present invention is that an enhanced cross-entropy loss function is used in the quality assessment model in the present application scheme. Based on the regularization term in the enhanced cross-entropy loss function, the model output can be encouraged to have a predicted probability distribution that is closer to the actual quality assessment result, thereby improving the accuracy of the model.

[0012] Based on the above technical solution, the present invention can also be improved as follows.

[0013] Furthermore, the enhanced cross entropy loss function is:

[0014]

[0015] Among them, L represents the loss value, C is the total number of sample products, and y i is the true quality evaluation result of the i-th sample product, p i is the predicted quality evaluation result of the i-th sample product, λ is the regularization coefficient, ||p i -y i || is the regularization term.

[0016] Further, the extracting of product quality features from the multi-source product information includes:

[0017] Extracting product quality features from the multi-source product information through a pre-trained large model processing module, wherein the large model processing module includes a linear layer, a multi-head matrix calculation layer, and a softmax layer;

[0018] Among them, the linear layer is used to convert the multi-source product information into a multi-dimensional vector; the multi-head matrix calculation layer is used to extract features from the multi-dimensional vector to obtain the first feature; and the softmax layer is used to normalize the first feature to obtain the product quality feature.

[0019] Furthermore, the quality assessment model includes a self-attention mechanism layer and a fully connected layer, wherein the self-attention mechanism layer is used to extract the product quality features to obtain a second feature, and the fully connected layer is used to obtain a quality assessment result of the product to be evaluated based on the second feature.

[0020] Furthermore, the step of obtaining multi-source commodity information of the commodity to be evaluated includes:

[0021] Acquiring a commodity quality evaluation request of a user for the commodity to be evaluated on a user interaction interface, wherein the commodity quality evaluation request includes a commodity identifier of the commodity to be evaluated;

[0022] According to the commodity quality evaluation request, multi-source commodity information of the commodity to be evaluated is obtained.

[0023] In a second aspect, in order to solve the above technical problems, the present invention further provides a commodity quality assessment device, the device comprising:

[0024] An acquisition module, used to acquire multi-source commodity information of the commodity to be evaluated;

[0025] A feature extraction module, used to extract product quality features from the multi-source product information;

[0026] The quality assessment module is used to input the product quality features into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method:

[0027] Acquire training data, wherein the training data includes a plurality of sample commodities and a true quality evaluation result of each of the sample commodities;

[0028] Training the initial model according to the training data to obtain a predicted quality assessment result for each of the sample commodities;

[0029] According to the predicted quality assessment results and the true quality assessment results of all sample products, an enhanced cross entropy loss function is used to determine the loss value of the initial model, so as to complete the training of the initial model based on the loss value and obtain the quality assessment model, wherein the enhanced cross entropy loss function is a function obtained by adding a regularization term to the cross entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the true quality assessment result.

[0030] In a third aspect, in order to solve the above-mentioned technical problem, the present invention also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the product quality assessment method of the present application is implemented.

[0031] In a fourth aspect, in order to solve the above-mentioned technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the product quality assessment method of the present application is implemented.

[0032] Additional aspects and advantages of the present application will be partially given in the following description, which will become apparent from the following description, or will be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for describing the embodiments of the present invention are briefly introduced below.

[0034] Figure 1A flowchart of a commodity quality assessment method provided by an embodiment of the present invention;

[0035] Figure 2 A schematic diagram of the structure of a commodity quality assessment device provided by one embodiment of the present invention;

[0036] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0037] The principles and features of the present invention are described below. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.

[0038] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0039] The solution provided by the embodiment of the present invention can be applied to any application scenario where the quality of goods needs to be evaluated. The solution provided by the embodiment of the present invention can be executed by any electronic device, for example, it can be a user's terminal device, including at least one of the following: a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart TV, and a smart car device.

[0040] The embodiment of the present invention provides a possible implementation method, such as Figure 1 As shown, a flowchart of a commodity quality assessment method is provided. The solution can be executed by any electronic device, for example, a terminal device, or a terminal device and a server. For the convenience of description, the method provided by the embodiment of the present invention will be described below using the terminal device as an example of the execution subject. Figure 1 The method may include the following steps:

[0041] S10, obtaining multi-source commodity information of the commodity to be evaluated;

[0042] S20, extracting product quality features from the multi-source product information;

[0043] S30, inputting the product quality feature into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method:

[0044] Acquire training data, wherein the training data includes a plurality of sample commodities and a true quality evaluation result of each of the sample commodities;

[0045] Training the initial model according to the training data to obtain a predicted quality assessment result for each of the sample commodities;

[0046] According to the predicted quality assessment results and the true quality assessment results of all sample products, an enhanced cross entropy loss function is used to determine the loss value of the initial model, so as to complete the training of the initial model based on the loss value and obtain the quality assessment model, wherein the enhanced cross entropy loss function is a function obtained by adding a regularization term to the cross entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the true quality assessment result.

[0047] The quality assessment model in the present application adopts an enhanced cross entropy loss function. Based on the regularization term in the enhanced cross entropy loss function, the model can be encouraged to output a predicted probability distribution that is closer to the actual quality assessment result, thereby improving the accuracy of the model.

[0048] The solution of the present invention is further described below in conjunction with the following specific embodiments. In this embodiment, a commodity quality assessment method provided may include the following steps:

[0049] S10, obtaining multi-source commodity information of the commodity to be evaluated;

[0050] Among them, the multi-source product information includes different product information, including but not limited to the basic attribute information of the product itself, the description, type, and comment information of the product.

[0051] Optionally, the step of obtaining multi-source commodity information of the commodity to be evaluated includes:

[0052] Acquiring a commodity quality evaluation request of a user for the commodity to be evaluated on a user interaction interface, wherein the commodity quality evaluation request includes a commodity identifier of the commodity to be evaluated;

[0053] According to the commodity quality evaluation request, multi-source commodity information of the commodity to be evaluated is obtained.

[0054] Among them, the commodity quality assessment request refers to a request for quality assessment of the commodity to be assessed. The request may be a request generated based on a trigger operation of the user on the client interface of the terminal device. The specific form of the trigger operation is configured as needed. For example, it may be a trigger action of a specific operation position of the user on the interface of the application of the terminal device. In actual use, the trigger operation may be a trigger selection operation for a related trigger identifier. Among them, the specific form of the trigger identifier may be configured according to actual needs. For example, it may be a designated virtual button or input box on the client interface. Specifically, for example, it may be a virtual button of "XXX commodity" displayed on the client interface. The user clicking the virtual button indicates that the user wants to conduct a quality assessment on the "XXX commodity".

[0055] Before executing S20, the multi-source product information may be pre-processed, including cleaning and normalization.

[0056] S20, extracting product quality features from the multi-source product information;

[0057] Optionally, in the above S20, extracting product quality features from the multi-source product information includes:

[0058] Extracting product quality features from the multi-source product information through a pre-trained large model processing module, wherein the large model processing module includes a linear layer, a multi-head matrix calculation layer, and a softmax layer;

[0059] Among them, the linear layer is used to convert the multi-source product information into a multi-dimensional vector; the multi-head matrix calculation layer is used to extract features from the multi-dimensional vector to obtain the first feature; and the softmax layer is used to normalize the first feature to obtain the product quality feature.

[0060] Using deep learning algorithms, we build a large model containing massive amounts of product information, namely the large model processing module. This model can automatically learn and understand the relevant information of the product, providing a scientific basis for product quality assessment.

[0061] Specifically, the specific calculation process of the linear layer is:

[0062] x l =x*W T +b (1)

[0063] Among them, x represents the input multi-source product information, W represents the weight matrix of the linear layer, T represents the matrix transposition, b represents the bias weight matrix of the linear layer, x l It is the final output result of the linear layer, that is, a multidimensional vector.

[0064] The calculation process of the multi-head matrix calculation layer is:

[0065] x j =(x l *W1 T +b1)*(x l *W2 T +b2)*(x l *W2 T +b2) (2)

[0066] Among them, W1, W2, W3 are different weight matrices, b1, b2, b3 are different bias matrices, x j is the first feature corresponding to the j-th head in the multi-head matrix calculation layer, and j represents the j-th head in the multi-head matrix calculation layer.

[0067] The calculation process of the softmax layer is:

[0068]

[0069] Among them, Softmax(x i ) represents the final output of the softmax layer, i.e., the product quality feature, exp(x i ) represents x i An exponential function with the natural constant e as the base, i and j represent the i-th head and j-th head respectively, ∑ represents accumulation, n represents the total number of heads in the multi-head matrix calculation layer, x i Calculate the first feature of the i-th head in the multi-head matrix layer.

[0070] S30, inputting the product quality feature into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method:

[0071] Acquire training data, wherein the training data includes a plurality of sample commodities and a true quality evaluation result of each of the sample commodities;

[0072] Training the initial model according to the training data to obtain a predicted quality assessment result for each of the sample commodities;

[0073] According to the predicted quality assessment results and the true quality assessment results of all sample products, an enhanced cross entropy loss function is used to determine the loss value of the initial model, so as to complete the training of the initial model based on the loss value and obtain the quality assessment model, wherein the enhanced cross entropy loss function is a function obtained by adding a regularization term to the cross entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the true quality assessment result.

[0074] Optionally, the quality assessment model includes a self-attention mechanism layer and a fully connected layer, wherein the self-attention mechanism layer is used to extract the product quality features to obtain a second feature, and the fully connected layer is used to obtain a quality assessment result of the product to be evaluated based on the second feature.

[0075] Specifically, the processing process of the above self-attention mechanism layer is:

[0076] Q=xWQ

[0077] V=xWV

[0078] K=xWK (4)

[0079] Among them, x represents the product quality feature, Q, V and K represent the query vector, key vector and value vector corresponding to the self-attention mechanism layer respectively, and WQ, WK, WK are weight matrices.

[0080] The above processing process is to linearly process the product quality features through the self-attention mechanism to obtain the third feature (including Q, V and K);

[0081] Then the attention weight score Score is calculated for Q and K in the third feature:

[0082]

[0083] Among them, d_k is the dimension of the key vector, which is used to prevent the gradient vanishing problem caused by the dot product result being too large, and T represents the transpose operation of the matrix.

[0084] Next, the attention score is normalized into a probability distribution, and the calculation formula is:

[0085] α=Softmax(Score) (6)

[0086] Among them, α is a hyperparameter.

[0087] Next, the attention output is calculated, and the value vector V is weighted summed according to the attention weight:

[0088] O=αV (7)

[0089] Among them, O is the second feature.

[0090] The processing process of the above fully connected layer is:

[0091] p=W_D*O+b (8)

[0092] Among them, W_D is the weight matrix, b is the bias term, and p represents the quality assessment result.

[0093] Optionally, the enhanced cross entropy loss function is:

[0094]

[0095] Among them, L represents the loss value, C is the total number of sample products, and y i is the true quality evaluation result of the i-th sample product, p i is the predicted quality evaluation result of the i-th sample product, and λ is the regularization coefficient, which is used to control the strength of the regularization term. The larger λ is, the greater the contribution of the regularization term to the loss function. ||p i -y i || is the regularization term, which is the square of the Euclidean distance between the predicted quality evaluation result and the true quality evaluation result of the i-th sample product. During the model training process, by minimizing the regularization term, the model can be encouraged to output a predicted probability distribution (predicted quality evaluation result) that is closer to the true quality evaluation result.

[0096] Optionally, the multi-source product information can be a picture or text. If the multi-source product information is a picture, in order to improve the diversity of the sample set during the training process of the large model processing module, the sample set can be expanded by an expansion method. The expansion method includes but is not limited to random flipping, random cropping, random color change, translation, rotation and scaling.

[0097] It should be further explained that, in the process of constructing the sample set, it is determined whether the number of sample data in the sample set meets the preset requirements. If so, the data in the sample set is directly used to train the large model processing module. If not, the sample set is expanded.

[0098] The following methods can be used to determine whether the number of sample data in the sample set meets the preset requirements:

[0099] S1, for each sample data, calculating in real time the similarity value between each sample data and the basic image, wherein the basic image is an image that can accurately and comprehensively express the quality of the sample product;

[0100] S2, sorting the sample data according to the similarity value from large to small;

[0101] S3, comparing the similarity values ​​with the preset similarity thresholds respectively from small to large, deleting the sample data corresponding to the similarity values ​​less than the similarity threshold, and obtaining a candidate sample set;

[0102] S4, counting the number of sample data in the candidate sample set, if the number is less than the set value, continue to expand the candidate sample set;

[0103] S5, repeat the processing from S1 to S4 above until the number of sample data in the candidate sample set is not less than the set value, and then the expansion of the candidate sample set is terminated.

[0104] Optionally, if the multi-source product information is text, the product quality features can be extracted from the text corresponding to the multi-source product information by using keywords. The specific implementation method is as follows:

[0105] The product name is used as a keyword and the keyword is used as the search center point. The candidate content whose similarity with the search center point is greater than the set similarity is searched from the text corresponding to the multi-source product information; the greater the similarity, the greater the correlation between the candidate content and the keyword. Then the product quality features are extracted from each candidate content.

[0106] The implementation process of taking the keyword as the search center point and searching for candidate content whose similarity with the search center point is greater than a set distance from the text corresponding to the multi-source product information is as follows:

[0107] Split the text corresponding to the multi-source product information to obtain multiple segments of text;

[0108] Take the keyword as the search center point and calculate the similarity between the search center point and each text segment.

[0109] Furthermore, the text corresponding to the multi-source product information is split to obtain multiple segments of text as follows:

[0110] The first method is to segment the text corresponding to the multi-source product information into paragraphs according to the paragraphs. For any paragraph obtained after segmentation, the paragraph is segmented into sentences according to the period or semicolon, and the sentence length of the segmented sentence is determined in real time, and the sentence length is associated with the serial number corresponding to the sentence to generate a sentence length record table. According to the preset target length segmentation range, the sentence length in the sentence length record table is graded, and the serial number corresponding to each grade is determined. According to the number of divisions corresponding to the grade, the sentence corresponding to each serial number under the grade is sliced ​​according to the number of divisions, and the slicing result corresponding to each serial number is obtained, that is, several paragraphs of text are obtained by segmentation.

[0111] The second method is to segment the text corresponding to the multi-source product information into paragraphs, and to segment any paragraph into at least two segments according to a preset fixed segmentation length. It should be further explained that in the process of segmentation according to a fixed segmentation length, if there are commas or semicolons in the segments obtained during the segmentation process, it is necessary to segment again, that is, segment according to commas or semicolons, and after segmentation, segment again according to the fixed segmentation length starting from the first text content after the comma or semicolon. For each segmentation result, the slicing process is performed according to the slicing method in the first method.

[0112] Based on Figure 1 Based on the same principle as the method shown in , the embodiment of the present invention also provides a commodity quality assessment device 20, such as Figure 2 As shown in , the commodity quality assessment device 20 may include an acquisition module 210, a feature extraction module 220 and a quality assessment module 230, wherein:

[0113] An acquisition module 210 is used to acquire multi-source commodity information of the commodity to be evaluated;

[0114] A feature extraction module 220 is used to extract product quality features from the multi-source product information;

[0115] The quality assessment module 230 is used to input the product quality features into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method:

[0116] Acquire training data, wherein the training data includes a plurality of sample commodities and a true quality evaluation result of each of the sample commodities;

[0117] Training the initial model according to the training data to obtain a predicted quality assessment result for each of the sample commodities;

[0118] According to the predicted quality assessment results and the true quality assessment results of all sample products, an enhanced cross entropy loss function is used to determine the loss value of the initial model, so as to complete the training of the initial model based on the loss value and obtain the quality assessment model, wherein the enhanced cross entropy loss function is a function obtained by adding a regularization term to the cross entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the true quality assessment result.

[0119] Optionally, the enhanced cross entropy loss function is:

[0120]

[0121] Among them, L represents the loss value, C is the total number of sample products, and yi is the true quality evaluation result of the i-th sample product, p i is the predicted quality evaluation result of the i-th sample product, λ is the regularization coefficient, ||p i -y i || is the regularization term.

[0122] Optionally, the enhanced cross entropy loss function is:

[0123]

[0124] Among them, L represents the loss value, C is the total number of sample products, and y i is the true quality evaluation result of the i-th sample product, p i is the predicted quality evaluation result of the i-th sample product, λ is the regularization coefficient, ||p i -y i || is the regularization term.

[0125] Optionally, when extracting the commodity quality features from the multi-source commodity information, the feature extraction module 220 is specifically used to:

[0126] Extracting product quality features from the multi-source product information through a pre-trained large model processing module, wherein the large model processing module includes a linear layer, a multi-head matrix calculation layer, and a softmax layer;

[0127] Among them, the linear layer is used to convert the multi-source product information into a multi-dimensional vector; the multi-head matrix calculation layer is used to extract features from the multi-dimensional vector to obtain the first feature; and the softmax layer is used to normalize the first feature to obtain the product quality feature.

[0128] Optionally, the quality assessment model includes a self-attention mechanism layer and a fully connected layer, wherein the self-attention mechanism layer is used to extract the product quality features to obtain a second feature, and the fully connected layer is used to obtain a quality assessment result of the product to be evaluated based on the second feature.

[0129] Optionally, when acquiring multi-source commodity information of the commodity to be evaluated, the acquisition module 210 is specifically used to:

[0130] Acquiring a commodity quality evaluation request of a user for the commodity to be evaluated on a user interaction interface, wherein the commodity quality evaluation request includes a commodity identifier of the commodity to be evaluated;

[0131] According to the commodity quality evaluation request, multi-source commodity information of the commodity to be evaluated is obtained.

[0132] The product quality assessment device of the embodiment of the present invention can execute the product quality assessment method provided by the embodiment of the present invention, and its implementation principle is similar. The actions performed by each module and unit in the product quality assessment device in each embodiment of the present invention correspond to the steps in the product quality assessment method in each embodiment of the present invention. For the detailed functional description of each module of the product quality assessment device, please refer to the description in the corresponding product quality assessment method shown in the previous text, which will not be repeated here.

[0133] The above-mentioned commodity quality assessment device may be a computer program (including program code) running in a computer device, for example, the commodity quality assessment device is an application software; the device may be used to execute the corresponding steps in the method provided in the embodiment of the present invention.

[0134] In some embodiments, the commodity quality assessment device provided by the embodiments of the present invention can be implemented in a combination of software and hardware. As an example, the commodity quality assessment device provided by the embodiments of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the commodity quality assessment method provided by the embodiments of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic components.

[0135] In other embodiments, the commodity quality assessment device provided by the embodiments of the present invention may be implemented in software. Figure 2 A commodity quality assessment device stored in a memory is shown, which may be software in the form of a program and a plug-in, and includes a series of modules, including an acquisition module 210, a feature extraction module 220 and a quality assessment module 230, for implementing the commodity quality assessment method provided in an embodiment of the present invention.

[0136] The modules involved in the embodiments of the present invention may be implemented by software or hardware, wherein the name of a module does not limit the module itself in some cases.

[0137] Based on the same principle as the method shown in the embodiments of the present invention, an electronic device is also provided in the embodiments of the present invention, which may include but is not limited to: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the method shown in any embodiment of the present invention by calling the computer program.

[0138] In an alternative embodiment, an electronic device is provided, such as Figure 3 As shown, Figure 3 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.

[0139] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0140] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0141] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.

[0142] The memory 4003 is used to store the application code (computer program) for executing the solution of the present invention, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the application code stored in the memory 4003 to implement the content shown in the above method embodiment.

[0143] The electronic device may also be a terminal device. Figure 3 The electronic 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.

[0144] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding contents of the aforementioned method embodiment.

[0145] According to another aspect of the present invention, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the implementation modes of the above-mentioned various embodiments.

[0146] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0147] It should be understood that the flow charts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the 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 module, the program segment, or a part of the 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 sequence different from that 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 and / or flow chart, and the combination of the boxes in the block diagram and / 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.

[0148] The computer-readable storage medium provided by the embodiment of the present invention may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. 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 thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.

[0149] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0150] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the disclosure scope involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) by each other.

Claims

1. A commodity quality assessment method, characterized in that: The following steps are involved: Obtain multi-source product information of the product to be evaluated; Extracting product quality features from the multi-source product information; The product quality features are input into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method: Acquire training data, wherein the training data includes a plurality of sample commodities and a true quality evaluation result of each of the sample commodities; Training the initial model according to the training data to obtain a predicted quality assessment result for each of the sample commodities; According to the predicted quality assessment results and the true quality assessment results of all sample products, an enhanced cross entropy loss function is used to determine the loss value of the initial model, so as to complete the training of the initial model based on the loss value and obtain the quality assessment model, wherein the enhanced cross entropy loss function is a function obtained by adding a regularization term to the cross entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the true quality assessment result.

2. The method according to claim 1, characterized in that The enhanced cross entropy loss function is: Among them, L represents the loss value, C is the total number of sample products, and y i is the true quality evaluation result of the i-th sample product, p i is the predicted quality evaluation result of the i-th sample product, λ is the regularization coefficient, ||p i -y i || is the regularization term.

3. The method according to claim 1, characterized in that The extracting of product quality features from the multi-source product information includes: Extracting product quality features from the multi-source product information through a pre-trained large model processing module, wherein the large model processing module includes a linear layer, a multi-head matrix calculation layer and a softmax layer; Among them, the linear layer is used to convert the multi-source product information into a multi-dimensional vector; the multi-head matrix calculation layer is used to extract features from the multi-dimensional vector to obtain the first feature; and the softmax layer is used to normalize the first feature to obtain the product quality feature.

4. The method according to any one of claims 1 to 3, characterized in that The quality assessment model includes a self-attention mechanism layer and a fully connected layer, wherein the self-attention mechanism layer is used to extract the product quality feature to obtain a second feature, and the fully connected layer is used to obtain a quality assessment result of the product to be evaluated based on the second feature.

5. The method according to any one of claims 1 to 3, characterized in that The step of obtaining multi-source commodity information of the commodity to be evaluated includes: Acquiring a commodity quality evaluation request of a user for the commodity to be evaluated on a user interaction interface, wherein the commodity quality evaluation request includes a commodity identifier of the commodity to be evaluated; According to the commodity quality evaluation request, multi-source commodity information of the commodity to be evaluated is obtained.

6. A commodity quality assessment device, characterized in that: include: An acquisition module, used to acquire multi-source commodity information of the commodity to be evaluated; A feature extraction module, used to extract product quality features from the multi-source product information; The quality assessment module is used to input the product quality features into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method: Acquire training data, wherein the training data includes a plurality of sample commodities and a true quality evaluation result of each of the sample commodities; Training the initial model according to the training data to obtain a predicted quality assessment result for each of the sample commodities; According to the predicted quality assessment results and the true quality assessment results of all sample products, an enhanced cross entropy loss function is used to determine the loss value of the initial model, so as to complete the training of the initial model based on the loss value and obtain the quality assessment model, wherein the enhanced cross entropy loss function is a function obtained by adding a regularization term to the cross entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the true quality assessment result.

7. The device according to claim 6, characterized in that The enhanced cross entropy loss function is: Among them, L represents the loss value, C is the total number of sample products, and y i is the true quality evaluation result of the i-th sample product, p i is the predicted quality evaluation result of the i-th sample product, λ is the regularization coefficient, ||p i -y i || is the regularization term.

8. The device according to claim 6, characterized in that When extracting the commodity quality features from the multi-source commodity information, the feature extraction module is specifically used to: Extracting product quality features from the multi-source product information through a pre-trained large model processing module, wherein the large model processing module includes a linear layer, a multi-head matrix calculation layer, and a softmax layer; Among them, the linear layer is used to convert the multi-source product information into a multi-dimensional vector; the multi-head matrix calculation layer is used to extract features from the multi-dimensional vector to obtain the first feature; and the softmax layer is used to normalize the first feature to obtain the product quality feature.

9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 5 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Annotation data generation method and device and computer readable storage medium

    CN108960409A

  • Sample collection method and system based on feature space

    CN110147845A

  • Workshop product quality evaluation method based on deep learning

    CN111553557A

  • Active learning sample selection method for target detection

    CN115393664A

  • Tumor microenvironment analysis method for framework-assisted liver cancer tissue full slide

    CN115527204A