Method, device, readable storage medium and electronic equipment for classification prediction

By cascading multiple prediction sub-models and correcting their sample annotations during training, the problem of insufficient accuracy of BERT pre-trained models in text classification was solved, achieving higher classification prediction accuracy.

CN115329067BActive Publication Date: 2025-11-21BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110506315.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-10
Publication Date
2025-11-21
Estimated Expiration
2041-05-10

AI Technical Summary

Technical Problem

Existing deep learning methods based on BERT pre-trained models have low accuracy in text classification, making it difficult to meet users' requirements for classification accuracy.

Method used

By employing multiple sequentially cascaded prediction sub-models, the accuracy of the model is improved by correcting the sample labels of non-first prediction sub-models and training based on the corrected sample labels.

Benefits of technology

The accuracy of classification prediction is improved by incorporating sample label correction behavior into the training process of the cascaded model, thereby enhancing the accuracy of the prediction model and the final classification result.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115329067B_ABST
    Figure CN115329067B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, device, readable storage medium and electronic device for classification prediction to improve the accuracy of classification prediction. The method comprises: inputting to-be-classified information into a first prediction sub-model in a cascade sequence to obtain a prediction result output by the first prediction sub-model; for each non-first prediction sub-model in the cascade sequence, inputting the to-be-classified information and a prediction result output by a previous prediction sub-model of the non-first prediction sub-model into the non-first prediction sub-model to obtain a prediction result output by the non-first prediction sub-model until obtaining a final classification result output by a last prediction sub-model in the cascade sequence. Training of the prediction model comprises: for any non-first prediction sub-model, correcting sample labels of the non-first prediction sub-model according to training results of prediction sub-models before the non-first prediction sub-model, and training the non-first prediction sub-model according to the corrected sample labels.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, in particular, to a classification prediction method and device, readable storage medium and electronic equipment. BACKGROUND

[0002] With the popularity and development of artificial intelligence and machine learning technology, more and more companies begin to try to use machine learning technology to solve business problems, and machine learning technology is widely used in various tasks. Taking a classification model as an example, it has a wide range of applications in tasks such as text classification, user profiling, abnormal user discovery, and abnormal transaction mining. At the same time, a large amount of data can be collected, creating conditions for the use of machine learning technology and improving the performance of machine learning models.

[0003] Taking text classification as an example, text classification usually refers to determining the category to which the text data to be classified belongs according to the text features of the text data to be classified. In related technologies, deep learning methods based on BERT pre-training models are often used to classify texts. SUMMARY

[0004] The purpose of the present disclosure is to provide a classification prediction method, device, readable storage medium and electronic equipment to improve the accuracy of classification prediction.

[0005] To achieve the above purpose, the first aspect of the present disclosure provides a method for classification prediction based on a prediction model, the prediction model comprising at least two prediction sub-models in a sequential cascade order, the method comprising:

[0006] inputting the information to be classified into a first prediction sub-model in the cascade order to obtain a prediction result output by the first prediction sub-model;

[0007] for each non-first prediction sub-model in the cascade order, inputting the information to be classified and the prediction result output by the previous prediction sub-model of the non-first prediction sub-model into the non-first prediction sub-model to obtain a prediction result output by the non-first prediction sub-model, until obtaining a final classification result output by the last prediction sub-model in the cascade order, wherein the training of the prediction model comprises: for any non-first prediction sub-model, correcting the sample label of the non-first prediction sub-model according to the training result of the prediction sub-model before the non-first prediction sub-model, and training the non-first prediction sub-model according to the corrected sample label.

[0008] Optionally, the training of the prediction model specifically comprises:

[0009] The sample information to be classified is taken as an input parameter of a first prediction sub-model, and original sample labels of the sample information to be classified are taken as output parameters of the first prediction sub-model, and the first prediction sub-model is trained;

[0010] For each non-first prediction sub-model in the cascade sequence, the following sub-training process is performed until the last prediction sub-model is trained to obtain a trained prediction model:

[0011] The input parameters of the non-first prediction sub-model are generated according to the sample information to be classified and a prediction result output by a previous prediction sub-model of the non-first prediction sub-model;

[0012] The corrected sample labels corresponding to the non-first prediction sub-model are determined;

[0013] The non-first prediction sub-model is trained according to the input parameters of the non-first prediction sub-model and the corrected sample labels corresponding to the non-first prediction sub-model.

[0014] Optionally, the corrected sample labels corresponding to the non-first prediction sub-model are determined by:

[0015] The prediction result output by the previous prediction sub-model of the non-first prediction sub-model is obtained;

[0016] It is determined whether the prediction result output by the previous prediction sub-model matches the corrected sample labels corresponding to the previous prediction sub-model;

[0017] If the prediction result output by the previous prediction sub-model matches the corrected sample labels corresponding to the previous prediction sub-model, the corrected sample labels corresponding to the previous prediction sub-model or the prediction result output by the previous prediction sub-model is determined as the corrected sample labels corresponding to the non-first prediction sub-model;

[0018] If the prediction result output by the previous prediction sub-model does not match the corrected sample labels corresponding to the previous prediction sub-model, the prediction result output by the previous prediction sub-model and the corrected sample labels corresponding to the previous prediction sub-model are output, and the corrected sample labels corresponding to the non-first prediction sub-model are received according to the prediction result output by the previous prediction sub-model and the corrected sample labels corresponding to the previous prediction sub-model.

[0019] Optionally, the sample information to be classified includes relevant feature information of the sample to be classified and a preset placeholder.

[0020] Optionally, the input parameters of the non-first prediction sub-model are generated according to the sample information to be classified and the prediction result output by the previous prediction sub-model of the non-first prediction sub-model by:

[0021] The prediction result output by the previous prediction sub-model of the non-first prediction sub-model is obtained;

[0022] The prediction result is used to replace a preset placeholder in the sample information to be classified, so as to generate an input parameter of the non-first prediction sub-model, wherein the preset placeholder has a length equal to a length of the prediction result output by each prediction sub-model.

[0023] Optionally, the information to be classified is takeout commodity information, and the takeout commodity information includes at least one of a takeout commodity name, a merchant name to which the takeout commodity belongs, and a cuisine to which the takeout commodity belongs and which is customized by a user, and the prediction model is used to predict a generation manner of the takeout commodity.

[0024] The second aspect of the present disclosure provides a device for performing classification prediction based on a prediction model, the prediction model including at least two prediction sub-models in a cascaded sequence, and the device includes:

[0025] An input module is configured to input information to be classified into a first prediction sub-model in the cascaded sequence, to obtain a prediction result output by the first prediction sub-model;

[0026] An obtaining module is configured to, for each non-first prediction sub-model in the cascaded sequence, input the information to be classified and a prediction result output by a previous prediction sub-model of the non-first prediction sub-model into the non-first prediction sub-model, to obtain a prediction result output by the non-first prediction sub-model, until a final classification result output by a last prediction sub-model in the cascaded sequence is obtained, wherein the training of the prediction model includes: for any non-first prediction sub-model, correcting a sample label of the non-first prediction sub-model according to a training result of a prediction sub-model before the non-first prediction sub-model, and training the non-first prediction sub-model according to the corrected sample label.

[0027] Optionally, the device further includes a training module, and the training module includes:

[0028] A first training submodule is configured to use sample information to be classified as an input parameter of a first prediction sub-model, use an original sample label of the sample information to be classified as an output parameter of the first prediction sub-model, and train the first prediction sub-model;

[0029] A second training submodule is configured to, for each non-first prediction sub-model in the cascaded sequence, perform the following sub-training process until a last prediction sub-model is trained, to obtain a trained prediction model:

[0030] generate an input parameter of the non-first prediction sub-model according to the sample information to be classified and a prediction result output by a previous prediction sub-model of the non-first prediction sub-model;

[0031] determine a corrected sample label corresponding to the non-first prediction sub-model;

[0032] According to the input parameter of the non-first predictor model and the corrected sample label corresponding to the non-first predictor model, the non-first predictor model is trained.

[0033] The third aspect of the present disclosure provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the steps of the method provided in the first aspect of the present disclosure.

[0034] The fourth aspect of the present disclosure provides an electronic device, comprising:

[0035] a memory, which stores a computer program;

[0036] a processor, configured to execute the computer program in the memory to implement the steps of the method provided in the first aspect of the present disclosure.

[0037] According to the above technical solution, for any non-first predictor model included in the prediction model, the sample label of the non-first predictor model is corrected according to the training result of the previous predictor model of the non-first predictor model, and the non-first predictor model is trained according to the corrected sample label. In this way, the correction of the sample label is integrated into the training process of the prediction model, which improves the accuracy of the trained prediction model. In addition, when a prediction model with high accuracy is used for classification prediction, the accuracy of the classification prediction is improved.

[0038] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF DRAWINGS

[0039] The accompanying drawings are included to provide a further understanding of the present disclosure and constitute a part of the specification, and are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation on the present disclosure. In the drawings:

[0040] Figure 1 is a schematic diagram of a prediction model according to an exemplary embodiment.

[0041] Figure 2 is a flowchart of a method of classification prediction based on a prediction model according to an exemplary embodiment.

[0042] Figure 3 is a flowchart of a prediction model training method according to an exemplary embodiment.

[0043] Figure 4 is a block diagram of an apparatus for classification prediction based on a prediction model according to an exemplary embodiment.

[0044] Figure 5is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0045] As described in the background, in the related art, a deep learning method based on a BERT pre-training model is mostly used to classify texts. The inventors have found through experiments that the accuracy of classification based on the BERT pre-training model is 91.7%. In order to further improve the accuracy of classification, the present disclosure provides a method and device for classifying and predicting based on a prediction model, a readable storage medium, and an electronic device.

[0046] The specific embodiments of the present disclosure are described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present disclosure, and are not used to limit the present disclosure.

[0047] In the present disclosure, a prediction model is used for classification and prediction, and the prediction model includes at least two prediction sub-models in a sequential cascade. Figure 1 is a schematic diagram of a prediction model according to an exemplary embodiment. As shown in Figure 1 , the prediction model can include a first prediction sub-model, a second prediction sub-model, and an Nth prediction sub-model, and the first prediction sub-model, the second prediction sub-model, and the Nth prediction sub-model are sequentially cascaded, that is, the first prediction sub-model is connected to the second prediction sub-model, the second prediction sub-model is connected to the third prediction sub-model, and so on, until the N-1th prediction sub-model is connected to the Nth prediction sub-model. According to actual requirements, the number of prediction sub-models in the prediction model can be any number greater than two, and each prediction sub-model can be any one selected from a gradient boosting decision tree (GDBT), a random forest model RF, a logistic regression model, and a BERT model. In addition, all prediction sub-models in the prediction model can be implemented using the same model, or can be implemented using different models, and the present disclosure does not make specific limitations on this.

[0048] Figure 2 is a flowchart of a method for classifying and predicting based on a prediction model according to an exemplary embodiment. The prediction model includes at least two prediction sub-models in a sequential cascade, for example, Figure 1 , as shown in the prediction model. As shown in Figure 2 , the classification method can include the following steps.

[0049] In step 201, the information to be classified is input into the first prediction sub-model in the cascade sequence to obtain the prediction result output by the first prediction sub-model.

[0050] In the present disclosure, when the prediction model is used for classification and prediction, first, the information to be classified is input into the first prediction sub-model in the cascade sequence (for example, Figure 1a first prediction sub-model in the prediction model, to obtain a prediction result output by the first prediction sub-model. The first prediction sub-model is a pre-trained model, and the training manner of the first prediction sub-model will be described in detail below.

[0051] In an embodiment, Figure 1 The scenario to which the prediction model shown is applicable is a scenario of predicting a generation manner of a takeout commodity, that is, the prediction model is used to predict a manner of generating a takeout commodity. Accordingly, the to-be-classified information in step 201 is takeout commodity information, which can include relevant feature information of the takeout commodity, for example, can include at least one of the following: a takeout commodity name, a merchant name to which the takeout commodity belongs, and a cuisine to which the takeout commodity belongs defined by a user. It should be noted that the manner of generating a takeout commodity is any one of 311 categories defined by a person in advance, which can include a roasted category, a stir-fried dish category, a braised dish category, and the like. The cuisine to which the takeout commodity belongs defined by a user can be a cold dish category or a hot dish category, or one of Sichuan cuisine, Hunan cuisine, Shandong cuisine, Cantonese cuisine, Jiangsu cuisine, Fujian cuisine, Zhejiang cuisine, and Anhui cuisine. For example, the takeout commodity is “fish-flavored shredded pork”, and the to-be-classified information can be “fish-flavored shredded pork”, “classic Sichuan cuisine”, and “XX home cooking”.

[0052] It should be noted that the specific implementation of step 201 can refer to the manner of classification based on the deep learning method of the BERT pre-training model in the related art, and the present disclosure will not repeat it.

[0053] In step 202, for each non-first prediction sub-model in the cascade order, the to-be-classified information and the prediction result output by the previous prediction sub-model of the non-first prediction sub-model are input into the non-first prediction sub-model, to obtain a prediction result output by the non-first prediction sub-model, until the final classification result output by the last prediction sub-model in the cascade order is obtained.

[0054] In actual applications, the accuracy of the prediction result output by the first prediction sub-model is low. For example, if the first prediction sub-model is a BERT pre-training model, the accuracy of the prediction result output by the first prediction sub-model is 91.7%, which may not meet the requirement of the user on the classification accuracy. Therefore, in the present disclosure, after obtaining the prediction result output by the first prediction sub-model, the to-be-classified information and the prediction result output by the first prediction sub-model are input into a second prediction sub-model to obtain a prediction result output by the second prediction sub-model. Then, the to-be-classified information and the prediction result output by the second prediction sub-model are input into a third prediction sub-model to obtain a prediction result output by the third prediction sub-model. In this way, the to-be-classified information and the prediction result output by the (N-1)th prediction sub-model are input into an Nth prediction sub-model to obtain a prediction result output by the Nth prediction sub-model. The prediction result output by the Nth prediction sub-model is taken as the final classification result. In this way, the last prediction sub-model in the cascade sequence considers the prediction result output by the previous prediction sub-model when outputting the final classification result, thereby improving the accuracy of the classification of the to-be-classified information.

[0055] In the training of the prediction model, for any non-first prediction sub-model, the sample label of the non-first prediction sub-model is corrected according to the training result of the prediction sub-model before the non-first prediction sub-model, and the non-first prediction sub-model is trained according to the corrected sample label. In this way, when the non-first prediction sub-model is trained, the sample label of the non-first prediction sub-model can be corrected based on the training result of the previous prediction sub-model, that is, the correction of the sample label is integrated into the model training process, thereby improving the accuracy of the trained prediction model.

[0056] For example, when the prediction model includes a first prediction sub-model and a second prediction sub-model in sequence, it is found through multiple implementations that when the prediction model trained by the training method provided in the present disclosure is used for classification prediction, the accuracy of the prediction can reach 92.5%, while when only the first prediction sub-model is used for classification prediction, the accuracy of the prediction is only 91.7%. Therefore, the method for classification prediction provided in the present disclosure can improve the accuracy of classification prediction.

[0057] According to the above technical solution, for any non-first prediction sub-model included in the prediction model, the sample label of the non-first prediction sub-model is corrected according to the training result of the prediction sub-model before the non-first prediction sub-model, and the non-first prediction sub-model is trained according to the corrected sample label. In this way, the correction of the sample label is integrated into the training process of the prediction model, thereby improving the accuracy of the trained prediction model. In addition, when a prediction model with high accuracy is used for classification prediction, the accuracy of classification prediction is improved.

[0058] The training process of the prediction model used in the present disclosure is described in detail below.

[0059] Figure 3 FIG. 1 is a flowchart of a prediction model training method according to an exemplary embodiment. As shown in FIG. 1, the training method can include the following steps. Figure 3

[0060] In step 301, the sample information to be classified is taken as the input parameter of the first prediction sub-model, the original sample label of the sample information to be classified is taken as the output parameter of the first prediction sub-model, and the first prediction sub-model is trained.

[0061] The training method of the first prediction sub-model can refer to the training method of the BERT model in the related art, and the present disclosure will not repeat it here.

[0062] Then, for each non-first prediction sub-model in the cascade order, the following sub-training process is performed until the last prediction sub-model is trained to obtain the trained prediction model:

[0063] For example, in step 302, for each non-first prediction sub-model in the cascade order, the input parameter of the non-first prediction sub-model is generated according to the sample information to be classified and the prediction result output by the previous prediction sub-model of the non-first prediction sub-model.

[0064] In the present disclosure, when training each non-first prediction sub-model in the cascade order, in addition to taking the sample information to be classified as the input parameter of the non-first prediction sub-model, the prediction result output by the previous prediction sub-model of the non-first prediction sub-model is also taken as the input parameter of the non-first prediction sub-model. That is, when training the non-first prediction sub-model, in addition to considering the sample information to be classified, the prediction result output by the previous prediction sub-model is also considered.

[0065] It is worth noting that, as mentioned above, all prediction sub-models in the prediction model can be implemented using the same model, or different models. If the same model is used, the input channels of each prediction sub-model are usually the same, that is, the length of the input parameter in the training process should be the same, that is, the length of the input parameter of the first prediction sub-model should be the same as the length of the input parameter of each non-first prediction sub-model in the cascade order.

[0066] Therefore, in one embodiment, the input parameter of the first prediction sub-model, i.e., the sample information to be classified, can include the relevant feature information of the sample to be classified and a preset placeholder. Accordingly, the specific way of generating the input parameter of the non-first prediction sub-model in the above step 302 is:

[0067] ​Firstly, a prediction result output by a previous predictor model of the non-first predictor model is acquired. For example, if the first predictor model is the second predictor model, the prediction result output by the first predictor model is the prediction result output by the previous predictor model of the non-first predictor model.

[0068] Then, the prediction result is substituted for a preset placeholder in the sample information to be classified to generate an input parameter of the non-first predictor model, where the preset placeholder has a length equal to that of the prediction result output by each predictor model.

[0069] For example, the input parameter of the first predictor model is "CLS fish-slices-with-chili sauce 0 classic hot dishes 0 Laoguo's home-style dishes 0", where "CLS" is a preset placeholder, and "0" represents a separator between two related feature information, and the lengths of the separators between different related feature information can be the same or different, which is not limited in the present disclosure. Accordingly, the input parameter of the non-first predictor model generated in the above manner is "a fish-slices-with-chili sauce 0 classic hot dishes 0 Laoguo's home-style dishes 0", where "a" is the prediction result output by the previous predictor model, and the length of "a" is equal to that of "CLS".

[0070] In step 303, a corrected sample label corresponding to the non-first predictor model is determined.

[0071] In the present disclosure, the sample label corresponding to the non-first predictor model is a sample label corrected according to the prediction result output by the previous predictor model. The sample label can be corrected by a user according to the prediction result output by the previous predictor model and the corrected sample label corresponding to the previous predictor model, or the sample label can be automatically corrected by a device performing the training method according to the prediction result output by the previous predictor model and the corrected sample label corresponding to the previous predictor model, which is not specifically limited in the present disclosure.

[0072] For example, the specific manner in which step 303 determines the corrected sample label corresponding to the non-first predictor model is as follows:

[0073] Firstly, a prediction result output by a previous predictor model of the non-first predictor model is acquired.

[0074] Then, it is determined whether the prediction result output by the previous predictor model matches the corrected sample label corresponding to the previous predictor model.

[0075] In the present disclosure, whether the prediction result output by the previous prediction sub-model matches the modified sample label corresponding to the previous prediction sub-model is compared, that is, whether the prediction result output by the previous prediction sub-model is consistent with the modified sample label corresponding to the previous prediction sub-model is compared. If the prediction result output by the previous prediction sub-model is consistent with the modified sample label corresponding to the previous prediction sub-model, it is determined that the two match. Otherwise, it is determined that the two do not match.

[0076] It is worth noting that if the non-first prediction sub-model is the second prediction sub-model, the previous prediction sub-model thereof is the first prediction sub-model (the first prediction sub-model), and correspondingly, the modified sample label corresponding to the previous prediction sub-model is the original sample label of the sample information to be classified.

[0077] Finally, if the match is determined, the modified sample label corresponding to the previous prediction sub-model or the prediction result output by the previous prediction sub-model is determined as the modified sample label corresponding to the non-first prediction sub-model. If the match is not determined, the prediction result output by the previous prediction sub-model and the modified sample label corresponding to the previous prediction sub-model are output, and the modified sample label corresponding to the non-first prediction sub-model is received according to the prediction result output by the previous prediction sub-model and the modified sample label corresponding to the previous prediction sub-model.

[0078] If the match is determined, it indicates that the prediction result output by the previous prediction sub-model is consistent with the modified sample label corresponding to the previous prediction sub-model, and the modified sample label corresponding to the previous prediction sub-model and the prediction result output by the previous prediction sub-model are accurate. At this time, the modified sample label corresponding to the previous prediction sub-model or the prediction result output by the previous prediction sub-model can be directly determined as the modified sample label corresponding to the non-first prediction sub-model.

[0079] If the match is not determined, it indicates that the prediction result output by the previous prediction sub-model is not consistent with the modified sample label corresponding to the previous prediction sub-model. At this time, it may be that the prediction result output by the previous prediction sub-model is inaccurate, or that the modified sample label corresponding to the previous prediction sub-model is inaccurate, or that both are inaccurate. At this time, the device or the user needs to further determine whether the prediction result output by the previous prediction sub-model is inaccurate or the modified sample label corresponding to the previous prediction sub-model is inaccurate, or both are inaccurate.

[0080] In actual applications, the device may not be able to determine which one is inaccurate. Therefore, in order to ensure the accuracy of the modified sample label corresponding to the non-first prediction sub-model, and further ensure the accuracy of the training of the non-first prediction sub-model, in the present disclosure, the modified sample label corresponding to the non-first prediction sub-model can be determined by the user according to the prediction result output by the previous prediction sub-model and the modified sample label corresponding to the previous prediction sub-model.

[0081] When the user determines the corrected sample label corresponding to the non-first prediction sub-model, the prediction result output by the previous prediction sub-model and the corrected sample label corresponding to the previous prediction sub-model are needed to be output, so as to facilitate the user to know the prediction result output by the previous prediction sub-model and the corrected sample label corresponding to the previous prediction sub-model, and then determine the corrected sample label corresponding to the non-first prediction sub-model. For example, if the user determines that the prediction result output by the previous prediction sub-model is accurate, the prediction result output by the previous prediction sub-model can be determined as the corrected sample label corresponding to the non-first prediction sub-model. For another example, if the user determines that the corrected sample label corresponding to the previous prediction sub-model is accurate, the corrected sample label corresponding to the previous prediction sub-model can be determined as the corrected sample label corresponding to the non-first prediction sub-model. For another example, if the user determines that both are inaccurate, the user can determine the accurate corrected sample label corresponding to the non-first prediction sub-model according to the sample information to be classified. In this way, the corrected sample label corresponding to the non-first prediction sub-model can be determined in the above manner.

[0082] It is to be noted that the disclosure does not limit the execution order of steps 302 and 303. For example, step 302 can be executed first and then step 303 (as shown in Figure 3 Alternatively, step 303 can be executed first and then step 302, or steps 302 and 303 can be executed simultaneously.

[0083] In step 304, the non-first prediction sub-model is trained according to the input parameter of the non-first prediction sub-model and the corrected sample label corresponding to the non-first prediction sub-model.

[0084] After the input parameter of the non-first prediction sub-model and the corrected sample label corresponding thereto are obtained in steps 302 and 303 respectively, the non-first prediction sub-model is trained by using the input parameter and the corrected sample label corresponding thereto. The specific training method can refer to the model training method in the prior art, and the disclosure does not repeat it.

[0085] In this way, when the non-first prediction sub-model is trained, the sample label is corrected according to the prediction result output by the previous prediction sub-model, the user's correction behavior is integrated in the process of training the non-first prediction sub-model, and the accuracy of training the prediction model is improved.

[0086] Based on the same inventive concept, the disclosure also provides a device for performing classification prediction based on a prediction model. Figure 4 is a block diagram of a device for performing classification prediction based on a prediction model according to an example embodiment. The prediction model includes at least two prediction sub-models that are sequentially cascaded. As shown inFigure 4 As shown, the device 400 for making classification prediction based on the prediction model can include:

[0087] an input module 401, configured to input the information to be classified into a first prediction sub-model in the cascade sequence to obtain a prediction result output by the first prediction sub-model;

[0088] an acquisition module 402, configured to input, for each non-first prediction sub-model in the cascade sequence, the information to be classified and a prediction result output by a previous prediction sub-model of the non-first prediction sub-model into the non-first prediction sub-model to obtain a prediction result output by the non-first prediction sub-model, until obtaining a final classification result output by a last prediction sub-model in the cascade sequence, wherein the training of the prediction model comprises: for any non-first prediction sub-model, correcting a sample label of the non-first prediction sub-model according to a training result of a prediction sub-model before the non-first prediction sub-model, and training the non-first prediction sub-model according to the corrected sample label.

[0089] Optionally, the device further includes a training module, which includes:

[0090] a first training sub-module, configured to take the sample information to be classified as an input parameter of the first prediction sub-model, take an original sample label of the sample information to be classified as an output parameter of the first prediction sub-model, and train the first prediction sub-model;

[0091] a second training sub-module, configured to, for each non-first prediction sub-model in the cascade sequence, perform the following sub-training process until the last prediction sub-model is trained to obtain the trained prediction model:

[0092] generate an input parameter of the non-first prediction sub-model according to the sample information to be classified and a prediction result output by a previous prediction sub-model of the non-first prediction sub-model;

[0093] determine a corrected sample label corresponding to the non-first prediction sub-model;

[0094] train the non-first prediction sub-model according to the input parameter of the non-first prediction sub-model and the corrected sample label corresponding to the non-first prediction sub-model.

[0095] Optionally, the determination of the corrected sample label corresponding to the non-first prediction sub-model comprises:

[0096] acquiring the prediction result output by the previous prediction sub-model of the non-first prediction sub-model;

[0097] comparing whether the prediction result output by the previous prediction sub-model matches a corrected sample label corresponding to the previous prediction sub-model.

[0098] If matched, the modified sample label corresponding to the previous prediction sub-model or the prediction result output by the previous prediction sub-model is determined as the modified sample label corresponding to the non-first prediction sub-model;

[0099] If not matched, the prediction result output by the previous prediction sub-model and the modified sample label corresponding to the previous prediction sub-model are output, and the modified sample label corresponding to the non-first prediction sub-model determined by a user according to the prediction result and the modified sample label corresponding to the previous prediction sub-model is received.

[0100] Optionally, the sample information to be classified includes feature information of the sample to be classified and a preset placeholder.

[0101] Optionally, the input parameter of the non-first prediction sub-model is generated according to the sample information to be classified and the prediction result output by the previous prediction sub-model of the non-first prediction sub-model, and includes:

[0102] The prediction result output by the previous prediction sub-model of the non-first prediction sub-model is obtained.

[0103] The prediction result is used to replace the preset placeholder in the sample information to be classified, so as to generate the input parameter of the non-first prediction sub-model, wherein the length of the preset placeholder is equal to the length of the prediction result output by each prediction sub-model.

[0104] Optionally, the information to be classified is takeout commodity information, and the takeout commodity information includes at least one of the following: a takeout commodity name, a merchant name to which the takeout commodity belongs, and a cuisine to which the takeout commodity belongs and which is customized by a user, and the prediction model is used to predict a generation manner of the takeout commodity.

[0105] As to the apparatus in the above-mentioned embodiments, specific manners in which various modules perform operations have been described in details in the embodiments of the method, and will not be described in details here.

[0106] Figure 5 is a block diagram of an electronic device according to an exemplary embodiment. As shown in Figure 5 The electronic device 700 can include a processor 701 and a memory 702. The electronic device 700 can further include one or more of a multimedia component 703, an input / output (I / O) interface 704, and a communication component 705.

[0107] The processor 701 is configured to control overall operations of the electronic device 700 to complete all or part of the steps of the above-described method for performing classification prediction based on a prediction model. The memory 702 is configured to store various types of data to support operations of the electronic device 700, which can include, for example, instructions for operating any application or method on the electronic device 700, and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and the like. The memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic storage, a flash memory, a magnetic disk, or an optical disk. The multimedia component 703 can include a screen and an audio component. The screen can be, for example, a touch screen, and the audio component is configured to output and / or input audio signals. For example, the audio component can include a microphone configured to receive external audio signals. The received audio signals can be further stored in the memory 702 or transmitted through the communication component 705. The audio component further includes at least one speaker configured to output audio signals. The I / O interface 704 provides an interface between the processor 701 and other interface modules, which can be a keyboard, a mouse, a button, and the like. The buttons can be virtual buttons or physical buttons. The communication component 705 is configured to perform wired or wireless communication between the electronic device 700 and other devices. The wireless communication, such as Wi-Fi, Bluetooth, near field communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, and the like, or a combination of one or more of them, is not limited herein. Therefore, the communication component 705 can include, for example, a Wi-Fi module, a Bluetooth module, an NFC module, and the like.

[0108] In an exemplary embodiment, the electronic device 700 can be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements for performing the above-described method of making a classification prediction based on a prediction model.

[0109] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the above-described method of making a classification prediction based on a prediction model. For example, the computer-readable storage medium can be the above-described memory 702 including program instructions, which can be executed by the processor 701 of the electronic device 700 to complete the above-described method of making a classification prediction based on a prediction model.

[0110] In another exemplary embodiment, a computer program product is also provided, which contains a computer program capable of being executed by a programmable device, and the computer program has code portions for executing the above-described method of making a classification prediction based on a prediction model when executed by the programmable device.

[0111] The preferred embodiments of the present disclosure are described in detail above with reference to the accompanying drawings, but the present disclosure is not limited to the specific details in the above-described embodiments. Various simple modifications can be made to the technical solutions of the present disclosure within the scope of the technical concept of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.

[0112] In addition, it should be noted that each specific technical feature described in the above-described specific embodiments can be combined in any appropriate manner without contradiction. In order to avoid unnecessary repetition, various possible combinations are not described again in the present disclosure.

[0113] Furthermore, any combination of the various different embodiments of the present disclosure can also be made, as long as it does not deviate from the idea of the present disclosure, and it should be considered as the disclosed content of the present disclosure.

Claims

1. A method for classification prediction based on a prediction model, characterized in that, The prediction model includes at least two sequentially cascaded prediction sub-models, and the method includes: The information to be classified is input into the first prediction sub-model in the cascade sequence to obtain the prediction result output by the first prediction sub-model; For each non-first prediction sub-model in the cascaded sequence, the information to be classified and the prediction result output by the previous prediction sub-model are input into the non-first prediction sub-model to obtain the prediction result output by the non-first prediction sub-model, until the final classification result output by the last prediction sub-model in the cascaded sequence is obtained. The training of the prediction model includes: for any non-first prediction sub-model, correcting the sample label of the non-first prediction sub-model according to the training result of the prediction sub-model before the non-first prediction sub-model, and training the non-first prediction sub-model according to the corrected sample label; The information to be classified is takeaway product information, which includes at least one of the following: takeaway product name, the name of the merchant to which the takeaway product belongs, and the cuisine of the takeaway product as defined by the user. The prediction model is used to predict the method of generating the takeaway product.

2. The method according to claim 1, characterized in that, The training of the prediction model specifically includes: The information of the sample to be classified is used as the input parameter of the first prediction sub-model, and the original sample label of the information of the sample to be classified is used as the output parameter of the first prediction sub-model. The first prediction sub-model is then trained. For each non-first prediction sub-model in the cascaded sequence, the following sub-training process is performed until the last prediction sub-model completes training, resulting in the trained prediction model: The input parameters for the non-first prediction sub-model are generated based on the information of the sample to be classified and the prediction results output by the previous prediction sub-model. Determine the corrected sample labeling corresponding to the non-first prediction sub-model; The non-first prediction sub-model is trained based on its input parameters and the corrected sample labels.

3. The method according to claim 2, characterized in that, Determining the corrected sample label corresponding to the non-first prediction sub-model includes: Obtain the prediction result output by the previous prediction sub-model that is not the first prediction sub-model; Compare whether the prediction result output by the previous prediction sub-model matches the corrected sample label corresponding to the previous prediction sub-model; If a match is found, the corrected sample label corresponding to the previous prediction sub-model or the prediction result output by the previous prediction sub-model is determined as the corrected sample label corresponding to the non-first prediction sub-model. If there is no match, the prediction result output by the previous prediction sub-model and the corrected sample label corresponding to the previous prediction sub-model are output, and the corrected sample label corresponding to the non-first prediction sub-model determined by the user based on the prediction result and the corrected sample label corresponding to the previous prediction sub-model are received.

4. The method according to claim 2, characterized in that, The information of the sample to be classified includes relevant feature information of the sample to be classified and preset placeholders.

5. The method according to claim 4, characterized in that, The step of generating the input parameters for the non-first prediction sub-model based on the information of the sample to be classified and the prediction result output by the previous prediction sub-model is as follows: Obtain the prediction result output by the previous prediction sub-model that is not the first prediction sub-model; The predicted result replaces the preset placeholder in the information of the sample to be classified to generate the input parameters of the non-first prediction sub-model, wherein the length of the preset placeholder is equal to the length of the prediction result output by each prediction sub-model.

6. A device for classification prediction based on a prediction model, characterized in that, The prediction model includes at least two sequentially cascaded prediction sub-models, and the device includes: The input module is used to input the information to be classified into the first prediction sub-model in the cascade order, and obtain the prediction result output by the first prediction sub-model; The acquisition module is used to input the information to be classified and the prediction result output by the previous prediction sub-model into each non-first prediction sub-model in the cascaded sequence, and obtain the prediction result output by the non-first prediction sub-model, until the final classification result output by the last prediction sub-model in the cascaded sequence is obtained. The training of the prediction model includes: for any non-first prediction sub-model, correcting the sample label of the non-first prediction sub-model according to the training result of the prediction sub-model before it, and training the non-first prediction sub-model according to the corrected sample label.

7. The apparatus according to claim 6, characterized in that, The device further includes a training module, the training module comprising: The first training submodule is used to train the first prediction submodel by taking the information of the sample to be classified as the input parameter of the first prediction submodel and taking the original sample label of the information of the sample to be classified as the output parameter of the first prediction submodel. The second training submodule is used to perform the following sub-training process for each non-first prediction sub-model in the cascaded sequence until the last prediction sub-model completes training, resulting in the trained prediction model: The input parameters for the non-first prediction sub-model are generated based on the information of the sample to be classified and the prediction results output by the previous prediction sub-model. Determine the corrected sample labeling corresponding to the non-first prediction sub-model; The non-first prediction sub-model is trained based on its input parameters and the corrected sample labels.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-5.

9. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Classification prediction method and device and prediction model training method and device

    CN110046636A