Classification model training method, apparatus, electronic device, computer-readable storage medium, and computer program product

By selecting target samples from original samples and performing multi-stage learning in content classification model training, the problems of high training cost and poor classification effect in the existing technology are solved, and efficient and accurate content classification is achieved.

WO2024216938A1PCT designated stage expired Publication Date: 2024-10-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Application Number
PCT/CN2023/130757
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-18
Filing Date
2023-11-09
Publication Date
2024-10-24

AI Technical Summary

Technical Problem

In the existing technology, content classification model training relies on a large amount of labeled sample data, resulting in high training costs and low efficiency. When the sample size is small, it is difficult for the model to learn and the classification effect is poor.

Method used

By obtaining the original sample content and the labeled sample content, the classification model is used to select the target sample from the original sample, construct its expected content type, and adjust the model parameters through multi-stage progressive learning to reduce the need for labeling of all samples and improve training efficiency. and classification accuracy.

Benefits of technology

It improves the model training efficiency, reduces the training cost, enhances the classification accuracy of the model, and can achieve better classification results with a small amount of labeled data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023130757_24102024_PF_FP_ABST
    Figure CN2023130757_24102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a classification model training method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product; the method is executed by the electronic device, and comprises: obtaining at least one piece of original sample content and labeled sample content, and obtaining a classification model, the labeled sample content carrying an expected content type corresponding thereto, and the classification model comprising a feature extraction module and a classification module; based on the expected content type corresponding to the labeled sample content and at least one content label corresponding to the labeled sample content, selecting from the original sample content at least one piece of target sample content, and constructing an expected content type corresponding to the target sample content; using the classification model to classify the target sample content, obtaining an actual content type corresponding to the target sample content; based on the actual content type corresponding to the target sample content and the expected content type corresponding to the target sample content, adjusting, within the classification model, the parameters of the feature extraction module and the classification module, obtaining an adjusted classification model; using the adjusted classification model to classify the labeled sample content, obtaining an actual content type corresponding to the labeled sample content; and according to the actual content type corresponding to the labeled sample content and the expected content type corresponding to the labeled sample content, updating the parameters of the classification module in the adjusted classification model, obtaining a target classification model, the target classification model being used for classifying content to be processed, so as to obtain the content type of the content to be processed.
Need to check novelty before this filing date? Find Prior Art

Description

Classification model training method, device, electronic device, computer-readable storage medium, and computer program product

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on the Chinese patent application with application number 202310458965.4 and application date April 18, 2023, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference. Technical Field

[0003] The present application relates to the field of computer technology, and in particular to a classification model training method, device, electronic device, computer-readable storage medium, and computer program product. Background Art

[0004] With the continuous development of network information technology, the amount of diverse content on the internet has increased dramatically. To analyze this massive amount of content and identify the content of interest to users, this content needs to be processed. Content classification is a key technology for processing large amounts of content and plays a vital role in information processing. Content classification involves categorizing content data according to a specific classification system or standard to determine the corresponding content type. Generally, content classification models can be trained using artificial intelligence technology to obtain a trained content classification model. Simply inputting the content to be processed into this trained content classification model yields the content classification results.

[0005] However, in current related technologies, a large amount of manually annotated data is usually required as a training set to train content classification models. Specifically, the sample content must first be labeled with label information, which contains the expected classification result corresponding to the sample content. The sample content is then classified and processed using the content classification model to obtain a predicted classification result. The parameters of the content classification model are updated based on the predicted classification result and the label information carried by the sample content. Current classification technology relies on a large number of labeled samples. It is based on supervised training of large labeled data sets. This requires a lot of manpower and material resources to annotate the sample content, making the training cost high. The data annotation process is often long, resulting in low training efficiency. For this training method, if a large number of annotated training samples are not used for model training, the problem of model learning difficulties caused by the small number of samples will arise, resulting in poor model classification results.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a classification model training method, device, electronic device, computer-readable storage medium and computer program product. Through the embodiments of the present application, the model training efficiency can be improved and the training cost can be reduced; it can also enable the model to converge better and improve the classification accuracy of the model.

[0008] An embodiment of the present application provides a classification model training method, which is performed by an electronic device and includes:

[0009] Obtaining at least one original sample content and annotated sample content, and obtaining a classification model, wherein the annotated sample content carries its corresponding expected content type, and the classification model includes a feature extraction module and a classification module;

[0010] Based on the expected content type corresponding to the annotated sample content and at least one content tag corresponding to the annotated sample content, selecting at least one target sample content from the original sample content, and constructing the expected content type corresponding to the target sample content;

[0011] Classifying the target sample content using the classification model to obtain the actual content type corresponding to the target sample content;

[0012] Adjusting parameters of a feature extraction module and a classification module in the classification model based on the actual content type corresponding to the target sample content and the expected content type corresponding to the target sample content to obtain an adjusted classification model;

[0013] Classify the labeled sample content using the adjusted classification model to obtain the actual content type corresponding to the labeled sample content;

[0014] According to the actual content type corresponding to the annotated sample content and the expected content type corresponding to the annotated sample content, the parameters of the classification module in the adjusted classification model are updated to obtain a target classification model. The target classification model is used to classify the content to be processed and obtain the content type of the content to be processed.

[0015] The present invention provides a classification model training device, comprising:

[0016] an acquisition unit configured to acquire at least one original sample content and an annotated sample content, and acquire a classification model, wherein the annotated sample content carries its corresponding expected content type, and the classification model includes a feature extraction module and a classification module;

[0017] a selection unit configured to select at least one target sample content from the original sample content based on the expected content type corresponding to the annotated sample content and at least one content tag corresponding to the annotated sample content, and construct the expected content type corresponding to the target sample content;

[0018] A first classification unit is configured to classify the target sample content using the classification model to obtain an actual content type corresponding to the target sample content;

[0019] an adjusting unit configured to adjust parameters of a feature extraction module and a classification module in the classification model based on an actual content type corresponding to the target sample content and an expected content type corresponding to the target sample content, to obtain an adjusted classification model;

[0020] a second classification unit configured to classify the annotated sample content using the adjusted classification model to obtain an actual content type corresponding to the annotated sample content;

[0021] An updating unit is configured to update the parameters of the classification module in the adjusted classification model according to the actual content type corresponding to the annotated sample content and the expected content type corresponding to the annotated sample content, to obtain a target classification model, wherein the target classification model is used to classify the content to be processed and obtain the content type of the content to be processed.

[0022] In some embodiments, in some embodiments, in some embodiments, in some embodiments, in some embodiments, in some embodiments, in some embodiments, in some embodiments, in some embodiments, in some embodiments, in some embodiments, in some embodiments, in some embodiments, an electronic device provided in an embodiment of the present application includes a processor and a memory, the memory stores computer-executable instructions, and the processor loads the computer-executable instructions to execute the classification model training method provided in an embodiment of the present application.

[0023] An embodiment of the present application also provides a computer-readable storage medium having computer-executable instructions stored thereon, wherein the computer-executable instructions, when executed by a processor, implement the classification model training method provided in an embodiment of the present application.

[0024] An embodiment of the present application also provides a computer program product, including computer-executable instructions, which, when executed by a processor, implement the classification model training method provided in the embodiment of the present application.

[0025] The present application can mine the target sample content used for target task training by annotating the sample content, thereby greatly increasing the number of samples used for training. This can improve the efficiency of obtaining training samples, and there is no need to annotate all training samples, which greatly improves the training efficiency and reduces the training cost. In addition, the present application can also perform multi-stage training and learning, first adjusting the overall parameters of the model based on the mined target sample content, and then using the annotated sample content to adjust the parameters of the classification module. This multi-stage progressive learning method can enable the model to converge better, so that the classification accuracy of the trained target classification model is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0027] FIG1a is a schematic diagram of a scenario of a classification model training method provided in an embodiment of the present application;

[0028] FIG1b is a flow chart of a classification model training method provided in an embodiment of the present application;

[0029] FIG1c is an illustration of a classification model training method provided in an embodiment of the present application;

[0030] FIG1d is another illustration of the classification model training method provided in an embodiment of the present application;

[0031] FIG1e is another illustration of the classification model training method provided in an embodiment of the present application;

[0032] FIG1f is another illustration of the classification model training method provided in an embodiment of the present application;

[0033] FIG1g is another illustration of the classification model training method provided in an embodiment of the present application;

[0034] FIG1h is another illustration of the classification model training method provided in an embodiment of the present application;

[0035] FIG1i is another illustration of the classification model training method provided in an embodiment of the present application;

[0036] FIG1j is another illustration of the classification model training method provided in an embodiment of the present application;

[0037] FIG1k is another illustration of the classification model training method provided in an embodiment of the present application;

[0038] FIG2 is another flow chart of the classification model training method provided in an embodiment of the present application;

[0039] FIG3 is a schematic diagram of the structure of a classification model training device provided in an embodiment of the present application;

[0040] FIG4 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.

[0042] The present invention provides a classification model training method and related equipment, which may include a classification model training device, an electronic device, a computer-readable storage medium, and a computer program product. The classification model training device can be integrated into an electronic device, which can be a terminal or a server.

[0043] It is understandable that the classification model training method of this embodiment can be executed on the terminal, on the server, or jointly by the terminal and the server. The above examples should not be understood as limiting the present application.

[0044] As shown in Figure 1a, a classification model training method is performed jointly by a terminal and a server. The classification model training system provided in the embodiment of the present application includes a terminal 10 and a server 11, etc. The terminal 10 and the server 11 are connected via a network, such as a wired or wireless network connection, wherein the classification model training device can be integrated into the server.

[0045] The server 11 can be configured to: obtain at least one original sample content and annotated sample content, and obtain a classification model, wherein the annotated sample content carries its corresponding expected content type, and the classification model includes a feature extraction module and a classification module; based on the expected content type corresponding to the annotated sample content and at least one content tag corresponding to the annotated sample content, select at least one target sample content from the original sample content and construct the expected content type corresponding to the target sample content; classify the target sample content using the classification model to obtain the actual content type corresponding to the target sample content; adjust the parameters of the feature extraction module and the classification module in the classification model based on the actual content type and the expected content type corresponding to the target sample content to obtain an adjusted classification model; classify the annotated sample content using the adjusted classification model to obtain the actual content type of the annotated sample content; and update the parameters of the classification module in the adjusted classification model based on the actual content type and the expected content type of the annotated sample content to obtain a target classification model. The server 11 can be a single server or a server cluster or cloud server consisting of multiple servers. The classification model training method or device disclosed in this application, wherein multiple servers can be composed into a blockchain, and the servers are nodes on the blockchain.

[0046] The terminal 10 can be configured to receive a trained target classification model sent by the server 11. The target classification model is used to classify the content to be processed and determine the content type of the content to be processed. The terminal 10 can include a mobile phone, an intelligent voice interaction device, a smart home appliance, an in-vehicle terminal, an aircraft, a tablet computer, a laptop computer, or a personal computer (PC). The terminal 10 can also be configured with a client, which can be an application client or a browser client.

[0047] The steps such as model training performed in the server 11 may also be executed by the terminal 10 .

[0048] The classification model training method provided in the embodiments of the present application relates to natural language processing and machine learning in the field of artificial intelligence.

[0049] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive field of computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making. AI technology is an interdisciplinary discipline encompassing a wide range of fields, encompassing both hardware and software technologies. AI software technologies primarily include computer vision, speech processing, natural language processing, machine learning / deep learning, autonomous driving, and smart transportation.

[0050] Natural language processing (NLP) is a key area of ​​research in computer science and artificial intelligence. It studies the theories and methods that enable effective communication between humans and computers using natural language. Natural language processing integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language we use in everyday life—and is closely linked to the study of linguistics. Natural language processing technologies typically include text processing, semantic understanding, machine translation, robotic question answering, and knowledge graphs.

[0051] Machine learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0052] It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.

[0053] This embodiment will be described from the perspective of a classification model training device, which can be integrated into an electronic device, such as a server or a terminal.

[0054] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0055] As shown in Figure 1b, the specific process of the classification model training method can be as follows:

[0056] 101. Obtain at least one original sample content and annotated sample content, and obtain a classification model, wherein the annotated sample content carries its corresponding expected content type, and the classification model includes a feature extraction module and a classification module.

[0057] The classification model may be a neural network model, which may be of various types, such as a bidirectional encoder representation model (Bert), a long short-term memory network (LSTM), a bidirectional long short-term memory network (BiLSTM), etc. It should be noted that the above examples should not be construed as limiting the classification model.

[0058] Specifically, an original training sample set can be obtained, which may include a first number of original sample contents, which are rough data that have not been labeled. In addition, a labeled training sample set can be obtained based on the target classification task, which may include a second number of labeled sample contents. The labeled sample contents may carry label information, which may be the expected content type of the labeled sample contents. The label information of the labeled sample contents may be obtained by manual labeling, and is label information with relatively high accuracy.

[0059] The target classification task can be to determine whether a piece of content belongs to a certain field (or type). For example, the target classification task can be to determine whether a piece of news belongs to the entertainment industry. The expected content type of the labeled sample content can be entertainment industry content type or non-entertainment industry content type.

[0060] The content here can be information in various content modes, such as video, audio, and text, and this embodiment does not limit this. For example, the original sample content or the annotated sample content can be long text content, that is, text content with a length greater than a preset text length. The preset text content can be set according to actual circumstances. It should be noted that the content mode of the original sample content and the annotated sample content should be consistent.

[0061] In a specific scenario, the first number is greater than the second number, and the difference between the two is greater than a preset number. Specifically, the first number is of a greater magnitude than the second number. Therefore, the annotated sample content can be referred to as a small sample relative to the original sample content. A small sample refers to a relatively small amount of annotated sample content.

[0062] In recent years, there has been considerable research on training methods for small samples. However, current classification tasks with small samples present several challenges, such as the conflict between the small amount of training data and the large number of parameters to be trained. Specifically, when transitioning from a pre-trained model based on massive amounts of data to transfer learning from a small amount of small sample data, the data size gap is large. Due to the mismatch between the amount of data and the magnitude of the parameters to be trained, training convergence may not be smooth, and it may even be difficult to ensure effective convergence of the training parameters, resulting in poor model classification performance.

[0063] This application can provide a small sample training scheme for parameter and data transition learning for classification domain tasks. This scheme is a multi-stage progressive training scheme, and its training goal needs to focus on a single domain classification task.

[0064] The logic of multi-stage training of the present application can be specifically: step by step, the model training is focused on the small sample classification task. First, a pre-training task plan for classification can be constructed; secondly, the mining method is used to construct coarse-quality training data (i.e., the target sample content in the above embodiment), and the model full-parameter transfer learning is performed based on the mined coarse-quality training data; then the manually labeled small sample data (i.e., the labeled sample content in the above embodiment) is used to perform model full-parameter transfer learning, and finally, the manually labeled small sample data is used to perform local parameter transfer learning. The advantage of this is that, from the perspective of training sample data and training parameter quantity, the training convergence is gradual and progressive, and the training parameter quantity has a good match with the effective training sample data, so that you can be more focused and focused on the early pre-training tasks, so that the training on the small sample labeled data in the later stage will have better convergence.

[0065] Among them, transfer learning specifically refers to using known model network structure and known model network parameters to fine-tune the parameters of several layers.

[0066] In one specific embodiment, as shown in Figure 1c, the system framework of the classification model training method provided by this application is shown. This system framework primarily includes a long text data preprocessing module, a feature extraction block, a self-pretrained classification task module, and a small sample classification training task module. The feature extraction block may include a basic pretrained model text feature extraction module, a convolutional neural network text feature extraction module, and a feature fusion module. The long text data preprocessing module and the feature extraction block may be collectively referred to as a feature extraction module.

[0067] Among them, the input of this embodiment is the corpus data of long text, which is manifested as constructed rough supervision data (i.e. target sample content) and manually annotated supervision data (i.e. annotated sample content) in different training steps. After the long text data preprocessing module, the input data of the core feature extraction block is obtained, wherein the feature extraction block includes two submodules: one is the basic pre-training model text feature extraction module, which as a basic pre-training module can be based on the transformer structure; the other is the convolutional neural network text feature extraction module of the text convolutional neural network model. The convolutional neural network text feature extraction module plays a complementary role. The text length supported by the text input based on the transformer structure is currently 512, but the length of long text is often higher than this value, so a text convolutional neural network model that can support long text is combined to extract text features; then the feature information extracted by these two submodules is subjected to feature fusion through a feature fusion module. Finally, different task classification layers are connected in different training stages. In the self-pretraining stage, the self-pretraining classification task module is adopted. In the small sample classification task stage of the subsequent stage, the small sample classification training task module is adopted. The module parameters within the dotted line in Figure 1c are the parameters to be trained.

[0068] The text convolutional neural network model is a convolutional neural network model that can be used for text classification. The core idea of ​​the text convolutional neural network model is to use multiple convolution kernels of different sizes to extract key information from sentences (similar to the N-gram model with multiple window sizes), thereby better capturing local correlations.

[0069] In some embodiments, obtaining a classification model in step 101 can be achieved through the following technical solutions: obtaining a preset classification task model, and obtaining positive content labels and negative content labels of the original sample content, the preset classification task model including a preset feature extraction module and a preset task module; extracting the target feature information of the original sample content through the preset feature extraction module; and calculating the positive similarity between the target feature information and the positive content label, and the negative similarity between the target feature information and the negative content label through the preset task module; adjusting the parameters of the preset classification task model based on the positive similarity and the negative similarity to obtain a trained preset classification task model, the trained preset classification task model including a trained feature extraction module and a task module; constructing a classification model based on the preset classification module and the trained feature extraction module. Through the embodiments of the present application, feature extraction capabilities can be learned in the pre-training stage, so that the feature extraction capabilities learned in the pre-training stage can be applied to the classification model later.

[0070] As an example, training a preset classification task model, referred to as "constructing a pre-training task solution for classification," falls into the self-pretraining phase. Self-pretraining specifically refers to pre-training on self-data based on a publicly available basic training model. The preset classification task model is specifically the model involved in the self-pretraining phase. It includes a preset feature extraction module and a preset task module. The preset feature extraction module is the feature extraction module used in the self-pretraining phase, while the preset task module is the self-pretraining classification task module shown in Figure 1c.

[0071] After training the preset classification task model, you can use the feature extraction module in the trained classification task model and add a preset classification module to build a classification model. This newly added classification module is the small sample classification training task module shown in Figure 1c. The data input terminal of the newly added classification module is the data output terminal of the feature extraction module.

[0072] In some embodiments, the above-mentioned acquisition of at least one positive content label and negative content label corresponding to the original sample content can be achieved through the following technical solutions: performing keyword extraction on the original sample content to obtain a positive content label for the original sample content under at least one content category; for each content category, selecting at least one negative content label for the original sample content under the content category from the label set of the content category, wherein the label set of a certain content category includes all content labels under the content category.

[0073] As an example, the positive content label is the real content label of the original sample content, and the negative content label is the non-real content label of the original sample content.

[0074] For example, each content category can correspond to one or more content tags. There are multiple content categories, which can be set based on actual circumstances. For example, content categories can include non-entities, place names, personal names, organization names, product names, work entity names, time, literary works, and other entities. Non-entity content categories can include content tags such as divorce_emotion, love_emotion, and decoration_home.

[0075] In some embodiments, the above-mentioned calculation of the positive similarity between the target feature information and the positive example content label, and the negative similarity between the target feature information and the negative example content label, can be achieved through the following technical solutions: calculating the first vector distance between the target feature information and the feature information of the positive example content label; determining the positive similarity between the target feature information and the positive example content label based on the first vector distance; calculating the second vector distance between the target feature information and the feature information of the negative example content label; determining the negative similarity between the target feature information and the negative example content label based on the second vector distance. Through the embodiments of the present application, vectors can be used to quantify similarity, thereby improving the learning effect of the pre-training stage.

[0076] For example, the positive example similarity is negatively correlated with the first vector distance: the larger the first vector distance, the smaller the positive example similarity; conversely, the smaller the first vector distance, the greater the positive example similarity. The negative example similarity is negatively correlated with the second vector distance: the smaller the second vector distance, the greater the negative example similarity; conversely, the larger the second vector distance, the smaller the negative example similarity.

[0077] In some embodiments, since the number of parameters of the "basic pre-training model text feature extraction module" is relatively large, an open source pre-trained model can be used to load the parameters. On this basis, further pre-training is constructed for the final classification task. This step can be called self-pretraining. For self-pretraining, a preset classification task model can be constructed. The preset classification task model can include a preset feature extraction module and a preset task module. The preset task module is the self-pretraining classification task module. It should be noted that the training object of self-pretraining is not only the parameters of the "basic pre-training model text feature extraction module" in the preset feature extraction module, but also includes the parameters of other modules in the preset feature extraction module and the preset task module.

[0078] As an example, the corresponding self-pretraining task can be constructed based on the original sample content (i.e., rough data). The original sample content can be news text data. Based on a large amount of news text data, keyword extraction can be performed to obtain multiple keyword labels corresponding to each article. These extracted keyword labels can be used as positive content labels corresponding to the article. Specifically, keyword labels can be divided into 9 categories (i.e., there are 9 content categories), namely non-entity, place name, person name, organization name, product name, work entity name, time, literary work, and other entities. Examples of content labels corresponding to each category of keyword labels can be shown in Table 1, in the format of "label_common category".

[0079] Table 1

[0080] Based on the frequency of occurrence of various words in news scenarios, we select Ntag tags. For example, Ntag can be on the order of 100,000. Specifically, the structure of the self-pretrained classification task module is shown in Figure 1d. It includes subtask modules for nine content categories. Each subtask module corresponds to a training task, and each content category has a tag pool (or tag set). The number of tags in the tag pool for each content category can be denoted as Ntag1, Ntag2, ..., Ntag9, respectively.

[0081] For example, the input data for the pre-trained classification task module can include the target feature information (e.g., doc_feat) of the original sample content output by the preset feature extraction module, as well as the positive and negative content labels for the original sample content under various content categories output by the label preparation module, label_tag. Positive content labels can be derived from keyword extraction results from the original sample content, while negative content labels can be sampled from a pool of similar labels.

[0082] Figure 1e shows the structure of the self-pretraining task, which illustrates the details of each subtask module. Specifically, each subtask module can obtain target feature information of the original sample content, and the feature size of the final output target feature information can be set to outfeat_size = 512. In addition, each subtask module can also obtain the positive and negative content labels of the original sample content in its corresponding content category from the label preparation module.

[0083] The label preparation module includes text keywords and sampled negative content labels. The typical number of negative content labels can range from Nneg_tags∈[64, 256]. Based on the label preparation module label_tag, the acquired content labels can be converted into corresponding IDs (identities). Then, the tag vector of the ID is queried through the tag_lookup_table tag lookup table. The matrix shape of the tag lookup table is [Ntag, outfeat_size], where Ntag refers to the total number of tags, that is, the magnitude of the entire tag lookup table. The vector size of each tag is consistent with the feature size outfeat_size of the target feature information (denoted as featout). By querying the label lookup table, Nneg_tags+Npos_tags feature vectors of size outfeat_size can be obtained, that is, the feature information pos_emb corresponding to the positive content label and the feature information corresponding to the negative content label neg_emb can be obtained. Nneg_tags represents the number of negative content labels and Nneg_tags represents the number of positive content labels.

[0084] Based on the positive and negative content labels of the original sample content and the target feature information, the preset task module can use contrastive loss to calculate the loss. The specific calculation process is shown in formula (1):

[0085] Among them, Y represents the positive or negative of the label, the positive content label Y = 1, the negative content label Y = 0. m is the set threshold, typically For example, the number of content tags is N=Nneg_tags+Npos_tags; D represents the vector distance value between the feature vector of each content tag and featout. Specifically, the vector distance can be calculated using Euclidean distance.

[0086] In some embodiments, the preset task module includes a subtask module corresponding to at least one content category; the positive content label includes the positive content label under each content category; the negative content label includes the negative content label under each content category; the above-mentioned calculation of the positive similarity between the target feature information and the positive content label, and the negative similarity between the target feature information and the negative content label through the preset task module can be achieved through the following technical solution: for each content category, the positive similarity between the positive content label under the content category and the target feature information, and the negative similarity between the negative content label under the content category and the target feature information are calculated through the subtask module corresponding to the content category; the above-mentioned adjustment of the parameters of the preset classification task model based on the positive similarity and the negative similarity to obtain the trained classification task model can be achieved through the following technical solution: based on the positive similarity and the negative similarity, the sub-loss function corresponding to the content category is determined; according to the sub-loss function corresponding to each content category, the parameters of the preset classification task model are adjusted to obtain the trained classification task model. Through the embodiments of the present application, the learning of various content categories can be integrated, so that the trained classification task model can be compatible with various categories, thereby making the trained classification task model compatible.

[0087] In some embodiments, the sub-loss functions corresponding to each content category can be fused to obtain a total loss function, and the fusion method can be weighted summation, etc.; then, based on the total loss function, the parameters of the preset feature extraction module and each sub-task module in the preset classification task model are adjusted.

[0088] 102. Based on the expected content type corresponding to the annotated sample content and at least one content tag corresponding to the annotated sample content, select at least one target sample content from the original sample content, and construct the expected content type corresponding to the target sample content.

[0089] As an example, at least one original sample content can be selected from the original training sample set as the target sample content required for the target classification task based on the mapping relationship between the expected content type corresponding to the annotated sample content and at least one content label corresponding to the annotated sample content. The selected target sample content can be used as rough data for training the target classification task, and the annotated sample content can be used as precise data for training the target classification task.

[0090] Generally speaking, there are two parts of data. One part is the data used for self-pre-training construction - the original sample content and its content labels, etc. The other part is a small amount of manually labeled sample data - the labeled sample content, which can be directly used for training target classification tasks.

[0091] Specifically, based on the feature extraction module obtained from the pre-training, a classification module is added according to the actual task. Since the parameters of the classification module are randomly initialized, this part can construct rough data for training. The construction method can be to use the overall module of the self-training stage to predict the labeled sample content, thereby determining the content label with a higher confidence level for the labeled sample content, and then mapping the content label of the labeled sample content to its expected content type label (i.e., the target task label) for the target classification task. Then, based on the data constructed from the pre-training, label-related sample extraction is performed, that is, the target sample content related to the content label of the labeled sample content is extracted from the original sample content, and the content label of the extracted target sample content is mapped to a new label, i.e., mapped to the corresponding content type. Then, the rough sample of the target classification task is constructed.

[0092] Determining a content label with a high confidence level for the labeled sample content may specifically include predicting the labeled sample content using the overall model obtained through pre-training to obtain a content prediction result, and determining a content label with a high confidence level based on the content prediction result.

[0093] In some embodiments, the content tag can be fine-grained tag information, and the label can be a relatively large-grained tag. For example, the expected content type of the labeled sample content can be that the labeled sample content is news belonging to the entertainment industry, and the content tag of the labeled sample content can be a star in the entertainment industry, such as its content tag can include "Star Zhao xx", "Actor Li xx", etc.

[0094] In some embodiments, in step 102, based on the expected content type corresponding to the annotated sample content and at least one content label corresponding to the annotated sample content, at least one target sample content is selected from the original sample content, and the expected content type corresponding to the target sample content is constructed. This can be achieved by the following technical solutions: obtaining the content label corresponding to the original sample content; establishing a mapping relationship between the expected content type corresponding to the annotated sample content and the content label corresponding to the annotated sample content; selecting the target sample content associated with the content label of the annotated sample content from the original sample content according to the content label corresponding to the original sample content; and constructing the expected content type of the target sample content based on the mapping relationship and the expected content type of the annotated sample content. Through the embodiments of the present application, the expected content type of the target sample content can be constructed through the association relationship, thereby obtaining a training sample with training value, thereby improving the training effect.

[0095] As an example, the content tag association mentioned here may mean that the similarity between the content tag of the original sample content and the content tag of the annotated sample content is greater than a preset similarity. The preset similarity can be set according to actual conditions. If the content tags are associated, the original sample content can be determined as the target sample content.

[0096] As an example, the expected content type of the annotated sample content associated with the content tag may be determined as the expected content type of the target sample content.

[0097] 103. Classify the target sample content using the classification model to obtain the actual content type corresponding to the target sample content.

[0098] In some embodiments, in step 103, the target sample content is classified by the classification model to obtain the actual content type corresponding to the target sample content, which can be achieved through the following technical solutions: the target sample content is subjected to feature extraction by the feature extraction module to obtain target feature information of the target sample content; and the actual content type of the target sample content is predicted based on the target feature information by the classification module.

[0099] As an example, a classification module can be used to determine the actual probability that the target sample content belongs to each preset content type based on the target feature information, thereby determining the actual content type of the target sample content based on the actual probability. The classification module can specifically be a support vector machine (SVM), a recurrent neural network, a fully connected deep neural network (DNN), etc., and this embodiment does not impose any restrictions on this.

[0100] As an example, the actual content type of the target sample content may specifically be the actual probability that the target sample content belongs to each preset content type.

[0101] In some embodiments, the target sample content includes at least one content segment, and the content segment includes at least one content unit; the above-mentioned feature extraction of the target sample content by the feature extraction module to obtain the target feature information of the target sample content can be achieved by the following technical solutions: the feature extraction module extracts key content from the target sample content to obtain a first content sequence; attention coding is performed on each content unit in the first content sequence to obtain attention coding feature information corresponding to each content unit in the first content sequence; content interception is performed on the target sample content to obtain a second content sequence; and based on the feature information of each content unit in the second content sequence, sequence feature coding is performed on the second content sequence to obtain sequence feature information; the attention coding feature information and the sequence feature information are fused to obtain the target feature information of the target sample content. Through the embodiments of the present application, target feature information with characterization capabilities can be obtained through attention coding processing, thereby improving the accuracy of feature extraction.

[0102] As an example, if the content modality of the target sample content is text modality, the content segment may be a text sentence in the target sample content, and the content unit may be a word or a character, which is not limited in this embodiment.

[0103] As an example, the Bert module in the feature extraction module can be used to perform attention encoding processing on each content unit in the first content sequence to obtain attention encoding feature information corresponding to each content unit in the first content sequence. Bert is an open source time series model based on the Transformer structure. Bert can be composed of multiple layers of bidirectional Transformers, typically 12 or 24 layers. Its training process can fully utilize contextual information, making the model more expressive.

[0104] Specifically, the Bert model uses the Transformer structure to perform multi-layer attention processing operations on each content unit in the first content sequence, thereby obtaining the attention encoding feature information of each content unit in the first content sequence. The attention encoding feature information contains both the semantic information of the content unit itself and the current contextual information.

[0105] In some embodiments, the feature extraction module may include a long text data preprocessing module and a feature extraction block; the long text data preprocessing module may be used to obtain a first content sequence (or a first identification sequence) and a second content sequence (or a second identification sequence); the feature extraction block may primarily consist of three parts: a basic pre-trained model text feature extraction module, a convolutional neural network text feature extraction module, and a feature fusion module. The basic pre-trained model text feature extraction module may be used to obtain attention encoding feature information corresponding to each content unit in the first content sequence; the convolutional neural network text feature extraction module may be used to obtain sequence feature information of the second content sequence; and the feature fusion module may be used to fuse the attention encoding feature information with the sequence feature information.

[0106] Figure 1f shows the structure of the feature extraction block. The basic pre-trained model text feature extraction module in the feature extraction block can obtain a first identifier sequence (length N1) from the long text data preprocessing module. Then, using a lookup table, it converts the first identifier sequence into corresponding feature information 1. Through processing in the positional encoding layer and the transformer encoder layer, it obtains the attention encoding feature information corresponding to each content identifier in the first identifier sequence. The textCNN convolutional neural network text feature extraction module in the feature extraction block can obtain a second identifier sequence (length N2) from the long text data preprocessing module. Then, using a lookup table, it converts the second identifier sequence into corresponding feature information 2. After processing in the textCNN encoder layer, it obtains sequence feature information. Finally, the feature fusion module fuses the attention encoding feature information and sequence feature information to obtain and output the target feature information.

[0107] As an example, the first identification sequence includes the content identification of each content unit in the first content sequence, and the second identification sequence includes the content identification corresponding to each content unit in the second content sequence. The content identification can be numbering information, and the query table can include a mapping relationship between preset content identification and preset feature information.

[0108] In some embodiments, the above-mentioned extraction of key content from the target sample content by the feature extraction module to obtain the first content sequence can be achieved through the following technical solutions: the feature extraction module determines, for each content segment in the target sample content, the segment feature information of the content segment based on the feature information of each content unit in the content segment; the segment feature information of each content segment of the target sample content is integrated to obtain the global feature information of the target sample content; based on the similarity between the segment feature information of each content segment and the global feature information, at least one target content segment is selected from each content segment; and the first content sequence is determined based on the target content segment. Through the embodiments of the present application, a target content segment that can represent global content can be obtained.

[0109] As an example, the feature information of each content unit in the content segment can be queried to obtain the feature information of each content unit in the content segment; the segment feature information of the content segment can be a feature sequence composed of the feature information of each content unit in the content segment, or can be obtained by fusing the feature information of each content unit in the content segment (such as mean operation, etc.).

[0110] As an example, there are many ways to fuse the segment feature information of each content segment. For example, the fusion method may be a mean operation or the like.

[0111] As an example, the similarity between the segment feature information of each content segment and the global feature information can be measured using the vector distance between the two. The greater the vector distance, the lower the similarity; conversely, the smaller the vector distance, the greater the similarity. In some embodiments, content segments with similarities greater than a preset similarity can be identified as target content segments. In other embodiments, the content segments can be sorted by similarity, such as from largest to smallest, to obtain sorted content segments, and the first n content segments in the sorted content segments can be identified as target content segments.

[0112] As an example, the target content segment may be considered as a key content segment in the target sample content. Specifically, when the content modality of the target sample content is a text modality, the target content segment may be a key sentence in the target sample content.

[0113] In some embodiments, the key content extraction of the target sample content may include not only the extraction of key sentences (i.e., target content segments), but also the extraction of keywords (i.e., target content units); after obtaining the target content segments and target content units, the target content segments and target content units may be fused to obtain a first content sequence, and the fusion method may be splicing processing, etc.

[0114] In some embodiments, the above-mentioned key content extraction of the target sample content to obtain the first content sequence can be achieved through the following technical solutions: extracting key units of the target sample content to select at least one target content unit from the content units of the target sample content; extracting key fragments of the target sample content to select at least one target content fragment from the content fragments of the target sample content; and fusing the target content units and the target content fragments to obtain the first content sequence.

[0115] For example, key units and key fragments can express the core content of the target sample content. Extracting key units and key fragments from the target sample content is important for classifying the target sample content. If the content modality of the target sample content is text, key units can be keywords and key fragments can be key sentences.

[0116] As an example, for the extraction of key units, the frequency information of each content unit in the target sample content can be counted. In some embodiments, the content unit whose frequency information is greater than the preset frequency information is determined as the key unit, that is, determined as the target content unit; in other embodiments, the content units can be sorted according to the size of the frequency information, such as sorting from large to small according to the size of the frequency information to obtain sorted content units, and the first n content units in the sorted content units can be determined as the target content units.

[0117] In some embodiments, the above-mentioned attention encoding processing of each content unit in the first content sequence to obtain attention encoding feature information corresponding to each content unit in the first content sequence can be achieved through the following technical solutions: performing multi-head attention processing on each content unit in the first content sequence to obtain attention feature information corresponding to each content unit; performing residual connection and normalization processing on the attention feature information corresponding to each content unit to obtain processed attention feature information corresponding to each content unit; performing full connection processing on the processed attention feature information corresponding to each content unit to obtain attention encoding feature information corresponding to each content unit in the first content sequence.

[0118] As an example, multi-head attention processing is performed on each content unit in the first content sequence, specifically, multi-head attention processing is performed on feature information of each content unit in the first content sequence.

[0119] In some embodiments, the above-mentioned fully connected processing of the processed attention feature information corresponding to each content unit to obtain the attention coding feature information corresponding to each content unit in the first content sequence can be achieved through the following technical solution: fully connected processing of the processed attention feature information corresponding to each content unit to obtain the attention coding feature information corresponding to each content unit in the first content sequence; using the attention coding feature information as new feature information; returning to execute the step of performing multi-head attention processing on the feature information corresponding to each content unit to obtain the attention feature information corresponding to each content unit, and obtaining the attention coding feature information corresponding to each content unit in the first content sequence that meets the preset conditions.

[0120] As an example, the preset condition can be set according to actual conditions. For example, the preset condition can be that the number of repeated executions reaches a preset number, and the preset number can be 12 times.

[0121] In some embodiments, the above-mentioned attention encoding processing of each content unit in the first content sequence to obtain attention encoding feature information corresponding to each content unit in the first content sequence can be achieved through the following technical solutions: determining the initial feature information corresponding to each content unit in the first content sequence according to the mask information corresponding to the first content sequence; performing position encoding on each content unit in the first content sequence to obtain the position information corresponding to each content unit in the first content sequence; determining the feature information corresponding to each content unit based on the initial feature information and position information corresponding to each content unit; performing attention encoding processing on the feature information corresponding to each content unit to obtain attention encoding feature information corresponding to each content unit in the first content sequence.

[0122] As an example, the position information of the content unit may represent the position of the content unit in the first content sequence. For example, the position may be the beginning or the end.

[0123] As an example, if the content modality of the target sample content is text modality, the initial feature information of the content unit may be the word vector of the content unit.

[0124] As an example, the feature information corresponding to each content unit can be obtained by fusing its corresponding initial feature information and location information. There are many ways to fuse the initial feature information and location information corresponding to the content unit, which are not limited in this embodiment. For example, the fusion method can be splicing processing or weighted fusion.

[0125] In some embodiments, the above-mentioned determination of the initial feature information corresponding to each content unit in the first content sequence based on the mask information corresponding to the first content sequence can be achieved through the following technical solution: performing identifier mapping processing on each content unit in the first content sequence to obtain the content identifier corresponding to each content unit in the first content sequence; and performing a feature query on the content identifier in a preset mapping relationship set based on the mask information corresponding to the first content sequence to obtain the initial feature information corresponding to each content identifier, wherein the preset mapping relationship set includes a mapping relationship between preset content identifiers and preset feature information.

[0126] As an example, the value of the mask information of each content unit can be 0 or 1, where 0 indicates that the content unit is invalid and 1 indicates that the content unit is valid. For content units with a mask information value of 0, no feature query is required and their initial feature information can be considered 0.

[0127] In some embodiments, the basic pre-training model text feature extraction module can use the parameters of the roberta (Robustly optimized BERT approach) pre-training model to initialize the encoder structure parameters of the transformer.

[0128] As an example, sub-block ① of the feature extraction block in Figure 1f is the basic pre-training model text feature extraction module (Transformer). The Transformer structure is used here, where the input is pre-processed text information (denoted as the first identification sequence input idx 1), which contains two parts, namely input_ids and input_mask. Input_ids is the id sequence corresponding to the pre-processed text sequence (i.e., the first content sequence in the above embodiment). The correspondence between id and text characters is consistent with the configuration during Transformer pre-training. Input_mask is a sequence that marks valid input_ids. Its length is consistent with input_ids, both are N1, and the length N1 can be 512. The median value of the input_mask sequence is 0 / 1, which is used to indicate the validity of the input_ids at the corresponding position in the sequence.

[0129] Specifically, an embedding feature vector query is first performed on the input first identification sequence input idx 1. Here, the shape of the query table can be [vocab_size, emb_size] = [21168, 768], where vocab_size is the number of text characters contained in the query table, and emb_size is the size of the feature vector. The shape of the result obtained after the query can be [N1, emb_size]. After that, it passes through a typical position encoding layer in the Transformer, and the position parameters are added based on the original data. The output result shape after position encoding is [N1, emb_size]. Then, it is input into the transformer encoder module (i.e., the transform coding layer). The module contains Nlayer layer repeated submodules. The submodule structure is shown in Figure 1g, and specifically Nlayer = 12. After being processed by the transformer encoder module, the final output is a feature vector sequence result of a size of [N1, hidden_layer_size] (including the attention encoding feature information corresponding to each content unit in the first content sequence in the above embodiment), which is recorded as It should be noted that the length of the output sequence is the same as that of the input sequence, which is N1. There are N1 vectors of dimension hidden_layer_size in the sequence. Typically hidden_layer_size = 768, where the output vector corresponding to sequence position i is h i , h i That is, the attention encoding feature information corresponding to the content unit with sequence position i in the first content sequence.

[0130] Among them, the special position i=0 is the CLS layer (the character at position i=0 in the text sequence in the input stage is the tag [CLS]), and the feature vector corresponding to the CLS layer can be used as the overall semantic representation.

[0131] Figure 1g shows the structure of each submodule in the transformer encoder module. Each submodule includes Multi-Head Attention (multi-head attention processing), Add & Norm (residual connection and normalization processing), and Feed Forward (feedforward neural network) processing. The Feed-Forward layer specifically includes two fully connected layers and a nonlinear activation function ReLu.

[0132] In some embodiments, the above-mentioned content interception processing of the target sample content to obtain the second content sequence can be achieved through the following technical solutions: performing a forward interception operation on the target sample content to obtain the forward content of the target sample content; performing a backward interception operation on the target sample content to obtain the backward content of the target sample content; and fusing the forward content and the backward content to obtain the second content sequence.

[0133] For example, it can be considered that the information in the front and back parts of the target sample content is relatively important. Therefore, the front and back parts of the target sample content can be intercepted, and the length of the intercepted content can be set according to the actual situation. The forward interception operation mentioned above intercepts the front part of the target sample content, and the backward interception operation intercepts the back part of the target sample content.

[0134] As an example, there are multiple ways to fuse the forward content and the backward content. For example, the fusion method may be splicing to obtain a second content sequence.

[0135] In some embodiments, the above-mentioned sequence feature encoding processing of the second content sequence based on the feature information of each content unit in the second content sequence to obtain the sequence feature information can be achieved through the following technical solutions: performing identifier mapping processing on each content unit in the second content sequence to obtain the content identifier corresponding to each content unit in the second content sequence; performing feature query on each content identifier in a preset mapping relationship set based on the mask information corresponding to the second content sequence to obtain the feature information corresponding to each content identifier, wherein the preset mapping relationship set includes a mapping relationship between preset content identifiers and preset feature information; performing sequence feature encoding processing on the feature information corresponding to each content identifier to obtain the sequence feature information.

[0136] As an example, the value of the mask information of each content unit can be 0 or 1, where 0 indicates that the content unit is invalid and 1 indicates that the content unit is valid. For content units with a mask information value of 0, no feature query is required and their feature information can be considered as 0.

[0137] In the specific scenario, sub-block ② of the feature extraction block in Figure 1f is a convolutional neural network text feature extraction module (specifically, the TextCNN model). Its input is consistent with the input sequence token ID system of sub-block ①. Specifically, the length of the input sequence of sub-block ② is N2, with a typical upper limit of N2 being 2000. In this sub-block, its lookup table is shared with sub-block ①. Through the lookup table, the input sequence is encoded and output as a sequence of embedding feature vectors. The embedding feature size is defined as emb_size. Specifically, the shape of the resulting embedding feature vector sequence after the query is [N2, emb_size]. Then, the embedding feature vector sequence output from the previous step is encoded by the TextCNN encoder layer. Finally, a mapping layer, the TextCNN output emb module, is connected to the output emb module, which outputs sequence feature information with a shape of [1, hidden_layer_size]. The hidden_layer_size remains the same as the embedding size of sub-block ①, and the output sequence length is 1.

[0138] For example, if the text length restriction is not significant, the convolutional neural network text feature extraction module can be replaced with another classification network, the TextCNN classification network, which primarily supports feature extraction for long texts. Examples include the Hierarchical Attention Network (HAN), TextRNN, TextRCNN, and Fasttext. Specifically, the network selection can be based on the model's memory usage restrictions and the classification accuracy requirements for the application.

[0139] In some embodiments, the above-mentioned fusion processing of the attention encoding feature information and the sequence feature information to obtain the target feature information of the target sample content can be achieved through the following technical solutions: determining the target attention encoding feature information from the attention encoding feature information corresponding to each content unit in the first content sequence; fusing the target attention encoding feature information and the sequence feature information to obtain the content feature information of the target sample content; obtaining the target feature information of the target sample content according to a preset mapping matrix and the content feature information.

[0140] As an example, the target attention encoding feature information may be the largest one among the attention encoding feature information corresponding to each content unit of the first content sequence.

[0141] As an example, there are many ways to fuse the target attention encoding feature information and the sequence feature information. For example, the fusion processing method can be splicing processing.

[0142] After obtaining the content feature information, the preset mapping matrix and the content feature information may be multiplied to obtain target feature information of the target sample content.

[0143] In the specific scenario, the sub-block ③ of the feature extraction block in Figure 1f is the feature fusion module, and its input is divided into two parts. The first part is the feature vector of shape [N1, hidden_layer_size] generated by sub-block ①, which is recorded as The output vector corresponding to the sequence position i is h i The second part is the feature vector of shape [1, hidden_layer_size] generated by sub-block ②. The fusion method of the two is three parts. The first part is the CLS layer in [N1, hidden_layer_size] generated by sub-block ①, that is, the embedding of i=0, that is, h0, which can be recorded as feat0, and the shape of h0 is [1, hidden_layer_size]. The second part is calculated from [N1, hidden_layer_size] generated by sub-block ①, as shown in formula (2):

[0144] Among them, axis=0 can indicate row-by-row operation along the column direction of the array. Each column can be an h i , the whole formula specifically takes h i By calculating the above formula (2), we can get a vector with the shape of [1, hidden_layer_size], which is recorded as feat1.

[0145] The third part is the result of sub-block ② with a shape of [1, hidden_layer_size], which is recorded as feat2.

[0146] By fusing the results of these three parts, such as vector concatenation, we can get a feature feat with a shape of [1,3*hidden_layer_size] merge , specifically, the content feature information of the target sample content in the above embodiment.

[0147] Then the feature feat merge A preset mapping matrix with one parameter trainable: Multiply them together to get the final output feature doc_feat (i.e., the target feature information of the target sample content), as shown in formula (3): doc_feat = feat merge ×M project (3)

[0148] The shape of doc_feat is [1, outfeat_size], where outfeat_size is the feature size of the final output, typically outfeat_size = 512.

[0149] For the long text data preprocessing module, its system framework diagram is shown in Figure 1h. The long text data preprocessing module is an input preprocessing module, which mainly consists of two parts, each of which produces two parts of preprocessing results as input data in the feature extraction block in Figure 1f. These two parts are the first identification sequence (denoted as input idx 1) and the second identification sequence (denoted as input idx 2).

[0150] Specifically, the long text data preprocessing module is shown in Figure 1h. It consists of two parts: block ① and block ②. The output of block ① is input idx 1, and the output of block ② is input idx 2. The sequence lengths of the two are N1 and N2, respectively. Typically, N1 = 512 and N2 = 2000.

[0151] In block ①, the input text (i.e., sample content) is processed by two modules: keyword extraction and key sentence extraction. The purpose of these two modules is to extract the main feature information of the long text into a sequence of length N1 as much as possible. The keyword extraction can be obtained using the textRank algorithm, and the number of extracted words can be N. keyword , a typical N keyword =20, thus obtaining the text composed of keywords keyword .

[0152] The key sentence extraction is divided into three stages, as follows:

[0153] 1) First, the text is divided into sentences, that is, the long text is divided into multiple sentences, which can be expressed as D0 = [Sent1, Sent2, ..., Sent n ], D0 represents the sample content;

[0154] Then, we segment each sentence into words, and get a data format with multiple sentences and multiple words in each sentence. Assuming that there are n sentences, the result format is as follows:

[0155] where m1, m2, ...m nIt indicates the number of words in each sentence, which are not necessarily equal. D1 indicates the sample content.

[0156] 2) Query the word vector for each word through the preset word vector library. The preset word vector library can correspond to a dense high-dimensional floating-point vector of 200 dimensions for each Chinese word. After the vector query, the data D2 is obtained as follows:

[0157] where k1, k2, ...k j The number of vector query results for each sentence is not necessarily equal, and k and m for the corresponding sentence are not necessarily equal. If a word vector does not match the query, the word can be discarded. The number of sentences j and n is not necessarily equal. If all words in a sentence do not match the word vector, the sentence will be discarded. However, the corresponding relationship between j and n needs to be recorded.

[0158] Then, we average the word vectors within each sentence to get multiple sentence vectors. D3 = normal(avg(D2, axis = 1))[v1, v2, ..., vj]

[0159] Where normal is the vector normalization operation, so that the modulus of each vector has |v i | 2 =1; v1, v2, ..., vj are the segment feature information corresponding to each sentence.

[0160] 3) Similarity calculation and sorting

[0161] First, calculate the overall vector of the text (i.e., the global feature information in the above embodiment), as shown in formula (4): D doc =normal(avg(D3, axis=0))=U doc (4)

[0162] where |v doc | 2 =1,D doc Represents global feature information;

[0163] Then, similarity calculation is performed on each sentence vector (i.e., segment feature information) and the overall text vector. Cosin similarity can be used to calculate the similarity score of each sentence vector, as shown in formula (5):

[0164] where s i A floating-point scalar value representing the similarity score.

[0165] Sort the result Score, arrange the corresponding original sentences according to the sorting order, and extract the top N keysentSentences are key sentences, where N keysent The preset number of conditions can be met, so that the text text can be obtained based on the selected key sentences keysent .

[0166] The preset quantity condition can be shown as formula (6):

[0167] After the keyword extraction and key sentence extraction modules, the content needs to be processed by the splicing module. The splicing format of the splicing module can be: text1= <t>title <k>text keyword <s>text keysent , where the separator <t> <k> <s>Separate the title and the target content unit keyword and the target content segment keysent , where text1 is the first content sequence in the above embodiments.

[0168] In block ② of Figure 1h, if N2 is relatively large, truncation operation can be performed on the input text. The input text passes through the text truncation module. Specifically, when the text length of the input sample content < N2, no truncation operation is performed and it is directly passed through to the module output; when the text length of the input sample content > N2, truncation operation is required, specifically, it can be considered that the front and rear parts of the article have more important information, so two-way truncation can be performed at this stage, that is, part of the text is obtained by intercepting from the beginning of the text to the back, and part of the text is obtained by intercepting from the end of the text to the front. In some embodiments, the forward ratio can be 0.7, then the backward ratio is 1 - 0.7 = 0.3; that is, the text obtained by forward interception can be expressed as text p = doc[:int(N2 * 0.7)] The text obtained by backward interception can be expressed as text b = doc[-int(N2 * 0.3):] Then the two are concatenated to obtain the text preprocessing result text2 of block ②, text2 = text p + text b .

[0169] Among them, text2 is the second content sequence in the above embodiments.

[0170] After the text preprocessing of block ① and block ② in Figure 1h is completed, it can pass through the token conversion module (i.e., the identification conversion module). The token conversion module performs tokenization operation on the text, that is, performs character-level id mapping on the text to obtain the id sequence of the input text, and at the same time obtains the mask sequence. The mask sequence is a 0 / 1 sequence used to identify the positions of valid character texts. Through the processing of the token conversion module on the first content sequence and the second content sequence, two parts of results, input idx 1 and input idx 2, are obtained respectively, which are used as the input of the feature extraction block.

[0171] 104. Based on the actual content type and the expected content type corresponding to the target sample content, adjust the parameters of the feature extraction module and the classification module in the classification model to obtain an adjusted classification model.

[0172] As an example, the adjustment of the parameters of the feature extraction module and the classification module may include the adjustment of the number of neurons in the feature extraction module and the classification module, and the adjustment of the connection weights and biases between neurons in each layer, etc.

[0173] As an example, the actual content type corresponding to the target sample content may be the actual probability of the target sample content in each preset content type, and the expected content type corresponding to the target sample content may be the expected probability of the target sample content in each preset content type.

[0174] In some embodiments, the training process is to first calculate the loss function between the actual probability and the expected probability, and then use the back propagation algorithm to adjust the parameters of the feature extraction module and the classification module. Based on the loss function, the parameters of the feature extraction module and the classification module are optimized so that the loss value between the actual probability and the expected probability is less than the preset loss value, thereby obtaining an adjusted classification model, wherein the preset loss value can be set according to actual conditions.

[0175] In some embodiments, a small amount of labeled sample content can be used to label the target sample content to construct rough data for model training, thereby ensuring the effectiveness of model training with a small amount of labeled information.

[0176] 105. Classify the labeled sample content using the adjusted classification model to obtain the actual content type of the labeled sample content.

[0177] As an example, after training the model using rough data, the model can be trained using labeled data with higher accuracy—labeled sample content.

[0178] In some embodiments, in step 105, the tagged sample content is classified by the adjusted classification model to obtain the actual content type of the tagged sample content, which can be achieved by the following technical solutions: the feature extraction module in the adjusted classification model is used to extract features of the tagged sample content to obtain target feature information of the tagged sample content; the classification module in the adjusted classification model is used to predict the actual content type of the tagged sample content based on the target feature information of the tagged sample content.

[0179] As an example, after the actual content type of the labeled sample content is predicted, only the parameters of the classification module may be adjusted based on the actual content type and the expected content type.

[0180] In some embodiments, before adjusting the parameters of the classification module based on the annotated sample content, the annotated sample content can be used to first adjust the parameters of the feature extraction module and the classification module, and finally the remaining annotated sample content can be used to further adjust the parameters of the classification module to obtain the final target classification model.

[0181] In some embodiments, before the above-mentioned classification processing of the annotated sample content by the adjusted classification model to obtain the actual content type of the annotated sample content, the following technical solution can also be executed: the annotated sample content is classified by the adjusted classification model to obtain the actual content type of the annotated sample content; according to the actual content type, the parameters in the feature extraction module and the classification module in the adjusted classification model are adjusted to obtain a readjusted classification model.

[0182] As an example, the model is trained using labeled sample content. At the data level, the training process can mix previously rough data (i.e., target sample content) with manually labeled data (i.e., labeled sample content). The rough data decays proportionally during training, ultimately reducing to zero. For example, the initial proportion of rough data could be 50%, and the proportion of rough data decreases by 10% after each epoch.

[0183] In some embodiments, before classifying the labeled sample content through the adjusted classification model in step 103 to obtain the actual content type of the labeled sample content, the following technical solution can also be executed: sample selection is performed from the target sample content and the labeled sample content, and at least one mixed training sample set is constructed based on the selected samples, and the corresponding proportions of the target sample content and the labeled sample content in each mixed training sample set are different; based on the corresponding proportions of each mixed training sample set, the training order of each mixed training sample set is determined; through the adjusted classification model, based on the training order, the sample content in each mixed training sample set is classified to obtain the actual content type of the sample content in each mixed training sample set; according to the actual content type, the parameters of the feature extraction module and the classification module in the adjusted classification model are readjusted to obtain a readjusted classification model.

[0184] For example, sample selection is performed from the target sample content and the labeled sample content, that is, sample selection is performed from the rough training sample set and the labeled training sample set. For example, the greater the proportion of target sample content in the mixed training sample set, the earlier the training order of the mixed training sample set is, and conversely, the smaller the proportion of target sample content in the mixed training sample set, the later the training order of the mixed training sample set is.

[0185] In some embodiments, the above-mentioned classification process of classifying the sample contents in each mixed training sample set based on the training sequence using the adjusted classification model to obtain the actual content type of the sample contents in each mixed training sample set can be achieved through the following technical solutions: determining the target mixed training sample set currently used for training according to the training sequence; classifying the sample contents in the target mixed training sample set using the adjusted classification model to obtain the actual content type of the sample contents in the target mixed training sample set; readjusting the parameters of the feature extraction module and the classification module in the adjusted classification model according to the actual content type to obtain the readjusted classification model can be achieved through the following technical solutions: readjusting the parameters of the feature extraction module and the classification module in the adjusted classification model according to the actual content type and the expected content type of the sample contents in the target mixed training sample set; selecting a new target mixed training sample set from each mixed training sample set according to the training sequence, returning to execute the step of classifying the sample contents in the target mixed training sample set using the adjusted classification model to obtain the actual content type of the sample contents in the target mixed training sample set, and obtaining the readjusted classification model.

[0186] In some embodiments, the above-mentioned readjustment of the parameters of the feature extraction module and the classification module in the adjusted classification model based on the actual content type and the expected content type of the sample content in the target mixed training sample set can be achieved through the following technical solutions: for each sample content in the target mixed training sample set, based on the actual content type and the expected content type of the sample content, the sub-loss function corresponding to the sample content is determined; the sub-loss functions corresponding to the sample contents in the target mixed training sample set are fused (there are various ways to fuse the sub-loss functions, such as weighted fusion, etc.), and the total loss function corresponding to the target mixed training sample set is determined; based on the total loss function, the parameters in the feature extraction module and the classification module in the adjusted classification model are adjusted.

[0187] 106. Update the parameters of the classification module in the adjusted classification model according to the actual content type and the expected content type of the labeled sample content to obtain a target classification model. The target classification model is used to classify the content to be processed to obtain the content type of the content to be processed.

[0188] As an example, the classification module is also known as the small sample classification task module. This module can be used during the actual classification business demand phase to perform classification training on small sample business data. This module primarily uses a small number of parameters. Figure 1i shows the structure of the small sample classification task module.

[0189] As an example, after the target feature information of the labeled sample content is extracted by the feature extraction module, it can be input into the classification module. The classification module can be embodied as the "classification function" module in Figure 1i. Through the "classification function" module, the actual probability of the labeled sample content belonging to each preset content type can be predicted. After obtaining the actual probability, the cross entropy loss function (Cross Entropy Loss) can be used to calculate the loss value, as shown in formula (7):

[0190] Where: yi represents the label of sample content i (i.e., the expected content type), the positive class is 1, and the negative class is 0; pi represents the actual probability that sample content i is predicted to be in the positive class; n represents the number of categories.

[0191] Among them, the calculation method of pi can be a sigmoid function, that is, the calculation process corresponding to the "classification function" module in Figure 1i can be shown as formula (8):

[0192] Among them, xi is the doc_feat vector, and θi is the training parameter of the classification function corresponding to each category.

[0193] Specifically, the logic of the multi-stage training of the small sample classification task training strategy proposed in the classification model training method of this application is to gradually focus the model training on the small sample classification task. First, a self-pre-training task plan for classification is constructed, and then a mining method is used to construct full-parameter transfer learning of coarse-quality training data, and then full-parameter transfer learning is performed using manually labeled small sample data, and finally local parameter transfer learning is performed using manually labeled small sample data. The specific approach is as follows:

[0194] S1. Self-pretraining stage: As shown in Figure 1j, this is the model structure diagram corresponding to the self-pretraining stage. The specific process of self-pretraining is as described in the previous embodiment and will not be repeated here. After the self-pretraining is completed, the structure and parameters within the dashed box, specifically the parameters of the feature extraction module, are taken as the self-pretrained model result.

[0195] S2. As shown in Figure 1k, the rough data training stage is shown. Based on step S1, the feature extraction module (gray box part) of the pre-trained module is obtained, and then the classification module (black box with thick lines) is added according to the actual task. Since the parameters of the classification module are randomly initialized, this part can construct rough data for training. For the method of constructing rough samples of the target task, please refer to the description of the above embodiment and will not be repeated here.

[0196] Then, the entire model of the structure in FIG1k can be trained based on the rough sample, and the training parameter range is the parameters of the structure within the dotted line.

[0197] In step S3, the previous step, S2, uses rough data to train the model's classification module parameters to a certain degree of convergence. Next, training is performed using labeled data. At the data level, this step can mix the previously rough data with manually labeled data. The rough data is decayed during training, eventually reducing to zero. For example, the initial proportion of rough data could be 50%, decreasing by 10% after each epoch. The parameter training range is the range enclosed by the dashed box in Figure 1k.

[0198] S4. At the end of training in step S3, only annotated data remains. This data is relatively small, and the parameters within the dashed boxes are large. In this step, the parameters within the gray boxes in Figure 1k are frozen and set to a non-trainable state. Only the parameters within the bold black boxes are trained, which have a relatively small number of parameters. Final training is performed using the annotated data to obtain the final classification model for the target task.

[0199] The classification model training method provided in this application can achieve better results in long text classification based on a small number of labeled samples.

[0200] Specifically, this application proposes a neural network text feature extraction framework that can well support feature extraction and classification task training of long texts. It is based on the transformer model and combined with textcnn, using the long text characteristics of textcnn as a supplement to the transformer, optimizing the problem of insufficient support for long text sequences of the transformer, and improving the model's classification and understanding ability of long texts.

[0201] This application also proposes a pre-training scheme for classification tasks. This pre-training scheme uses fine-grained classification, which can be easily transferred to other classification tasks. The pre-training tasks cover a variety of classification systems, enabling the pre-trained model to better cope with a variety of practical classification tasks. The model structure also pre-trains the initialization parameters of the TextCNN. These parameters are adjusted based on the classification task, allowing for rapid convergence on new task data.

[0202] Specifically, the features extracted by the transformer model are combined with those extracted by a text classification model, such as TextCNN, to obtain text features. Based on these features, self-pretraining is performed. This pretraining task is mainly targeted at classification tasks, using a nine-category labeling task architecture. Pretraining is performed on a large scale of common, fine-grained label words, combined with a large amount of readily available news data, to obtain a pretrained model for this application.

[0203] In addition, the present application also proposes a training scheme for data stage training and parameter stage training. First, a large amount of unlabeled rough supervision data based on mining is used. After loading based on open source parameters, further self-pretraining is performed to train the global parameters (including pre-training parameters and task module parameters) with a large amount of data. Secondly, a new classification module is added, and then a rough target task is constructed based on the labeled data and the pre-training model for training. Again, a small amount of labeled data is used for normal global parameter finetuning training. Finally, the pre-training parameters are frozen (the number of parameters is large), and only a small number of newly added classification layer parameters are trained to match the small amount of parameters corresponding to the small data. Through a multi-stage progressive learning method, the target classification task is gradually converged, and finally it can converge well on the training data of a small sample, so as to achieve better and more usable accuracy and recall.

[0204] This application solves the cumbersome process of conventional data labeling, transforming the original process (demand-side standard refinement, outsourcing bidding, labeling training, data labeling, delivery review, multiple rounds of iteration to complete data labeling, and algorithm learning) into a process where the demand-side labels a small number of samples and learns the algorithm according to its own needs. The original process often has a long cycle, many participants, high costs, and low efficiency. This application can greatly improve efficiency and reduce costs.

[0205] This application can be mainly applied to the automatic classification system of long texts such as news and self-media information. It can help with interest-oriented content distribution, the construction and maintenance of interest content pools in various categories, and the supplementation of materials for auxiliary content production, etc., to enhance the user experience of reading long texts. In the application app of information flow, building a corresponding classification system for text or adding interest tags can better describe the content of user interest. In order to solve the current cost issues of data annotation and communication efficiency issues in the annotation process, this application can quickly build the corresponding model with a smaller amount of annotation and achieve better results.

[0206] As can be seen from the above, this embodiment can obtain at least one original sample content and annotated sample content, and obtain a classification model, wherein the annotated sample content carries its corresponding expected content type, and the classification model includes a feature extraction module and a classification module; based on the expected content type corresponding to the annotated sample content and at least one content tag corresponding to the annotated sample content, at least one target sample content is selected from the original sample content, and the expected content type corresponding to the target sample content is constructed; the target sample content is classified by the classification model to obtain the actual content type corresponding to the target sample content; based on the actual content type and the expected content type corresponding to the target sample content, the parameters of the feature extraction module and the classification module in the classification model are adjusted to obtain an adjusted classification model; the annotated sample content is classified by the adjusted classification model to obtain the actual content type of the annotated sample content; according to the actual content type and the expected content type of the annotated sample content, the parameters of the classification module in the adjusted classification model are updated to obtain a target classification model, which is used to classify the content to be processed and obtain the content type of the content to be processed. The present application can mine the target sample content used for target task training by annotating the sample content, thereby greatly increasing the number of samples used for training. This can improve the efficiency of obtaining training samples, and there is no need to annotate all training samples, which greatly improves the training efficiency and reduces the training cost. In addition, the present application can also perform multi-stage training and learning, first adjusting the overall parameters of the model based on the mined target sample content, and then using the annotated sample content to adjust the parameters of the classification module. This multi-stage progressive learning method can enable the model to converge better, so that the classification accuracy of the trained target classification model is higher.

[0207] According to the method described in the previous embodiment, the classification model training device will be further described in detail below by taking the example of being specifically integrated in a server.

[0208] The present application embodiment provides a classification model training method. As shown in FIG2 , the specific process of the classification model training method can be as follows:

[0209] 201. The server obtains at least one original sample content and annotated sample content, and obtains a classification model. The annotated sample content carries its corresponding expected content type. The classification model includes a feature extraction module and a classification module.

[0210] As an example, an original training sample set can be obtained, which may include a first amount of original sample content, which is rough data that has not been labeled. In addition, a labeled training sample set can be obtained based on the target classification task, which may include a second amount of labeled sample content. The labeled sample content may carry label information, which may be the expected content type of the labeled sample content. The label information of the labeled sample content may be obtained by manual labeling, and is label information with relatively high accuracy.

[0211] For example, the first quantity is greater than the second quantity, and the difference between the first quantity and the second quantity is greater than a predetermined quantity. Specifically, the first quantity is greater than the second quantity. Therefore, the annotated sample content can be referred to as a small sample relative to the original sample content. A small sample refers to a relatively small amount of annotated sample content.

[0212] In some embodiments, obtaining the classification model in step 201 can be achieved through the following technical solutions: obtaining a preset classification task model, and obtaining the positive content label and the negative content label of the original sample content, the preset classification task model including a preset feature extraction module and a preset task module; extracting the target feature information of the original sample content through the preset feature extraction module; and calculating the positive similarity between the target feature information and the positive content label, and the negative similarity between the target feature information and the negative content label through the preset task module; adjusting the parameters of the preset classification task model based on the positive similarity and the negative similarity to obtain a trained classification task model, the classification task model including a trained feature extraction module and a task module; constructing a classification model based on the preset classification module and the trained feature extraction module.

[0213] For example, training a preset classification task model falls within the self-pretraining phase. Self-pretraining specifically refers to pretraining on your own big data based on a publicly available basic training model. The preset classification task model is specifically the model involved in the self-pretraining phase. It includes a preset feature extraction module and a preset task module. The preset feature extraction module is the feature extraction module used in the self-pretraining phase, while the preset task module is the self-pretrained classification task module.

[0214] After the preset classification task model is trained, the feature extraction module in the trained classification task model can be used and a preset classification module can be added to construct a classification model. Specifically, the data input end of the newly added classification module is the data output end of the feature extraction module.

[0215] For example, each content category can correspond to one or more content tags. There are multiple content categories, which can be set based on actual circumstances. For example, content categories can include non-entities, place names, personal names, organization names, product names, work entity names, time, literary works, and other entities. For non-entity content categories, they can include content tags such as divorce_emotion, love_emotion, and decoration_home.

[0216] In some embodiments, the preset task module includes a subtask module corresponding to at least one content category; the positive content label includes the positive content label under each content category; the negative content label includes the negative content label under each content category; the above-mentioned calculation of the positive similarity between the target feature information and the positive content label, and the negative similarity between the target feature information and the negative content label through the preset task module can be achieved through the following technical solution: for each content category, the positive similarity between the positive content label under the content category and the target feature information, and the negative similarity between the negative content label under the content category and the target feature information are calculated through the subtask module corresponding to the content category; the above-mentioned adjustment of the parameters of the preset classification task model based on the positive similarity and the negative similarity to obtain the trained classification task model can be achieved through the following technical solution: based on the positive similarity and the negative similarity, the sub-loss function corresponding to the content category is determined; according to the sub-loss function corresponding to each content category, the parameters of the preset classification task model are adjusted to obtain the trained classification task model.

[0217] In some embodiments, the sub-loss functions corresponding to each content category can be fused to obtain a total loss function, and the fusion method can be weighted summation, etc.; then, based on the total loss function, the parameters of the preset feature extraction module and each sub-task module in the preset classification task model are adjusted.

[0218] 202. The server selects at least one target sample content from the original sample content based on the expected content type corresponding to the annotated sample content and at least one content tag corresponding to the annotated sample content, and constructs the expected content type corresponding to the target sample content.

[0219] As an example, at least one original sample content can be selected from the original training sample set as the target sample content required for the target classification task based on the mapping relationship between the expected content type corresponding to the annotated sample content and at least one content label corresponding to the annotated sample content. The selected target sample content can be used as rough data for training the target classification task, and the annotated sample content can be used as precise data for training the target classification task.

[0220] In some embodiments, in step 202, based on the expected content type corresponding to the annotated sample content and at least one content tag corresponding to the annotated sample content, at least one target sample content is selected from the original sample content, and the expected content type corresponding to the target sample content is constructed. This can be achieved through the following technical solutions: obtaining the content tag corresponding to the annotated sample content and the content tag corresponding to the original sample content; establishing a mapping relationship between the expected content type corresponding to the annotated sample content and the content tag corresponding to the annotated sample content; selecting, from the original sample content, target sample content associated with the content tag of the annotated sample content according to the content tag corresponding to the original sample content; and constructing the expected content type of the target sample content based on the mapping relationship and the expected content type of the annotated sample content.

[0221] As an example, the content tag association mentioned here may mean that the similarity between the content tag of the original sample content and the content tag of the annotated sample content is greater than a preset similarity. The preset similarity can be set according to actual conditions. If the content tags are associated, the original sample content can be determined as the target sample content.

[0222] As an example, the expected content type of the annotated sample content associated with the content tag may be determined as the expected content type of the target sample content.

[0223] 203. The server classifies the target sample content through the classification model to obtain the actual content type corresponding to the target sample content; based on the actual content type and expected content type corresponding to the target sample content, the server adjusts the parameters of the feature extraction module and the classification module in the classification model to obtain an adjusted classification model.

[0224] In some embodiments, in step 203, the target sample content is classified by the classification model to obtain the actual content type corresponding to the target sample content, which can be achieved through the following technical solutions: the target sample content is subjected to feature extraction by the feature extraction module to obtain target feature information of the target sample content; and the actual content type of the target sample content is predicted based on the target feature information by the classification module.

[0225] In some embodiments, the target sample content includes at least one content segment, and the content segment includes at least one content unit; the above-mentioned feature extraction of the target sample content by the feature extraction module to obtain the target feature information of the target sample content can be achieved through the following technical solutions: the feature extraction module extracts key content from the target sample content to obtain a first content sequence; attention coding is performed on each content unit in the first content sequence to obtain attention coding feature information corresponding to each content unit in the first content sequence; content interception is performed on the target sample content to obtain a second content sequence; and based on the feature information of each content unit in the second content sequence, sequence feature coding is performed on the second content sequence to obtain sequence feature information; the attention coding feature information and the sequence feature information are fused to obtain the target feature information of the target sample content.

[0226] In some embodiments, the above-mentioned extraction of key content from the target sample content by the feature extraction module to obtain the first content sequence can be achieved through the following technical solutions: through the feature extraction module, for each content segment in the target sample content, based on the feature information of each content unit in the content segment, the segment feature information of the content segment is determined; the segment feature information of each content segment of the target sample content is fused to obtain the global feature information of the target sample content; based on the similarity between the segment feature information of each content segment and the global feature information, at least one target content segment is selected from the content segments; and based on the target content segment, the first content sequence is determined.

[0227] As an example, the target content segment may be considered as a key content segment in the target sample content. Specifically, when the content modality of the target sample content is a text modality, the target content segment may be a key sentence in the target sample content.

[0228] In some embodiments, the key content extraction of the target sample content may include not only the extraction of key sentences (i.e., target content segments), but also the extraction of keywords (i.e., target content units); after obtaining the target content segments and target content units, the target content segments and target content units may be fused to obtain a first content sequence, and the fusion method may be splicing processing, etc.

[0229] In some embodiments, the above-mentioned attention encoding processing of each content unit in the first content sequence to obtain attention encoding feature information corresponding to each content unit in the first content sequence can be achieved through the following technical solutions: performing multi-head attention processing on each content unit in the first content sequence to obtain attention feature information corresponding to each content unit; performing residual connection and normalization processing on the attention feature information corresponding to each content unit to obtain processed attention feature information corresponding to each content unit; performing full connection processing on the processed attention feature information corresponding to each content unit to obtain attention encoding feature information corresponding to each content unit in the first content sequence.

[0230] In some embodiments, the above-mentioned content interception processing of the target sample content to obtain the second content sequence can be achieved through the following technical solutions: performing a forward interception operation on the target sample content to obtain the forward content of the target sample content; performing a backward interception operation on the target sample content to obtain the backward content of the target sample content; and fusing the forward content and the backward content to obtain the second content sequence.

[0231] For example, it can be considered that the information in the front and back parts of the target sample content is relatively important. Therefore, the front and back parts of the target sample content can be intercepted, and the length of the intercepted content can be set according to the actual situation. The forward interception operation mentioned above intercepts the front part of the target sample content, and the backward interception operation intercepts the back part of the target sample content.

[0232] As an example, there are multiple ways to fuse the forward content and the backward content. For example, the fusion method may be splicing to obtain a second content sequence.

[0233] 204. The server selects samples from the target sample content and the annotated sample content to construct at least one mixed training sample set, wherein the target sample content and the annotated sample content have different corresponding proportions in each mixed training sample set.

[0234] 205. The server determines the training order of each mixed training sample set based on the corresponding proportion of each mixed training sample set.

[0235] As an example, the greater the proportion of target sample content in the mixed training sample set, the earlier the training order of the mixed training sample set. Conversely, the smaller the proportion of target sample content in the mixed training sample set, the later the training order of the mixed training sample set.

[0236] 206. The server classifies the sample contents in each mixed training sample set using the adjusted classification model based on the training sequence to obtain the actual content type of the sample contents in each mixed training sample set.

[0237] 207. The server readjusts the parameters of the feature extraction module and the classification module in the adjusted classification model according to the actual content type to obtain a readjusted classification model.

[0238] In some embodiments, in step 206, the sample content in each mixed training sample set is classified based on the training sequence using the adjusted classification model to obtain the actual content type of the sample content in each mixed training sample set. This can be achieved by the following technical solution: according to the training sequence, a target mixed training sample set currently used for training is determined; according to the adjusted classification model, the sample content in the target mixed training sample set is classified to obtain the actual content type of the sample content in the target mixed training sample set; in step 207, according to the actual content type, the parameters of the feature extraction module and the classification module in the adjusted classification model are readjusted to obtain the readjusted classification model. This can be achieved by the following technical solution: according to the actual content type and the expected content type of the sample content in the target mixed training sample set, the parameters of the feature extraction module and the classification module in the adjusted classification model are readjusted; according to the training sequence, a new target mixed training sample set is selected from each mixed training sample set, and the step of classifying the sample content in the target mixed training sample set using the adjusted classification model to obtain the actual content type of the sample content in the target mixed training sample set is returned to execute, thereby obtaining the readjusted classification model.

[0239] In some embodiments, the above-mentioned readjustment of the parameters of the feature extraction module and the classification module in the adjusted classification model based on the actual content type and the expected content type of the sample content in the target mixed training sample set can be achieved through the following technical solutions: for each sample content in the target mixed training sample set, based on the actual content type and the expected content type of the sample content, the sub-loss function corresponding to the sample content is determined; the sub-loss functions corresponding to each sample content in the target mixed training sample set are merged to determine the total loss function corresponding to the target mixed training sample set; based on the total loss function, the parameters in the feature extraction module and the classification module in the adjusted classification model are adjusted.

[0240] There are many ways to fuse sub-loss functions, such as weighted fusion.

[0241] 208. The server classifies the labeled sample content using the readjusted classification model to obtain the actual content type of the labeled sample content.

[0242] 209. The server updates the parameters of the classification module in the readjusted classification model according to the actual content type and expected content type of the labeled sample content to obtain a target classification model. The target classification model is used to classify the content to be processed to obtain the content type of the content to be processed.

[0243] This application also proposes a pre-training scheme for classification tasks. This pre-training scheme uses fine-grained classification, which can be easily transferred to other classification tasks. The pre-training tasks cover a variety of classification systems, enabling the pre-trained model to better cope with a variety of practical classification tasks. The model structure also pre-trains the initialization parameters of the TextCNN. These parameters are adjusted based on the classification task, allowing for rapid convergence on new task data.

[0244] Specifically, the features extracted by the transformer model are combined with those extracted by a text classification model, such as TextCNN, to obtain text features. Based on these features, self-pretraining is performed. This pretraining task is mainly targeted at classification tasks, using a nine-category labeling task architecture. Pretraining is performed on a large scale of common, fine-grained label words, combined with a large amount of readily available news data, to obtain a pretrained model for this application.

[0245] This application also proposes a training scheme for data stage training and parameter stage training. First, a large amount of unlabeled rough supervision data based on mining is used. After loading based on open source parameters, further self-pretraining is performed to train the global parameters (including pre-training parameters and task module parameters) with a large amount of data. Secondly, a new classification module is added, and then a rough target task is constructed based on the labeled data and the pre-training model for training. Again, a small amount of labeled data is used for normal global parameter finetuning training. Finally, the pre-training parameters are frozen (the number of parameters is large), and only a small amount of newly added classification layer parameters are trained to match the small amount of parameters corresponding to the small data. Through a multi-stage progressive learning method, the target classification task is gradually converged, and eventually it can converge well on a small sample of training data, thereby achieving better accuracy and recall.

[0246] As can be seen from the above, this embodiment can obtain at least one original sample content and annotated sample content through the server, and obtain a classification model, the annotated sample content carries its corresponding expected content type, and the classification model includes a feature extraction module and a classification module; based on the expected content type corresponding to the annotated sample content and at least one content label corresponding to the annotated sample content, at least one target sample content is selected from the original sample content, and the expected content type corresponding to the target sample content is constructed; the target sample content is classified by the classification model to obtain the actual content type corresponding to the target sample content; based on the actual content type and the expected content type corresponding to the target sample content, the parameters of the feature extraction module and the classification module in the classification model are adjusted to obtain the adjusted classification model; samples are selected from the target sample content and the annotated sample content to construct at least one mixed training sample set, and the proportions of the target sample content and the annotated sample content in each mixed training sample set are different. Same; based on the corresponding proportion of each mixed training sample set, determine the training order of each mixed training sample set; through the adjusted classification model, based on the training order, classify the sample content in each mixed training sample set to obtain the actual content type of the sample content in each mixed training sample set; according to the actual content type, readjust the parameters of the feature extraction module and the classification module in the adjusted classification model to obtain the readjusted classification model; through the readjusted classification model, classify the labeled sample content to obtain the actual content type of the labeled sample content; according to the actual content type and expected content type of the labeled sample content, update the parameters of the classification module in the readjusted classification model to obtain the target classification model, and the target classification model is used to classify the content to be processed to obtain the content type of the content to be processed.

[0247] The present application can mine the target sample content used for target task training by annotating the sample content, thereby greatly increasing the number of training samples, which can improve the efficiency of obtaining training samples and eliminate the need to annotate all training samples, thereby greatly improving training efficiency and reducing training costs; in addition, the present application can also perform multi-stage training and learning, so that the model can converge better, and the classification accuracy of the target classification model obtained by training is higher.

[0248] The embodiment of the present application also provides a classification model training device, as shown in Figure 3, the classification model training device may include an acquisition unit 301, a selection unit 302, a first classification unit 303, an adjustment unit 304, a second classification unit 305 and an update unit 306. The acquisition unit 301 is configured to acquire at least one original sample content and annotated sample content, and acquire a classification model, wherein the annotated sample content carries its corresponding expected content type, and the classification model includes a feature extraction module and a classification module; the selection unit 302 is configured to select at least one target sample content from the original sample content based on the expected content type corresponding to the annotated sample content and at least one content label corresponding to the annotated sample content, and construct the expected content type corresponding to the target sample content; the first classification unit 303 is configured to classify the target sample content through the classification model to obtain the actual content type corresponding to the target sample content; the adjustment unit 304 is configured to classify the target sample content based on the target content. The parameters of the feature extraction module and the classification module in the classification model are adjusted according to the actual content type corresponding to the labeled sample content and the expected content type corresponding to the target sample content to obtain an adjusted classification model; the second classification unit 305 is configured to classify the labeled sample content through the adjusted classification model to obtain the actual content type corresponding to the labeled sample content; the updating unit 306 is configured to update the parameters of the classification module in the adjusted classification model according to the actual content type corresponding to the labeled sample content and the expected content type corresponding to the labeled sample content to obtain a target classification model, and the target classification model is used to classify the content to be processed to obtain the content type of the content to be processed.

[0249] In some embodiments, the acquisition unit may include a model acquisition subunit, a similarity calculation subunit, an adjustment subunit, and a model construction subunit. The model acquisition subunit is configured to acquire a preset classification task model and acquire the positive content label and negative content label of the original sample content. The preset classification task model includes a preset feature extraction module and a preset task module. The similarity calculation subunit is configured to extract the target feature information of the original sample content through the preset feature extraction module; and calculate the positive similarity between the target feature information and the positive content label, and the negative similarity between the target feature information and the negative content label through the preset task module. The adjustment subunit is configured to adjust the parameters of the preset classification task model based on the positive similarity and the negative similarity to obtain a trained preset classification task model. The trained preset classification task model includes a trained feature extraction module and a task module. The model construction subunit is configured to construct a classification model based on the preset classification module and the trained feature extraction module.

[0250] In some embodiments, the preset task module includes a subtask module corresponding to at least one content category; the positive content label includes the positive content label under each content category; the negative content label includes the negative content label under each content category; the similarity calculation subunit is specifically configured to calculate, for each content category, the positive similarity between the positive content label under the content category and the target feature information, and the negative similarity between the negative content label under the content category and the target feature information through the subtask module corresponding to the content category; the adjustment subunit is specifically configured to determine the sub-loss function corresponding to the content category based on the positive similarity and the negative similarity; according to the sub-loss function corresponding to each content category, adjust the parameters of the preset classification task model to obtain the trained classification task model.

[0251] In some embodiments, the selection unit may include a label acquisition subunit, an establishment subunit, a sample selection subunit, and a construction subunit. The label acquisition subunit is configured to acquire the content label corresponding to the original sample content; the establishment subunit is configured to establish a mapping relationship between the expected content type corresponding to the annotated sample content and the content label corresponding to the annotated sample content; the sample selection subunit is configured to select target sample content associated with the content label of the annotated sample content from the original sample content based on the content label corresponding to the original sample content; and the construction subunit is configured to construct the expected content type of the target sample content based on the mapping relationship and the expected content type of the annotated sample content.

[0252] In some embodiments, the first classification unit may include a feature extraction subunit and a prediction subunit. The feature extraction subunit is configured to extract features of the target sample content through the feature extraction module to obtain target feature information of the target sample content; the prediction subunit is configured to predict the actual content type of the target sample content based on the target feature information through the classification module.

[0253] In some embodiments, the target sample content includes at least one content segment, and the content segment includes at least one content unit. The feature extraction subunit is configured to extract key content from the target sample content through the feature extraction module to obtain a first content sequence; perform attention encoding processing on each content unit in the first content sequence to obtain attention encoding feature information corresponding to each content unit in the first content sequence; perform content interception processing on the target sample content to obtain a second content sequence; and based on the feature information of each content unit in the second content sequence, perform sequence feature encoding processing on the second content sequence to obtain sequence feature information; and fuse the attention encoding feature information and the sequence feature information to obtain target feature information of the target sample content.

[0254] In some embodiments, the feature extraction subunit is configured as follows: through the feature extraction module, for each content segment in the target sample content, based on the feature information of each content unit in the content segment, determine the segment feature information of the content segment; fuse the segment feature information of each content segment of the target sample content to obtain the global feature information of the target sample content; based on the similarity between the segment feature information of each content segment and the global feature information, select at least one target content segment from the content segments; and determine a first content sequence based on the target content segment.

[0255] In some embodiments, the feature extraction subunit is configured to: perform multi-head attention processing on each content unit in the first content sequence to obtain attention feature information corresponding to each content unit; perform residual connection and normalization processing on the attention feature information corresponding to each content unit to obtain processed attention feature information corresponding to each content unit; perform full connection processing on the processed attention feature information corresponding to each content unit to obtain attention coding feature information corresponding to each content unit in the first content sequence.

[0256] In some embodiments, the feature extraction subunit is configured to: perform a forward interception operation on the target sample content to obtain the forward content of the target sample content; perform a backward interception operation on the target sample content to obtain the backward content of the target sample content; and perform a fusion process on the forward content and the backward content to obtain a second content sequence.

[0257] In some embodiments, the feature extraction subunit is configured to: determine the target attention coding feature information from the attention coding feature information corresponding to each content unit in the first content sequence; fuse the target attention coding feature information and the sequence feature information to obtain the content feature information of the target sample content; and obtain the target feature information of the target sample content based on a preset mapping matrix and the content feature information.

[0258] In some embodiments, the classification model training device may further include a mixed sample set construction unit, a training sequence determination unit, a third classification unit, and a readjustment unit. The mixed sample set construction unit is configured to select samples from the target sample content and the annotated sample content to construct at least one mixed training sample set, wherein the target sample content and the annotated sample content in each mixed training sample set have different corresponding proportions; the training sequence determination unit is configured to determine the training order of each mixed training sample set based on the corresponding proportions of each mixed training sample set; the third classification unit is configured to classify the sample content in each mixed training sample set based on the training sequence through the adjusted classification model to obtain the actual content type of the sample content in each mixed training sample set; the readjustment unit is configured to readjust the parameters of the feature extraction module and the classification module in the adjusted classification model according to the actual content type to obtain the readjusted classification model.

[0259] In some embodiments, the readjustment unit may include a readjustment subunit and a loop subunit. The readjustment subunit is configured to readjust the parameters of the feature extraction module and the classification module in the adjusted classification model according to the actual content type and expected content type of the sample content in the target mixed training sample set; the loop subunit is configured to select a new target mixed training sample set from each mixed training sample set according to the training order, return to execute the step of classifying the sample content in the target mixed training sample set using the adjusted classification model to obtain the actual content type of the sample content in the target mixed training sample set, and obtain the readjusted classification model.

[0260] From the above, it can be seen that the present application can mine the target sample content used for target task training by annotating the sample content, thereby greatly increasing the number of samples used for training, which can improve the efficiency of obtaining training samples and does not require all training samples to be annotated, thereby greatly improving the training efficiency and reducing the training cost; in addition, the present application can also perform multi-stage training and learning, first adjusting the overall parameters of the model based on the mined target sample content, and then using the annotated sample content to adjust the parameters of the classification module. Such a multi-stage progressive learning method can enable the model to converge better, so that the classification accuracy of the trained target classification model is higher.

[0261] The present application also provides an electronic device, as shown in FIG4 , which shows a schematic diagram of the structure of the electronic device involved in the present application embodiment. The electronic device may be a terminal or a server, etc. Specifically:

[0262] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device structure shown in FIG4 does not limit the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0263] Processor 401 is the control center of the electronic device. It connects all parts of the electronic device using various interfaces and circuits. It performs various functions of the electronic device and processes data by running or executing software programs and / or modules stored in memory 402 and accessing data stored in memory 402. Processor 401 may include one or more processing cores; preferably, processor 401 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 401.

[0264] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0265] The electronic device also includes a power supply 403 for supplying power to various components. Preferably, the power supply 403 can be logically connected to the processor 401 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 403 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.

[0266] The electronic device may further include an input unit 404, which may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0267] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application programs stored in the memory 402, thereby implementing the classification model training method provided in the embodiment of the present application.

[0268] The present application can mine the target sample content used for target task training by annotating the sample content, thereby greatly increasing the number of samples used for training. This can improve the efficiency of obtaining training samples, and there is no need to annotate all training samples, which greatly improves the training efficiency and reduces the training cost. In addition, the present application can also perform multi-stage training and learning, first adjusting the overall parameters of the model based on the mined target sample content, and then using the annotated sample content to adjust the parameters of the classification module. This multi-stage progressive learning method can enable the model to converge better, so that the classification accuracy of the trained target classification model is higher.

[0269] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by computer-executable instructions, or by controlling related hardware through computer-executable instructions. The computer-executable instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0270] To this end, an embodiment of the present application provides a computer-readable storage medium, which stores a plurality of computer-executable instructions, which can be loaded by a processor to execute the steps in any one of the classification model training methods provided in the embodiment of the present application.

[0271] The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0272] Since the computer-executable instructions stored in the computer-readable storage medium can execute the steps in any classification model training method provided in the embodiments of the present application, the beneficial effects that can be achieved by any classification model training method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0273] Embodiments of the present application provide a computer program product comprising computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the methods provided in various optional implementations of the aforementioned classification model training.

[0274] The above is a detailed introduction to a classification model training method and related equipment provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.< / s> < / k> < / t> < / s> < / k> < / t>

Claims

1. A classification model training method, the method being performed by an electronic device, comprising: Acquire at least one original sample content and annotated sample content, and acquire a classification model, wherein the annotated sample content carries its corresponding expected content type, and the classification model includes a feature extraction module and a classification module; Based on the expected content type corresponding to the annotated sample content and at least one content tag corresponding to the annotated sample content, selecting at least one target sample content from the original sample content, and constructing the expected content type corresponding to the target sample content; Classifying the target sample content through the classification model to obtain the actual content type corresponding to the target sample content; Based on the actual content type corresponding to the target sample content and the expected content type corresponding to the target sample content, adjusting parameters of a feature extraction module and a classification module in the classification model to obtain an adjusted classification model; Classify the labeled sample content using the adjusted classification model to obtain the actual content type corresponding to the labeled sample content; According to the actual content type corresponding to the annotated sample content and the expected content type corresponding to the annotated sample content, the parameters of the classification module in the adjusted classification model are updated to obtain a target classification model, and the target classification model is used to classify the content to be processed to obtain the content type of the content to be processed.

2. The method according to claim 1, wherein: The selecting at least one target sample content from the original sample content based on the expected content type corresponding to the annotated sample content and at least one content tag corresponding to the annotated sample content, and constructing the expected content type corresponding to the target sample content, includes: Obtaining a content label corresponding to the original sample content; Establishing a mapping relationship between an expected content type corresponding to the annotated sample content and a content label corresponding to the annotated sample content; According to the content label corresponding to the original sample content, selecting target sample content associated with the content label of the marked sample content from the original sample content; Based on the mapping relationship and the expected content type of the annotated sample content, the expected content type of the target sample content is constructed.

3. The method according to claim 1 or 2, wherein: The obtaining of the classification model comprises: Obtaining a preset classification task model, and obtaining positive content labels and negative content labels of the original sample content, wherein the preset classification task model includes a preset feature extraction module and a preset task module; The target feature information of the original sample content is extracted by the preset feature extraction module; and the positive similarity between the target feature information and the positive example content label, and the negative similarity between the target feature information and the negative example content label are calculated by the preset task module; Based on the positive example similarity and the negative example similarity, adjusting the parameters of the preset classification task model to obtain a trained preset classification task model, wherein the trained preset classification task model includes a trained feature extraction module and a task module; The classification model is constructed based on the preset classification module and the trained feature extraction module.

4. The method according to claim 3, wherein: The preset task module includes at least one subtask module corresponding to a content category; the positive example content label includes positive example content labels under each content category; The negative example content labels include negative example content labels under each content category; The calculating, by the preset task module, the positive example similarity between the target feature information and the positive example content label, and the negative example similarity between the target feature information and the negative example content label, comprises: For each content category, by using a subtask module corresponding to the content category, a positive similarity between a positive content label under the content category and the target feature information, and a negative similarity between a negative content label under the content category and the target feature information are calculated; The adjusting the parameters of the preset classification task model based on the positive example similarity and the negative example similarity to obtain the trained classification task model includes: Determining a sub-loss function corresponding to the content category based on the positive example similarity and the negative example similarity; According to the sub-loss functions corresponding to each content category, the parameters of the preset classification task model are adjusted to obtain a trained classification task model.

5. The method according to any one of claims 1 to 4, wherein: Before classifying the labeled sample content by using the adjusted classification model to obtain the actual content type of the labeled sample content, the method further includes: Performing sample selection processing from the target sample content and the annotated sample content, and constructing at least one mixed training sample set based on the selected samples, wherein the target sample content and the annotated sample content in each mixed training sample set have different corresponding proportions; Determine the training order of each mixed training sample set based on the corresponding proportion of each mixed training sample set; Using the adjusted classification model, based on the training sequence, classify the sample contents in each mixed training sample set to obtain the actual content type of the sample contents in each mixed training sample set; According to the actual content type, the parameters of the feature extraction module and the classification module in the adjusted classification model are readjusted. Then, we get the re-adjusted classification model.

6. The method according to claim 5, wherein: The method of classifying the sample contents in each mixed training sample set based on the training sequence by using the adjusted classification model to obtain the actual content type of the sample contents in each mixed training sample set includes: According to the training sequence, determining a target mixed training sample set currently used for training; Using the adjusted classification model, classifying the sample contents in the target mixed training sample set to obtain the actual content type of the sample contents in the target mixed training sample set; The step of re-adjusting parameters of a feature extraction module and a classification module in the adjusted classification model according to the actual content type to obtain a re-adjusted classification model includes: Re-adjusting parameters of a feature extraction module and a classification module in the adjusted classification model according to actual content types and expected content types of sample contents in the target mixed training sample set; According to the training order, a new target mixed training sample set is selected from each mixed training sample set; the step of performing classification processing on the sample content in the target mixed training sample set through the adjusted classification model is returned to obtain the actual content type of the sample content in the target mixed training sample set, and the re-adjusted classification model is obtained.

7. The method according to any one of claims 1 to 6, wherein: The classifying process of the target sample content by the classification model to obtain the actual content type corresponding to the target sample content includes: By means of the feature extraction module, feature extraction is performed on the target sample content to obtain target feature information of the target sample content; The classification module predicts the actual content type of the target sample content based on the target feature information.

8. The method according to claim 7, wherein: The target sample content includes at least one content segment, and the content segment includes at least one content unit; The feature extraction module extracts features from the target sample content to obtain target feature information of the target sample content, including: By means of the feature extraction module, key content is extracted from the target sample content to obtain a first content sequence; Performing attention coding processing on each content unit in the first content sequence to obtain attention coding feature information corresponding to each content unit in the first content sequence; Performing content interception processing on the target sample content to obtain a second content sequence, and performing sequence feature encoding processing on the second content sequence based on feature information of each content unit in the second content sequence to obtain sequence feature information; The attention encoding feature information and the sequence feature information are fused to obtain target feature information of the target sample content.

9. The method according to claim 8, wherein: The step of extracting key content from the target sample content by the feature extraction module to obtain a first content sequence includes: The feature extraction module performs the following processing: for each content segment in the target sample content, determining the segment feature information of the content segment according to the feature information of each content unit in the content segment; Merging the segment feature information of each content segment of the target sample content to obtain the global feature information of the target sample content; Selecting at least one target content segment from the content segments based on the similarity between the segment feature information of each content segment and the global feature information; A first content sequence is determined according to the target content segment.

10. The method according to claim 8, wherein: The performing attention encoding processing on each content unit in the first content sequence to obtain attention encoding feature information corresponding to each content unit in the first content sequence includes: Performing multi-head attention processing on each content unit in the first content sequence to obtain attention feature information corresponding to each content unit; Performing residual connection and normalization processing on the attention feature information corresponding to each content unit to obtain processed attention feature information corresponding to each content unit; Fully connect the processed attention feature information corresponding to each content unit to obtain the attention encoding feature information corresponding to each content unit in the first content sequence.

11. The method according to claim 8, wherein: The performing content interception processing on the target sample content to obtain a second content sequence includes: Performing a forward interception operation on the target sample content to obtain the forward content of the target sample content; Performing a backward interception operation on the target sample content to obtain the backward content of the target sample content; The forward content and the backward content are merged to obtain a second content sequence.

12. The method according to claim 8, wherein: The fusing process of the attention encoding feature information and the sequence feature information to obtain target feature information of the target sample content includes: Determine target attention encoding feature information from the attention encoding feature information corresponding to each content unit in the first content sequence; The target attention encoding feature information and the sequence feature information are fused to obtain content feature information of the target sample content; According to the preset mapping matrix and the content feature information, the target feature information of the target sample content is obtained.

13. A classification model training device, comprising: An acquisition unit configured to acquire at least one original sample content and annotated sample content, and acquire a classification model, wherein the annotated sample content carries its corresponding expected content type, and the classification model includes a feature extraction module and a classification module; a selection unit configured to select at least one target sample content from the original sample content based on the expected content type corresponding to the annotated sample content and at least one content tag corresponding to the annotated sample content, and construct the expected content type corresponding to the target sample content; A first classification unit is configured to classify the target sample content through the classification model to obtain an actual content type corresponding to the target sample content; an adjusting unit, configured to adjust parameters of a feature extraction module and a classification module in the classification model based on an actual content type corresponding to the target sample content and an expected content type corresponding to the annotated sample content, to obtain an adjusted classification model; A second classification unit is configured to classify the labeled sample content by using the adjusted classification model to obtain an actual content type corresponding to the labeled sample content; An updating unit is configured to update the parameters of the classification module in the adjusted classification model according to the actual content type corresponding to the annotated sample content and the expected content type corresponding to the annotated sample content, so as to obtain a target classification model, wherein the target classification model is used to classify the content to be processed and obtain the content type of the content to be processed.

14. An electronic device comprising a memory and a processor; the memory stores computer-executable instructions, and the processor is used to run the computer-executable instructions in the memory to execute the classification model training method described in any one of claims 1 to 12.

15. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are suitable for loading by a processor to execute the classification model training method described in any one of claims 1 to 12.

16. A computer program product, comprising computer executable instructions, which, when executed by a processor, implement the classification model training method described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Classification model training method and device, electronic equipment and storage medium

    CN112560912A

  • Classification model training method, image classification method and device, equipment and medium

    CN115239675A

  • Model training method, system and device and computer readable storage medium

    CN115329825A

  • Method for training image classification model, image processing method, and apparatuses

    US20210241109A1

Cited By

  • Quality evaluation method for embedded storage chip

    CN119763640A

  • Label classification method and device for long text, equipment, storage medium and product

    CN119782531A

  • Intelligent technical and tactical style evaluation method and system for boxing sports

    CN119992661A