A model training method, device, electronic device and storage medium thereof

By replacing the neural network layer with a convolutional layer in the artificial intelligence deep learning model, the problems of low efficiency and slow response caused by excessive neural network layers are solved, and the efficient computing and fast response of the model are achieved, which is suitable for e-commerce platforms. Product information review.

CN113807494BActive Publication Date: 2024-11-15BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110040360.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-13
Publication Date
2024-11-15
Estimated Expiration
2041-01-13

AI Technical Summary

Technical Problem

In the prior art, due to the excessive number of neural network layers, artificial intelligence deep learning models have low work efficiency and slow response time, especially in the review of product information of e-commerce platforms.

Method used

By replacing the network layer in the neural network as a convolutional layer, the model built from the convolutional layer is obtained, which simplifies the complexity of the neural network and improves work efficiency and response time.

Benefits of technology

It reduces the number of parameters and calculations of the model, shortens the response time, improves the computing efficiency of the model, is suitable for product information review on e-commerce platforms, and improves the merchant’s product delivery experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113807494B_ABST
    Figure CN113807494B_ABST
Patent Text Reader

Abstract

The present invention discloses a model training method, device, electronic device and storage medium thereof. The method comprises: receiving a preprocessed training sample; replacing a part of the corresponding network layer of the training model network with at least one pre-set convolution layer according to a predetermined replacement method through a preset training model network according to the preprocessed training sample to obtain a trained convolution layer; and replacing the corresponding network layer through the trained convolution layer deployment to obtain a training model. The training model constructed by the convolution layer is obtained by training by replacing the network layer in the neural network with the convolution layer, simplifying the complexity of the neural network, thereby improving the working efficiency and response time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a model training method, device, electronic equipment and storage medium thereof. Background Art

[0002] At present, in many scenarios and fields, artificial intelligence deep learning can replace the original less efficient working methods, but there are still some situations in the existing technology. Even if the artificial intelligence deep learning method in the existing technology is adopted, there will be a corresponding slow situation. For example, with the development of the Internet information age, the functions of e-commerce platforms are becoming more and more perfect, and many merchants have begun to move from offline to online. Now online shopping has become a part of our daily life. In order to attract consumers to buy goods, many merchants will give some promotional slogans to the goods, and these promotional slogans are displayed on the details page of the goods. However, many promotional slogans do not comply with the regulations of e-commerce platforms, and even violate the Advertising Law. For example, the promotional slogans contain absolute descriptions such as "latest science", "latest technology", "most advanced processing technology", and contain promises such as "safe", "non-toxic side effects", "no dependence", "invalid refund", "XX insurance company insurance" and so on. In order to improve the accuracy of product information, better regulate the behavior of merchants in publishing product information, and create a healthy and good e-commerce platform ecology for the majority of online consumers. The e-commerce platform will organize special auditors to manually detect the compliance of product promotional slogans, and remove products that do not comply with the platform's standardized promotional slogans.

[0003] In the field of artificial intelligence, since the advent of Bert, it has attracted widespread attention in the field of natural language processing and has achieved outstanding results in many NLP tasks. At the same time, many Bert pre-trained models of different sizes have been open-sourced, such as 12-layer and 10-layer Bert. However, since the 12-layer or 10-layer network model is still too complex to process, the final model operation still has problems such as low efficiency and slow response time.

[0004] Therefore, those skilled in the art are committed to finding a model training method to help solve the technical problem in the prior art that the training model has too many neural network layers, resulting in low work efficiency and slow response. Summary of the invention

[0005] The present application provides a model training method, the purpose of which is to replace the network layer in a neural network with a convolutional layer, train a training model constructed by the convolutional layer, simplify the complexity of the neural network, and thus improve the technical problem of working efficiency and response time.

[0006] The method includes:

[0007] Receiving preprocessed training samples;

[0008] According to the preprocessed training samples, the preset training model network is used in a predetermined replacement manner to replace a part of the corresponding network layers of the training model network with at least one preset convolutional layer to obtain a trained convolutional layer;

[0009] The training model is obtained by replacing the corresponding network layer with the trained convolutional layer deployment.

[0010] In one embodiment, receiving the preprocessed training sample comprises:

[0011] Obtain text training samples to be trained;

[0012] Deleting non-text characters in the text training sample in a predetermined deletion manner;

[0013] Adding an index code and a character vector to the text training sample model with the non-text characters deleted to obtain a text vector, wherein the index code is used to describe the content of the characters in the text training sample, and the character vector is used to describe the order of the characters in the text training sample;

[0014] The text vector is normalized to obtain an output vector to complete the preprocessing of the training sample.

[0015] In one embodiment, the pre-processed training samples are trained by using a preset training model network in a predetermined replacement manner to replace a portion of the corresponding network layers of the training model network with a preset convolutional layer to obtain the trained convolutional layer, including:

[0016] Establishing a correspondence between at least one preset convolutional layer and network layers of different parts in the training model network;

[0017] According to the preprocessed training samples, the preset convolutional layers are used to replace the corresponding network layers in part of the training model network through the preset training model network in a random replacement manner to obtain the trained convolutional layers.

[0018] In one embodiment, the training samples after preprocessing are trained by randomly replacing the corresponding network layers in the training model network with the preset convolutional layers to obtain the trained convolutional layers, including:

[0019] Creating at least one continuous numerical interval, wherein the number of the numerical intervals is the same as the number of the convolutional layers and corresponds to different convolutional layers;

[0020] Randomly generate a numerical value, wherein the numerical value is a value belonging to the at least one numerical interval;

[0021] Selecting the convolution layer corresponding to the value belonging to the value interval;

[0022] The corresponding convolution layer replaces the corresponding network layer, and training is performed according to the preprocessed training samples to obtain a trained convolution layer.

[0023] In one embodiment, replacing the corresponding network layer with the corresponding convolutional layer, and training according to the preprocessed training sample to obtain the trained convolutional layer includes:

[0024] The corresponding convolutional layer replaces the corresponding network layer, and obtains the distribution probability of the first category of training samples and the second category of training samples in the training samples through the classifier layer according to the preprocessed training samples, wherein the training samples include the first category of training samples and the second category of training samples determined to be classified;

[0025] The convolutional layer is optimized according to the distribution probability to obtain a trained convolutional layer that meets the probability requirement.

[0026] In one embodiment, the present application also provides a model training method, the method comprising:

[0027] Receiving the preprocessed illegal text training sample;

[0028] According to the preprocessed illegal text training sample, the preset illegal text training model network is used to replace part of the corresponding network layer of the illegal text training model network with at least one preset convolution layer to obtain a trained convolution layer through a preset illegal text training model network in a predetermined replacement manner;

[0029] The illegal text training model is obtained by replacing the corresponding network layer with the trained convolutional layer deployment.

[0030] In one embodiment, before the step of receiving the pre-processed illegal text training sample, the method further includes:

[0031] Obtaining product information from an e-commerce platform, wherein the product information is data information in text form;

[0032] Classifying the product information into illegal training samples and non-illegal training samples according to a predetermined classification method;

[0033] The classified commodity information is stored as the illegal text training sample to be preprocessed.

[0034] In one embodiment, the present application provides a model training device, the device comprising:

[0035] A receiving module, used for receiving preprocessed training samples;

[0036] A replacement module, used to replace the corresponding network layer of the training model network with at least one preset convolutional layer according to the preprocessed training sample through the preset training model network in a predetermined replacement manner to obtain a trained convolutional layer;

[0037] The deployment building module is used to obtain a training model by replacing the corresponding network layer with the trained convolutional layer deployment.

[0038] In one embodiment, the present application provides an electronic device, the device comprising: a processor and a memory;

[0039] The memory stores an application program executable by the processor, which is used to enable the processor to perform the steps of the model training method.

[0040] In one embodiment, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the model training method when executed by a processor.

[0041] As can be seen above, based on the above embodiments, the network layer in the neural network is replaced by a convolutional layer, and a training model constructed by the convolutional layer is trained to simplify the complexity of the neural network, thereby improving the technical problems of working efficiency and response time. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 Flow chart of a model training method process 100 in one embodiment of the present invention;

[0043] Figure 2 Flow chart of a model training method process 200 in one embodiment of the present invention;

[0044] Figure 3 Flow chart of a model training method process 300 in one embodiment of the present invention;

[0045] Figure 4 A schematic diagram of a data structure of a model training method in one embodiment of the present invention;

[0046] Figure 5 Flow chart of a model training method process 400 in one embodiment of the present invention;

[0047] Figure 6 Flow chart of a model training method process 500 in one embodiment of the present invention;

[0048] Figure 7 Flow chart of a model training method process 600 in one embodiment of the present invention;

[0049] Figure 8A schematic diagram of the architecture of model deployment in one embodiment of the present invention;

[0050] Fig. 9 Schematic diagram of a model training device in one embodiment of the present invention. DETAILED DESCRIPTION

[0051] The inventors found that in the field of artificial intelligence deep learning, due to the large number of neural network layers, the trained model has multiple neural network layers. Therefore, when the model is used, the subsequent calculation time will be relatively long, and the response time will also be relatively long. For example, when an e-commerce platform determines whether the product information complies with regulations, especially whether the product information complies with the requirements of the Advertising Law, Bert in the prior art is mainly based on the Transformer structure of Attention calculation. The number of parameters is too large, the requirements for the machine's computing resources are high, the prediction time is long, and the model prediction time is poor. Especially for e-commerce product review systems, when merchants publish products, if the review results take a long time to return, it will affect the merchant's product delivery experience and cause complaints from merchants.

[0052] Figure 1 Flow chart of a model training method process 100 in one embodiment of the present invention. Figure 1 As shown, in one embodiment, the present application provides a model training method, the method comprising:

[0053] S101, receiving preprocessed training samples.

[0054] In this step, the specific steps of first receiving the preprocessed training samples are as follows. The training samples are used for training the model later. Of course, due to different training models, the corresponding preprocessing methods are also different. The purpose of preprocessing is to make the obtained training samples meet the requirements of subsequent training. The specific preprocessing content is described in detail later, so it will not be repeated here.

[0055] S102: According to the preprocessed training samples, a preset training model network is used to replace a part of the corresponding network layers of the training model network with at least one preset convolutional layer in a predetermined replacement manner to perform training to obtain a trained convolutional layer.

[0056] In this step, a specific step of replacing part of the network layer with a convolution layer for training is provided. It should be noted that the convolution layer will perform convolution operations according to the training samples to replace part of the network layer operations, allowing the convolution layer to perform transfer learning so that the convolution layer can complete the operation function of the corresponding network layer. In this way, the large model is divided into one or more small models to achieve equivalent operation results, reducing the amount of operations and operation time.

[0057] It should be pointed out that the preset neural network is a model neural network that has been trained and is used to train the corresponding convolutional layer.

[0058] S103, obtaining a training model by replacing the corresponding network layer with the trained convolutional layer deployment.

[0059] In this step, part or even all of the network layers have been replaced by the convolutional layers, and a new training model is formed by the trained convolutional layers. Since the new training model is composed of multiple convolutional layers (i.e., small models) instead of the neural network (i.e., large model), the number of parameters and the amount of calculation will be reduced, thereby reducing the amount of calculation and shortening the response time.

[0060] In this embodiment, a specific implementation method is provided for reducing the model operation amount and response time by making a small model equivalent to a large model. First, receive the preprocessed training sample. The essence of this embodiment is to first train a data structure network that replaces the large model with a small model, and then replace the previous more complex large model with the compressed data structure network. Then, the process of replacement learning is essentially a kind of transfer learning, so a certain number of training samples are still required for learning. In addition, different training models require different training samples, so it is necessary to receive the training samples for learning in this step. Then, according to the preprocessed training samples, at least one preset convolutional layer is replaced with the corresponding network layer of part of the training model network in a predetermined replacement manner through the preset training model network to obtain the trained convolutional layer. The training model network is a neural network that has been trained and has multiple layers of the network layer. The convolutional layer corresponds to part of the network layer, and replaces the corresponding network layer for transfer learning. The convolutional layer is equivalent to complete the operation of the corresponding network layer. When the convolutional layer can complete the operation function of the corresponding network layer, the convolutional layer training is completed. Finally, the trained convolutional layer is deployed to construct the trained convolutional layer to replace the corresponding network layer to obtain the training model. The final training model can be obtained by re-architecting the data operation structure equivalent to the overall neural network through the trained convolutional layer.

[0061] Figure 2 FIG. 2 is a flow chart of a model training method process 200 according to an embodiment of the present invention. Figure 2 As shown, in one embodiment, receiving the preprocessed training sample includes:

[0062] S201, obtaining text training samples to be trained.

[0063] In this step, a specific step for obtaining the text training sample to be trained is provided. The following further explains the subsequent steps through the artificial intelligence deep learning scenario of text. First, the text training sample in text form is obtained, because the subsequent scenario is applied to the text training model.

[0064] S202: Delete non-text characters in the text training sample in a predetermined deletion manner.

[0065] In this step, a specific implementation method of deleting non-text characters in the text sample in a predetermined deletion manner is provided. Because the text training sample may also contain punctuation marks, other symbols, etc., if the pure text content in the text training sample is trained, then the non-pure text characters in the text training sample naturally need to be deleted.

[0066] S203, adding index codes and character vectors to the text training sample model with the non-text characters deleted to obtain a text vector, wherein the index codes are used to describe the content of the characters in the text training sample, and the character vectors are used to describe the order of the characters in the text training sample.

[0067] In this step, a specific step of adding the index code and the character vector to the text training sample is provided. Specifically, the cls character is added at the starting position of the text, the text characters in the title text are converted into index codes, and the corresponding character vectors are obtained in the Embedding layer according to the index codes of the characters, and the initial vector representation of the title text is combined together; similarly, the position vector corresponding to the character position is obtained, and the representation vector of the original title text is superimposed with the position vector to obtain the text vector containing word order information.

[0068] S204, normalizing the text vector to obtain an output vector to complete preprocessing of the text training sample.

[0069] In this step, a specific implementation method of completing the preprocessing of the text training sample after normalizing the text vector is provided.

[0070] In this embodiment, a specific implementation method of preprocessing is provided. First, a text training sample to be trained is obtained. In this embodiment, it is only applied to the scenario of text training samples. The method of obtaining may be from a preset database or from the network, as long as it can be used for subsequent training. Then, the non-text characters in the text training sample are deleted in a predetermined deletion method, the purpose of which is to delete some unnecessary non-text characters to conduct pure text training. Subsequently, the text training sample model with the non-text characters deleted is added with index coding and character vectors to obtain a text vector, wherein the index coding is used to describe the content of the characters in the text training sample, and the character vector is used to describe the order of the characters in the text training sample. The text content can be converted into a form that can be trained later, namely the text vector, through the text vector. The text vector is normalized to obtain an output vector to complete the preprocessing of the text training sample. It should be noted that in this embodiment, the character embedding matrix vector size in the character vector is 21128*128, covering 21128 characters, and the vector dimension of each character is 128; the position embedding matrix vector size is 512*128, including 512 position information, and the position vector dimension is 128. Assuming that the length of the model input text is set to S, the dimension size of the vector E is S*128.

[0071] Figure 3 This is a flowchart of a model training method process 300 in one embodiment of the present invention. Figure 4 FIG. 1 is a schematic diagram of the data structure of a model training method in one embodiment of the present invention. Figure 3 and Figure 4 As shown, in one embodiment, the training sample after preprocessing is trained by replacing the corresponding network layer of the training model network with the preset convolution layer according to a predetermined replacement method through the preset training model network to obtain the trained convolution layer, which includes:

[0072] S301, establish a correspondence between at least one preset convolutional layer and network layers of different parts in the training model network.

[0073] In this step, the convolutional layer is first established to establish a corresponding relationship with the network layers of different parts of the training model network. In this step, the 12-layer network layer is taken as an example. The network layer is in the Bert environment, and the convolutional layer of Textcnn is used for subsequent replacement, represented by Transformer, and the network layer uses a Bert model of size 128 as the basic model. The first 3 layers of Bert are exchanged with the first convolutional layer of Textcnn; Bert's 4-6 layers are exchanged with the second convolutional layer of Textcnn, and Bert's 7-9 layers are exchanged with the third convolutional layer of Textcnn; the last 3 layers are exchanged with the forward propagation layer of Textcnn.

[0074] S302: According to the preprocessed training samples, a preset convolutional layer is used to replace a part of the corresponding network layers in the training model network in a random replacement manner through a preset training model network to obtain a trained convolutional layer.

[0075] In this step, the replacement is implemented according to the above configuration to train the convolutional layer.

[0076] In this step, a specific implementation method is provided for establishing a correspondence between the convolutional layer and the network layer, and then replacing part of the corresponding network layer of the training model network with the preset convolutional layer in a random replacement manner through the preset training model network according to the preprocessed training samples to obtain the trained convolutional layer.

[0077] In addition, according to the configuration between the convolutional layer and the network layer mentioned above, the following specific matching relationship calculation process can be obtained:

[0078] The vector E output by the Embedding layer is convolved. The convolution layer is implemented by convolution kernels, and 128 4*128 convolution kernels are selected. For the 128 4*128 convolution kernels, in order to ensure that the dimension of a single convolution kernel after operation is S, the vector E needs to be padded. Each convolution kernel slides over the padded vector E in a sliding window manner. p , each time you slide one step, do a convolution operation and get C i , and finally generate S elements, recorded as feature vectors Similarly, 128 convolution kernels can be obtained Splice together to get the convolution output vector C of the first layer 1 , the latitude size is S*128. Similarly, C 1 Input to the second convolutional layer to get C 2 ; C 2 Input to the third convolutional layer to get C 3 The convolution calculation formula is as follows:

[0079]

[0080] Among them, W k1 is a 4*128 convolution kernel matrix, i is the position of the current convolution kernel when sliding, c i is the result of the convolution operation. k1 Bias vector, where f is the relu nonlinear activation function.

[0081] The forward propagation layer calculation formula is as follows:

[0082] Z=f(W c C 3 +b c )

[0083] Among them, W c , b c is a trainable parameter matrix.

[0084] Figure 5 FIG. 4 is a flow chart of a model training method process 400 according to an embodiment of the present invention. Figure 5 As shown, in one embodiment, the training samples after preprocessing are trained by randomly replacing the corresponding network layers in the training model network with the preset convolutional layers to obtain the trained convolutional layers, including:

[0085] S401, creating at least one continuous numerical interval, wherein the number of the numerical intervals is the same as the number of the convolutional layers and corresponds to different convolutional layers.

[0086] In this step, a specific step of creating a continuous numerical interval is provided for subsequent random replacement.

[0087] S402: randomly generate a numerical value, wherein the numerical value belongs to the at least one numerical interval.

[0088] In this step, a specific step of randomly generating the numerical value is provided to implement the subsequent steps.

[0089] S403: Select the convolution layer corresponding to the value that belongs to the value interval.

[0090] In this step, a specific step of making the different numerical intervals correspond to the different convolutional layers is provided.

[0091] S404: Replace the corresponding network layer with the corresponding convolution layer, and perform training according to the preprocessed training samples to obtain a trained convolution layer.

[0092] In this step, a specific random replacement step is provided.

[0093] In this embodiment, a specific random replacement method is provided. First, at least one continuous numerical interval is created, wherein the number of the numerical intervals is the same as the number of the convolutional layers and corresponds to different convolutional layers. Then, a numerical value is randomly generated, wherein the numerical value is a range value belonging to the at least one numerical interval. The convolutional layer corresponding to the numerical interval is selected. Finally, the corresponding network layer is replaced by the corresponding convolutional layer, and the trained convolutional layer is obtained according to the preprocessed training sample. Obviously, only one convolutional layer is used to replace the corresponding network layer in Bert at a time.

[0094] The following is a specific example of random replacement. During training, the corresponding convolutional layer is selected for replacement with a probability of 1 / 4. For example, when the model is trained for classification tasks, a random number in the interval (0,1] can be generated. The interval is then divided into four parts (0,0.25), (0.25,0.5), (0.5,0.75), (0.75,0.5], i.e., the numerical interval. When the generated random number falls in the first interval, i.e., the numerical value, the Textcnn forward propagation layer is used to replace the last three layers of Bert; when the generated random number falls in the second interval, the third convolutional layer of Textcnn is used to replace it; and so on, until the training is finally completed.

[0095] Figure 6 FIG. 5 is a flow chart of a model training method process 500 according to an embodiment of the present invention. Figure 6 As shown, in one embodiment, replacing the corresponding network layer with the corresponding convolution layer to train the trained convolution layer according to the preprocessed training sample includes:

[0096] S501, replacing the corresponding network layer with the corresponding convolution layer, and obtaining the distribution probabilities of the first category of training samples and the second category of training samples in the training samples through the classifier layer according to the preprocessed training samples, wherein the training samples include the first category of training samples and the second category of training samples determined to be classified.

[0097] This step provides a specific step for obtaining the distribution probability through the classifier layer. In the scenario of predicting whether the product information contains illegal content, the first category is the product information containing illegal content, and the second category is the product information not containing illegal content.

[0098] S502, adjusting the convolutional layer according to the distribution probability to optimize and obtain a trained convolutional layer that meets the probability requirement.

[0099] In this step, a trained convolution layer is obtained by finally adjusting the convolution layer through the distribution probability.

[0100] In this embodiment, a specific implementation method of how to finally train the convolution layer that meets the requirements is provided. The corresponding convolution layer replaces the corresponding network layer, and the distribution probability of the first category of training samples and the second category of training samples in the training samples is obtained through the classifier layer according to the preprocessed training samples, wherein the training samples include the first category of training samples and the second category of training samples that are determined to be classified. The convolution layer is adjusted according to the distribution probability to optimize and obtain a trained convolution layer that can meet the probability requirements.

[0101] For example, when Bert is doing a classification task, it extracts the first position vector T1 of the matrix vector output by the last layer of Transformer and then inputs it into the classifier for classification; in addition, the vector Z output by the forward propagation layer of Textcnn is also input into the classifier. The two are replaced with a certain probability, which is equivalent to designing a probability switch to control the input of the classifier. The classifier converts the final output result into a probability distribution of product promotion violations, and sets a threshold of the probability value as the benchmark for product promotion violations. The relevant calculation formula is as follows:

[0102]

[0103]

[0104] Among them, random(0,1) means generating a random number (0,1), the output function f uses the sigmoid function, W is the fully connected layer matrix, and b is the corresponding fully connected layer bias vector.

[0105] In this embodiment, the cross entropy loss function is used, and the stochastic gradient descent method is used to optimize the loss function of the model to obtain the parameters in the model. In addition, before updating the model parameters, the pre-trained Bert model is used as the basic model. When doing classification task training, its model parameters are frozen and not adjusted; only the parameters of the Textcnn related layers and the fully connected classifier layer are adjusted and optimized. The formula of the cross entropy loss function is as follows:

[0106]

[0107] Among them, y is the label of the sample and N is the number of samples.

[0108] In one embodiment, a model training method is also provided in the present application, the method comprising:

[0109] Receiving the preprocessed illegal text training sample;

[0110] According to the preprocessed illegal text training sample, the preset illegal text training model network is used to replace part of the corresponding network layer of the illegal text training model network with at least one preset convolution layer to obtain a trained convolution layer through a preset illegal text training model network in a predetermined replacement manner;

[0111] The illegal text training model is obtained by replacing the corresponding network layer with the trained convolutional layer deployment.

[0112] In this embodiment, a specific model training implementation method is provided for illegal texts, that is, when violating the Advertising Law and other related laws. Regarding the pre-processing method, the random method during replacement can adopt the above method, which will not be repeated here.

[0113] Figure 7 FIG. 6 is a flow chart of a model training method process 600 according to an embodiment of the present invention. Figure 7 As shown, in one embodiment, the present application further provides a model training method. Before the step of receiving the pre-processed illegal text training sample, the method further includes:

[0114] S601, obtaining product information from an e-commerce platform, wherein the product information is data information in text form.

[0115] In this step, a specific step of obtaining the product information is provided.

[0116] S602: Classify the product information into illegal training samples and non-illegal training samples according to a predetermined classification method.

[0117] In this step, a specific step of classifying the commodity information into the illegal training samples and the non-illegal training samples is provided, that is, the illegal training samples are equivalent to the training samples of the first category mentioned above, and the non-illegal training samples are equivalent to the training samples of the second category mentioned above.

[0118] S603: Store the classified commodity information as the illegal text training sample to be preprocessed.

[0119] In this step, a specific step of storing the commodity information as the pre-processed illegal text training sample is provided.

[0120] In this embodiment, a specific implementation method using the e-commerce platform as a scenario is provided. First, the product information of the e-commerce platform is obtained, wherein the product information is data information in text form. Then, the product information is divided into the illegal training samples and the non-illegal training samples according to a predetermined classification method. Finally, the classified product information is stored as a text training sample to be trained.

[0121] Figure 8 FIG. 1 is a schematic diagram of the architecture of the model deployment in one embodiment of the present invention. Figure 8 As shown, in addition, in the stored procedure

[0122] The model designed by the model is trained on the server through the training set data. The main program is written in Python language, in which the framework of the model is built with tensorflow, and also includes other third-party libraries that Python depends on. The maximum input length of the model is set to 100 characters, epoch is 4, and bath_size is 128. After the model training is completed, the Textcnn model is saved on the server's disk. The saved content mainly includes the model structure and the trained parameters in the model. Model testing: load the test set data from the disk to the memory for data cleaning; load the Textcnn model saved during training from the disk to the memory, and input the cleaned test set title data into the model for prediction. Finally, compare the predicted results with the actual annotation results to obtain the evaluation results. Finally, regarding the model deployment call, the trained Textcnn model is deployed on the corresponding server. The product review system will transmit the title of the product published by the merchant to the server where the algorithm model is deployed after preprocessing, and obtain the result of whether the corresponding product is in violation, and further determine whether the product is on the shelf or off the shelf.

[0123] Fig. 9 FIG. 1 is a schematic diagram of a model training device according to an embodiment of the present invention. Fig. 9 As shown, in one embodiment, a model training device is provided, the device comprising:

[0124] A receiving module 101 is used to receive preprocessed training samples;

[0125] A replacement module 102 is used to replace the corresponding network layer of the training model network with at least one preset convolution layer according to the preprocessed training sample through the preset training model network in a predetermined replacement manner to obtain a trained convolution layer;

[0126] The deployment construction module 103 is used to deploy and construct the trained convolutional layer to replace the corresponding network layer to obtain a training model.

[0127] In one embodiment, an electronic device is provided, the device comprising: a processor and a memory;

[0128] The memory stores an application program executable by the processor, which is used to enable the processor to perform the steps of the model training method as described.

[0129] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that when the program is executed by a processor, the steps of the model training method are implemented.

[0130] In addition, the method steps described in this application can be implemented by hardware in addition to being implemented by a data processing program, for example, by logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers, etc. Therefore, such hardware that can implement the method described in this application can also constitute this application.

[0131] The flow chart and block diagram in the accompanying drawings of the present application show the possible architecture, function and operation of the system, method and computer program product according to the various embodiments disclosed in the present application. 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 implementations as replacements, the functions marked in the box can also occur in the order of the standards in different figures. For example, the boxes represented by two connections 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 the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0132] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the features described in the various embodiments and / or claims of the present application may be combined and / or combined in a variety of ways, and all of these combinations and / or combinations fall within the scope disclosed in the present application.

[0133] Specific embodiments are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas, and is not used to limit the present application. For those skilled in the art, changes can be made in the specific implementation methods and application scopes according to the ideas, spirits and principles of the present invention, and any modifications, equivalent substitutions, improvements, etc. made therein should be included in the scope of protection of this application.

[0134] In practical applications, the computer-readable medium may be included in the device / apparatus / system described in the above embodiments, or may exist independently without being assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the data table partitioning device described above implements the data table partitioning method.

[0135] According to the embodiments disclosed in the present application, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: 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), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof, but it is not used to limit the scope of protection of the present application. In the embodiments disclosed in the present application, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.

[0136] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A model training method, characterized in that: The method includes: Receiving preprocessed text training samples; According to the preprocessed text training sample, the preset training model network is used to replace the corresponding network layer of the training model network with at least one preset convolution layer in a predetermined replacement manner to obtain a trained convolution layer; The training model is obtained by replacing the corresponding network layer with the trained convolutional layer deployment; The training of the preprocessed text training sample by using a preset training model network in a predetermined replacement manner to replace a portion of the corresponding network layers of the training model network with at least one preset convolutional layer to obtain the trained convolutional layer comprises: Establishing a correspondence between at least one preset convolutional layer and network layers of different parts in the training model network; According to the preprocessed text training samples, a preset training model network is used in a predetermined replacement manner to replace part of the corresponding network layers of the training model network with at least one preset convolutional layer for training, and the convolutional layer is used to equivalently complete the operation of the corresponding network layer. When the convolutional layer can complete the operation function of the corresponding network layer, the trained convolutional layer is obtained; wherein, the training model network is a neural network that has been trained and has multiple layers of the network layers; one convolutional layer corresponds to multiple network layers, the convolutional layer is a small-scale model, and the network layer is a large-scale model.

2. The model training method according to claim 1, characterized in that: The receiving of the preprocessed text training sample comprises: Obtain text training samples to be trained; Deleting non-text characters in the text training sample in a predetermined deletion manner; Adding an index code and a character vector to the text training sample model with the non-text characters deleted to obtain a text vector, wherein the index code is used to describe the content of the characters in the text training sample, and the character vector is used to describe the order of the characters in the text training sample; The text vector is normalized to obtain an output vector to complete the preprocessing of the text training sample.

3. The model training method according to claim 1, characterized in that: The preprocessed text training sample is trained by replacing part of the corresponding network layer of the training model network with at least one preset convolution layer according to a predetermined replacement method through a preset training model network, and the operation of the corresponding network layer is equivalently completed by the convolution layer. When the convolution layer can complete the operation function of the corresponding network layer, the trained convolution layer is obtained, which includes: Creating at least one continuous numerical interval, wherein the number of the numerical intervals is the same as the number of the convolutional layers and corresponds to different convolutional layers; Randomly generate a numerical value, wherein the numerical value is a value belonging to the at least one numerical interval; Selecting the convolution layer corresponding to the value belonging to the value interval; The corresponding convolution layer replaces the corresponding network layer, and is trained according to the preprocessed text training sample. When the convolution layer can complete the calculation function of the corresponding network layer, the trained convolution layer is obtained.

4. The model training method according to claim 3, characterized in that: The corresponding convolution layer replaces the corresponding network layer, and performs training according to the preprocessed text training sample. When the convolution layer can complete the operation function of the corresponding network layer, the trained convolution layer includes: The corresponding convolutional layer is replaced with the corresponding network layer, and the distribution probability of the first category of text training samples and the second category of text training samples in the text training samples is obtained through the classifier layer according to the preprocessed text training samples, wherein the text training samples include the first category of text training samples and the second category of text training samples determined to be classified; The convolutional layer is optimized according to the distribution probability to obtain a trained convolutional layer that meets the probability requirement.

5. A model training method, characterized in that: The method includes: Receiving the preprocessed illegal text training sample; According to the preprocessed illegal text training sample, the preset illegal text training model network is used to replace part of the corresponding network layer of the illegal text training model network with at least one preset convolution layer to obtain a trained convolution layer through a preset illegal text training model network in a predetermined replacement manner; The illegal text training model is obtained by replacing the corresponding network layer through the trained convolutional layer deployment; The step of replacing a part of the corresponding network layers of the illegal text training model network with at least one preset convolutional layer by using the preset illegal text training model network according to the preprocessed illegal text training sample in a predetermined replacement manner to obtain the trained convolutional layer comprises: Establishing a correspondence between at least one preset convolutional layer and network layers of different parts in the illegal text training model network; According to the preprocessed illegal text training samples, the corresponding network layers of part of the illegal text training model network are replaced by at least one preset convolutional layer in a predetermined replacement manner through the preset illegal text training model network for training, and the operation corresponding to the network layer is equivalently completed by the convolutional layer. When the convolutional layer can complete the operation function corresponding to the network layer, the trained convolutional layer is obtained; wherein the illegal text training model network is a trained neural network and has multiple layers of the network layers; one convolutional layer corresponds to multiple network layers, the convolutional layer is a small-scale model, and the network layer is a large-scale model.

6. The model training method according to claim 5, characterized in that: Before the step of receiving the pre-processed illegal text training sample, the method further includes: Obtaining product information from an e-commerce platform, wherein the product information is data information in text form; Classifying the product information into illegal training samples and non-illegal training samples according to a predetermined classification method; The classified commodity information is stored as the illegal text training sample to be preprocessed.

7. A model training device, characterized in that: The device comprises: A receiving module, used for receiving the preprocessed text training samples; A replacement module, used for replacing a part of the corresponding network layer of the training model network with at least one preset convolutional layer through a preset training model network in a predetermined replacement manner according to the preprocessed text training sample to obtain a trained convolutional layer; A deployment building module, used to replace the corresponding network layer by the trained convolutional layer deployment to obtain a training model; The training of the preprocessed text training sample by using a preset training model network in a predetermined replacement manner to replace a portion of the corresponding network layers of the training model network with at least one preset convolutional layer to obtain the trained convolutional layer comprises: Establishing a correspondence between at least one preset convolutional layer and network layers of different parts in the training model network; According to the preprocessed text training samples, a preset training model network is used in a predetermined replacement manner to replace part of the corresponding network layers of the training model network with at least one preset convolutional layer for training, and the convolutional layer is used to equivalently complete the operation of the corresponding network layer. When the convolutional layer can complete the operation function of the corresponding network layer, the trained convolutional layer is obtained; wherein, the training model network is a neural network that has been trained and has multiple layers of the network layers; one convolutional layer corresponds to multiple network layers, the convolutional layer is a small-scale model, and the network layer is a large-scale model.

8. An electronic device, characterized in that: The electronic device comprises: a processor and a memory; The memory stores an application program executable by the processor, which is used to enable the processor to perform the steps of the model training method as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the model training method described in any one of claims 1 to 6 are implemented.