Content classification method and device, electronic equipment and readable storage medium
By configuring N atomic models in the classification model and integrating scores on multiple dimensions with weight parameters, the problem of low accuracy in content classification recognition in the prior art is solved, and higher content classification accuracy is achieved.
Patent Information
- Application Number
- CN202311058798.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-21
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, the accuracy of content classification recognition is low, mainly because the trained model is trained based on manual subjective judgment labels and data sets.
By configuring N atomic models in the classification model, using N atomic models to classify and identify the content in the corresponding N dimensions, and integrating the scores on multiple dimensions with weight parameters to improve the accuracy of content classification.
The accuracy of content recognition by classification models is improved, and the recognition ability of the model is enhanced through the integration of multi-dimensional scoring.
Smart Images

Figure CN119513677A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of classification and identification technology, and specifically relates to a content classification method, device, electronic device and readable storage medium. Background Art
[0002] With the development of Internet business, there is a need to classify and identify different contents. In related technologies, content is classified and identified through trained recognition models. Since the trained models are trained based on labels and data sets based on human subjective judgment, the accuracy of content classification and identification through the models is low. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a content classification method, device, electronic device and readable storage medium, which improve the accuracy of content recognition by the classification model.
[0004] In a first aspect, an embodiment of the present application provides a content classification method, comprising: obtaining a classification model, the classification model comprising N atomic models, where N is an integer greater than 1; inputting a first content into the classification model to obtain a first dimension score of the first content in N dimensions, the N first dimension scores corresponding one-to-one to the N atomic models; determining the classification information of the first content based on the N first dimension scores and the weight parameters corresponding to the classification model.
[0005] In a second aspect, an embodiment of the present application provides a content classification device, comprising: an acquisition module, used to acquire a classification model, the classification model comprising N atomic models, where N is an integer greater than 1; an input module, used to input a first content into the classification model to obtain a first dimension score of the first content in N dimensions, the N first dimension scores corresponding one-to-one to the N atomic models; a determination module, used to determine the classification information of the first content based on the N first dimension scores and the weight parameters corresponding to the classification model.
[0006] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method of the first aspect.
[0007] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the content classification method of the first aspect are implemented.
[0008] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the content classification method of the first aspect.
[0009] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the content classification method of the first aspect.
[0010] In the embodiment of the present application, by configuring N atomic models in the classification model, the first content is classified and identified in the corresponding N dimensions through the N atomic models, and the first dimension score of the first content in the N dimensions can be determined, and the classification information is determined according to the N first dimension scores and weight parameters. Since the N atomic models in the classification model can identify the N dimensions in the first content, the recognition accuracy is high, and the first dimension scores in multiple dimensions are integrated through the weight parameters, thereby improving the accuracy of the classification model in identifying the first content. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A schematic diagram of a process flow of a content classification method provided in an embodiment of the present application is shown;
[0012] Figure 2 A schematic diagram of a classification model provided by some embodiments of the present application is shown;
[0013] Figure 3 A schematic diagram showing a training process of a classification model provided by some embodiments of the present application is shown;
[0014] Figure 4 A structural block diagram of a content classification device provided in an embodiment of the present application is shown;
[0015] Figure 5 A structural block diagram of an electronic device according to an embodiment of the present application is shown;
[0016] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0018] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0019] The following is combined with Figures 1 to 6 , the content classification method, device, electronic device and readable storage medium provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.
[0020] In an embodiment of the present application, a content classification method is provided. Figure 1 A flow chart of a content classification method provided in an embodiment of the present application is shown. Figure 1 As shown, the content classification method includes:
[0021] Step 102, obtaining a classification model, the classification model includes N atomic models, where N is an integer greater than 1;
[0022] In the embodiment of the present application, the classification model is used to classify the content to be classified. Exemplarily, the content to be classified includes any of the following: video content, picture content, text content, etc.
[0023] In the embodiment of the present application, the classification model includes N atomic models, and different atomic models are used to identify the content to be classified in different dimensions.
[0024] Figure 2 A schematic diagram of a classification model provided by some embodiments of the present application is shown. Figure 2 As shown, the classification model is a picture-text classification model. The picture dimension in the picture-text classification model includes: an atomic model corresponding to the theme dimension, an atomic model corresponding to the composition dimension, an atomic model corresponding to the style dimension, and an atomic model corresponding to the nurture dimension. The text dimension of the picture-text classification model includes: an atomic model corresponding to the distinctness dimension, an atomic model corresponding to the accuracy dimension, an atomic model corresponding to the structural dimension, an atomic model corresponding to the vividness dimension, an atomic model corresponding to the usefulness dimension, and an atomic model corresponding to the authenticity dimension.
[0025] Step 104, inputting the first content into the classification model to obtain first dimension scores of the first content in N dimensions, where the N first dimension scores correspond one-to-one to the N atomic models;
[0026] In an embodiment of the present application, the first content is content that needs to be classified and identified. By inputting the first content into the classification model, the N atomic models in the classification model can score the first content in the corresponding dimension to obtain the first dimension score of the first content in different dimensions.
[0027] Step 106 : Determine classification information of the first content according to the N first dimension scores and the weight parameters corresponding to the classification model.
[0028] In the embodiment of the present application, the N first dimension scores can reflect the matching degree of the first content in the N atomic models in the N dimensions. The weight parameter is the weight of the dimension corresponding to the N atomic models in the classification model, so the classification information of the first content can be determined through the first dimension score and the weight parameter corresponding to the classification model.
[0029] In the embodiment of the present application, by configuring N atomic models in the classification model, the first content is classified and identified in the corresponding N dimensions through the N atomic models, and the first dimension score of the first content in the N dimensions can be determined, and the classification information is determined according to the N first dimension scores and weight parameters. Since the N atomic models in the classification model can identify the N dimensions in the first content, the recognition accuracy is high, and the first dimension scores in multiple dimensions are integrated through the weight parameters, thereby improving the accuracy of the classification model in identifying the first content.
[0030] In some embodiments of the present application, the weight parameters include N atomic weight parameters and bias parameters, and the N atomic weight parameters correspond one-to-one to the N atomic models;
[0031] Determine the classification information of the first content according to the N first dimension scores and the weight parameters corresponding to the classification model, including: multiplying the N first dimension scores with the corresponding atomic weight parameters to obtain N weight scores; adding the N weight scores with the bias parameter to obtain the first classification score; and determining the classification information according to the first classification score.
[0032] In an embodiment of the present application, the weight parameters include N atomic weight parameters and bias parameters. The N atomic weight parameters are coefficients corresponding to the N atomic models in the fitting formula corresponding to the classification model, and correspond one-to-one to the N atomic models in the classification model. The bias parameter is the bias in the fitting formula corresponding to the classification model.
[0033] Exemplarily, in the case where two atomic models are included in the classification model, the fitting expression (1) of the classification model is as follows:
[0034] d=X1×W1+X2×W2+bias; (1)
[0035] Among them, d represents the classification model, X1 and X2 represent the atomic models, W1 and W2 are the atomic weight parameters corresponding to X1 and X2 respectively, and bias is the bias parameter.
[0036] In an embodiment of the present application, the N first dimension scores are dimension scores obtained by N atomic models respectively identifying the first content. In the process of determining the classification information, the N first dimension scores are multiplied by the corresponding atomic weight parameters respectively, and the N calculation results are determined as N weight scores. The N weight scores are added to the bias parameter to obtain a first classification score. The first classification score is the score obtained by the classification model for identifying the first content. The classification information of the first content can be determined by the first classification score.
[0037] It should be noted that the classification model is used to identify whether the first content belongs to the category corresponding to the classification model, so the first classification score can be used to determine whether the first content matches the category corresponding to the classification model.
[0038] Exemplarily, a scoring threshold is set, and after the first classification score of the first content is obtained, the first classification score is numerically compared with the scoring threshold. When the first classification score is greater than or equal to the scoring threshold, it is determined that the classification information of the first content matches the category corresponding to the classification model. When the first classification score is less than the scoring threshold, it is determined that the classification information of the first content does not match the category corresponding to the classification model.
[0039] In an embodiment of the present application, after determining the N first dimension scores corresponding to the N atomic models, the N first dimension scores are multiplied by the N atomic weight parameters respectively, and the N weight scores obtained by the calculation are added to the bias explanation, so as to obtain a first classification score that can determine the first content. The classification information of the first content is determined by the first classification score, which can improve the accuracy of the determined classification information.
[0040] In some embodiments of the present application, before obtaining the classification model, it also includes: obtaining N atomic models; determining N atomic weight parameters and bias parameters corresponding to the N atomic models through a training data set; and constructing a classification model based on the N atomic weight parameters, bias parameters and N atomic models.
[0041] In the embodiment of the present application, N atomic models can be trained by the second content to obtain N atomic models, wherein the second content is used to train the N atomic models. The required N atomic models can also be searched in the pre-trained atomic model library.
[0042] In an embodiment of the present application, before obtaining the classification model, it is necessary to construct the classification model. In the process of constructing the classification model, firstly, N atomic models are obtained, and then corresponding N atomic weight parameters and bias parameters are configured for the N atomic models. Then, the N atomic weight parameters and bias parameters are configured to the N atomic models to obtain the classification model.
[0043] In the embodiment of the present application, after obtaining N atomic models, it is necessary to configure corresponding N atomic weight parameters and bias parameters for the N atomic models.
[0044] Exemplarily, a plurality of manually annotated third contents are obtained, where the third contents are training data for training a classification model to determine atomic weight parameters and bias parameters, each third content has a classification score and a dimensionality score for N atoms, and the N atomic weight parameters corresponding to the N atoms and the bias parameters of the classification model are determined through the classification score and the dimensionality score.
[0045] It should be noted that the second content of training the atomic model and the third content of training the classification model to obtain the atomic weight parameters and the bias parameters can be the same training data or different training data.
[0046] In an embodiment of the present application, the classification model includes atomic models of N dimensions, and the N atomic models are obtained, and then the classification model is trained with training data to obtain the atomic weight parameters corresponding to each atomic model of the N atomic models, as well as the bias parameters in the classification model. Since the atomic model in the classification model is a model obtained by training based on the atomic dimension, the training accuracy of the atomic model is higher than the accuracy of the classification model obtained by training in the related art, which further improves the recognition accuracy of the classification model, and the atomic model in the classification model can be reused in other classification models. In the process of constructing other classification models, it is only necessary to adjust the atomic weight parameters of the atomic model and the bias parameters in the classification model, without retraining the classification model, so the labor cost is reduced.
[0047] In some embodiments of the present application, obtaining the N atomic models includes: constructing the N atomic models based on atomic information of N dimensions corresponding to the classification model; and / or searching for the N atomic models in an atomic model library based on dimensional information of N dimensions corresponding to the classification model.
[0048] In an embodiment of the present application, when obtaining N atomic models of a classification model, the N atomic models matching the classification model may be trained, or the N atomic models matching the classification model may be searched in a pre-trained atomic model library.
[0049] In the embodiment of the present application, in the process of training the atomic model, the second content is obtained, and the second content is a training data set for training the atomic model. By extracting the atomic information of the second content in N dimensions corresponding to the classification model, the atomic information is data that can be used to train the atomic model in the training data set, and the data can be obtained by manual annotation. Based on the N atomic information, the N atomic models in the classification model are trained respectively to obtain the N atomic models in the classification model.
[0050] In an embodiment of the present application, based on the dimension information of N dimensions corresponding to the classification model, by searching and obtaining N atomic models in an atomic model library, the atomic model library includes multiple atomic models that have been pre-trained in advance, and searching the N atomic models in the classification model based on the classification information that the classification model needs to identify. By storing the constructed atomic models in the atomic model library, the reusability of the atomic models can be improved and the labor cost required for subsequent training of the classification model can be reduced.
[0051] Exemplarily, each atomic model in the atomic model library is configured with a dimension label, and the N atomic models corresponding to the classification model can be found through the dimension label.
[0052] In some embodiments of the present application, after constructing the classification model according to N atomic weight parameters, bias parameters and N atomic models, it also includes: adjusting at least one of the N atomic weight parameters and bias parameters to update the classification model.
[0053] In an embodiment of the present application, after the classification model is constructed, the classification model can be updated by adjusting N atomic weight parameters and / or bias parameters corresponding to the N atomic models in the classification model.
[0054] In an embodiment of the present application, during the use of the classification model, it is determined that the recognition accuracy of the classification model is low. The recognition accuracy of the classification model can be improved by adjusting the atomic weight parameters corresponding to each atomic model in the classification model and / or adjusting the bias parameters in the classification model.
[0055] It should be noted that by adjusting the atomic weight parameters and / or bias parameters, other classification models can be obtained, further reducing the labor cost required for training the classification model.
[0056] In an embodiment of the present application, when the accuracy of the classification model is insufficient, there is no need to retrain the classification model. The classification model can be updated and iterated only by adjusting the atomic weight parameters and / or bias parameters, thereby further reducing the labor cost required for training the classification model and improving the efficiency of classification model training.
[0057] In some embodiments of the present application, the number of the training data is M, where M is an integer greater than 1;
[0058] Determine N atomic weight parameters and bias parameters corresponding to N atomic models, including: determine M second classification scores corresponding to M training data, the second classification scores correspond to the training data one-to-one; obtain the second dimension scores of N dimensions corresponding to each training data; determine N atomic weight parameters and bias parameters according to the M second classification scores and P second dimension scores, where P is the product of M and N.
[0059] In the embodiment of the present application, the second classification score is the classification score corresponding to each training data, and the second classification score can be the classification score obtained by manual annotation. The N second dimension scores are the dimension scores of the training data on the N dimensions corresponding to the classification model, and the second dimension scores can also be the dimension scores obtained by manual annotation. Through the M second classification scores corresponding to the M training data, and the N second dimension scores corresponding to each training data in the M training data, the N atomic weight parameters and bias parameters in the classification model can be determined.
[0060] Exemplarily, the number of training data is 100, and the second classification score of each training data in the 100 training data is obtained by manual labeling, for a total of 100 second classification scores, and each training data is labeled with the second dimension scores on 5 dimensions, for a total of 500 second dimension scores for the 100 training data.
[0061] In an embodiment of the present application, M second classification scores and P second dimension scores corresponding to M training data are obtained, and then N atomic weight parameters and bias parameters in the classification model can be obtained through the second classification scores and second dimension scores, thereby improving the recognition accuracy of the constructed classification model.
[0062] In some embodiments of the present application, N atomic weight parameters and bias parameters are determined based on M second classification scores and P second dimension scores, including: linear fitting the M second classification scores and P second dimension scores to obtain N atomic weight parameters and bias parameters.
[0063] In the embodiment of the present application, after obtaining M second classification scores corresponding to M training data and P second dimension scores, the expression (2) of the classification model can be obtained by linear fitting, that is, the N atomic weight parameters and bias parameters in the classification model are obtained, which improves the recognition accuracy of the constructed classification model. Expression (2) is as follows:
[0064] d=X1×W1+X2×W2+……Xn×Wn+bias; (1)
[0065] Among them, d represents the classification model, X1, X2...Xn represent N atomic models respectively, W1, W2...Wn represent N atomic weight parameters respectively, and bias is the bias parameter.
[0066] Figure 3 A schematic diagram of the training process of the classification model provided by some embodiments of the present application is shown, such as Figure 3 As shown, in some embodiments of the present application, the process of building a classification model includes: inputting training data into the underlying atomic layer. In the underlying atomic layer, a set of dimensions that describe the training data is first defined, and then an atomic model is trained for each dimension so that the atomic model can input any content to obtain the dimension score of the corresponding dimension. Multiple atomic models corresponding to the classification model are input into the business label layer, and the classification model is constructed in the business label layer by atomic linear fitting. The classification model is configured in the actual business and applied to the distribution of content.
[0067] The content classification method provided in the embodiment of the present application can be executed by a content classification device. In the embodiment of the present application, the content classification device provided in the embodiment of the present application is described by taking the content classification method executed by the content classification device as an example.
[0068] In some embodiments of the present application, a content classification device is provided. Figure 4 The structure diagram of the content classification device provided by the embodiment of the present application is shown as follows: Figure 4 As shown, the content classification device 400 includes:
[0069] An acquisition module 402 is used to acquire a classification model, where the classification model includes N atomic models, where N is an integer greater than 1;
[0070] An input module 404 is used to input the first content into the classification model to obtain first dimension scores of the first content in N dimensions, where the N first dimension scores correspond to the N atomic models one by one;
[0071] The determination module 406 is used to determine the classification information of the first content according to the N first dimension scores and the weight parameters corresponding to the classification model.
[0072] In the embodiment of the present application, by configuring N atomic models in the classification model, the first content is classified and identified in the corresponding N dimensions through the N atomic models, and the first dimension score of the first content in the N dimensions can be determined, and the classification information is determined according to the N first dimension scores and weight parameters. Since the N atomic models in the classification model can identify the N dimensions in the first content, the recognition accuracy is high, and the first dimension scores in multiple dimensions are integrated through the weight parameters, thereby improving the accuracy of the classification model in identifying the first content.
[0073] In some embodiments of the present application, the content classification device 400 includes:
[0074] An operation module, used for performing a multiplication operation on the N first dimension scores and the corresponding atomic weight parameters to obtain N weight scores;
[0075] A calculation module, used for performing an addition operation on the N weight scores and the bias parameter to obtain a first classification score;
[0076] The determination module 406 is used to determine the classification information according to the first classification score.
[0077] In an embodiment of the present application, after determining the N first dimension scores corresponding to the N atomic models, the N first dimension scores are multiplied by the N atomic weight parameters respectively, and the N weight scores obtained by the calculation are added to the bias explanation, so as to obtain a first classification score that can determine the first content. The classification information of the first content is determined by the first classification score, which can improve the accuracy of the determined classification information.
[0078] In some embodiments of the present application, the acquisition module 402 is used to acquire N atomic models;
[0079] A determination module 406 is used to determine N atomic weight parameters and bias parameters corresponding to the N atomic models through training data;
[0080] The content classification device 400 includes:
[0081] A building module is used to build a classification model according to N atomic weight parameters, bias parameters and N atomic models.
[0082] In an embodiment of the present application, the classification model includes atomic models of N dimensions, and the N atomic models are obtained, and then the classification model is trained with training data to obtain the atomic weight parameters corresponding to each atomic model of the N atomic models, as well as the bias parameters in the classification model. Since the atomic model in the classification model is a model obtained by training based on the atomic dimension, the training accuracy of the atomic model is higher than the accuracy of the classification model obtained by training in the related art, which further improves the recognition accuracy of the classification model, and the atomic model in the classification model can be reused in other classification models. In the process of constructing other classification models, it is only necessary to adjust the atomic weight parameters of the atomic model and the bias parameters in the classification model, without retraining the classification model, so the labor cost is reduced.
[0083] In some embodiments of the present application, a construction module is used to construct N atomic models based on atomic information of N dimensions corresponding to the classification model; and / or search for N atomic models in an atomic model library based on dimensional information of N dimensions corresponding to the classification model.
[0084] In the embodiment of the present application, in the process of training the atomic model, the second content is obtained, and the second content is a training data set for training the atomic model. By extracting the atomic information of the second content in N dimensions corresponding to the classification model, the atomic information is data that can be used to train the atomic model in the training data set, and the data can be obtained by manual annotation. Based on the N atomic information, the N atomic models in the classification model are trained respectively to obtain the N atomic models in the classification model.
[0085] In an embodiment of the present application, based on the dimension information of N dimensions corresponding to the classification model, by searching and obtaining N atomic models in an atomic model library, the atomic model library includes multiple atomic models that have been pre-trained in advance, and searching the N atomic models in the classification model based on the classification information that the classification model needs to identify. By storing the constructed atomic models in the atomic model library, the reusability of the atomic models can be improved and the labor cost required for subsequent training of the classification model can be reduced.
[0086] In some embodiments of the present application, the content classification device 400 includes:
[0087] The adjustment module is used to adjust at least one of the N atomic weight parameters and the bias parameters to update the classification model.
[0088] In an embodiment of the present application, when the accuracy of the classification model is insufficient, there is no need to retrain the classification model. The classification model can be updated and iterated only by adjusting the atomic weight parameters and / or bias parameters, thereby further reducing the labor cost required for training the classification model and improving the efficiency of classification model training.
[0089] In some embodiments of the present application, the number of training data is M, where M is an integer greater than 1;
[0090] A determination module 406 is used to determine M second classification scores corresponding to the M training data, where the second classification scores correspond to the training data one by one;
[0091] An acquisition module 402 is used to acquire the second dimension scores of N dimensions corresponding to each training data;
[0092] The determination module 406 is used to determine N atomic weight parameters and bias parameters according to the M second classification scores and the P second dimension scores, where P is the product of M and N.
[0093] In an embodiment of the present application, M second classification scores and P second dimension scores corresponding to M training data are obtained, and then N atomic weight parameters and bias parameters in the classification model can be obtained through the second classification scores and second dimension scores, thereby improving the recognition accuracy of the constructed classification model.
[0094] In some embodiments of the present application, the determination module 406 is used to perform linear fitting on the M second classification scores and the P second dimension scores to obtain N atomic weight parameters and bias parameters.
[0095] In an embodiment of the present application, after obtaining M second classification scores corresponding to M training data and P second dimension scores, N atomic weight parameters and bias parameters in the classification model can be obtained by linear fitting, thereby improving the recognition accuracy of the constructed classification model.
[0096] The content classification device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not make specific limitations.
[0097] The content classification device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0098] The content classification device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.
[0099] Optionally, an embodiment of the present application further provides an electronic device, Figure 5A structural block diagram of an electronic device according to an embodiment of the present application is shown. Figure 5 As shown, the electronic device 500 includes a processor 502 and a memory 504. The memory 504 stores programs or instructions that can be executed on the processor 502. When the program or instruction is executed by the processor 502, the various steps of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0100] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0101] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0102] The electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610.
[0103] Those skilled in the art will appreciate that the electronic device 600 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 610 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0104] The processor 610 is used to obtain a classification model, where the classification model includes N atomic models, where N is an integer greater than 1;
[0105] The processor 610 is configured to input the first content into the classification model to obtain first dimension scores of the first content in N dimensions, where the N first dimension scores correspond to the N atomic models one by one;
[0106] The processor 610 is configured to determine classification information of the first content according to the N first dimension scores and the weight parameters corresponding to the classification model.
[0107] In the embodiment of the present application, by configuring N atomic models in the classification model, the first content is classified and identified in the corresponding N dimensions through the N atomic models, and the first dimension score of the first content in the N dimensions can be determined, and the classification information is determined according to the N first dimension scores and weight parameters. Since the N atomic models in the classification model can identify the N dimensions in the first content, the recognition accuracy is high, and the first dimension scores in multiple dimensions are integrated through the weight parameters, thereby improving the accuracy of the classification model in identifying the first content.
[0108] Further, the processor 610 is used to perform a multiplication operation on the N first dimension scores and the corresponding atomic weight parameters to obtain N weight scores;
[0109] The processor 610 is configured to perform an addition operation on the N weight scores and the bias parameter to obtain a first classification score;
[0110] The processor 610 is configured to determine classification information according to the first classification score.
[0111] In an embodiment of the present application, after determining the N first dimension scores corresponding to the N atomic models, the N first dimension scores are multiplied by the N atomic weight parameters respectively, and the N weight scores obtained by the calculation are added to the bias explanation, so as to obtain a first classification score that can determine the first content. The classification information of the first content is determined by the first classification score, which can improve the accuracy of the determined classification information.
[0112] Further, the processor 610 is used to obtain N atomic models;
[0113] Processor 610, used to determine N atomic weight parameters and bias parameters corresponding to N atomic models through training data;
[0114] Processor 610 is used to construct a classification model according to N atomic weight parameters, bias parameters and N atomic models.
[0115] In an embodiment of the present application, the classification model includes atomic models of N dimensions, and the N atomic models are obtained, and then the classification model is trained with training data to obtain the atomic weight parameters corresponding to each atomic model of the N atomic models, as well as the bias parameters in the classification model. Since the atomic model in the classification model is a model obtained by training based on the atomic dimension, the training accuracy of the atomic model is higher than the accuracy of the classification model obtained by training in the related art, which further improves the recognition accuracy of the classification model, and the atomic model in the classification model can be reused in other classification models. In the process of constructing other classification models, it is only necessary to adjust the atomic weight parameters of the atomic model and the bias parameters in the classification model, without retraining the classification model, so the labor cost is reduced.
[0116] Further, the processor 610 is used to construct N atomic models based on the atomic information of N dimensions corresponding to the classification model; and / or search for N atomic models in the atomic model library based on the dimension information of N dimensions corresponding to the classification model.
[0117] In the embodiment of the present application, in the process of training the atomic model, the second content is obtained, and the second content is a training data set for training the atomic model. By extracting the atomic information of the second content in N dimensions corresponding to the classification model, the atomic information is data that can be used to train the atomic model in the training data set, and the data can be obtained by manual annotation. Based on the N atomic information, the N atomic models in the classification model are trained respectively to obtain the N atomic models in the classification model.
[0118] In an embodiment of the present application, based on the dimension information of N dimensions corresponding to the classification model, by searching and obtaining N atomic models in an atomic model library, the atomic model library includes multiple atomic models that have been pre-trained in advance, and searching the N atomic models in the classification model based on the classification information that the classification model needs to identify. By storing the constructed atomic models in the atomic model library, the reusability of the atomic models can be improved and the labor cost required for subsequent training of the classification model can be reduced.
[0119] Furthermore, the processor 610 is used to adjust at least one of the N atomic weight parameters and bias parameters to update the classification model.
[0120] In an embodiment of the present application, when the accuracy of the classification model is insufficient, there is no need to retrain the classification model. The classification model can be updated and iterated only by adjusting the atomic weight parameters and / or bias parameters, thereby further reducing the labor cost required for training the classification model and improving the efficiency of classification model training.
[0121] Furthermore, the number of training data is M, where M is an integer greater than 1;
[0122] Processor 610, configured to determine M second classification scores corresponding to the M training data, where the second classification scores correspond to the training data one by one;
[0123] Processor 610 is used to obtain the second dimension scores of N dimensions corresponding to each training data;
[0124] Processor 610 is used to determine N atomic weight parameters and bias parameters according to M second classification scores and P second dimension scores, where P is the product of M and N.
[0125] In an embodiment of the present application, M second classification scores and P second dimension scores corresponding to M training data are obtained, and then N atomic weight parameters and bias parameters in the classification model can be obtained through the second classification scores and second dimension scores, thereby improving the recognition accuracy of the constructed classification model.
[0126] Further, the processor 610 is used to perform linear fitting on the M second classification scores and the P second dimension scores to obtain N atomic weight parameters and bias parameters.
[0127] In an embodiment of the present application, after obtaining M second classification scores corresponding to M training data and P second dimension scores, N atomic weight parameters and bias parameters in the classification model can be obtained by linear fitting, thereby improving the recognition accuracy of the constructed classification model.
[0128] It should be understood that in the embodiment of the present application, the input unit 604 may include a graphics processor (GPU) 6041 and a microphone 6042, and the graphics processor 6041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes a touch panel 6071 and at least one of other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0129] The memory 609 can be used to store software programs and various data. The memory 609 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 609 may include a volatile memory or a non-volatile memory, or the memory 609 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 609 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0130] The processor 610 may include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 610.
[0131] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned content classification method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0132] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0133] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned content classification method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0134] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0135] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned content classification method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0136] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0137] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0138] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A content classification method, characterized in that: include: Acquire a classification model, wherein the classification model includes N atomic models, where N is an integer greater than 1; Inputting the first content into the classification model to obtain first dimension scores of the first content in N dimensions, wherein the N first dimension scores correspond one-to-one to the N atomic models; Classification information of the first content is determined according to the N first dimension scores and weight parameters corresponding to the classification model.
2. The content classification method according to claim 1, characterized in that: The weight parameters include N atomic weight parameters and bias parameters, and the N atomic weight parameters correspond one-to-one to the N atomic models; The determining the classification information of the first content according to the N first dimension scores and the weight parameter corresponding to the classification model includes: Multiplying the N first dimension scores by the corresponding atomic weight parameters to obtain N weight scores; Adding the N weight scores to the bias parameter to obtain a first classification score; The classification information is determined according to the first classification score.
3. The content classification method according to claim 1 or 2, characterized in that: Before obtaining the classification model, the method further includes: Obtaining the N atomic models; The N atomic weight parameters and bias parameters corresponding to the N atomic models are determined through training data; and the classification model is constructed according to the N atomic weight parameters, the bias parameters and the N atomic models.
4. The content classification method according to claim 3, characterized in that: The obtaining of the N atomic models comprises: Constructing the N atomic models based on the atomic information of the N dimensions corresponding to the classification model; and / or Based on the dimension information of the N dimensions corresponding to the classification model, the N atomic models are searched in the atomic model library.
5. The content classification method according to claim 3, characterized in that: After constructing the classification model according to the N atomic weight parameters, the bias parameters and the N atomic models, the method further includes: At least one of the N atom weight parameters and the bias parameter is adjusted to update the classification model.
6. The content classification method according to claim 3, characterized in that: The number of the training data is M, where M is an integer greater than 1; The determining of N atomic weight parameters and bias parameters corresponding to the N atomic models includes: Determine M second classification scores corresponding to the M training data, where the second classification scores correspond to the training data one by one; Obtaining a second dimension score of the N dimensions corresponding to each of the training data; The N atomic weight parameters and the bias parameter are determined according to the M second classification scores and the P second dimension scores, where P is the product of M and N.
7. The content classification method according to claim 6, characterized in that: Determining the N atomic weight parameters and the bias parameter according to the M second classification scores and the P second dimension scores includes: Linear fitting is performed on the M second classification scores and the P second dimension scores to obtain the N atomic weight parameters and the bias parameter.
8. A content classification device, characterized in that: include: An acquisition module, used to acquire a classification model, wherein the classification model includes N atomic models, where N is an integer greater than 1; An input module, used for inputting the first content into the classification model to obtain first dimension scores of the first content in N dimensions, wherein the N first dimension scores correspond one-to-one to the N atomic models; A determination module is used to determine the classification information of the first content according to the N first dimension scores and the weight parameters corresponding to the classification model.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.