Content classification model training method and related equipment

Pseudo labels are generated through content slicing processing and clustering, and content classification model parameters are adjusted to solve the problems of high data annotation cost and low accuracy in the existing technology, and improve the training efficiency and classification accuracy of the model.

CN118568568BActive Publication Date: 2024-10-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410865446.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2024-10-29
Estimated Expiration
2044-07-01

AI Technical Summary

Technical Problem

In the existing technology, the training of content classification models requires a large amount of manually labeled sample data, which results in high time and cost, and accuracy problems, which affects the training efficiency and classification accuracy of the model.

Method used

By obtaining the content classification model and training data, perform content slicing processing, extract global and local feature information, use category label information of labeled sample content for clustering, generate pseudo labels for unlabeled sample content, and adjust model parameters based on consistency information. , reduce data annotation costs and time, and improve model classification accuracy.

Benefits of technology

It can save data annotation cost and time while improving model training effect and classification accuracy. It improves the quality of pseudo labels through weakly supervised clustering and global/local consistency information processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568568B_ABST
    Figure CN118568568B_ABST
Patent Text Reader

Abstract

The present application discloses a training method and related equipment for a content classification model; the sample content in the training data can be sliced ​​to obtain multiple content segments, and the training data includes labeled sample content and unlabeled sample content; the global feature information of the sample content and the local feature information of each content segment of the sample content are extracted through the content classification model; the global feature information of each sample content is clustered based on the category label information of the labeled sample content to obtain the category label information of the unlabeled sample content; the consistency information of the content segment and the sample content to which it belongs is calculated based on the local feature information of the content segment and the global feature information of the sample content to which the content segment belongs; the parameters of the content classification model are adjusted based on the consistency information and the category label information of the unlabeled sample content to obtain the target content classification model. The present application can save data annotation costs and time; and can also improve the accuracy of model classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a training method for a content classification model and related equipment. Background Art

[0002] With the development of computer technology, multimedia applications are becoming more and more widespread, and various content information (such as videos, images, articles, etc.) is also growing rapidly. In order to better realize functions such as content recommendation, review, and search, it is necessary to classify the massive content information.

[0003] In the current related technologies, content classification is generally carried out through content classification models. For content classification models, a large amount of manually annotated sample data is required for training so that the content classification model can learn content classification capabilities. However, a large amount of annotated sample data requires a long time and manpower costs, and such sample data based only on manual annotation may have problems in accuracy; this is not conducive to improving the efficiency of model training, nor is it conducive to improving the classification accuracy of the model. Summary of the invention

[0004] The embodiments of the present application provide a training method for a content classification model and related equipment. The related equipment may include a training device for a content classification model, an electronic device, a computer-readable storage medium, and a computer program product. Only a small amount of labeled sample content is required, which saves a lot of data labeling costs and time; and can also improve the training effect of the model and enhance the accuracy of model classification.

[0005] The present application provides a method for training a content classification model, including:

[0006] Obtaining a content classification model and training data, wherein the sample content in the training data includes annotated sample content and unannotated sample content, and the annotated sample content carries its corresponding category label information;

[0007] For each sample content, performing content slicing processing on the sample content to obtain multiple content segments of the sample content;

[0008] By using the content classification model, feature extraction processing is performed on the sample content and each content segment of the sample content to obtain global feature information of the sample content and local feature information corresponding to each content segment;

[0009] Based on the category label information of the labeled sample content, clustering is performed on the global feature information of each sample content in the training data to obtain the category label information corresponding to the unlabeled sample content;

[0010] For each content segment of the sample content, calculating consistency information between the content segment and the sample content to which it belongs according to local feature information corresponding to the content segment and global feature information of the sample content to which the content segment belongs;

[0011] Based on the consistency information and the category label information corresponding to the unlabeled sample content, the parameters of the content classification model are adjusted to obtain a target content classification model, and the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

[0012] Accordingly, an embodiment of the present application provides a training device for a content classification model, including:

[0013] An acquisition unit, used to acquire a content classification model and training data, wherein the sample content in the training data includes annotated sample content and unannotated sample content, and the annotated sample content carries its corresponding category label information;

[0014] A slicing unit, configured to perform content slicing processing on each sample content to obtain multiple content segments of the sample content;

[0015] An extraction unit, configured to perform feature extraction processing on the sample content and each content segment of the sample content respectively through the content classification model, so as to obtain global feature information of the sample content and local feature information corresponding to each content segment;

[0016] A clustering unit, configured to perform clustering processing on the global feature information of each sample content in the training data based on the category label information of the labeled sample content, so as to obtain the category label information corresponding to the unlabeled sample content;

[0017] a consistency unit, configured to calculate, for each content segment of the sample content, consistency information between the content segment and the sample content to which it belongs, according to local feature information corresponding to the content segment and global feature information of the sample content to which the content segment belongs;

[0018] An adjustment unit is used to adjust the parameters of the content classification model based on the consistency information and the category label information corresponding to the unlabeled sample content to obtain a target content classification model, wherein the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

[0019] Optionally, in some embodiments of the present application, the clustering unit may include setting subunits, adding subunits, selecting subunits, and returning subunits, as follows:

[0020] The setting subunit is used to set a preset number of cluster centers and calculate the similarity between the global feature information of each sample content in the training data and each cluster center;

[0021] an adding subunit, configured to determine, for each sample content, a target cluster center matching the sample content from among the cluster centers based on the similarity and the category label information of the annotated sample content, and add the sample content to a content set corresponding to the target cluster center;

[0022] A selection subunit is used to select sample content that meets the preset cluster center conditions from the content set corresponding to each cluster center as a new cluster center;

[0023] A return subunit is used to return to the step of calculating the similarity between the global feature information of each sample content in the training data and each cluster center until the obtained cluster center meets the clustering end condition; based on the category label information of the labeled sample content in the target content set corresponding to the cluster center that meets the clustering end condition, determine the category label information of the unlabeled sample content in the target content set.

[0024] Optionally, in some embodiments of the present application, the clustering unit may include a similarity determination subunit, a graph model construction subunit, and a label transfer subunit, as follows:

[0025] The similarity determination subunit is used to determine the sample similarity between every two sample contents based on the global feature information of every two sample contents;

[0026] A graph model construction subunit, configured to construct a content graph model according to the sample similarities, wherein the content graph model represents the association relationship between the contents of each sample;

[0027] The label transfer subunit is used to perform label information transfer processing on the category label information of the labeled sample content according to the content graph model to obtain the category label information corresponding to the unlabeled sample content.

[0028] Optionally, in some embodiments of the present application, the content graph model includes content nodes corresponding to each sample content, and edges between content nodes, wherein the edges represent an association relationship between two connected content nodes;

[0029] The label transfer subunit can be specifically used to perform label information transfer processing on the category label information of the labeled sample content through the edges between content nodes in the content graph model to determine the reference category label information of the unlabeled sample content; for each unlabeled sample content, according to the adjacent content nodes of the unlabeled sample content in the content graph model, the reference category label information of the unlabeled sample content is iteratively updated until the labels of the content nodes in the content graph model converge, thereby obtaining the category label information corresponding to the unlabeled sample content.

[0030] Optionally, in some embodiments of the present application, the consistency unit may include a construction subunit, a first determination subunit, a second determination subunit, and a calculation subunit, as follows:

[0031] The construction subunit is used to construct a global feature set based on the global feature information of each sample content, and to construct a local feature set based on the local feature information of the content fragments of each sample content;

[0032] A first determining subunit is configured to search, for each sample content, the global feature set for at least one similar global feature information that matches the global feature information of the sample content, and determine a candidate label set for the sample content based on category label information of the sample content to which the similar global feature information belongs;

[0033] A second determining subunit is configured to search, for each content segment of the sample content, the local feature set for at least one similar local feature information that matches the local feature information of the content segment, and determine a candidate label set for the content segment based on category label information of the sample content to which the similar local feature information belongs;

[0034] The calculation subunit is used to calculate the consistency information between the content segment and the sample content to which it belongs based on the candidate tag set of the content segment and the candidate tag set of the sample content to which the content segment belongs.

[0035] Optionally, in some embodiments of the present application, the computing subunit can be specifically used to perform statistical analysis and processing on the category label information in the candidate label set of the content segment to determine the label probability distribution information of the content segment; perform statistical analysis and processing on the category label information in the candidate label set of the sample content to which the content segment belongs to to determine the label probability distribution information of the sample content to which the content segment belongs; and calculate the consistency information between the content segment and the sample content to which it belongs based on the label probability distribution information of the content segment and the label probability distribution information of the sample content to which the content segment belongs.

[0036] Optionally, in some embodiments of the present application, the adjustment unit may include a first classification subunit, a second classification subunit and an adjustment subunit, as follows:

[0037] The first classification subunit is used to perform content classification processing on the sample content based on the global feature information of the sample content to obtain global category probability distribution information corresponding to the sample content;

[0038] A second classification subunit is used to perform content classification processing on the content segment based on the local feature information corresponding to the content segment to obtain local category probability distribution information corresponding to the content segment;

[0039] The adjustment subunit is used to adjust the parameters of the content classification model according to the global category probability distribution information, the local category probability distribution information, the consistency information and the category label information corresponding to the unlabeled sample content to obtain a target content classification model.

[0040] Optionally, in some embodiments of the present application, the adjustment subunit can be specifically used to, for each sample content, correct the category label information of the sample content based on the local category probability distribution information of each content segment in the sample content and the consistency information corresponding to each content segment, to obtain the corrected category label information of the sample content; based on the global category probability distribution information corresponding to each sample content, fuse the corrected category label information of each sample content to obtain global loss information; based on the global loss information, adjust the parameters of the content classification model to obtain the target content classification model.

[0041] Optionally, in some embodiments of the present application, the step of “adjusting the parameters of the content classification model based on the global loss information to obtain a target content classification model” may include:

[0042] Calculating local classification loss information of the content segment based on local category probability distribution information of the content segment and category label information of sample content to which the content segment belongs;

[0043] Based on the global loss information and the local classification loss information, the parameters of the content classification model are adjusted to obtain a target content classification model.

[0044] Optionally, in some embodiments of the present application, the step of “adjusting the parameters of the content classification model based on the global loss information and the local classification loss information to obtain a target content classification model” may include:

[0045] Performing difference measurement processing between the local category probability distribution information of the content segment and the uniform distribution to obtain divergence information corresponding to the content segment;

[0046] Based on the consistency information corresponding to the content segment, the local classification loss information and the divergence information are merged to obtain the local loss information of the content segment;

[0047] According to the global loss information and the local loss information corresponding to each content segment of the sample content, the parameters of the content classification model are adjusted to obtain a target content classification model.

[0048] Optionally, in some embodiments of the present application, the extraction unit may include an acquisition subunit, a fusion subunit, a first encoding subunit, and a second encoding subunit, as follows:

[0049] The acquisition subunit is used to acquire an image sequence of the sample content in image mode and a text sequence in text mode, and acquire an image subsequence in image mode and a text subsequence in text mode of each content segment of the sample content;

[0050] A fusion subunit is used to fuse the image sequence and text sequence of the sample content to obtain a content unit sequence corresponding to the sample content; and fuse the image subsequence and text subsequence of the content segment to obtain a content unit sequence corresponding to the content segment;

[0051] A first encoding subunit, configured to perform attention encoding processing on a content unit sequence of the sample content through the content classification model to obtain global feature information of the sample content;

[0052] The second encoding subunit is used to perform attention encoding processing on the content unit sequence of the content segment through the content classification model to obtain local feature information of the content segment.

[0053] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0054] An electronic device provided in an embodiment of the present application includes a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads the instructions to execute the steps in the training method of the content classification model provided in the embodiment of the present application.

[0055] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps in the training method for the content classification model provided in the embodiment of the present application are implemented.

[0056] In addition, an embodiment of the present application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps in the training method of the content classification model provided in the embodiment of the present application.

[0057] The embodiment of the present application provides a training method and related devices for a content classification model, which can obtain a content classification model and training data, wherein the sample content in the training data includes annotated sample content and unannotated sample content, and the annotated sample content carries its corresponding category label information; for each sample content, the sample content is sliced ​​to obtain a plurality of content segments of the sample content; through the content classification model, feature extraction is performed on the sample content and each content segment of the sample content to obtain global feature information of the sample content and local feature information corresponding to each content segment; based on the category label information of the annotated sample content, the sample content is sliced ​​to obtain a plurality of content segments of the sample content ... The global feature information of each sample content in the training data is clustered to obtain the category label information corresponding to the unlabeled sample content; for each content segment of the sample content, the consistency information between the content segment and the sample content to which the content segment belongs is calculated according to the local feature information corresponding to the content segment and the global feature information of the sample content to which the content segment belongs; based on the consistency information and the category label information corresponding to the unlabeled sample content, the parameters of the content classification model are adjusted to obtain a target content classification model, and the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

[0058] This application only requires a small amount of labeled sample content, saving a lot of data labeling costs and time; based on the partially labeled sample content, a weakly supervised clustering method is used to generate pseudo-labels for unlabeled sample content, thereby utilizing a large amount of unsupervised data - unlabeled sample content for training together, and combining global and local consistency information, it is possible to process the noise of pseudo-labels obtained by clustering, thereby improving the quality of pseudo-labels, which is beneficial to improving the training effect of the model and improving the model classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. 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.

[0060] Figure 1a It is a scenario diagram of a method for training a content classification model provided in an embodiment of the present application;

[0061] Figure 1b is a flow chart of a method for training a content classification model provided in an embodiment of the present application;

[0062] Figure 1c is an illustration of a training method for a content classification model provided in an embodiment of the present application;

[0063] Figure 1d It is a model architecture diagram of the content classification model training method provided in the embodiment of the present application;

[0064] Figure 1e is another flow chart of the training method of the content classification model provided in the embodiment of the present application;

[0065] Figure 2 is another flow chart of the training method of the content classification model provided in the embodiment of the present application;

[0066] Figure 3 It is a structural diagram of a training device for a content classification model provided in an embodiment of the present application;

[0067] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0069] The present application provides a method for training a content classification model and related equipment, and the related equipment may include a training device for a content classification model, an electronic device, a computer-readable storage medium, and a computer program product. The training device for the content classification model may be integrated in an electronic device, which may be a terminal or a server.

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

[0071] like Figure 1a As shown, a training method for a content classification model jointly executed by a terminal and a server is taken as an example. The training system for a content classification model provided in an 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, etc., wherein the training device for the content classification model can be integrated in the server.

[0072] Among them, the server 11 can be used to: obtain a content classification model and training data, the sample content in the training data includes annotated sample content and unannotated sample content, and the annotated sample content carries its corresponding category label information; for each sample content, perform content slicing processing on the sample content to obtain multiple content segments of the sample content; through the content classification model, perform feature extraction processing on the sample content and each content segment of the sample content respectively to obtain global feature information of the sample content and local feature information corresponding to each content segment; based on the category label information of the annotated sample content, perform clustering processing on the global feature information of each sample content in the training data to obtain the category label information corresponding to the unannotated sample content; for each content segment of the sample content, calculate the consistency information between the content segment and the sample content to which it belongs according to the local feature information corresponding to the content segment and the global feature information of the sample content to which the content segment belongs; based on the consistency information and the category label information corresponding to the unannotated sample content, adjust the parameters of the content classification model to obtain the target content classification model. The server 11 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0073] The terminal 10 can be used to: receive the target content classification model sent by the server 11, and the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content. The terminal 10 can include a mobile phone, a vehicle terminal, an aircraft, a tablet computer, a notebook computer, or a personal computer (PC). A client can also be set on the terminal 10, and the client can be an application client or a browser client, etc.

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

[0075] The training method of the content classification model provided in the embodiment of the present application involves machine learning, natural language processing, and computer vision technology in the field of artificial intelligence.

[0076] Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. Among them, artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, as well as machine learning / deep learning, autonomous driving, smart transportation and other major directions.

[0077] Among them, machine learning (ML) is a multi-disciplinary interdisciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0078] Among them, natural language processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.

[0079] Among them, Computer Vision (CV) is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify and measure targets, and further processing graphics to make computer processing into images that are more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, automatic driving, smart transportation and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.

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

[0081] This embodiment will be described from the perspective of a training device for a content classification model. The training device for a content classification model may be integrated into an electronic device, which may be a server, a terminal or other device.

[0082] 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 need to comply with relevant laws, regulations and standards of relevant countries and regions.

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

[0084] 101. Obtain a content classification model and training data, wherein the sample content in the training data includes annotated sample content and unannotated sample content, and the annotated sample content carries its corresponding category label information.

[0085] Among them, the content classification model can be a neural network model, which can be LSTM (Long Short-Term Memory), RNN (Recurrent Neural Network), GRU (Gate Recurrent Unit), transformer, etc., but it should be understood that the neural network model of this embodiment is not limited to the types listed above.

[0086] Specifically, the content classification model may include a feature extraction module and a classification module. The feature extraction module may be used to extract feature information of the content. The classification module may classify the content based on the feature information extracted by the feature extraction module and predict category label information of the content.

[0087] The training data may include multiple sample contents, and the sample contents may include a small amount of labeled sample contents and a large amount of unlabeled sample contents. The labeled sample contents may carry category label information; specifically, the labeled sample contents are sample contents that have been manually labeled. In this embodiment, a small amount of labeled data may be combined with large-scale unsupervised data (i.e., unlabeled sample contents) to predict its pseudo label to train the content classification model.

[0088] In this embodiment, the content modality of the sample content is not limited, for example, the sample content may be text, audio, image, or video, etc. Specifically, the sample content may be single-modal content, such as pure text content, or multi-modal content, such as a combination of text and images.

[0089] The training method of the content classification model provided in this application can be applied to a variety of business scenarios. By automatically generating classifications and labels for massive UGC content, the machine can provide content category labels of different granularities for downstream content distribution links (such as content recommendation systems and content operations), improve the efficiency of content distribution, and significantly reduce the cost of manual content review. It is also applicable to content of various types of media such as video, graphics, and text. The process of its product-side application is as follows: Figure 1c As shown, content information (such as video) enters the content processing link from the content production link, obtains corresponding content features through human-machine collaboration, and then determines category label information based on the content features and enters the downstream content distribution link. It should be noted that the method proposed in this application belongs to the machine labeling link.

[0090] Among them, UGC stands for User-generated Content, that is, content produced by users.

[0091] 102. For each sample content, perform content slicing processing on the sample content to obtain multiple content segments of the sample content.

[0092] There are many ways to slice content, and this embodiment does not specifically limit this. For example, the content slicing method can be uniform slicing or non-uniform slicing. Specifically, in some embodiments, the sample content can be divided into a preset number of content segments, and in other embodiments, the sample content can also be sliced ​​based on a preset segment length.

[0093] For example, the sample content is a video, denoted by x i , the sample content can be evenly cut into N video clips according to the time dimension, where the jth video clip is recorded as {x i,j}, j=1,2,3,…,N.

[0094] 103. Perform feature extraction processing on the sample content and each content segment of the sample content through the content classification model to obtain global feature information of the sample content and local feature information corresponding to each content segment.

[0095] Specifically, the global feature information of the sample content and the local feature information of each content segment may be extracted through the feature extraction module of the content classification model.

[0096] Optionally, in this embodiment, the step of “performing feature extraction processing on the sample content and each content segment of the sample content respectively through the content classification model to obtain global feature information of the sample content and local feature information corresponding to each content segment” may include:

[0097] Acquire an image sequence of the sample content in image mode and a text sequence in text mode, and acquire an image subsequence of each content segment of the sample content in image mode and a text subsequence in text mode;

[0098] Performing fusion processing on the image sequence and text sequence of the sample content to obtain a content unit sequence corresponding to the sample content; performing fusion processing on the image subsequence and text subsequence of the content fragment to obtain a content unit sequence corresponding to the content fragment;

[0099] By using the content classification model, performing attention encoding processing on the content unit sequence of the sample content to obtain global feature information of the sample content;

[0100] By using the content classification model, attention encoding processing is performed on the content unit sequence of the content segment to obtain local feature information of the content segment.

[0101] The sample content may be a video, and this embodiment may use features in two modes: visual features and text features. The visual mode comes from the visual features of the video frames obtained by decoding and extracting the sample content, while the text may come from the title description and subtitles of the video itself.

[0102] It should be noted that the text sequence in the text mode here may include corresponding text description information obtained by converting the audio of the sample content through the ASR technology, and may also include text information obtained by performing text recognition on the image of the sample content through the OCR technology.

[0103] Among them, ASR (Automatic Speech Recognition) is a technology that converts speech into text. OCR (Optical Character Recognition) is a technology that detects and recognizes text content from images.

[0104] In a specific scenario, when the sample content is a video, m frames can be extracted from the video frame sequence of the sample content as the image sequence of the sample content in the image mode, and the text sequence of the sample content in the text mode can be determined based on the video title, subtitles, etc. of the sample content. For each content segment of the sample content, multiple video frames in the content segment can be extracted as the image subsequence of the content segment in the image mode. Since it is difficult to assign the video title text to a specific slice, only the subtitles extracted from the current content segment can be used as the text subsequence of the content segment in the text mode.

[0105] There are many ways to fuse the image sequence and text sequence of the sample content, such as splicing processing, to obtain the content unit sequence of the sample content, the content unit sequence of the sample content includes multiple content units, each content unit can be a word, a character or feature information corresponding to a video frame. Similarly, there are many ways to fuse the image subsequence and text subsequence of the content fragment, such as splicing processing, to obtain the content unit sequence of the content fragment.

[0106] Optionally, in this embodiment, the step of “performing attention encoding processing on the content unit sequence of the sample content through the content classification model to obtain global feature information of the sample content” may include:

[0107] Obtaining, by means of the content classification model, a content vector and a type vector corresponding to each content unit in the content unit sequence of the sample content, wherein the type vector represents the information type to which the content unit belongs;

[0108] Encoding the position information of each content unit in the content unit sequence to obtain a position vector corresponding to each content unit;

[0109] Merging the content vector, the type vector and the position vector to obtain feature information of each content unit in the content unit sequence of the sample content;

[0110] Attention encoding is performed on feature information of each content unit in the content unit sequence to obtain global feature information of the sample content.

[0111] Among them, if the content unit is a text unit, the content vector corresponding to the content unit can be the word vector of the text unit, and the text unit can be a word or a character; if the content unit is a video frame unit, the content vector corresponding to the content unit can be the visual feature information of the video frame unit.

[0112] Among them, the type vector of the content unit can specifically represent the information type to which the content unit belongs, such as indicating whether the content unit is a text unit or a video frame unit. If the content unit is a text unit, the type vector can also specifically represent whether the text unit is a verb or a noun, etc.

[0113] The position vector of the content unit may represent the position of the content unit in the text sequence or image sequence. If the content unit is a text unit, the position vector may specifically indicate that the content unit is at the beginning or end of a sentence, etc.; if the content unit is a video frame unit, the position vector may specifically indicate that the video frame unit is at the beginning or end of a video, etc.

[0114] There are many ways to fuse the content vector, type vector and position vector. For example, the fusion method can be splicing, and the splicing order is not limited; for another example, the fusion method can be weighted fusion, etc., first determine the weights corresponding to the content vector, type vector and position vector, and then fuse them according to the weights. Through the fusion process, the feature information of the content unit can be obtained.

[0115] In other embodiments, the audio sequence of the sample content in the audio mode can also be used to fuse the image sequence, text sequence and audio sequence of the sample content to obtain the content unit sequence of the sample content. Similarly, the image subsequence, text subsequence and audio subsequence of the content segment can also be fused to obtain the content unit sequence of the content segment.

[0116] In a specific scenario, Figure 1d As shown, the model structure of the content classification model is shown. The content classification model may include a feature encoder (i.e., the feature extraction module mentioned above) and a classifier (i.e., the classification module mentioned above). The feature encoder in this embodiment may adopt a single-stream transformer structure to tokenize the input of multimodal content information, and use the transformer's self-attention mechanism to align and fuse multimodal features. The classifier is specifically a fully connected layer (fc), and the size of fc is the size of the target classification category, denoted by C, that is, each neuron in fc corresponds to a specific category.

[0117] Specifically, the sample content is a video, and the method of extracting embedding (feature information) of tokens in the text sequence under the text modality can adopt the BERT (Bidirectional Encoder Representations from Transformers) approach, specifically adding the position encoding and type encoding to the embedding of the word itself; for the image sequence in the image modality of the sample content, m frames can be extracted from the sample video to form an image sequence. Similar to the word embedding, the method of extracting embedding of each token (content unit, specifically each video frame) in the image sequence can be: use a visual feature encoder to extract features from each frame to obtain the embedding of the video frame itself, and then add the position encoding and type encoding to the embedding of the video frame itself to obtain the final feature information visual token embedding of the video frame. For an audio sequence of sample content in audio mode, n audio frames in the sample content can also be extracted to form an audio sequence. The embedding of each token (content unit, specifically each audio frame) in the audio sequence can be extracted by adding the position encoding and the type encoding to the audio features of the audio frame itself to obtain the final embedding of the audio frame.

[0118] The video feature encoder can be a model such as CNN (Convolutional Neural Networks), ViT (Vision Transformer), etc. Transformer is a network structure model suitable for processing sequence data. Its core idea is to model the relationship between each element in the input sequence and other elements as an attention weight matrix, and calculate the representation of each element through the self-attention mechanism. This structure enables Transformer to have a strong ability to capture long-distance dependencies in the sequence.

[0119] Among them, the m video frames constituting the image sequence can be specifically extracted in the following manner: the sample video is evenly divided into m segments, and in the training phase of the model, one frame is randomly extracted from each segment to form the image sequence; in the testing phase of the model, a middle frame of each segment can be extracted, and a total of m frames can be extracted to form the image sequence.

[0120] In this embodiment, the text sequence, image sequence and audio sequence of the sample content can be spliced ​​to obtain the content unit sequence of the sample content. After the feature extraction of each token in the text sequence, image sequence and audio sequence, the feature information of each token in the content unit sequence of the sample content can be determined. Then, the feature information of each token in the content unit sequence of the sample content is processed by attention encoding through the transformer to obtain the global feature information of the sample content. Specifically, the high-level embedding output by CLStoken can be regarded as the global feature information after the fusion of the entire sample content, which is recorded as f. Specifically, if the sample content is recorded as x i , then its global feature information can be recorded as f i g .

[0121] Among them, text sequences, image sequences and audio sequences can be separated by [SEP], which is a separator; a special symbol [CLS] can also be added at the starting position of the content unit sequence to represent the semantic information of the entire sequence. Through training, the transformer model learns the semantic representation of the content at the overall level and encodes it in the [CLS] symbol.

[0122] Similarly, for the content segments of the sample content (specifically, videos), their local feature information can also be extracted through the above transformer model. Specifically, the method of extracting embedding (feature information) of tokens in the text subsequence of the content segment in the text mode can adopt the BERT approach, specifically adding the position encoding and type encoding to the embedding of the word itself; for the image subsequence of the content segment in the image mode, m frames can be extracted from the video segment to form an image subsequence. Similar to the word embedding, the method of extracting embedding of each token (content unit, specifically each video frame) in the image subsequence can be: use the visual feature encoder to extract features from each frame to obtain the embedding of the video frame itself, and then add the position encoding and type encoding to the embedding of the video frame itself to obtain the final feature information visual token embedding of the video frame. For an audio subsequence of a content segment in an audio mode, n audio frames in the audio segment corresponding to the content segment may also be extracted to form an audio subsequence. The embedding of each token (content unit, specifically each audio frame) in the audio subsequence may be extracted by adding a position code and a type code to the audio features of the audio frame itself to obtain the final embedding of the audio frame.

[0123] Among them, the m video frames constituting the image subsequence can be specifically extracted in the following manner: the video clip is evenly divided into m segments, and in the training phase of the model, one frame is randomly selected from each segment to form the image subsequence; in the testing phase of the model, a middle frame of each segment can be extracted, and a total of m frames can be extracted to form the image subsequence.

[0124] In this embodiment, the text subsequence, image subsequence and audio subsequence of the content fragment can be spliced ​​to obtain the content unit sequence of the content fragment. After the feature extraction of each token in the text subsequence, image subsequence and audio subsequence, the feature information of each token in the content unit sequence of the content fragment can be determined. Then, the feature information of each token in the content unit sequence of the content fragment is subjected to attention encoding processing by transformer to obtain the local feature information of the content fragment. Specifically, the high-level embedding output by CLStoken can be used as the local feature information. Specifically, if the content fragment is recorded as x i,j , then its local feature information can be recorded as f i,j p .

[0125] Among them, the text subsequence, image subsequence and audio subsequence can be separated by [SEP], which is a separator; a special symbol [CLS] can also be added at the starting position of the content unit sequence of the content fragment to represent the semantic information of the entire sequence. Through training, the transformer model learns the overall-level semantic representation of the content fragment and encodes it in the [CLS] symbol.

[0126] 104. Based on the category label information of the labeled sample content, cluster the global feature information of each sample content in the training data to obtain the category label information corresponding to the unlabeled sample content.

[0127] There are many ways to cluster the global feature information of each sample content, which is not limited in this embodiment. For example, the clustering method can be COP-K-Means (Constrained K-Means) algorithm, Label Propagation Algorithm (LPA) and Label Propagation Clustering Algorithm (LPCA).

[0128] In this embodiment, the category label information of the labeled sample content can be used to label the unlabeled sample content through a weakly supervised clustering method, thereby obtaining the category label information of the unlabeled sample content.

[0129] Among them, the category label information of the unlabeled sample content obtained by clustering can be regarded as pseudo-label information of the unlabeled sample content. The pseudo-label information is not obtained through manual labeling, but is obtained by using the category label information of the labeled sample content.

[0130] Optionally, in this embodiment, the step of “clustering the global feature information of each sample content in the training data based on the category label information of the labeled sample content to obtain the category label information corresponding to the unlabeled sample content” may include:

[0131] Setting a preset number of cluster centers, and calculating the similarity between the global feature information of each sample content in the training data and each cluster center;

[0132] For each sample content, based on the similarity and the category label information of the annotated sample content, determine a target cluster center matching the sample content from the cluster centers, and add the sample content to a content set corresponding to the target cluster center;

[0133] For the content set corresponding to each cluster center, sample content that meets the preset cluster center conditions is selected from the content set as a new cluster center;

[0134] Return to the step of calculating the similarity between the global feature information of each sample content in the training data and each cluster center until the obtained cluster center meets the clustering end condition; based on the category label information of the labeled sample content in the target content set corresponding to the cluster center that meets the clustering end condition, determine the category label information of the unlabeled sample content in the target content set.

[0135] Among them, the preset number can be the number of content categories, that is, the number of category labels. In a specific scenario, when the business defines the classification system and standards, it will naturally annotate a small number of samples for each content category as examples. This part of the samples, that is, the annotated sample content mentioned above, can be used as supervised data for model training; in addition, the online system has a large amount of UGC content, that is, content that has not been manually labeled with categories. This part of the data can also be used for model training as unsupervised data. This embodiment can use the annotation of supervised data to determine the pseudo-label information of unsupervised data, so that unsupervised data can also be used in model training. Specifically, if K content categories are defined, the annotated sample content is the content under these K content categories, and K clustering centers can be set.

[0136] The preset cluster center condition and cluster end condition can be set according to actual conditions.

[0137] Specifically, the preset cluster center condition may be the minimum distance from the distribution center of the content set. For example, the distribution center of the content set may be determined for the distribution information of the sample content in each content set, and the sample content with the minimum distance from the distribution center of gravity is used as the new cluster center of the content set. The global feature information of each sample content in the content set may be averaged to determine the distribution center of gravity of the content set.

[0138] For each content set, calculate whether the latest cluster center of the content set is the same as the cluster center used most recently in the clustering process. If they are the same, it can be considered that the cluster center of the content set has not changed. If the cluster centers of all content sets no longer change, the clustering process is completed and a preset number of content sets are obtained; if the cluster centers of all content sets do not change, return to the step "based on the similarity and the category label information of the labeled sample content, determine the target cluster center that matches the sample content from the cluster centers, and add the sample content to the content set corresponding to the target cluster center" until the cluster center of each content set no longer changes.

[0139] It should be noted that the fact that the latest cluster center of each content set in the clustering process is the same as the cluster center most recently used by the content set is only an optional condition for ending the loop. The optional condition can also be that the difference between the two cluster centers is less than a preset value, which can be set according to actual conditions.

[0140] The step of “for each sample content, determining a target cluster center matching the sample content from the cluster centers based on the similarity and the category label information of the annotated sample content” may include:

[0141] When the sample content is annotated sample content, based on the category label information of the annotated sample content, determining a target cluster center matching the annotated sample content from the various cluster centers;

[0142] When the sample content is unlabeled sample content, based on the similarity between the global feature information of the unlabeled sample content and each cluster center, a target cluster center matching the unlabeled sample content is determined from the cluster centers.

[0143] Each category label information corresponds to a cluster center, and the cluster center corresponding to the category label information of the labeled sample content can be determined as the target cluster center matching the labeled sample content. For unlabeled sample content, the cluster center with the greatest similarity to the global feature information of the unlabeled sample content can be determined as the target cluster center matching the unlabeled sample content.

[0144] When the clustering end condition is met, a preset number of target content sets can be obtained. This embodiment can determine the category label information of the unlabeled sample content in the corresponding target content set based on the category label information of the labeled sample content included in each target content set.

[0145] Optionally, in this embodiment, the step of “clustering the global feature information of each sample content in the training data based on the category label information of the labeled sample content to obtain the category label information corresponding to the unlabeled sample content” may include:

[0146] Determine the sample similarity between each two sample contents based on the global feature information of each two sample contents;

[0147] Constructing a content graph model according to the sample similarities, wherein the content graph model represents the association relationship between the contents of each sample;

[0148] According to the content graph model, the category label information of the labeled sample content is processed by label information transmission to obtain the category label information corresponding to the unlabeled sample content.

[0149] The feature distance between the global feature information of each sample content can be calculated, and based on the feature distance, the sample similarity between two sample contents can be determined. The larger the feature distance, the smaller the sample similarity; conversely, the smaller the feature distance, the greater the sample similarity.

[0150] The content graph model includes content nodes corresponding to each sample content and edges between content nodes, wherein the edges represent the association relationship between two connected content nodes, and each content node represents the category label information of the sample content. An edge is a line between two nodes. Specifically, if the sample similarity between two sample contents is less than the preset sample similarity, there is no edge between the content nodes of the two sample contents; if the sample similarity between two sample contents is not less than the preset sample similarity, there is an edge between the content nodes of the two sample contents, and the weight of the edge is the sample similarity between the sample contents of the two connected content nodes.

[0151] Optionally, in this embodiment, the content graph model includes content nodes corresponding to each sample content, and edges between content nodes, wherein the edges represent an association relationship between two connected content nodes;

[0152] The step of “performing label information transfer processing on the category label information of the labeled sample content according to the content graph model to obtain category label information corresponding to the unlabeled sample content” may include:

[0153] Performing label information transmission processing on the category label information of the labeled sample content through the edges between content nodes in the content graph model to determine reference category label information of the unlabeled sample content;

[0154] For each unlabeled sample content, the reference category label information of the unlabeled sample content is iteratively updated according to the adjacent content nodes of the unlabeled sample content in the content graph model until the labels of the content nodes in the content graph model converge, thereby obtaining the category label information corresponding to the unlabeled sample content.

[0155] The content graph model is a graph neural network. In this embodiment, a content graph model can be constructed, and the content graph model can be used to learn the representation of nodes, that is, to learn the category label information of nodes; specifically, the content graph model can be used as the main architecture to integrate the association relationship between nodes into the feature embedding process.

[0156] Among them, in the content graph model, the category label information of the annotated sample content is processed by transferring label information through the edges between content nodes. Specifically, for each content node, a node search is performed in the content graph model according to the content node to determine the neighbor node corresponding to the content node, and the feature information is transferred to the content node according to the initial category label information of the neighbor node and the corresponding sample similarity between the neighbor node and the content node, so as to obtain the reference category label information of the content node. It should be noted that for unlabeled sample content, the category label information of its content node needs to be reset to the original category label information. Among them, the neighbor node can specifically be a node connected to the content node in the content graph model.

[0157] In some embodiments, the condition corresponding to label convergence may be that the number of label iterations reaches a preset number, which can be set according to actual conditions, such as 5. In other embodiments, the condition corresponding to label convergence may also be that the category label information of the content nodes corresponding to all unlabeled sample contents in the local iteration is the same as the category label information of the previous iteration.

[0158] Among them, the step of "performing feature information transfer processing on the content node according to the initial category label information of the neighbor node and the corresponding sample similarity between the neighbor node and the content node to obtain reference category label information of the content node" may specifically include: constructing a node relationship matrix according to the corresponding sample similarity between the neighbor node and the content node, each element in the node relationship matrix represents the sample similarity between the content node and the corresponding neighbor node; then, constructing a label matrix according to the initial category label information of the neighbor node, each element in the label matrix represents the initial category label information of the corresponding neighbor node, and finally, fusing the node relationship matrix and the label matrix to obtain the reference category label information of the content node.

[0159] 105. For each content segment of the sample content, calculate consistency information between the content segment and the sample content to which it belongs according to local feature information corresponding to the content segment and global feature information of the sample content to which the content segment belongs.

[0160] The consistency information represents the semantic consistency between the content segment and the sample content to which it belongs.

[0161] Optionally, in this embodiment, the step of “for each content segment of the sample content, calculating the consistency information between the content segment and the sample content to which it belongs according to the local feature information corresponding to the content segment and the global feature information of the sample content to which the content segment belongs” may include:

[0162] Based on the global feature information of each sample content, a global feature set is constructed, and based on the local feature information of the content fragments of each sample content, a local feature set is constructed;

[0163] For each sample content, searching the global feature set for at least one similar global feature information that matches the global feature information of the sample content, and determining a candidate label set for the sample content based on category label information of the sample content to which the similar global feature information belongs;

[0164] For each content segment of the sample content, searching the local feature set for at least one similar local feature information matching the local feature information of the content segment, and determining a candidate label set for the content segment based on category label information of the sample content to which the similar local feature information belongs;

[0165] Based on the candidate tag set of the content segment and the candidate tag set of the sample content to which the content segment belongs, the consistency information between the content segment and the sample content to which the content segment belongs is calculated.

[0166] The global feature set may include global feature information of each sample content, and the local feature set may include local feature information of all content segments of each sample content.

[0167] Among them, the global feature information of the sample content can be similarly calculated with the global feature information of other sample contents in the global feature set except the sample content, and based on the similarity between the global feature information of other sample contents and the global feature information of the sample content, similar global feature information of the sample content can be selected from the global feature information of other sample contents. In some embodiments, the global feature information of other sample contents with a similarity greater than a preset similarity can be used as similar global feature information of the sample content; in other embodiments, the global feature information of other sample contents can be arranged based on the similarity, such as arranging from large to small according to the similarity, to obtain the arranged global feature information, and the first Y global feature information in the arranged global feature information can be used as the similar global feature information of the sample content.

[0168] Among them, the local feature information corresponding to the content segment can be calculated with the local feature information of other content segments in the local feature set except the content segment, and based on the similarity between the local feature information of other content segments and the local feature information of the content segment, the similar local feature information of the content segment is selected from the local feature information of other content segments. In some embodiments, the local feature information of other content segments with a similarity greater than a preset similarity can be used as the similar local feature information of the content segment; in other embodiments, the local feature information of other content segments can be sorted based on the similarity, such as sorting from large to small according to the similarity, to obtain sorted local feature information, and the first Y local feature information in the sorted local feature information can be used as the similar local feature information of the content segment.

[0169] The candidate tag set of the sample content may include the category tag information of the sample content to which each similar global feature information of the sample content belongs. The candidate tag set of the content segment may include the category tag information of the sample content to which each similar local feature information of the content segment belongs.

[0170] Optionally, in this embodiment, the step of “calculating consistency information between the content segment and the sample content to which the content segment belongs based on the candidate tag set of the content segment and the candidate tag set of the sample content to which the content segment belongs” may include:

[0171] Performing statistical analysis on the category label information in the candidate label set of the content segment to determine the label probability distribution information of the content segment;

[0172] Performing statistical analysis on the category label information in the candidate label set of the sample content to which the content segment belongs, and determining the label probability distribution information of the sample content to which the content segment belongs;

[0173] Based on the label probability distribution information of the content segment and the label probability distribution information of the sample content to which the content segment belongs, the consistency information between the content segment and the sample content to which the content segment belongs is calculated.

[0174] The statistical analysis of the candidate tag set of the content segment can be specifically: counting the number of occurrences of each category tag information in the candidate tag set. For example, in a specific scenario, a total of 5 classes are defined, that is, there are 5 types of category tag information, namely, class A, class B, class C, class D and class E; and there are 3 sample contents to which similar local feature information matching the content segment belongs, and the category tag information of these three sample contents are class A, class B, and class B, that is, the candidate tag set of the content segment includes three category tag information of class A, class B, and class B, among which class A appears once, class B appears twice, and class C, class D, and class E appear 0 times. Then, the tag probability distribution information of the content segment can be obtained by statistics as [1 / 5, 2 / 5, 0, 0, 0], 1 / 5 represents the occurrence probability of class A tags, 2 / 5 represents the occurrence probability of class B tags, the first 0 in the array represents the occurrence probability of class C tags, the second 0 in the array represents the occurrence probability of class D tags, and the third 0 in the array represents the occurrence probability of class E tags.

[0175] Similarly, the statistical analysis of the candidate tag set of the sample content to which the content segment belongs may specifically be: counting the number of occurrences of each category of tag information in the candidate tag set of the sample content to which the content segment belongs. For example, in a specific scenario, a total of 5 classes are defined, that is, there are 5 types of category label information, namely Class A, Class B, Class C, Class D and Class E; and there are 3 similar global feature information matching the sample content to which the content fragment belongs. The category label information of the sample content to which these 3 similar global feature information belong is Class A, Class B, and Class C, respectively. That is, the candidate label set of the sample content to which the content fragment belongs includes the three category label information of Class A, Class B, and Class C, among which Class A appears 1 time, Class B appears 1 time, Class C appears 1 time, and Class D and Class E appear 0 times. Then, the label probability distribution information of the sample content to which the content fragment belongs can be statistically obtained as [1 / 5, 1 / 5, 1 / 5, 0, 0]. The first 1 / 5 in the array represents the probability of occurrence of the A class label, the second 1 / 5 in the array represents the probability of occurrence of the B class label, the third 1 / 5 in the array represents the probability of occurrence of the C class label, the first 0 in the array represents the probability of occurrence of the D class label, and the second 0 in the array represents the probability of occurrence of the E class label.

[0176] The step of “calculating consistency information between the content segment and the sample content to which the content segment belongs based on the label probability distribution information of the content segment and the label probability distribution information of the sample content to which the content segment belongs” may include:

[0177] Performing divergence calculation on the label probability distribution information of the content segment and the label probability distribution information of the sample content to which the content segment belongs to obtain divergence information;

[0178] Based on the divergence information, consistency information between the content segment and the sample content to which it belongs is determined.

[0179] There are many ways to calculate the divergence, which are not limited in this embodiment. For example, the divergence calculation method may be KL divergence.

[0180] In a specific scenario, the sample content x can be extracted through the feature encoder in the content classification model. i The global feature information f i g , and the sample content x i Each content fragment x i,j The local feature information f i,j p ; For each sample content x i , according to its global feature information f i g and the local feature information f of its content fragment i,j p Search for top-k similar content in the corresponding range of the training set data respectively, and return the corresponding top-k pseudo-label list (i.e., the candidate label set in the above embodiment); then, calculate the consistency information of the content segment and the sample content to which it belongs based on the top-k pseudo-label list of the content segment and the top-k pseudo-label list of the sample content to which the content segment belongs. The specific process is as follows:

[0181] S1: In the global feature set {f * g Search with sample content x i The global feature information f i g The matching similar global feature information, in the local feature set {f *,* p}Search with content fragment x i,j The local feature information f i,j p The matched similar local feature information is used to obtain the top-k pseudo-label lists of scores, where * represents any;

[0182] S2: Convert each pseudo-label list into label probability distribution information. For example, if k=3, the pseudo-label list contains 3 category label information. If a total of 5 classes are defined, there are 5 types of category label information. These five category label information are recorded as category 0, category 1, category 2, category 3, and category 4, respectively. Specifically, if the pseudo-label list is [1, 1, 0], in the pseudo-label list, category 1 appears 2 times, category 0 appears 1 time, and other categories appear 0 times. Therefore, the pseudo-label list can be converted into label probability distribution information [1 / 5, 2 / 5, 0,0, 0], where 1 / 5 represents the probability of category 0 appearing, 2 / 5 represents the probability of category 1 appearing, and the last three 0s in the label probability distribution information represent the probabilities of category 2, category 3, and category 4 appearing, respectively.

[0183] S3: Calculate the consistency information between the local feature information of each content segment and the global feature information of the sample content to which it belongs. The definition of the consistency information can be specifically shown in formula (1):

[0184] a i,j = exp(-α * KL(retr i g ||retr i,j p ))(1)

[0185] Among them, retr is the converted top-k pseudo-label probability distribution (that is, the above label probability distribution information), retr i g Represents the label probability distribution information of sample content i belonging to content segment j, retr i,j p represents the label probability distribution information of content segment j in sample content i, α is a configurable parameter, KL(·||·) is the KL divergence, and a i,j Indicates the consistency information (consistency score) between content segment j and the sample content i to which it belongs. When the probability distribution information of the two labels is consistent, the KL divergence is 0, and a i,j =1; the lower the consistency, the i,j The closer to 0.

[0186] 106. Based on the consistency information and the category label information corresponding to the unlabeled sample content, adjust the parameters of the content classification model to obtain a target content classification model, wherein the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

[0187] After the target content classification model is trained, the feature extraction module of the target content classification model can be used to extract features of the target content to obtain global feature information of the target content, and then the classification module of the target content classification model can be used to predict the category label information of the target content based on the global feature information of the target content.

[0188] Optionally, in this embodiment, the step of “adjusting the parameters of the content classification model based on the consistency information and the category label information corresponding to the unlabeled sample content to obtain a target content classification model” may include:

[0189] Based on the global feature information of the sample content, performing content classification processing on the sample content to obtain global category probability distribution information corresponding to the sample content;

[0190] Based on the local feature information corresponding to the content segment, the content segment is subjected to content classification processing to obtain local category probability distribution information corresponding to the content segment;

[0191] According to the global category probability distribution information, the local category probability distribution information, the consistency information and the category label information corresponding to the unlabeled sample content, the parameters of the content classification model are adjusted to obtain a target content classification model.

[0192] Among them, the classification module of the content classification model can perform content classification processing on the sample content based on the global feature information of the sample content to obtain global category probability distribution information of the sample content. The global category probability distribution information includes the probability that each preset category label information belongs to the sample content.

[0193] Among them, the classification module of the content classification model can perform content classification processing on the content fragment based on the local feature information of the content fragment to obtain local category probability distribution information of the content fragment, and the local category probability distribution information includes the probability that each preset category label information belongs to the content fragment.

[0194] Optionally, in this embodiment, the step of “adjusting parameters of the content classification model according to the global category probability distribution information, the local category probability distribution information, the consistency information, and the category label information corresponding to the unlabeled sample content to obtain a target content classification model” may include:

[0195] For each sample content, based on the local category probability distribution information of each content segment in the sample content and the consistency information corresponding to each content segment, the category label information of the sample content is corrected to obtain the corrected category label information of the sample content;

[0196] Based on the global category probability distribution information corresponding to each sample content, the corrected category label information of each sample content is fused to obtain the global loss information;

[0197] Based on the global loss information, the parameters of the content classification model are adjusted to obtain a target content classification model.

[0198] The step of “for each sample content, based on the local category probability distribution information of each content segment in the sample content and the consistency information corresponding to each content segment, correcting the category label information of the sample content to obtain the corrected category label information of the sample content” may include:

[0199] For each sample content, based on the consistency information corresponding to each content segment in the sample content, weighted fusion is performed on the local category probability distribution information of each content segment in the sample content to obtain a category correction factor of the sample content;

[0200] The category correction factor of the sample content and the category label information of the sample content are fused to obtain the corrected category label information of the sample content.

[0201] The sample content here may include annotated sample content and unannotated sample content.

[0202] Optionally, in this embodiment, the step of “fusing the corrected category label information of each sample content based on the global category probability distribution information corresponding to each sample content to obtain the global loss information” may include:

[0203] For each sample content, performing a logarithmic operation on the global category probability distribution information corresponding to the sample content;

[0204] Fusion of the logarithmic operation result and the corrected category label information of the sample content to obtain a global sub-loss of the sample content;

[0205] The global sub-losses of each sample content are fused to obtain the global loss information.

[0206] In a specific scenario, the global feature information and local feature information are normalized by the softmax (normalized exponential function) of the classifier (the above classification module), and the score vectors can be recorded as s i g and i,j p ; Among them, s i g is the global category probability distribution information corresponding to the sample content i in the above embodiment, s i,j pis the local category probability distribution information of content segment j in sample content i in the above embodiment.

[0207] For global feature information, this embodiment can define a classification loss based on local feature correction. Specifically, the local features can be used to correct the pseudo labels. The predicted value of is shown in formula (2):

[0208] (2)

[0209] Among them, β is an adjustable parameter with a value range between 0 and 1, and w i,j is the consistency score a corresponding to content segment j i,j The result of softmax normalization. In essence, the pseudo-label of global feature information is smoothed by using the category distribution of local features based on consistency weighting.

[0210] in, is the corrected category label information of sample content i, is the category label information of sample content i.

[0211] In this embodiment, the loss of the global feature (i.e., the global loss information) can be defined as shown in formula (3):

[0212] (3)

[0213] in, Represents the global loss information. The cross entropy loss is used here, but the pseudo label y is replaced by the corrected It should be noted that the pseudo-label here can refer to both the pseudo-label information of the unlabeled sample content and the category label information obtained by manually labeling the labeled sample content.

[0214] Optionally, in this embodiment, the step of “adjusting the parameters of the content classification model based on the global loss information to obtain a target content classification model” may include:

[0215] Calculating local classification loss information of the content segment based on local category probability distribution information of the content segment and category label information of sample content to which the content segment belongs;

[0216] Based on the global loss information and the local classification loss information, the parameters of the content classification model are adjusted to obtain a target content classification model.

[0217] Among them, the local category probability distribution information of the content segment can be logarithmically operated to obtain a logarithmic operation result, and then the category label information of the sample content to which the content segment belongs is fused with the logarithmic operation result (such as multiplication) to obtain the local classification loss information of the content segment.

[0218] Optionally, in this embodiment, the step of “adjusting the parameters of the content classification model based on the global loss information and the local classification loss information to obtain a target content classification model” may include:

[0219] Performing difference measurement processing between the local category probability distribution information of the content segment and the uniform distribution to obtain divergence information corresponding to the content segment;

[0220] Based on the consistency information corresponding to the content segment, the local classification loss information and the divergence information are merged to obtain the local loss information of the content segment;

[0221] According to the global loss information and the local loss information corresponding to each content segment of the sample content, the parameters of the content classification model are adjusted to obtain a target content classification model.

[0222] Among them, the KL divergence can be used to measure the difference between the local category probability distribution information of the content fragment and the uniform distribution. If the calculated KL divergence is close to 0, it means that the local category probability distribution information of the content fragment is consistent with the distribution information of the uniform distribution, which reflects that the content of the content fragment may not contain significant discriminant information. Therefore, the loss cannot be determined solely based on the inconsistency between the content fragment and the global feature information. It is necessary to consider that the content fragment itself does not contain significant discriminant information, resulting in inconsistency with the global feature information.

[0223] There are multiple ways to fuse the local classification loss information and the divergence information, such as weighted fusion, where the fusion weight can be determined based on the consistency information of the content segment.

[0224] Among them, the global loss information and the local loss information corresponding to each content segment of all sample contents can be fused (such as weighted operation) to obtain the total loss information; then the parameters of the content classification model are adjusted based on the total loss information to obtain the target content classification model.

[0225] Among them, the back propagation algorithm can be used to adjust the parameters of the content classification model and optimize the parameters of the content classification model based on the total loss information, so that the total loss information is less than the preset loss value, and a trained content classification model is obtained. The trained content classification model is the target content classification model.

[0226] In this embodiment, for local feature information, a label smoothing classification loss can be defined, as shown in formula (4):

[0227] (4)

[0228] in, represents the sum of the local loss information of each content segment under all sample contents. N represents the number of content segments obtained by segmenting a single sample content. is the category label information of sample content i, KL is the KL divergence function, and u is the uniform distribution.

[0229] in, It contains two items. The first item is the classification loss of cross entropy, and the second item is KL divergence. The two items are used with consistency score a i,j Weighted fusion. Considering that each content segment may not contain significant discriminative information like global feature information, we do not force the classification loss to be low (the first term on the right side of the equal sign in equation (4)). Instead, we introduce the KL divergence calculation with the uniform distribution u. If the feature of a slice (content segment) is consistent with the global feature information a i,j If u is large, the first term is large, and the model is more inclined to classify it into the category of the pseudo label. If the consistency is low (indicating that the slice may not contain important information), the second term is large, and the model encourages its classification score to collapse into a uniform distribution, close to u, so that the KL divergence is small.

[0230] In this embodiment, the two losses of equation (3) and equation (4) are trained together to update the parameters of the classifier and feature encoder (i.e., feature extraction module). Specifically, the training process depends on the calculation results of the features generated by the feature encoder, and the feature encoder parameters are updated during the training process. Therefore, the method of updating once per epoch is adopted in the implementation, that is, during the training of one epoch, the pseudo-labels and consistency scores of the feature calculation of the previous epoch are kept unchanged for training; after one epoch of training is completed, the pseudo-labels and consistency scores are updated based on the updated feature encoder and the training continues. Among them, epoch means that all samples in the training data set are fully trained for the model.

[0231] The training method of the content classification model of the present application generates, corrects and smoothes pseudo labels through clustering and global / local consistency calculation to train the model, and optimizes alternately. It can make full use of large-scale unsupervised data and control the impact of noise; and there is no need for a large amount of manual labeling, which helps to improve process efficiency and save costs.

[0232] Aiming at the specific business needs of content understanding, this application proposes a weakly supervised content classification method based on clustering and pseudo-label correction. It mainly includes two steps: 1) For a large amount of collected content (among which only individual content has been manually annotated, and most of the rest of the content is unlabeled data), extract global features and local features respectively, directly generate pseudo labels through weakly supervised clustering methods, and calculate the consistency of global and local features; 2) Based on the results of generating pseudo labels and consistency estimation, design label smoothing local classification loss and local correction-based global classification loss, and train feature encoders and classifiers. The above two steps are performed alternately until the model converges. The method proposed in this application only relies on a small amount of labeled data, avoids the time consumption of large-scale labeled data, and reduces the impact of noise through global and local consistency. It is more suitable for scenarios where content classification systems need to be quickly adjusted in business scenarios.

[0233] In a specific scenario, Figure 1e FIG. 1 is a flow chart of a training method for a content classification model of the present application, and the training steps are specifically described as follows:

[0234] S1: Construct training data and define training data as X = {x i}, which contains two subsets, L and U. L is a small amount of sample content with class labels (n samples are labeled for each class), and U is a sample content without class labels. The content of U is much larger than that of L.

[0235] S2: Preprocess the training data: for each sample content x i In addition to keeping the original content, each content is evenly cut into N segments according to the duration, denoted as {x i,j}, subscript j represents the jth slice, j = 1, 2, ..., N;

[0236] S3: Extract global feature information and local feature information: Based on the feature encoder, extract features from the original sample content and the corresponding content slices. The features of the original sample content are considered as global feature information, denoted as f i g , the feature of the content slice is considered as local feature information, denoted as f i,j p Since the sample content is divided into N content slices, the sample content can correspond to N local features, namely: local feature #1 (f i,1 p ), local feature #2 (f i,2 p ),…, local features #N (f i,N p );

[0237] S4: Clustering to generate pseudo labels: Cluster the global feature information of the sample content to obtain pseudo labels. Note that some sample contents have labeled results. Based on the weakly supervised clustering method, a pseudo label y is assigned to other unlabeled sample contents. i ;

[0238] S5: Calculate local and global consistency: For each sample content x i Each content slice j can get a consistency score a with the global feature i,j ;

[0239] S6, through the classifier to the global feature f i g Perform category label score prediction to obtain the global prediction score S i g (i.e., the global category probability distribution information in the above embodiment); the local feature #1 (f i,1 p ), local feature #2 (f i,2 p ),…, local features #N (f i,N p ) These N local features are used to predict the category label score and obtain the local score #1 (S i,1 p )、Local score #2(S i,2 p ),…, local score #N (S i,N p ), the local score is the local category probability distribution information in the above embodiment;

[0240] S7: Based on the global prediction score, local score, pseudo label and consistency score, calculate the loss, train the model according to the loss, update the feature encoder and classifier parameters, and exit after one epoch of training is completed; the loss here may include the local loss of label smoothing and the modified global cross entropy loss, as described in the above embodiment;

[0241] S8: Based on the updated feature encoder, repeat S3-S7 until the model training is completed.

[0242] Specifically, when defining the classification system and standards, the business will naturally label a small number of samples for each category as examples. This part of the samples can be used as supervised data for model training, denoted as L. In addition, the online system has a large amount of UGC content, that is, content that has not been manually labeled. This part of the data can also be used for model training as unsupervised data, denoted as U. Generally speaking, the scale of U is much larger than L. These two parts of data are combined as the training set X = {x i}. For each sample content x i , can be further divided into N segments evenly according to the time dimension, denoted as {x i,j}, j=1,2,3,…,N.

[0243] This application proposes a weakly supervised content classification method, which generates pseudo labels through a weakly supervised clustering method, and better utilizes the unsupervised data in the same domain for training. This only requires a small amount of manual labeling, which can save a lot of data labeling costs and time. In addition, this application also introduces the calculation of global and local consistency, which can better handle the noise of pseudo labels obtained by clustering methods, make pseudo labels of higher quality, reduce the impact of pseudo label noise on the training process, and facilitate model learning.

[0244] As can be seen from the above, the present embodiment can obtain a content classification model and training data, wherein the sample content in the training data includes annotated sample content and unannotated sample content, and the annotated sample content carries its corresponding category label information; for each sample content, the sample content is subjected to content slicing processing to obtain a plurality of content segments of the sample content; through the content classification model, feature extraction processing is performed on the sample content and each content segment of the sample content to obtain global feature information of the sample content and local feature information corresponding to each content segment; based on the category label information of the annotated sample content, the global feature information of each sample content in the training data is clustered to obtain the category label information corresponding to the unannotated sample content; for each content segment of the sample content, the consistency information between the content segment and the sample content to which it belongs is calculated according to the local feature information corresponding to the content segment and the global feature information of the sample content to which the content segment belongs; based on the consistency information and the category label information corresponding to the unannotated sample content, the parameters of the content classification model are adjusted to obtain a target content classification model, and the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

[0245] This application only requires a small amount of labeled sample content, saving a lot of data labeling costs and time; based on the partially labeled sample content, a weakly supervised clustering method is used to generate pseudo-labels for unlabeled sample content, thereby utilizing a large amount of unsupervised data - unlabeled sample content for training together, and combining global and local consistency information, it is possible to process the noise of pseudo-labels obtained by clustering, thereby improving the quality of pseudo-labels, which is beneficial to improving the training effect of the model and improving the model classification accuracy.

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

[0247] The present application embodiment provides a method for training a content classification model. Figure 2 As shown, the specific process of the training method of the content classification model can be as follows:

[0248] 201. The server obtains a content classification model and training data, wherein the sample content in the training data includes labeled sample content and unlabeled sample content, and the labeled sample content carries its corresponding category label information.

[0249] Among them, the content classification model may include a feature extraction module and a classification module. The feature extraction module may be used to extract feature information of the content. The classification module may classify the content based on the feature information extracted by the feature extraction module and predict the category label information of the content.

[0250] In this embodiment, the content modality of the sample content is not limited, for example, the sample content may be text, audio, image, or video, etc. Specifically, the sample content may be single-modal content, such as pure text content, or multi-modal content, such as a combination of text and images.

[0251] 202. The server performs content slicing processing on each sample content to obtain multiple content segments of the sample content.

[0252] 203. The server performs feature extraction processing on the sample content and each content segment of the sample content respectively through the content classification model to obtain global feature information of the sample content and local feature information corresponding to each content segment.

[0253] Optionally, in this embodiment, the step of “performing feature extraction processing on the sample content and each content segment of the sample content respectively through the content classification model to obtain global feature information of the sample content and local feature information corresponding to each content segment” may include:

[0254] Acquire an image sequence of the sample content in image mode and a text sequence in text mode, and acquire an image subsequence of each content segment of the sample content in image mode and a text subsequence in text mode;

[0255] Performing fusion processing on the image sequence and text sequence of the sample content to obtain a content unit sequence corresponding to the sample content; performing fusion processing on the image subsequence and text subsequence of the content fragment to obtain a content unit sequence corresponding to the content fragment;

[0256] By using the content classification model, performing attention encoding processing on the content unit sequence of the sample content to obtain global feature information of the sample content;

[0257] By using the content classification model, attention encoding processing is performed on the content unit sequence of the content segment to obtain local feature information of the content segment.

[0258] The sample content may be a video, and this embodiment may use features in two modes: visual features and text features. The visual mode comes from the visual features of the video frames obtained by decoding and extracting the sample content, while the text may come from the title description and subtitles of the video itself.

[0259] It should be noted that the text sequence in the text mode here may include corresponding text description information obtained by converting the audio of the sample content through the ASR technology, and may also include text information obtained by performing text recognition on the image of the sample content through the OCR technology.

[0260] 204. The server performs clustering processing on the global feature information of each sample content in the training data based on the category label information of the labeled sample content to obtain the category label information corresponding to the unlabeled sample content.

[0261] There are many ways to cluster the global feature information of each sample content, which is not limited in this embodiment. For example, the clustering method can be COP-K-Means (Constrained K-Means) algorithm, Label Propagation Algorithm (LPA) and Label Propagation Clustering Algorithm (LPCA).

[0262] In this embodiment, the category label information of the labeled sample content can be used to label the unlabeled sample content through a weakly supervised clustering method, thereby obtaining the category label information of the unlabeled sample content.

[0263] Among them, the category label information of the unlabeled sample content obtained by clustering can be regarded as pseudo-label information of the unlabeled sample content. The pseudo-label information is not obtained through manual labeling, but is obtained by using the category label information of the labeled sample content.

[0264] 205. The server calculates, for each content segment of the sample content, consistency information between the content segment and the sample content to which it belongs according to local feature information corresponding to the content segment and global feature information of the sample content to which the content segment belongs.

[0265] The consistency information represents the semantic consistency between the content segment and the sample content to which it belongs.

[0266] Optionally, in this embodiment, the step of “for each content segment of the sample content, calculating the consistency information between the content segment and the sample content to which it belongs according to the local feature information corresponding to the content segment and the global feature information of the sample content to which the content segment belongs” may include:

[0267] Based on the global feature information of each sample content, a global feature set is constructed, and based on the local feature information of the content fragments of each sample content, a local feature set is constructed;

[0268] For each sample content, searching the global feature set for at least one similar global feature information that matches the global feature information of the sample content, and determining a candidate label set for the sample content based on category label information of the sample content to which the similar global feature information belongs;

[0269] For each content segment of the sample content, searching the local feature set for at least one similar local feature information matching the local feature information of the content segment, and determining a candidate label set for the content segment based on category label information of the sample content to which the similar local feature information belongs;

[0270] Based on the candidate tag set of the content segment and the candidate tag set of the sample content to which the content segment belongs, the consistency information between the content segment and the sample content to which the content segment belongs is calculated.

[0271] The global feature set may include global feature information of each sample content, and the local feature set may include local feature information of all content segments of each sample content.

[0272] The candidate tag set of the sample content may include the category tag information of the sample content to which each similar global feature information of the sample content belongs. The candidate tag set of the content segment may include the category tag information of the sample content to which each similar local feature information of the content segment belongs.

[0273] Optionally, in this embodiment, the step of “calculating consistency information between the content segment and the sample content to which the content segment belongs based on the candidate tag set of the content segment and the candidate tag set of the sample content to which the content segment belongs” may include:

[0274] Performing statistical analysis on the category label information in the candidate label set of the content segment to determine the label probability distribution information of the content segment;

[0275] Performing statistical analysis on the category label information in the candidate label set of the sample content to which the content segment belongs, and determining the label probability distribution information of the sample content to which the content segment belongs;

[0276] Based on the label probability distribution information of the content segment and the label probability distribution information of the sample content to which the content segment belongs, the consistency information between the content segment and the sample content to which the content segment belongs is calculated.

[0277] The step of “calculating consistency information between the content segment and the sample content to which the content segment belongs based on the label probability distribution information of the content segment and the label probability distribution information of the sample content to which the content segment belongs” may include:

[0278] Performing divergence calculation on the label probability distribution information of the content segment and the label probability distribution information of the sample content to which the content segment belongs to obtain divergence information;

[0279] Based on the divergence information, consistency information between the content segment and the sample content to which it belongs is determined.

[0280] There are many ways to calculate the divergence, which are not limited in this embodiment. For example, the divergence calculation method may be KL divergence.

[0281] 206. The server performs content classification processing on the sample content based on the global feature information of the sample content to obtain global category probability distribution information corresponding to the sample content.

[0282] Among them, the classification module of the content classification model can perform content classification processing on the sample content based on the global feature information of the sample content to obtain global category probability distribution information of the sample content. The global category probability distribution information includes the probability that each preset category label information belongs to the sample content.

[0283] 207. The server performs content classification processing on the content segment based on the local feature information corresponding to the content segment to obtain local category probability distribution information corresponding to the content segment.

[0284] Among them, the classification module of the content classification model can perform content classification processing on the content fragment based on the local feature information of the content fragment to obtain local category probability distribution information of the content fragment, and the local category probability distribution information includes the probability that each preset category label information belongs to the content fragment.

[0285] 208. The server adjusts the parameters of the content classification model according to the global category probability distribution information, the local category probability distribution information, the consistency information and the category label information corresponding to the unlabeled sample content to obtain a target content classification model. The target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

[0286] Optionally, in this embodiment, the step of “adjusting parameters of the content classification model according to the global category probability distribution information, the local category probability distribution information, the consistency information, and the category label information corresponding to the unlabeled sample content to obtain a target content classification model” may include:

[0287] For each sample content, based on the local category probability distribution information of each content segment in the sample content and the consistency information corresponding to each content segment, the category label information of the sample content is corrected to obtain the corrected category label information of the sample content;

[0288] Based on the global category probability distribution information corresponding to each sample content, the corrected category label information of each sample content is fused to obtain the global loss information;

[0289] Based on the global loss information, the parameters of the content classification model are adjusted to obtain a target content classification model.

[0290] The step of “for each sample content, based on the local category probability distribution information of each content segment in the sample content and the consistency information corresponding to each content segment, correcting the category label information of the sample content to obtain the corrected category label information of the sample content” may include:

[0291] For each sample content, based on the consistency information corresponding to each content segment in the sample content, weighted fusion is performed on the local category probability distribution information of each content segment in the sample content to obtain a category correction factor of the sample content;

[0292] The category correction factor of the sample content and the category label information of the sample content are fused to obtain the corrected category label information of the sample content.

[0293] The sample content here may include annotated sample content and unannotated sample content.

[0294] Optionally, in this embodiment, the step of “fusing the corrected category label information of each sample content based on the global category probability distribution information corresponding to each sample content to obtain the global loss information” may include:

[0295] For each sample content, performing a logarithmic operation on the global category probability distribution information corresponding to the sample content;

[0296] Fusion of the logarithmic operation result and the corrected category label information of the sample content to obtain a global sub-loss of the sample content;

[0297] The global sub-losses of each sample content are fused to obtain the global loss information.

[0298] Optionally, in this embodiment, the step of “adjusting the parameters of the content classification model based on the global loss information to obtain a target content classification model” may include:

[0299] Calculating local classification loss information of the content segment based on local category probability distribution information of the content segment and category label information of sample content to which the content segment belongs;

[0300] Based on the global loss information and the local classification loss information, the parameters of the content classification model are adjusted to obtain a target content classification model.

[0301] Among them, the local category probability distribution information of the content segment can be logarithmically operated to obtain a logarithmic operation result, and then the category label information of the sample content to which the content segment belongs is fused with the logarithmic operation result (such as multiplication) to obtain the local classification loss information of the content segment.

[0302] Optionally, in this embodiment, the step of “adjusting the parameters of the content classification model based on the global loss information and the local classification loss information to obtain a target content classification model” may include:

[0303] Performing difference measurement processing between the local category probability distribution information of the content segment and the uniform distribution to obtain divergence information corresponding to the content segment;

[0304] Based on the consistency information corresponding to the content segment, the local classification loss information and the divergence information are merged to obtain the local loss information of the content segment;

[0305] According to the global loss information and the local loss information corresponding to each content segment of the sample content, the parameters of the content classification model are adjusted to obtain a target content classification model.

[0306] Among them, the KL divergence can be used to measure the difference between the local category probability distribution information of the content fragment and the uniform distribution. If the calculated KL divergence is close to 0, it means that the local category probability distribution information of the content fragment is consistent with the distribution information of the uniform distribution, which reflects that the content of the content fragment may not contain significant discriminant information. Therefore, the loss cannot be determined solely based on the inconsistency between the content fragment and the global feature information. It is necessary to consider that the content fragment itself does not contain significant discriminant information, resulting in inconsistency with the global feature information.

[0307] Aiming at the specific business needs of content understanding, this application proposes a weakly supervised content classification method based on clustering and pseudo-label correction. It mainly includes two steps:

[0308] 1) For a large amount of collected content (only a few of which are manually annotated, and most of the rest are unlabeled data), extract global features and local features respectively, directly generate pseudo labels through weakly supervised clustering methods, and calculate the consistency of global and local features;

[0309] 2) Based on the results of generating pseudo labels and consistency estimation, a local classification loss for label smoothing and a global classification loss based on local correction are designed to train feature encoders and classifiers. The above two steps are performed alternately until the model converges. The method proposed in this application relies only on a small amount of labeled data, avoiding the time consumption of large-scale labeled data, and reducing the impact of noise through global and local consistency. It is more suitable for scenarios where content classification systems need to be quickly adjusted in business scenarios.

[0310] As can be seen from the above, the present embodiment can obtain a content classification model and training data through a server, wherein the sample content in the training data includes annotated sample content and unannotated sample content, wherein the annotated sample content carries its corresponding category label information; for each sample content, the sample content is subjected to content slicing processing to obtain a plurality of content segments of the sample content; through the content classification model, feature extraction processing is performed on the sample content and each content segment of the sample content, respectively, to obtain global feature information of the sample content and local feature information corresponding to each content segment; based on the category label information of the annotated sample content, the global feature information of each sample content in the training data is clustered to obtain the category label information corresponding to the unannotated sample content; for each content segment of the sample content, according to the corresponding The local feature information of the content segment and the global feature information of the sample content to which the content segment belongs are used to calculate the consistency information between the content segment and the sample content to which it belongs; based on the global feature information of the sample content, the sample content is subjected to content classification processing to obtain the global category probability distribution information corresponding to the sample content; based on the local feature information corresponding to the content segment, the content segment is subjected to content classification processing to obtain the local category probability distribution information corresponding to the content segment; according to the global category probability distribution information, the local category probability distribution information, the consistency information and the category label information corresponding to the unlabeled sample content, the parameters of the content classification model are adjusted to obtain the target content classification model, and the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

[0311] This application only requires a small amount of labeled sample content, saving a lot of data labeling costs and time; based on the partially labeled sample content, a weakly supervised clustering method is used to generate pseudo-labels for unlabeled sample content, thereby utilizing a large amount of unsupervised data - unlabeled sample content for training together, and combining global and local consistency information, it is possible to process the noise of pseudo-labels obtained by clustering, thereby improving the quality of pseudo-labels, which is beneficial to improving the training effect of the model and improving the model classification accuracy.

[0312] In order to better implement the above method, the present application embodiment also provides a training device for a content classification model, such as Figure 3 As shown, the training device of the content classification model may include an acquisition unit 301, a slicing unit 302, an extraction unit 303, a clustering unit 304, a consistency unit 305 and an adjustment unit 306, as follows:

[0313] (1) Acquisition unit 301;

[0314] The acquisition unit is used to acquire a content classification model and training data, wherein the sample content in the training data includes annotated sample content and unannotated sample content, and the annotated sample content carries its corresponding category label information.

[0315] (2) Slicing unit 302;

[0316] The slicing unit is used to perform content slicing processing on each sample content to obtain multiple content segments of the sample content.

[0317] (3) Extraction unit 303;

[0318] The extraction unit is used to perform feature extraction processing on the sample content and each content segment of the sample content respectively through the content classification model to obtain global feature information of the sample content and local feature information corresponding to each content segment.

[0319] (4) clustering unit 304;

[0320] The clustering unit is used to perform clustering processing on the global feature information of each sample content in the training data based on the category label information of the labeled sample content, so as to obtain the category label information corresponding to the unlabeled sample content.

[0321] Optionally, in some embodiments of the present application, the clustering unit may include setting subunits, adding subunits, selecting subunits, and returning subunits, as follows:

[0322] The setting subunit is used to set a preset number of cluster centers and calculate the similarity between the global feature information of each sample content in the training data and each cluster center;

[0323] an adding subunit, configured to determine, for each sample content, a target cluster center matching the sample content from among the cluster centers based on the similarity and the category label information of the annotated sample content, and add the sample content to a content set corresponding to the target cluster center;

[0324] A selection subunit is used to select sample content that meets the preset cluster center conditions from the content set corresponding to each cluster center as a new cluster center;

[0325] A return subunit is used to return to the step of calculating the similarity between the global feature information of each sample content in the training data and each cluster center until the obtained cluster center meets the clustering end condition; based on the category label information of the labeled sample content in the target content set corresponding to the cluster center that meets the clustering end condition, determine the category label information of the unlabeled sample content in the target content set.

[0326] Optionally, in some embodiments of the present application, the clustering unit may include a similarity determination subunit, a graph model construction subunit, and a label transfer subunit, as follows:

[0327] The similarity determination subunit is used to determine the sample similarity between every two sample contents based on the global feature information of every two sample contents;

[0328] A graph model construction subunit, configured to construct a content graph model according to the sample similarities, wherein the content graph model represents the association relationship between the contents of each sample;

[0329] The label transfer subunit is used to perform label information transfer processing on the category label information of the labeled sample content according to the content graph model to obtain the category label information corresponding to the unlabeled sample content.

[0330] Optionally, in some embodiments of the present application, the content graph model includes content nodes corresponding to each sample content, and edges between content nodes, wherein the edges represent an association relationship between two connected content nodes;

[0331] The label transfer subunit can be specifically used to perform label information transfer processing on the category label information of the labeled sample content through the edges between content nodes in the content graph model to determine the reference category label information of the unlabeled sample content; for each unlabeled sample content, according to the adjacent content nodes of the unlabeled sample content in the content graph model, the reference category label information of the unlabeled sample content is iteratively updated until the labels of the content nodes in the content graph model converge, thereby obtaining the category label information corresponding to the unlabeled sample content.

[0332] (5) consistency unit 305;

[0333] The consistency unit is used to calculate, for each content segment of the sample content, consistency information between the content segment and the sample content to which it belongs according to local feature information corresponding to the content segment and global feature information of the sample content to which the content segment belongs.

[0334] Optionally, in some embodiments of the present application, the consistency unit may include a construction subunit, a first determination subunit, a second determination subunit, and a calculation subunit, as follows:

[0335] The construction subunit is used to construct a global feature set based on the global feature information of each sample content, and to construct a local feature set based on the local feature information of the content fragments of each sample content;

[0336] A first determining subunit is configured to search, for each sample content, the global feature set for at least one similar global feature information that matches the global feature information of the sample content, and determine a candidate label set for the sample content based on category label information of the sample content to which the similar global feature information belongs;

[0337] A second determining subunit is configured to search, for each content segment of the sample content, the local feature set for at least one similar local feature information that matches the local feature information of the content segment, and determine a candidate label set for the content segment based on category label information of the sample content to which the similar local feature information belongs;

[0338] The calculation subunit is used to calculate the consistency information between the content segment and the sample content to which it belongs based on the candidate tag set of the content segment and the candidate tag set of the sample content to which the content segment belongs.

[0339] Optionally, in some embodiments of the present application, the computing subunit can be specifically used to perform statistical analysis and processing on the category label information in the candidate label set of the content segment to determine the label probability distribution information of the content segment; perform statistical analysis and processing on the category label information in the candidate label set of the sample content to which the content segment belongs to to determine the label probability distribution information of the sample content to which the content segment belongs; and calculate the consistency information between the content segment and the sample content to which it belongs based on the label probability distribution information of the content segment and the label probability distribution information of the sample content to which the content segment belongs.

[0340] (6) adjustment unit 306;

[0341] An adjustment unit is used to adjust the parameters of the content classification model based on the consistency information and the category label information corresponding to the unlabeled sample content to obtain a target content classification model, wherein the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

[0342] Optionally, in some embodiments of the present application, the adjustment unit may include a first classification subunit, a second classification subunit and an adjustment subunit, as follows:

[0343] The first classification subunit is used to perform content classification processing on the sample content based on the global feature information of the sample content to obtain global category probability distribution information corresponding to the sample content;

[0344] A second classification subunit is used to perform content classification processing on the content segment based on the local feature information corresponding to the content segment to obtain local category probability distribution information corresponding to the content segment;

[0345] The adjustment subunit is used to adjust the parameters of the content classification model according to the global category probability distribution information, the local category probability distribution information, the consistency information and the category label information corresponding to the unlabeled sample content to obtain a target content classification model.

[0346] Optionally, in some embodiments of the present application, the adjustment subunit can be specifically used to, for each sample content, correct the category label information of the sample content based on the local category probability distribution information of each content segment in the sample content and the consistency information corresponding to each content segment, to obtain the corrected category label information of the sample content; based on the global category probability distribution information corresponding to each sample content, fuse the corrected category label information of each sample content to obtain global loss information; based on the global loss information, adjust the parameters of the content classification model to obtain the target content classification model.

[0347] Optionally, in some embodiments of the present application, the step of “adjusting the parameters of the content classification model based on the global loss information to obtain a target content classification model” may include:

[0348] Calculating local classification loss information of the content segment based on local category probability distribution information of the content segment and category label information of sample content to which the content segment belongs;

[0349] Based on the global loss information and the local classification loss information, the parameters of the content classification model are adjusted to obtain a target content classification model.

[0350] Optionally, in some embodiments of the present application, the step of “adjusting the parameters of the content classification model based on the global loss information and the local classification loss information to obtain a target content classification model” may include:

[0351] Performing difference measurement processing between the local category probability distribution information of the content segment and the uniform distribution to obtain divergence information corresponding to the content segment;

[0352] Based on the consistency information corresponding to the content segment, the local classification loss information and the divergence information are merged to obtain the local loss information of the content segment;

[0353] According to the global loss information and the local loss information corresponding to each content segment of the sample content, the parameters of the content classification model are adjusted to obtain a target content classification model.

[0354] Optionally, in some embodiments of the present application, the extraction unit may include an acquisition subunit, a fusion subunit, a first encoding subunit, and a second encoding subunit, as follows:

[0355] The acquisition subunit is used to acquire an image sequence of the sample content in image mode and a text sequence in text mode, and acquire an image subsequence in image mode and a text subsequence in text mode of each content segment of the sample content;

[0356] A fusion subunit is used to fuse the image sequence and text sequence of the sample content to obtain a content unit sequence corresponding to the sample content; and fuse the image subsequence and text subsequence of the content segment to obtain a content unit sequence corresponding to the content segment;

[0357] A first encoding subunit, configured to perform attention encoding processing on a content unit sequence of the sample content through the content classification model to obtain global feature information of the sample content;

[0358] The second encoding subunit is used to perform attention encoding processing on the content unit sequence of the content segment through the content classification model to obtain local feature information of the content segment.

[0359] Optionally, in some embodiments of the present application, the first encoding sub-unit can be specifically used to obtain, through the content classification model, a content vector and a type vector corresponding to each content unit in the content unit sequence of the sample content, the type vector representing the information type to which the content unit belongs; encode the position information of each content unit in the content unit sequence to obtain a position vector corresponding to each content unit; fuse the content vector, the type vector and the position vector to obtain feature information of each content unit in the content unit sequence of the sample content; perform attention encoding processing on the feature information of each content unit in the content unit sequence to obtain global feature information of the sample content.

[0360] As can be seen from the above, in this embodiment, the acquisition unit 301 can acquire the content classification model and training data, and the sample content in the training data includes annotated sample content and unannotated sample content, and the annotated sample content carries its corresponding category label information; the slicing unit 302 performs content slicing processing on each sample content to obtain multiple content segments of the sample content; the extraction unit 303 performs feature extraction processing on the sample content and each content segment of the sample content through the content classification model to obtain global feature information of the sample content and local feature information corresponding to each content segment; the clustering unit 304 performs feature extraction processing on the sample content and each content segment of the sample content based on the category label information of the annotated sample content. The global feature information of each sample content in the training data is clustered to obtain the category label information corresponding to the unlabeled sample content; the consistency unit 305 calculates the consistency information between the content segment and the sample content to which it belongs, for each content segment of the sample content, according to the local feature information corresponding to the content segment and the global feature information of the sample content to which the content segment belongs; the adjustment unit 306 adjusts the parameters of the content classification model based on the consistency information and the category label information corresponding to the unlabeled sample content to obtain a target content classification model, and the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

[0361] This application only requires a small amount of labeled sample content, saving a lot of data labeling costs and time; based on the partially labeled sample content, a weakly supervised clustering method is used to generate pseudo-labels for unlabeled sample content, thereby utilizing a large amount of unsupervised data - unlabeled sample content for training together, and combining global and local consistency information, it is possible to process the noise of pseudo-labels obtained by clustering, thereby improving the quality of pseudo-labels, which is beneficial to improving the training effect of the model and improving the model classification accuracy.

[0362] The present application also provides an electronic device, such as Figure 4 As shown, it shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, and the electronic device may be a terminal or a server, etc. Specifically:

[0363] 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 Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0364] The processor 401 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, the processor 401 performs various functions of the electronic device and processes data. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.

[0365] 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 devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0366] The electronic device also includes a power supply 403 for supplying power to each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 403 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

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

[0368] 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 will load 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 will run the application programs stored in the memory 402, thereby realizing various functions, as follows:

[0369] A content classification model and training data are obtained, wherein the sample content in the training data includes annotated sample content and unannotated sample content, and the annotated sample content carries its corresponding category label information; for each sample content, the sample content is sliced ​​to obtain a plurality of content segments of the sample content; through the content classification model, feature extraction is performed on the sample content and each content segment of the sample content to obtain global feature information of the sample content and local feature information corresponding to each content segment; based on the category label information of the annotated sample content, the global feature information of each sample content in the training data is clustered to obtain the category label information corresponding to the unannotated sample content; for each content segment of the sample content, the consistency information between the content segment and the sample content to which it belongs is calculated according to the local feature information corresponding to the content segment and the global feature information of the sample content to which the content segment belongs; based on the consistency information and the category label information corresponding to the unannotated sample content, the parameters of the content classification model are adjusted to obtain a target content classification model, and the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

[0370] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0371] As can be seen from the above, the present embodiment can obtain a content classification model and training data, wherein the sample content in the training data includes annotated sample content and unannotated sample content, and the annotated sample content carries its corresponding category label information; for each sample content, the sample content is subjected to content slicing processing to obtain a plurality of content segments of the sample content; through the content classification model, feature extraction processing is performed on the sample content and each content segment of the sample content to obtain global feature information of the sample content and local feature information corresponding to each content segment; based on the category label information of the annotated sample content, the global feature information of each sample content in the training data is clustered to obtain the category label information corresponding to the unannotated sample content; for each content segment of the sample content, the consistency information between the content segment and the sample content to which it belongs is calculated according to the local feature information corresponding to the content segment and the global feature information of the sample content to which the content segment belongs; based on the consistency information and the category label information corresponding to the unannotated sample content, the parameters of the content classification model are adjusted to obtain a target content classification model, and the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

[0372] This application only requires a small amount of labeled sample content, saving a lot of data labeling costs and time; based on the partially labeled sample content, a weakly supervised clustering method is used to generate pseudo-labels for unlabeled sample content, thereby utilizing a large amount of unsupervised data - unlabeled sample content for training together, and combining global and local consistency information, it is possible to process the noise of pseudo-labels obtained by clustering, thereby improving the quality of pseudo-labels, which is beneficial to improving the training effect of the model and improving the model classification accuracy.

[0373] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0374] To this end, an embodiment of the present application provides a computer-readable storage medium, which stores a plurality of instructions, which can be loaded by a processor to execute the steps in any content classification model training method provided in the embodiment of the present application. For example, the instruction can execute the following steps:

[0375] A content classification model and training data are obtained, wherein the sample content in the training data includes annotated sample content and unannotated sample content, and the annotated sample content carries its corresponding category label information; for each sample content, the sample content is sliced ​​to obtain a plurality of content segments of the sample content; through the content classification model, feature extraction is performed on the sample content and each content segment of the sample content to obtain global feature information of the sample content and local feature information corresponding to each content segment; based on the category label information of the annotated sample content, the global feature information of each sample content in the training data is clustered to obtain the category label information corresponding to the unannotated sample content; for each content segment of the sample content, the consistency information between the content segment and the sample content to which it belongs is calculated according to the local feature information corresponding to the content segment and the global feature information of the sample content to which the content segment belongs; based on the consistency information and the category label information corresponding to the unannotated sample content, the parameters of the content classification model are adjusted to obtain a target content classification model, and the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

[0376] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0377] 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.

[0378] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the content classification model training methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any of the content classification model training methods 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.

[0379] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations of the training aspect of the above-mentioned content classification model.

[0380] The above is a detailed introduction to the training method and related equipment of a content classification model provided in an embodiment 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, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for training a content classification model, characterized in that: include: Obtaining a content classification model and training data, wherein the sample content in the training data includes annotated sample content and unannotated sample content, and the annotated sample content carries its corresponding category label information; For each sample content, performing content slicing processing on the sample content to obtain multiple content segments of the sample content; By using the content classification model, feature extraction processing is performed on the sample content and each content segment of the sample content to obtain global feature information of the sample content and local feature information corresponding to each content segment; Based on the category label information of the labeled sample content, clustering is performed on the global feature information of each sample content in the training data to obtain the category label information corresponding to the unlabeled sample content; For each content segment of the sample content, calculating consistency information between the content segment and the sample content to which it belongs according to local feature information corresponding to the content segment and global feature information of the sample content to which the content segment belongs; Based on the global feature information of the sample content, performing content classification processing on the sample content to obtain global category probability distribution information corresponding to the sample content; Based on the local feature information corresponding to the content segment, the content segment is subjected to content classification processing to obtain local category probability distribution information corresponding to the content segment; According to the global category probability distribution information, the local category probability distribution information, the consistency information and the category label information corresponding to the unlabeled sample content, the parameters of the content classification model are adjusted to obtain a target content classification model, and the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

2. The method according to claim 1, characterized in that The clustering process based on the category label information of the labeled sample content to the global feature information of each sample content in the training data to obtain the category label information corresponding to the unlabeled sample content includes: Setting a preset number of cluster centers, and calculating the similarity between the global feature information of each sample content in the training data and each cluster center; For each sample content, based on the similarity and the category label information of the annotated sample content, determine a target cluster center matching the sample content from the cluster centers, and add the sample content to a content set corresponding to the target cluster center; For the content set corresponding to each cluster center, sample content that meets the preset cluster center conditions is selected from the content set as a new cluster center; Return to the step of calculating the similarity between the global feature information of each sample content in the training data and each cluster center until the obtained cluster center meets the clustering end condition; based on the category label information of the labeled sample content in the target content set corresponding to the cluster center that meets the clustering end condition, determine the category label information of the unlabeled sample content in the target content set.

3. The method according to claim 1, characterized in that The clustering process based on the category label information of the labeled sample content to the global feature information of each sample content in the training data to obtain the category label information corresponding to the unlabeled sample content includes: Determine the sample similarity between each two sample contents based on the global feature information of each two sample contents; Constructing a content graph model according to the sample similarities, wherein the content graph model represents the association relationship between the contents of each sample; According to the content graph model, the category label information of the labeled sample content is processed by label information transmission to obtain the category label information corresponding to the unlabeled sample content.

4. The method according to claim 3, characterized in that The content graph model includes content nodes corresponding to each sample content and edges between content nodes, wherein the edges represent the association relationship between two connected content nodes; The step of performing label information transfer processing on the category label information of the labeled sample content according to the content graph model to obtain category label information corresponding to the unlabeled sample content includes: Performing label information transmission processing on the category label information of the labeled sample content through the edges between content nodes in the content graph model to determine reference category label information of the unlabeled sample content; For each unlabeled sample content, the reference category label information of the unlabeled sample content is iteratively updated according to the adjacent content nodes of the unlabeled sample content in the content graph model until the labels of the content nodes in the content graph model converge, thereby obtaining the category label information corresponding to the unlabeled sample content.

5. The method according to claim 1, characterized in that The step of calculating, for each content segment of the sample content, consistency information between the content segment and the sample content to which the content segment belongs according to local feature information corresponding to the content segment and global feature information of the sample content to which the content segment belongs, includes: Based on the global feature information of each sample content, a global feature set is constructed, and based on the local feature information of the content fragments of each sample content, a local feature set is constructed; For each sample content, searching the global feature set for at least one similar global feature information that matches the global feature information of the sample content, and determining a candidate label set for the sample content based on category label information of the sample content to which the similar global feature information belongs; For each content segment of the sample content, searching the local feature set for at least one similar local feature information matching the local feature information of the content segment, and determining a candidate label set for the content segment based on category label information of the sample content to which the similar local feature information belongs; Based on the candidate tag set of the content segment and the candidate tag set of the sample content to which the content segment belongs, the consistency information between the content segment and the sample content to which the content segment belongs is calculated.

6. The method according to claim 5, characterized in that The calculating, based on the candidate tag set of the content segment and the candidate tag set of the sample content to which the content segment belongs, the consistency information between the content segment and the sample content to which the content segment belongs includes: Performing statistical analysis on the category label information in the candidate label set of the content segment to determine the label probability distribution information of the content segment; Performing statistical analysis on the category label information in the candidate label set of the sample content to which the content segment belongs, and determining the label probability distribution information of the sample content to which the content segment belongs; Based on the label probability distribution information of the content segment and the label probability distribution information of the sample content to which the content segment belongs, the consistency information between the content segment and the sample content to which the content segment belongs is calculated.

7. The method according to claim 1, characterized in that The step of adjusting the parameters of the content classification model according to the global category probability distribution information, the local category probability distribution information, the consistency information, and the category label information corresponding to the unlabeled sample content to obtain a target content classification model includes: For each sample content, based on the local category probability distribution information of each content segment in the sample content and the consistency information corresponding to each content segment, the category label information of the sample content is corrected to obtain the corrected category label information of the sample content; Based on the global category probability distribution information corresponding to each sample content, the corrected category label information of each sample content is fused to obtain the global loss information; Based on the global loss information, the parameters of the content classification model are adjusted to obtain a target content classification model.

8. The method according to claim 7, characterized in that The adjusting the parameters of the content classification model based on the global loss information to obtain a target content classification model includes: Calculating local classification loss information of the content segment based on local category probability distribution information of the content segment and category label information of sample content to which the content segment belongs; Based on the global loss information and the local classification loss information, the parameters of the content classification model are adjusted to obtain a target content classification model.

9. The method according to claim 8, characterized in that The adjusting the parameters of the content classification model based on the global loss information and the local classification loss information to obtain a target content classification model includes: Performing difference measurement processing between the local category probability distribution information of the content segment and the uniform distribution to obtain divergence information corresponding to the content segment; Based on the consistency information corresponding to the content segment, the local classification loss information and the divergence information are merged to obtain the local loss information of the content segment; According to the global loss information and the local loss information corresponding to each content segment of the sample content, the parameters of the content classification model are adjusted to obtain a target content classification model.

10. The method according to claim 1, characterized in that The step of performing feature extraction processing on the sample content and each content segment of the sample content respectively through the content classification model to obtain global feature information of the sample content and local feature information corresponding to each content segment includes: Acquire an image sequence of the sample content in image mode and a text sequence in text mode, and acquire an image subsequence of each content segment of the sample content in image mode and a text subsequence in text mode; The image sequence and the text sequence of the sample content are fused to obtain a content unit sequence corresponding to the sample content; the image subsequence and the text subsequence of the content fragment are fused to obtain a content unit sequence corresponding to the content fragment; By using the content classification model, performing attention encoding processing on the content unit sequence of the sample content to obtain global feature information of the sample content; By using the content classification model, attention encoding processing is performed on the content unit sequence of the content segment to obtain local feature information of the content segment.

11. A training device for a content classification model, characterized in that: include: An acquisition unit, used to acquire a content classification model and training data, wherein the sample content in the training data includes annotated sample content and unannotated sample content, and the annotated sample content carries its corresponding category label information; A slicing unit, configured to perform content slicing processing on each sample content to obtain multiple content segments of the sample content; An extraction unit, configured to perform feature extraction processing on the sample content and each content segment of the sample content respectively through the content classification model to obtain global feature information of the sample content and local feature information corresponding to each content segment; A clustering unit, configured to perform clustering processing on the global feature information of each sample content in the training data based on the category label information of the labeled sample content, so as to obtain the category label information corresponding to the unlabeled sample content; a consistency unit, configured to calculate, for each content segment of the sample content, consistency information between the content segment and the sample content to which it belongs, according to local feature information corresponding to the content segment and global feature information of the sample content to which the content segment belongs; An adjustment unit is used to perform content classification processing on the sample content based on the global feature information of the sample content to obtain global category probability distribution information corresponding to the sample content; perform content classification processing on the content segment based on the local feature information corresponding to the content segment to obtain local category probability distribution information corresponding to the content segment; and adjust parameters of the content classification model according to the global category probability distribution information, the local category probability distribution information, the consistency information and the category label information corresponding to the unlabeled sample content to obtain a target content classification model, wherein the target content classification model is used to perform content classification processing on the target content to obtain the category label information of the target content.

12. An electronic device, characterized in that: It comprises a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to execute the operations in the content classification model training method described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the content classification model training method according to any one of claims 1 to 10.

14. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps in the training method of the content classification model described in any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Content recognition method, content recognition model training method and storage medium

    CN112396106A

  • Pseudo-label unsupervised data training method and device, equipment and medium

    CN116912624A