Content classification methods, devices, readable storage media and electronic devices

By using a top-down hierarchical feature information fusion and attention mechanism in the target hierarchical classification model, the problem of low content classification accuracy in existing technologies is solved, achieving high-accuracy content classification and simplifying the model deployment and iteration process.

CN114881174BActive Publication Date: 2026-03-10BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-02
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

The accuracy of content classification in existing technologies is not high. Existing methods fail to effectively utilize information from different category levels, resulting in unsatisfactory classification accuracy. Furthermore, the models have high deployment costs and are difficult to iterate.

Method used

A target hierarchical classification model is adopted. Through a hierarchical network with one-to-one correspondence between N-level categories and the first classifier of the lowest-level category, hierarchical feature information is transferred and fused from top to bottom. The attention mechanism is used to extract feature information and generate and determine the target classification.

Benefits of technology

It improved the accuracy of content classification, simplified model deployment, reduced the difficulty of iteration, and met the requirement of high classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114881174B_ABST
    Figure CN114881174B_ABST
Patent Text Reader

Abstract

This disclosure relates to a content classification method, apparatus, readable storage medium, and electronic device. The method includes: extracting target feature information corresponding to the content to be classified; classifying the content according to a preset category system using a target hierarchical classification model based on the target feature information to obtain a target category; the target hierarchical classification model includes N hierarchical networks corresponding one-to-one with N levels of categories in the preset category system, and a first classifier corresponding to the lowest level category; each hierarchical network is used to generate hierarchical feature information of the corresponding hierarchical category based at least on the target feature information and hierarchical feature information from the previous level network. In this way, the N hierarchical networks can transfer and fuse hierarchical feature information in a top-down manner, using the fused information between category levels for content classification, thus improving the accuracy of content classification. Furthermore, classification is performed using a single model, which is simple to deploy and easy to iterate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of information processing technology, and more specifically, to a content classification method, apparatus, readable storage medium, and electronic device. Background Technology

[0002] With the development of internet technology, the amount of content on the internet is increasing, creating a need for content categorization in many scenarios. For example, there's a need to manage, distribute, and comment on content based on its type, and to push content of the corresponding category based on user selections. Currently, artificial intelligence models are commonly used for content categorization, but the accuracy of the resulting categories is not high. Summary of the Invention

[0003] The purpose of this disclosure is to provide a content classification method, apparatus, readable storage medium, and electronic device to partially solve the aforementioned problems existing in the related art.

[0004] To achieve the above objectives, firstly, this disclosure provides a content classification method, including:

[0005] Extract the target feature information corresponding to the content to be classified;

[0006] Based on the target feature information, the content to be classified is classified according to a preset category system using a target hierarchical classification model to obtain the target category corresponding to the content to be classified. The preset category system includes N levels of categories, and the target category belongs to the lowest level category in the N levels of categories, where N≥2.

[0007] The target hierarchical classification model includes: N hierarchical networks that correspond one-to-one with the N-level categories and are connected in series from high to low according to the corresponding category hierarchy, and a first classifier corresponding to the lowest level category;

[0008] The hierarchical network is used to generate hierarchical feature information of the hierarchical category corresponding to the hierarchical network, based at least on the target feature information and the hierarchical feature information from the previous hierarchical network.

[0009] The first classifier is connected to the hierarchical network corresponding to the lowest-level category, and is used to determine the target category based at least on the hierarchical feature information from the hierarchical network corresponding to the lowest-level category.

[0010] Optionally, determining the target classification based at least on hierarchical feature information from the hierarchical network corresponding to the lowest-level category includes:

[0011] The target classification is determined based on the hierarchical feature information from each of the said hierarchical networks.

[0012] Optionally, determining the target classification based at least on hierarchical feature information from the hierarchical network corresponding to the lowest-level category includes:

[0013] Attention feature information is extracted from the target feature information using an attention mechanism;

[0014] The target classification is determined based on the hierarchical feature information from the hierarchical network corresponding to the lowest-level category and the attention feature information.

[0015] Optionally, determining the target classification based at least on hierarchical feature information from the hierarchical network corresponding to the lowest-level category includes:

[0016] Attention feature information is extracted from the target feature information using an attention mechanism;

[0017] The target classification is determined based on the hierarchical feature information from each of the network layers and the attention feature information.

[0018] Optionally, determining the target classification based on the hierarchical feature information from each of the network layers and the attention feature information includes:

[0019] Global feature information is determined based on the hierarchical feature information from each of the aforementioned hierarchical networks;

[0020] The target classification is determined based on the global feature information and the attention feature information.

[0021] Optionally, generating hierarchical feature information for the hierarchical category corresponding to the hierarchical network based at least on the target feature information and hierarchical feature information from the previous hierarchical network includes:

[0022] Based on the target feature information and the hierarchical feature information from each layer of the network preceding this layer, the hierarchical feature information of the corresponding hierarchical category of this layer is generated.

[0023] Optionally, the content to be classified includes at least one of text, images, and videos.

[0024] Optionally, the target hierarchical classification model further includes a second classifier that corresponds one-to-one with the other hierarchical categories in the N-level categories except for the lowest-level category. The second classifier is connected to a hierarchical network corresponding to its own hierarchical category. During the training phase of the target hierarchical classification model, the second classifier determines the predicted classification of the sample content used as training data in the hierarchical category corresponding to its own hierarchical category based on the hierarchical feature information from the hierarchical network connected to the second classifier itself.

[0025] Optionally, the target hierarchical classification model is trained in the following manner:

[0026] Acquire training data, wherein the training data includes the sample content and the classification labels of the sample content under each of the hierarchical categories;

[0027] Extract the sample feature information corresponding to the sample content;

[0028] Based on the sample feature information, the sample content is classified according to the preset category system through the current hierarchical classification model, to obtain the predicted classification of the sample content under the hierarchical category corresponding to the second classifier itself, output by each second classifier, and the predicted classification of the sample content under the lowest level category output by the first classifier.

[0029] The model parameters of the current hierarchical classification model are updated based on the predicted classification and classification label under each of the aforementioned hierarchical categories.

[0030] In response to the satisfaction of the training cutoff condition, the current hierarchical classification model is determined as the target hierarchical classification model;

[0031] In response to the failure to meet the training cutoff condition, the step of acquiring training data is re-executed up to the step of updating the model parameters of the current hierarchical classification model based on the predicted classification and classification label under each hierarchical category.

[0032] Optionally, updating the model parameters of the current hierarchical classification model based on the predicted classification and classification label under each hierarchical category includes:

[0033] The current loss is determined based on the predicted classification and classification label under each of the aforementioned hierarchical categories;

[0034] Based on the current loss, update the model parameters of the current hierarchical classification model.

[0035] Optionally, determining the current loss based on the predicted classification and classification label under each of the hierarchical categories includes:

[0036] For each of the aforementioned hierarchical categories, the hierarchical classification loss for that category is determined based on the predicted classification and classification label of the sample content under that hierarchical category.

[0037] The sum of the classification losses for each of the aforementioned levels is used to determine the current loss.

[0038] Optionally, determining the current loss based on the predicted classification and classification label under each of the hierarchical categories includes:

[0039] For each other level category in the N-level categories except the highest level category, the inter-level misclassification loss between the hierarchical network corresponding to the other level category and its previous level network is determined based on the first discrimination result of whether the predicted classification of the sample content under the other level category belongs to the predicted classification of the sample content under the previous level category, the second discrimination result of whether the classification label of the sample content under the previous level category is consistent with the predicted classification, and the third discrimination result of whether the classification label of the sample content under the other level category is consistent with the predicted classification.

[0040] For each of the aforementioned hierarchical categories, the hierarchical classification loss for that category is determined based on the predicted classification and classification label of the sample content under that hierarchical category.

[0041] The sum of the inter-level misclassification loss and the classification loss of each level is determined as the current loss.

[0042] Secondly, this disclosure provides a content classification device, including:

[0043] The first extraction module is used to extract the target feature information corresponding to the content to be classified.

[0044] The first classification module is used to classify the content to be classified according to a preset category system based on the target feature information extracted by the first extraction module and through a target hierarchical classification model to obtain the target category corresponding to the content to be classified. The preset category system includes N levels of categories, and the target category belongs to the lowest level category in the N levels of categories, where N≥2.

[0045] The target hierarchical classification model includes: N hierarchical networks that correspond one-to-one with the N-level categories and are connected in series from high to low according to the corresponding category hierarchy, and a first classifier corresponding to the lowest level category;

[0046] The hierarchical network is used to generate hierarchical feature information of the hierarchical category corresponding to the hierarchical network, based at least on the target feature information and the hierarchical feature information from the previous hierarchical network.

[0047] The first classifier is connected to the hierarchical network corresponding to the lowest-level category, and is used to determine the target category based at least on the hierarchical feature information from the hierarchical network corresponding to the lowest-level category.

[0048] Thirdly, this disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the content classification method provided in the first aspect of this disclosure.

[0049] Fourthly, this disclosure provides an electronic device, comprising:

[0050] A memory on which computer programs are stored;

[0051] A processor is configured to execute the computer program in the memory to implement the steps of the content classification method provided in the first aspect of this disclosure.

[0052] In the above technical solution, based on the target feature information corresponding to the content to be classified, the content to be classified is classified according to a preset category system using a target hierarchical classification model to obtain the target category corresponding to the content to be classified. The target hierarchical classification model includes: N hierarchical networks that correspond one-to-one with the N-level categories in the preset category system and are sequentially connected in descending order of the corresponding category hierarchy, and a first classifier corresponding to the lowest-level category in the N-level categories. The hierarchical network is used to generate the hierarchical feature information of the corresponding hierarchical category based at least on the target feature information and the hierarchical feature information from the previous hierarchical network. In this way, the N hierarchical networks that correspond one-to-one with the N-level categories in the preset category system can transfer and fuse hierarchical feature information in a top-down manner, thereby utilizing the fused information between category levels for content classification and improving the accuracy of content classification. Furthermore, a single target hierarchical classification model can meet the requirement of high classification accuracy, and the model is simple to deploy and easy to iterate.

[0053] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0054] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings:

[0055] Figure 1 This is a flowchart illustrating a content classification method according to an exemplary embodiment.

[0056] Figure 2A This is a schematic diagram illustrating the structure of a target hierarchical classification model according to an exemplary embodiment.

[0057] Figure 2B This is a schematic diagram illustrating the structure of a target hierarchical classification model according to another exemplary embodiment.

[0058] Figure 2C This is a schematic diagram illustrating the structure of a target hierarchical classification model according to another exemplary embodiment.

[0059] Figure 2DThis is a schematic diagram illustrating the structure of a target hierarchical classification model according to another exemplary embodiment.

[0060] Figure 2E This is a schematic diagram illustrating the structure of a target hierarchical classification model according to another exemplary embodiment.

[0061] Figure 2F This is a schematic diagram illustrating the structure of a target hierarchical classification model according to another exemplary embodiment.

[0062] Figure 2G This is a schematic diagram illustrating the structure of a target hierarchical classification model according to another exemplary embodiment.

[0063] Figure 2H This is a schematic diagram illustrating the structure of a target hierarchical classification model according to another exemplary embodiment.

[0064] Figure 3 This is a schematic diagram illustrating the structure of a target hierarchical classification model according to another exemplary embodiment.

[0065] Figure 4 This is a flowchart illustrating a training method for a target hierarchical classification model according to an exemplary embodiment.

[0066] Figure 5 This is a block diagram illustrating a content classification device according to an exemplary embodiment.

[0067] Figure 6 This is a block diagram illustrating an electronic device according to an exemplary embodiment.

[0068] Figure 7 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0069] As discussed in the background section, currently, artificial intelligence models are commonly used for content classification, but the accuracy of the content categories obtained from current classifications is not high. Specifically, at present, the following three methods are mainly used to classify the content to be classified according to the lowest level category in the preset category system. Among them, the preset category system is usually represented by a tree structure: (1) Classify the content to be classified directly according to the lowest level category in the preset category system through a single classification model. However, it fails to effectively utilize the information of different category levels, so that the classification model cannot be effectively constrained, resulting in unsatisfactory classification accuracy; (2) Train a classification model of a single level category, and train a separate leaf node (i.e., the lowest level category) classification model under each level category. The classification accuracy of this method is greatly affected by the accuracy of the classification model of the single level category, making it difficult to guarantee the classification accuracy. In addition, multiple classification models need to be trained according to the number of level categories, and the model deployment cost is large; (3) Train the corresponding classification model for each level category. Multiple classification models will not affect each other during the training process. In this way, not only is the model deployment cost large, but when the parent node to which the leaf category belongs is adjusted, the classification model of the level to which the parent node belongs needs to be adjusted, and the iteration difficulty is high.

[0070] In view of this, the present disclosure provides a content classification method, apparatus, readable storage medium, and electronic device.

[0071] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.

[0072] It should be noted that all actions involving the acquisition of signals, information, or data in this disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the location is situated, and with authorization from the owner of the relevant device.

[0073] Figure 1 This is a flowchart illustrating a content classification method according to an exemplary embodiment, wherein the method can be applied to terminals such as smartphones, tablets, and personal computers, and can also be applied to servers. Figure 1 As shown, the method may include the following S101 and S102.

[0074] In S101, the target feature information corresponding to the content to be classified is extracted.

[0075] In this disclosure, the content to be classified includes at least one of text, images, and videos; that is, the content to be classified can be one or more of text, images, and videos. For example, the content to be classified may be text-image content (e.g., an article), and the content to be classified may also be video content.

[0076] Target feature information is used to describe the characteristics of the content to be classified, and can be extracted based on relevant information about the content to be classified (e.g., the text and images corresponding to the content to be classified). When the content to be classified is video, its relevant information may include each video frame, video subtitles, and speech recognition results of the audio in the video.

[0077] Additionally, feature extraction networks can be used to extract target feature information corresponding to the content to be classified. For example, when the content to be classified includes both text and images (or videos), the feature extraction network can be an Image Bidirectional Encoder Representations from Transformers (ImageBERT) model, which belongs to the machine learning model family. While the BERT framework learns text features to understand the semantic information of the content, ImageBERT simultaneously integrates text and image features, combining image information with textual semantic information to enrich the content expression.

[0078] In S102, based on the target feature information, the content to be classified is classified according to the preset category system through the target hierarchical classification model to obtain the target category corresponding to the content to be classified.

[0079] In this disclosure, the preset category system includes N-level categories, and the target category belongs to the lowest level category in the N-level categories, where N≥2.

[0080] The target hierarchical classification model includes: N hierarchical networks, each corresponding one-to-one with an N-level category, connected in descending order of category hierarchy; and a first classifier corresponding to the lowest-level category. Each hierarchical network generates hierarchical feature information for its corresponding category based at least on the target feature information and hierarchical feature information from the preceding hierarchical network. The first classifier, connected to the hierarchical network corresponding to the lowest-level category, determines the target classification based at least on the hierarchical feature information from the hierarchical network corresponding to the lowest-level category.

[0081] For example, the above-mentioned preset category system includes three levels of categories, i.e., N=3, namely first-level categories, second-level categories, and third-level categories. The category hierarchy of the first-level, second-level, and third-level categories decreases sequentially, with the lowest level being the third-level category. For example... Figures 2A-2H As shown, the target hierarchical classification model includes a first-level network corresponding to the first-level category, a second-level network corresponding to the second-level category, a third-level network corresponding to the third-level category, and a first classifier corresponding to the third-level category.

[0082] The system comprises: a first-level network, used to generate first-level category hierarchical feature information based on target feature information; a second-level network, connected to the first-level network, used to generate second-level category hierarchical feature information based on target feature information and the hierarchical feature information from the first-level network; a third-level network, connected to the second-level network, used to generate third-level category hierarchical feature information based at least on target feature information and the hierarchical feature information from the second-level network; and a first classifier, connected to the third-level network, used to determine the target classification based at least on the hierarchical feature information from the third-level network.

[0083] In the above technical solution, based on the target feature information corresponding to the content to be classified, the content to be classified is classified according to a preset category system using a target hierarchical classification model to obtain the target category corresponding to the content to be classified. The target hierarchical classification model includes: N hierarchical networks that correspond one-to-one with the N-level categories in the preset category system and are sequentially connected in descending order of the corresponding category hierarchy, and a first classifier corresponding to the lowest-level category in the N-level categories. The hierarchical network is used to generate the hierarchical feature information of the corresponding hierarchical category based at least on the target feature information and the hierarchical feature information from the previous hierarchical network. In this way, the N hierarchical networks that correspond one-to-one with the N-level categories in the preset category system can transfer and fuse hierarchical feature information in a top-down manner, thereby utilizing the fused information between category levels for content classification and improving the accuracy of content classification. Furthermore, a single target hierarchical classification model can meet the requirement of high classification accuracy, and the model is simple to deploy and easy to iterate.

[0084] The following is a detailed description of a specific implementation method for generating hierarchical feature information of the hierarchical category corresponding to the hierarchical network, based at least on the target feature information and the hierarchical feature information from the previous hierarchical network. Specifically, this can be achieved in various ways. In one implementation method, hierarchical feature information of the hierarchical category corresponding to the hierarchical network can be generated based on the target feature information and the hierarchical feature information from the previous hierarchical network.

[0085] For example, such as Figure 2A-2D As shown, the first-level network is used to generate first-level feature information based on target feature information; the second-level network is used to generate second-level feature information based on target feature information and hierarchical feature information from the first-level network (i.e., first-level feature information); and the third-level network is used to generate third-level feature information based on target feature information and hierarchical feature information from the second-level network (i.e., second-level feature information).

[0086] In another implementation, hierarchical feature information for the corresponding hierarchical category of a given hierarchical network can be generated based on the target feature information and the hierarchical feature information from each preceding hierarchical network. This allows for the fusion of hierarchical feature information from each hierarchical network, resulting in more comprehensive hierarchical feature information for content classification and further improving the accuracy of content classification.

[0087] For example, such as Figure 2E-2H As shown, the first-level network is used to generate first-level feature information based on target feature information; the second-level network is used to generate second-level feature information based on target feature information and hierarchical feature information from the first-level network (i.e., first-level feature information); and the third-level network is used to generate third-level feature information based on target feature information, hierarchical feature information from the first-level network (i.e., first-level feature information), and hierarchical feature information from the second-level network (i.e., second-level feature information).

[0088] The following provides a detailed description of the specific implementation method for determining the target classification based at least on the hierarchical feature information from the hierarchical network corresponding to the lowest-level category. Specifically, this can be achieved in various ways. In one implementation, the target classification can be determined based on the hierarchical feature information from the hierarchical network corresponding to the lowest-level category.

[0089] For example, such as Figure 2A and Figure 2E As shown, the first classifier is used to determine the target classification based on the hierarchical feature information (i.e., the third-level feature information) from the third-level network.

[0090] In another implementation, the target classification can be determined based on the hierarchical feature information from each level of the network. This allows for full utilization of the hierarchical feature information output from multiple network levels, ensuring sufficient information representation and further improving the accuracy of content classification.

[0091] For example, such as Figure 2B and Figure 2F As shown, the first classifier is used to determine the target classification based on the hierarchical feature information from the first-level network (i.e., the first-level feature information), the hierarchical feature information from the second-level network (i.e., the second-level feature information), and the hierarchical feature information from the third-level network (i.e., the third-level feature information).

[0092] In another implementation, attentional feature information of the target feature information can be extracted first using an attention mechanism. For example, attentional feature information of the target feature information can be extracted using an attention module. Then, the target category is determined based on the hierarchical feature information and attentional feature information from the hierarchical network corresponding to the lowest-level category. When determining the target category, the attentional feature information of the target feature information is introduced to guide the first classifier to effectively classify the content to be classified, thereby avoiding the loss of effective information due to the target feature information being processed through multiple hierarchical networks, and thus improving the accuracy of content classification.

[0093] For example, such as Figure 2C and Figure 2G As shown, the first classifier is used to determine the target classification based on the hierarchical feature information (i.e., the third-level feature information) from the third-level network and the attention feature information.

[0094] In another implementation, attentional features of the target feature information can be extracted first using an attention mechanism; then, the target classification is determined based on the hierarchical feature information and attentional feature information from each layer of the network. In determining the target classification, not only is the attentional feature information of the target feature information introduced, but also the hierarchical feature information output from multiple layers of the network is fully utilized, thereby maximizing the accuracy of content classification.

[0095] For example, such as Figure 2D and Figure 2H As shown, the first classifier is used to determine the target classification based on the hierarchical feature information from the first layer network (i.e., the first layer feature information), the hierarchical feature information from the second layer network (i.e., the second layer feature information), the hierarchical feature information from the third layer network (i.e., the third layer feature information), and attention feature information.

[0096] The following is a detailed explanation of the specific implementation method for determining target classification based on the hierarchical feature information from each level of the network. Specifically, it can be achieved through the following steps (1) and (2):

[0097] (1) Determine global feature information based on the hierarchical feature information from each level of the network.

[0098] (2) Determine the target classification based on global feature information.

[0099] Specifically, global hierarchical feature information can be input into the first classifier to obtain the target classification corresponding to the content to be classified.

[0100] The following is a detailed description of the specific implementation method for determining target classification based on the hierarchical feature information and attention feature information from each layer of the network. Specifically, it can be achieved through the following steps [1] and [2]:

[0101] [1] Determine global feature information based on the hierarchical feature information from each level of the network.

[0102] [2] Determine the target classification based on global feature information and attention feature information.

[0103] Specifically, global hierarchical feature information and attention feature information can be input into the first classifier to obtain the target classification corresponding to the content to be classified.

[0104] The following is a detailed description of the specific implementation of determining global feature information based on the hierarchical feature information from each level of the network in steps (1) and [1].

[0105] Specifically, hierarchical feature information from each layer of the network can be fused to obtain global feature information.

[0106] In one implementation, the hierarchical feature information from each layer of the network can be fused by learning parameters α (i.e., the weight matrix) to obtain global feature information. That is, global feature information = the sum of the hierarchical feature information (which can be represented as a vector) output by the other layer networks in the N layer networks, except for the layer network corresponding to the lowest level category. + Hierarchical feature information output by the hierarchical network corresponding to the lowest-level category

[0107] For example, such as Figure 2B , Figure 2C , Figure 2F as well as Figure 2H The target hierarchical classification model shown has global feature information equal to (first-level feature information + second-level feature information). +Third-level feature information

[0108] In addition, the target hierarchical classification model also includes a second classifier that corresponds one-to-one with the other hierarchical categories in the N-level categories except for the lowest level category. The second classifier is connected to the hierarchical network corresponding to its own hierarchical category. During the training phase of the target hierarchical classification model, the model uses hierarchical feature information from the hierarchical network connected to the second classifier itself to determine the predicted classification of the sample content used as training data under the hierarchical category corresponding to the second classifier itself.

[0109] For example, such as Figure 3As shown, the target hierarchical classification model includes a first-level network, a second-level network, a third-level network, and a first classifier corresponding to the three-level categories, as well as a second classifier corresponding to the first-level categories and a second classifier corresponding to the second-level categories. Specifically, the first-level network generates hierarchical feature information (fourth-level feature information) for the first-level categories based on the sample feature information of the sample content used as training data during the training phase of the target hierarchical classification model. The second-level network generates hierarchical feature information for the second-level categories (fifth-level feature information) based on the sample feature information and the hierarchical feature information from the first-level network (i.e., the fourth-level feature information) during the training phase of the target hierarchical classification model. The third-level network generates hierarchical feature information for the third-level categories (sixth-level feature information) based at least on the sample feature information and the hierarchical feature information from the second-level network (i.e., the fifth-level feature information) during the training phase of the target hierarchical classification model. The second classifier A, corresponding to the first-level categories, is connected to the first-level network and is used to... During the training phase of the target hierarchical classification model, the predicted classification of the sample content under the first-level category is determined based on the hierarchical feature information (i.e., the fourth-level feature information) from the hierarchical network (i.e., the first-level network) connected to the second-level classifier A itself. During the training phase of the target hierarchical classification model, the second classifier B, connected to the second-level network, is used to determine the predicted classification of the sample content under the second-level category based on the hierarchical feature information (i.e., the fifth-level feature information) from the hierarchical network (i.e., the second-level network) connected to the second-level classifier B itself. During the training phase of the target hierarchical classification model, the first classifier, connected to the third-level network, is used to determine the predicted classification of the sample content under the third-level category based at least on the hierarchical feature information (i.e., the sixth-level feature information) from the third-level network.

[0110] The following section details the specific training methods for the aforementioned hierarchical classification model. Specifically, it can be achieved through... Figure 4 This is achieved through steps S401 to S406 shown in the diagram.

[0111] In S401, training data is acquired, which includes sample content and the classification labels of the sample content under each level category.

[0112] In this disclosure, sample content includes at least one of text, images, and videos; that is, sample content can be one or more of text, images, and videos. For example, sample content is text-and-image content (e.g., an article), and sample content can also be video content.

[0113] In S402, the sample feature information corresponding to the sample content is extracted.

[0114] In this disclosure, sample feature information corresponding to sample content can be extracted in a manner similar to that used in S101 above for extracting target feature information corresponding to the content to be classified. This disclosure will not elaborate further.

[0115] In S403, based on the sample feature information, the sample content is classified according to the preset category system through the current hierarchical classification model, and the predicted classification of the sample content under the hierarchical category corresponding to the second classifier is obtained from the output of each second classifier, and the predicted classification of the sample content under the lowest level category is obtained from the output of the first classifier.

[0116] In S404, the model parameters of the current level classification model are updated based on the predicted classification and classification label under each level category.

[0117] In S405, determine whether the training cutoff condition is met.

[0118] In this disclosure, the training cutoff condition can be either reaching a preset training count threshold or the current loss of the current level classification model being less than a preset loss threshold.

[0119] If the training cutoff condition is not met, return to step S401 above and continue execution until the training cutoff condition is met. If the training cutoff condition is met, execute step S406 below.

[0120] In S406, the current hierarchical classification model is determined as the target hierarchical classification model.

[0121] The following provides a detailed explanation of the specific implementation method for updating the model parameters of the current hierarchical classification model based on the predicted classification and classification label under each level category in S404 above. Specifically, it can be achieved through the following steps 1) and 2):

[0122] 1) Determine the current loss based on the predicted category and category label under each level of category.

[0123] 2) Update the model parameters of the current level classification model based on the current loss.

[0124] The following is a detailed explanation of the specific implementation method for determining the current loss based on the predicted classification and classification label under each level category in step 1) above. Specifically, this can be achieved in various ways. In one implementation, for each level category, the hierarchical classification loss for that level category can be determined based on the predicted classification and classification label of the sample content under that level category. Then, the sum of the classification losses for each level is used to determine the current loss.

[0125] Specifically, for each category level, the hierarchical classification loss of that category level can be determined based on the difference between the predicted classification and the classification label of the sample content under that category level. Then, the sum of the classification losses of each level level is used to determine the current loss.

[0126] In another implementation, the current loss can be determined through the following steps ① to ③:

[0127] ① For each other level category in the N-level category except the highest level category, determine the inter-level misclassification loss between the level network corresponding to the other level category and the level network before it based on the first discrimination result of whether the predicted classification of the sample content under the other level category belongs to the predicted classification of the sample content under the level category above the other level category, the second discrimination result of whether the classification label of the sample content under the level category above the other level category is consistent with the predicted classification, and the third discrimination result of whether the classification label of the sample content under the other level category is consistent with the predicted classification.

[0128] For example, if N=3, then as follows Figure 3 As shown, the inter-level misclassification loss between the hierarchical network corresponding to the second-level category (i.e., the second-level network) and its preceding hierarchical network (i.e., the first-level network) can be determined based on the first discrimination result of whether the predicted classification of the sample content under the second-level category belongs to the predicted classification of the sample content under the first-level category, the second discrimination result of whether the classification label of the sample content under the first-level category is consistent with the predicted classification, and the third discrimination result of whether the classification label of the sample content under the second-level category is consistent with the predicted classification. Simultaneously, the inter-level misclassification loss between the hierarchical network corresponding to the third-level category (i.e., the third-level network) and its preceding hierarchical network (i.e., the second-level network) can be determined based on the first discrimination result of whether the predicted classification of the sample content under the third-level category belongs to the predicted classification of the sample content under the second-level category, the second discrimination result of whether the classification label of the sample content under the second-level category is consistent with the predicted classification, and the third discrimination result of whether the classification label of the sample content under the third-level category is consistent with the predicted classification.

[0129] ② For each category level, determine the category level loss based on the predicted classification and classification label of the sample content under that category level.

[0130] ③The sum of the misclassification loss between each level and the classification loss at each level is determined as the current loss.

[0131] For example, based on the first discrimination result (whether the predicted classification of the sample content under level i belongs to the predicted classification of the sample content under level i-1), the second discrimination result (whether the classification label of the sample content under level i-1 is consistent with the predicted classification), and the third discrimination result (whether the classification label of the sample content under level i is consistent with the predicted classification), the inter-level misclassification loss between the hierarchical network corresponding to level i and its previous hierarchical network (i.e., the hierarchical network corresponding to level i-1) can be determined:

[0132]

[0133] Among them, Hier i-1,i Let be the inter-level misclassification loss between the hierarchical network corresponding to the i-th level category and its preceding level network, where i = 2, 3, ..., N; β is the penalty parameter, and 1 < β ≤ 5; Child i The first discrimination result is whether the predicted classification of the sample content under the i-th level category belongs to the predicted classification of the sample content under the i-1 level category. Specifically, if the predicted classification of the sample content under the i-th level category belongs to the predicted classification of the sample content under the i-1 level category, then Child... i =0, if the predicted classification of the sample content under level i is not the same as the predicted classification of the sample content under level i-1, then Child i =1;Pred i-1 The second discrimination result is whether the category label of the sample content under the i-1 level category is consistent with the predicted category. Specifically, if the category label of the sample content under the i-1 level category is consistent with the predicted category, then Pred... i-1 =0, if the category label of the sample content under the i-1 level category is inconsistent with the predicted category, then Pred i-1 =1;Pred i The third criterion is whether the category label of the sample content under this i-th level category is consistent with the predicted category. Specifically, if the category label of the sample content under this i-th level category is consistent with the predicted category, then Pred... i =0, if the category label of the sample content under this i-th level category is inconsistent with the predicted category, then Pred i =1.

[0134] In the above implementation, during the training of the target hierarchical classification model, the current loss of the current hierarchical classification model not only refers to the classification loss of each level, but also to the misclassification loss between each level. In this way, the misclassification loss between each level can be used to constrain the subordinate relationship between adjacent hierarchical categories in the N-level category. Penalties are imposed on unrelated predictions between levels (i.e., the predicted classification of sample content under this level category does not belong to the predicted classification of sample content under the previous level category of this level category), thereby enabling the current hierarchical classification model to learn hierarchical relationship information and improve the accuracy of model classification.

[0135] Figure 5 This is a block diagram illustrating a content classification device according to an exemplary embodiment. Figure 5 As shown, the device 500 includes:

[0136] The first extraction module 501 is used to extract the target feature information corresponding to the content to be classified.

[0137] The first classification module 502 is used to classify the content to be classified according to a preset category system based on the target feature information extracted by the first extraction module 501 through a target hierarchical classification model, so as to obtain the target category corresponding to the content to be classified. The preset category system includes N levels of categories, and the target category belongs to the lowest level category in the N levels of categories, where N≥2.

[0138] The target hierarchical classification model includes: N hierarchical networks that correspond one-to-one with the N-level categories and are connected in series from high to low according to the corresponding category hierarchy, and a first classifier corresponding to the lowest level category;

[0139] The hierarchical network is used to generate hierarchical feature information of the hierarchical category corresponding to the hierarchical network, based at least on the target feature information and the hierarchical feature information from the previous hierarchical network.

[0140] The first classifier is connected to the hierarchical network corresponding to the lowest-level category, and is used to determine the target category based at least on the hierarchical feature information from the hierarchical network corresponding to the lowest-level category.

[0141] In the above technical solution, based on the target feature information corresponding to the content to be classified, the content to be classified is classified according to a preset category system using a target hierarchical classification model to obtain the target category corresponding to the content to be classified. The target hierarchical classification model includes: N hierarchical networks that correspond one-to-one with the N-level categories in the preset category system and are sequentially connected in descending order of the corresponding category hierarchy, and a first classifier corresponding to the lowest-level category in the N-level categories. The hierarchical network is used to generate the hierarchical feature information of the corresponding hierarchical category based at least on the target feature information and the hierarchical feature information from the previous hierarchical network. In this way, the N hierarchical networks that correspond one-to-one with the N-level categories in the preset category system can transfer and fuse hierarchical feature information in a top-down manner, thereby utilizing the fused information between category levels for content classification and improving the accuracy of content classification. Furthermore, a single target hierarchical classification model can meet the requirement of high classification accuracy, and the model is simple to deploy and easy to iterate.

[0142] Optionally, the first classifier is used to determine the target classification based on hierarchical feature information from each of the said hierarchical networks.

[0143] Optionally, the first classifier is configured to: extract attention feature information of the target feature information using an attention mechanism; and determine the target classification based on the hierarchical feature information from the hierarchical network corresponding to the lowest-level category and the attention feature information.

[0144] Optionally, the first classifier is configured to: extract attention feature information of the target feature information using an attention mechanism; and determine the target classification based on the hierarchical feature information from each of the network layers and the attention feature information.

[0145] Optionally, the first classifier is configured to: determine global feature information based on hierarchical feature information from each of the said hierarchical networks; and determine the target classification based on the global feature information and the attention feature information.

[0146] Optionally, the hierarchical network is used to generate hierarchical feature information of the hierarchical category corresponding to the hierarchical network based on the target feature information and the hierarchical feature information from each hierarchical network preceding the hierarchical network.

[0147] Optionally, the content to be classified includes at least one of text, images, and videos.

[0148] Optionally, the target hierarchical classification model further includes a second classifier that corresponds one-to-one with the other hierarchical categories in the N-level categories except for the lowest-level category. The second classifier is connected to a hierarchical network corresponding to its own hierarchical category. During the training phase of the target hierarchical classification model, the second classifier determines the predicted classification of the sample content used as training data in the hierarchical category corresponding to its own hierarchical category based on the hierarchical feature information from the hierarchical network connected to the second classifier itself.

[0149] Optionally, the target hierarchical classification model is trained using a model training device, wherein the model training device includes:

[0150] An acquisition module is used to acquire training data, wherein the training data includes the sample content and the classification labels of the sample content under each of the hierarchical categories;

[0151] The second extraction module is used to extract sample feature information corresponding to the sample content;

[0152] The second classification module is used to classify the sample content according to the preset category system based on the sample feature information and the current hierarchical classification model, so as to obtain the predicted classification of the sample content under the hierarchical category corresponding to the second classifier itself, output by each second classifier, and the predicted classification of the sample content under the lowest hierarchical category output by the first classifier.

[0153] The update module is used to update the model parameters of the current hierarchical classification model based on the predicted classification and classification label under each of the hierarchical categories.

[0154] The triggering module is configured to: determine the current hierarchical classification model as the target hierarchical classification model in response to the training cutoff condition being met; and trigger the acquisition module to acquire training data in response to the training cutoff condition not being met.

[0155] Optionally, the update module includes:

[0156] The first determining submodule is used to determine the current loss based on the predicted classification and classification label under each of the aforementioned hierarchical categories;

[0157] The update submodule is used to update the model parameters of the current hierarchical classification model based on the current loss.

[0158] Optionally, the first determining submodule includes:

[0159] The second determining submodule is used to determine the hierarchical classification loss for each hierarchical category based on the predicted classification and classification label of the sample content under that hierarchical category.

[0160] The third determining submodule is used to sum the classification losses of each level to determine the current loss.

[0161] Optionally, the first determining submodule includes:

[0162] The fourth determination submodule is used to determine the inter-level misclassification loss between the hierarchical network corresponding to the other level category and its previous level network for each other level category in the N-level categories, based on the first discrimination result of whether the predicted classification of the sample content under the other level category belongs to the predicted classification of the sample content under the previous level category, the second discrimination result of whether the classification label of the sample content under the previous level category is consistent with the predicted classification, and the third discrimination result of whether the classification label of the sample content under the other level category is consistent with the predicted classification.

[0163] The fifth determination submodule is used to determine the hierarchical classification loss for each hierarchical category based on the predicted classification and classification label of the sample content under that hierarchical category.

[0164] The sixth determination submodule is used to determine the sum of the inter-level misclassification loss and the classification loss of each level as the current loss.

[0165] In addition, it should be noted that the above-mentioned model training device can be independent of the above-mentioned content classification device 500, or it can be integrated into the above-mentioned content classification device 500. This disclosure does not make any specific limitations.

[0166] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0167] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the content classification method described above.

[0168] Figure 6 This is a block diagram illustrating an electronic device 700 according to an exemplary embodiment. Figure 6 As shown, the electronic device 700 may include a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input / output (I / O) interface 704, and a communication component 705.

[0169] The processor 701 controls the overall operation of the electronic device 700 to complete all or part of the steps in the content classification method described above. The memory 702 stores various types of data to support the operation of the electronic device 700. This data may include, for example, instructions for any application or method operating on the electronic device 700, and application-related data such as contact data, sent and received messages, pictures, audio, video, etc. The memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 703 may include a screen and audio components. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 702 or transmitted via communication component 705. The audio component also includes at least one speaker for outputting audio signals. I / O interface 704 provides an interface between processor 701 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IoT, eMTC, or other 5G technologies, or combinations thereof, is not limited here. Therefore, the corresponding communication component 705 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.

[0170] In an exemplary embodiment, the electronic device 700 may 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, microcontrollers, microprocessors, or other electronic components to perform the content classification method described above.

[0171] 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 content classification method described above. For example, the computer-readable storage medium may be the memory 702 including the program instructions described above, which may be executed by the processor 701 of the electronic device 700 to complete the content classification method described above.

[0172] Figure 7 This is a block diagram illustrating an electronic device 1900 according to an exemplary embodiment. For example, the electronic device 1900 may be provided as a server. (Refer to...) Figure 7 The electronic device 1900 includes a processor 1922, which may be one or more, and a memory 1932 for storing computer programs executable by the processor 1922. The computer program stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processor 1922 may be configured to execute the computer program to perform the content classification method described above.

[0173] Additionally, the electronic device 1900 may also include a power supply component 1926 and a communication component 1950. The power supply component 1926 can be configured to perform power management of the electronic device 1900, and the communication component 1950 can be configured to enable communication of the electronic device 1900, such as wired or wireless communication. Furthermore, the electronic device 1900 may also include an input / output (I / O) interface 1958. The electronic device 1900 can operate on an operating system, such as Windows Server, stored in memory 1932. TM Mac OS X TM Unix TM Linux TM etc.

[0174] 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 content classification method described above. For example, the computer-readable storage medium may be the memory 1932 including the program instructions, which may be executed by the processor 1922 of the electronic device 1900 to complete the content classification method described above.

[0175] In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable device, the computer program having a code portion for performing the above-described content classification method when executed by the programmable device.

[0176] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.

[0177] It should also be noted that the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.

[0178] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.

Claims

1. A method of classifying content, characterized by, The method comprises the following steps: extracting target feature information corresponding to content to be classified, the content to be classified being at least one of text, image, and video; classifying the content to be classified according to a preset category system through a target hierarchical classification model according to the target feature information, to obtain a target classification corresponding to the content to be classified, wherein the preset category system comprises N-level categories, the target classification belongs to a lowest-level category in the N-level categories, and N≥2; the target hierarchical classification model comprises N hierarchical networks corresponding to the N-level categories in sequence from high to low according to the corresponding category levels, and a first classifier corresponding to the lowest-level category; the hierarchical network is configured to generate hierarchical feature information of a hierarchical category corresponding to the hierarchical network according to at least the target feature information and hierarchical feature information from a previous hierarchical network of the hierarchical network; the first classifier is connected to the hierarchical network corresponding to the lowest-level category, and is configured to determine the target classification according to at least the hierarchical feature information from the hierarchical network corresponding to the lowest-level category; the target hierarchical classification model further comprises second classifiers corresponding to other hierarchical categories in the N-level categories except the lowest-level category, wherein the second classifier is connected to the hierarchical network corresponding to the hierarchical category corresponding to the second classifier itself, and is configured to determine, in a training stage of the target hierarchical classification model, a predicted classification of sample content used as training data in the hierarchical category corresponding to the second classifier itself according to hierarchical feature information from the hierarchical network connected to the second classifier itself; and the target hierarchical classification model is trained in the following manner: obtaining training data, wherein the training data comprises the sample content and classification labels of the sample content in each hierarchical category; extracting sample feature information corresponding to the sample content; classifying the sample content according to the preset category system through a current hierarchical classification model according to the sample feature information, to obtain a predicted classification of the sample content in the hierarchical category corresponding to each second classifier output by the second classifier, and a predicted classification of the sample content in the lowest-level category output by the first classifier; updating model parameters of the current hierarchical classification model according to the predicted classification in each hierarchical category and the classification label; determining the current hierarchical classification model as the target hierarchical classification model in response to satisfying a training stop condition; re-executing the steps of obtaining training data to updating model parameters of the current hierarchical classification model according to the predicted classification in each hierarchical category and the classification label in response to not satisfying the training stop condition.

2. The method of claim 1, wherein, the determination of the target classification according to at least the hierarchical feature information from the hierarchical network corresponding to the lowest-level category comprises: extracting attention feature information of the target feature information by using an attention mechanism; determining the target classification according to the hierarchical feature information from the hierarchical network corresponding to the lowest-level category and the attention feature information.

3. The method of claim 1, wherein, The target classification is determined according to at least the hierarchical feature information from the hierarchical network corresponding to the lowest level category. Attention feature information of the target feature information is extracted by using an attention mechanism. The target classification is determined according to the hierarchical feature information from each hierarchical network and the attention feature information.

4. The method of claim 1, wherein, The current hierarchical classification model is updated according to the predicted classification and the classification label under each hierarchical category. A current loss is determined according to the predicted classification and the classification label under each hierarchical category. The current hierarchical classification model is updated according to the current loss.

5. The method of claim 4, wherein, The current loss is determined according to the predicted classification and the classification label under each hierarchical category. For each hierarchical category, a hierarchical classification loss of the hierarchical category is determined according to the predicted classification and the classification label of the sample content under the hierarchical category; a sum of each hierarchical classification loss is determined as the current loss; or for each other hierarchical category in the N-level categories except the highest level category, a hierarchical inter-classification loss between a hierarchical network corresponding to the other hierarchical category and a previous hierarchical network of the other hierarchical category is determined according to a first discrimination result of whether the predicted classification of the sample content under the other hierarchical category belongs to the predicted classification of the sample content under a previous hierarchical category of the other hierarchical category, a second discrimination result of whether the classification label and the predicted classification of the sample content under the other hierarchical category are consistent, and a third discrimination result of whether the classification label and the predicted classification of the sample content under the other hierarchical category are consistent; for each hierarchical category, a hierarchical classification loss of the hierarchical category is determined according to the predicted classification and the classification label of the sample content under the hierarchical category; a sum of each hierarchical inter-classification loss and each hierarchical classification loss is determined as the current loss.

6. A content classification apparatus characterized by comprising: The method comprises the following steps: A first extraction module is configured to extract target feature information corresponding to content to be classified, the content to be classified being at least one of text, an image, and a video; A first classification module is configured to classify the content to be classified according to a preset category system by using a target hierarchical classification model according to the target feature information extracted by the first extraction module, to obtain a target classification corresponding to the content to be classified, wherein the preset category system comprises N-level categories, the target classification belongs to a lowest level category in the N-level categories, and N is greater than or equal to 2; The target hierarchical classification model comprises N hierarchical networks corresponding to the N-level categories and connected in sequence from high to low according to the levels of the corresponding categories, and a first classifier corresponding to the lowest level category; The hierarchical network is configured to generate hierarchical feature information of a hierarchical category corresponding to the hierarchical network according to at least the target feature information and hierarchical feature information from a previous hierarchical network of the hierarchical network; The first classifier is connected with the hierarchical network corresponding to the lowest level category, and is configured to determine the target classification according to at least the hierarchical feature information from the hierarchical network corresponding to the lowest level category. The target hierarchical classification model further comprises a second classifier corresponding to each of the N hierarchical categories except the lowest hierarchical category, wherein the second classifier is connected with a hierarchical network corresponding to the hierarchical category to which the second classifier corresponds, and is configured to, in a training stage of the target hierarchical classification model, determine a predicted classification of a sample content under a hierarchical category corresponding to the second classifier according to hierarchical feature information from the hierarchical network connected with the second classifier in the training stage. The target hierarchical classification model is obtained by the following method: obtaining training data, wherein the training data comprises the sample content and a classification label of the sample content under each of the hierarchical categories; extracting sample feature information corresponding to the sample content; classifying the sample content according to the preset category system by a current hierarchical classification model according to the sample feature information, to obtain a predicted classification of the sample content under a hierarchical category corresponding to each of the second classifiers output by the second classifiers and a predicted classification of the sample content under the lowest hierarchical category output by the first classifier; updating model parameters of the current hierarchical classification model according to the predicted classification and the classification label under each of the hierarchical categories; determining the current hierarchical classification model as the target hierarchical classification model in response to satisfying a training stop condition; re-executing the steps of obtaining training data to updating model parameters of the current hierarchical classification model according to the predicted classification and the classification label under each of the hierarchical categories in response to not satisfying the training stop condition.

7. A computer-readable storage medium having stored thereon a computer program, characterized in that The program, when executed by the processor, implements the method of claim 1 5. The steps of the method of any one of claims 1-4.

8. An electronic device, comprising: comprise: a memory having a computer program stored thereon; a processor for executing the computer program in the memory to implement the method of claim 1 the steps of the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Audio and video processing method, device, equipmentand medium

    CN109257622A

  • Content classification method and device, computer equipment and storage medium

    CN110737801A

  • Method for carrying out unbiased classification on image data

    CN110837570A