Adaptive content recognition method and related equipment

By using iterative training methods of student models and teacher models in content security audits, the problem of insufficient robustness and adaptability of multilingual sample recognition in the prior art is solved, and efficient and accurate content security audits are achieved.

CN119903181APending Publication Date: 2025-04-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311389217.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-24
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

Existing content security auditing technologies have difficulty staying robust to multilingual samples in the open world and are unable to quickly adapt to audit tasks for different types of harmful content.

Method used

By collecting content security sample sets, pre-trained language models of different magnitudes are obtained as student models and teacher models, the student models are used to identify target samples and their categories, hard samples and teacher training samples are generated based on the teacher model, and iterative training is carried out to obtain the target content security audit model.

Benefits of technology

It realizes robust recognition of multilingual samples in the open world and can quickly adapt to audit tasks for different types of harmful content, improving the efficiency and accuracy of content security audits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903181A_ABST
    Figure CN119903181A_ABST
Patent Text Reader

Abstract

The invention discloses a self-adaptive content recognition method and related equipment, and the method comprises the steps: collecting a preset number of samples, and obtaining a content safety sample set; pre-trained language models of different magnitudes are obtained and serve as a student model and a teacher model; using the student model to identify a target sample in the content security sample set and the category of the target sample; based on the teacher model, identifying a sample inconsistent with the identification result of the student model as a hard sample, and according to the category of the hard sample, generating a teacher training sample of a corresponding category; based on different classes of teacher training samples, performing iterative training on the student model to obtain a trained target content security auditing model; and identifying to-be-audited content by adopting the target content security auditing model, and identifying target content and the category of the target content. According to the method and the device, various types of harmful contents such as pornographic information can be quickly and efficiently identified.
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 an adaptive content recognition method and related equipment. Background Art

[0002] With the rapid development of the Internet, user-generated content has exploded, leading to the proliferation of a large amount of inappropriate content. Therefore, content security review is crucial to building a healthy and positive network environment. It is necessary to conduct effective security review of text, images, audio and video content, identify and filter harmful information such as pornography.

[0003] At present, the mainstream content security review technology is mainly based on rules and machine learning methods (discriminative small models). The rule method relies on manual formulation of filtering rules, which is difficult to update and maintain; the machine learning method requires a large amount of labeled data training, and it is difficult to achieve zero-sample learning. In recent years, the pre-trained language model technology has made significant progress, but the direct application to content security review tasks is still unsatisfactory. The model has poor robustness to samples in the open world, and multiple models need to be trained for different types of harmful content, which cannot respond quickly and naturally to human instructions.

[0004] However, the demand for content security review is growing, and there are many related application scenarios. Therefore, how to train a content security review model that is both efficient and accurate so that it can remain robust to multilingual samples in the open world and quickly adapt to the needs of different types of harmful content review tasks is a technical problem that needs to be solved urgently.

[0005] Application Contents

[0006] The embodiments of the present application provide an adaptive content recognition method and related devices. The related devices may include an adaptive content recognition device, an electronic device, a computer-readable storage medium, and a computer program product, which can improve the adaptive content recognition processing performance.

[0007] The present application provides an adaptive content recognition method, including:

[0008] Collecting a predetermined number of samples to obtain a content security sample set;

[0009] Obtain pre-trained language models of different sizes as student models and teacher models respectively;

[0010] Using the student model to identify a target sample in the content safety sample set and a category of the target sample;

[0011] Based on the teacher model, samples that are inconsistent with the recognition results of the student model are identified as hard samples, and according to the categories of the hard samples, teacher training samples of corresponding categories are generated;

[0012] Based on the teacher training samples of different categories, the student model is iteratively trained to obtain a trained target content security review model;

[0013] The target content security audit model is used to identify the content to be audited, and the target content and the category of the target content are identified.

[0014] Accordingly, an embodiment of the present application provides an adaptive content recognition device, including:

[0015] A collection unit, used to collect a predetermined number of samples to obtain a content security sample set;

[0016] An acquisition unit, used to acquire pre-trained language models of different magnitudes, which are used as student models and teacher models respectively;

[0017] A first identification unit, configured to use the student model to identify a target sample in the content safety sample set and a category of the target sample;

[0018] An identification and generation unit, which identifies samples inconsistent with the identification results of the student model based on the teacher model as hard samples, and generates teacher training samples of corresponding categories according to the categories of the hard samples;

[0019] A training unit, used for iteratively training the student model based on the teacher training samples of different categories to obtain a trained target content security review model;

[0020] The second identification unit is used to identify the content to be audited by using the target content security audit model, and identify the target content and the category of the target content.

[0021] Optionally, in some embodiments of the present application, the acquisition unit may include a first acquisition subunit, a selection and marking subunit, and an adjustment subunit, as follows:

[0022] The first acquisition subunit is used to acquire a lightweight language model as an initial model;

[0023] A selection and labeling subunit is used to select a predetermined number of training data from the content safety sample set, and label the real labels corresponding to the training data to obtain a training sample set;

[0024] The adjustment subunit is used to determine the parameter values ​​of the initial model that maximize the likelihood function based on the training sample set, and adjust the language model according to the parameter values ​​to obtain the student model.

[0025] Optionally, in some embodiments of the present application, the recognition generation unit may include a judgment subunit, a prediction subunit, and a first generation subunit, as follows:

[0026] The judgment subunit is used to use the teacher model to judge the samples in the content safety sample set and generate corresponding soft labels, wherein the soft labels are used to indicate the probability that the teacher model judges the samples as target content;

[0027] The prediction subunit is used to use the student model to predict the sample to obtain an initial prediction probability. When the difference between the initial prediction probability and the soft label is greater than a preset judgment threshold, the sample corresponding to the soft label is identified as a hard sample.

[0028] The first generating subunit is used to use the teacher model to identify the category of the hard sample, and generate a sample with the same category as the hard sample but different content according to the semantic features of the hard sample as a teacher training sample.

[0029] Optionally, in some embodiments of the present application, the training unit may include a second generation subunit, a third generation subunit and a training subunit, as follows:

[0030] The second generating subunit is used to generate a target content sample and a non-target content sample as auxiliary samples based on the teacher model;

[0031] A third generating subunit is used to generate a soft label corresponding to the auxiliary sample and a soft label corresponding to the teacher training sample by using the teacher model, wherein the soft label is used to indicate the probability that the teacher model determines that the sample is the target content;

[0032] The training sub-unit is used to use the teacher training sample and the auxiliary sample as a teacher training sample set, and based on the teacher training sample set, iteratively train the student model to obtain a trained target content security review model.

[0033] Optionally, in some embodiments of the present application, the training subunit may include a first selection subunit, a second selection subunit, a first training subunit, and a second training subunit, as follows:

[0034] The first selection subunit is used to select teacher training samples and auxiliary samples of different categories for mixing to obtain the teacher training sample set;

[0035] A first training subunit is used to iteratively train the student model based on the teacher training sample set to obtain a trained target content security audit model, and then repeatedly execute the steps of generating teacher training samples of corresponding categories according to the categories of the hard samples, generating target content samples and non-target content samples based on the teacher model as auxiliary samples, and then using the teacher model to generate soft labels corresponding to the auxiliary samples and soft labels corresponding to the teacher training samples, using the teacher training samples and the auxiliary samples as the teacher training sample set, and using the student model to identify samples in the teacher training sample set to obtain identification results, until the difference between the soft label and the identification result is less than a preset identification threshold;

[0036] The second selection subunit is used to select teacher training samples and auxiliary samples of the same category as a teacher training sample set of the same category;

[0037] The second training sub-unit is used to alternately train the student model based on the teacher training sample sets of different categories to obtain a trained target content security review model, and then repeatedly execute the steps of generating teacher training samples of corresponding categories according to the categories of the hard samples, generating target content samples and non-target content samples based on the teacher model as auxiliary samples, and then using the teacher model to generate soft labels corresponding to the auxiliary samples and soft labels corresponding to the teacher training samples, taking the teacher training samples and the auxiliary samples as the teacher training sample sets, and using the student model to identify the samples in the teacher training sample set to obtain the recognition result, until the difference between the soft label and the recognition result is less than a preset recognition threshold.

[0038] Optionally, in some embodiments of the present application, the first training subunit may be specifically used to use the student model and the teacher model to identify the teacher training sample, and if the identified categories are inconsistent, count the number of inconsistent categories to determine the recognition error ratios corresponding to the different categories;

[0039] When the recognition error ratio exceeds a first preset category threshold, determining the category as a weak category, and using the teacher model to generate weak category samples for the weak category;

[0040] According to the recognition error ratio, the weak category ratio of the weak category samples in the teacher training sample set is determined, and the teacher training sample set is updated based on the weak category ratio.

[0041] Optionally, in some embodiments of the present application, the second training subunit may be specifically used to use the student model to identify the teacher training sample, and count the number of inconsistencies between the categories identified by the student model and the categories identified by the teacher model, and determine the recognition error ratio corresponding to the current category;

[0042] When the recognition error ratio exceeds a second preset category threshold, determining the category as a weak category, and using the teacher model to generate weak category samples for the weak category;

[0043] Determining the number of training times for the weak category according to the recognition error ratio, and combining the weak category samples based on the number of training times to obtain multiple groups of weak category sample sets;

[0044] The student model is alternately trained based on the multiple groups of weak category sample sets to obtain a trained target content security review model.

[0045] 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 adaptive content recognition method provided in the embodiment of the present application.

[0046] The embodiment of the present application further 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 adaptive content recognition method provided in the embodiment of the present application are implemented.

[0047] 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 adaptive content recognition method provided in the embodiment of the present application.

[0048] The embodiment of the present application provides an adaptive content recognition method and related equipment, which can collect a predetermined number of samples to obtain a content security sample set; obtain pre-trained language models of different magnitudes as student models and teacher models respectively; use the student model to identify the target samples in the content security sample set, as well as the category of the target samples; identify samples that are inconsistent with the recognition results of the student model based on the teacher model as hard samples, and generate teacher training samples of corresponding categories according to the categories of the hard samples; iteratively train the student model based on the teacher training samples of different categories to obtain a trained target content security audit model; use the target content security audit model to identify the content to be audited, and identify the target content and the category of the target content. The present application selects a powerful teacher model to train a student model, and trains it using samples of different categories, so that it can obtain the ability to quickly and efficiently process multiple content security categories under a unified command response interface. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0050] Figure 1a is a schematic diagram of a scenario of an adaptive content recognition method provided in an embodiment of the present application;

[0051] Figure 1b is a flow chart of an adaptive content recognition method provided by an embodiment of the present application;

[0052] Figure 2 is another flow chart of the adaptive content recognition method provided by an embodiment of the present application;

[0053] Figure 3 is a schematic diagram of the structure of an adaptive content recognition device provided in an embodiment of the present application;

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

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

[0056] The embodiment of the present application provides an adaptive content recognition method and related equipment, which may include an adaptive content recognition device, an electronic device, a computer-readable storage medium, and a computer program product. The adaptive content recognition device may be integrated in an electronic device, which may be a terminal or a server.

[0057] It is understandable that the adaptive content recognition method of this embodiment can be executed on a terminal, can be executed on a server, or can be executed by both a terminal and a server. The above examples should not be construed as limiting the present application.

[0058] like Figure 1a As shown, the adaptive content recognition method is performed by a terminal and a server together as an example. The adaptive content recognition system provided in the embodiment of the present application includes a terminal and a server, etc. The terminal and the server are connected via a network, such as a wired or wireless network connection, etc., wherein the adaptive content recognition device can be integrated in the terminal.

[0059] Among them, the server can be used to: collect a predetermined number of samples to obtain a content security sample set; obtain pre-trained language models of different magnitudes as student models and teacher models respectively; use the student model to identify the target sample in the content security sample set, as well as the category of the target sample; identify samples inconsistent with the recognition results of the student model based on the teacher model as hard samples, and generate teacher training samples of corresponding categories according to the category of the hard samples; iteratively train the student model based on the teacher training samples of different categories to obtain a trained target content security audit model; use the target content security audit model to identify the content to be audited, and identify the target content and the category of the target content. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The adaptive content recognition method or device disclosed in this application, wherein multiple servers can be composed of a blockchain, and the server is a node on the blockchain.

[0060] The terminal can be used to obtain the content to be reviewed uploaded by the user, and filter the content to be reviewed according to the target content and the category of the target content identified by the target content security review model. The terminal can include a mobile phone, a tablet computer, a laptop, or a personal computer (PC). A client can also be set on the terminal, which can be an application client or a browser client, etc.

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

[0062] This embodiment will be described from the perspective of an adaptive content recognition device. The adaptive content recognition device may be integrated into an electronic device, which may be a server or a terminal.

[0063] This embodiment can be applied to various scenarios such as cloud technology and artificial intelligence.

[0064] It is understandable that in the specific implementation of the present application, related data such as user information (such as information posted by terminal device users) is involved. When the above embodiments of the present 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.

[0065] like Figure 1b As shown, the specific process of the adaptive content recognition method can be as follows:

[0066] 101. Collect a predetermined number of samples to obtain a content security sample set.

[0067] There are many methods for collecting a predetermined number of samples to obtain a content safety sample set, which can be specifically as follows:

[0068] For example, data samples may be obtained from a website through the application programming interface disclosed by the website, or data samples may be obtained by automatically collecting signals, pictures or videos through sensors, cameras and other intelligent terminals, or the required data samples may be collected using data stored in a traditional relational database.

[0069] Among them, obtaining data samples from a website through the application programming interface disclosed by the website can start from the uniform resource locator of one or several initial web pages, obtain the content on each web page, and in the process of crawling the web pages, continuously extract new uniform resource locators from the current page and put them into the queue until the set stop condition is met. In this way, unstructured data and semi-structured data can be extracted from the web page and stored in the local storage system, thereby obtaining a content security sample set.

[0070] 102. Obtain pre-trained language models of different magnitudes as student models and teacher models respectively.

[0071] Among them, pre-trained language models of different scales include large-scale models and lightweight models. Among them, large-scale models have good performance and generalization ability and are large models of a single complex network or a collection of several networks, while lightweight models have small network scale and limited expression ability.

[0072] Among them, the student model can be a small-scale commercial pre-trained language model, and the teacher model can be a large-scale commercial pre-trained language model with powerful indication representation and reasoning capabilities.

[0073] After obtaining a lightweight language model as an initial model, a predetermined amount of training data is selected from the content safety sample set, and real labels corresponding to the training data are marked to obtain a training sample set.

[0074] In one embodiment, obtaining pre-trained language models of different magnitudes as student models and teacher models respectively includes the following steps:

[0075] Get a lightweight language model as the initial model;

[0076] Selecting a predetermined amount of training data from the content safety sample set, and marking the real labels corresponding to the training data, to obtain a training sample set;

[0077] Based on the training sample set, the parameter values ​​of the initial model that maximize the likelihood function are determined, and the language model is adjusted according to the parameter values ​​to obtain the student model.

[0078] There are many ways to select a predetermined amount of training data from the content safety sample set. For example, data samples can be collected from the content safety sample set by manual extraction to obtain a subset of the content safety sample set as a training sample set.

[0079] There are many ways to label the real labels corresponding to the training data. For example, data samples collected from the content security sample set can be labeled manually to obtain the real labels corresponding to the samples.

[0080] Specifically, manual labeling means that the data administrator will divide the data to be labeled into different data package tasks according to different needs. Each data task will have different specifications and labeling format requirements. The labeling tasks will then be assigned to multiple labelers for labeling. After the labelers complete the labeling work, the quality inspectors will check the data. Finally, the data that passes the quality inspection link will be used as real data for training.

[0081] There are many ways to adjust the initial model, such as determining parameter values ​​of the initial model that maximize the likelihood function, and adjusting the language model according to the parameter values.

[0082] Specifically, determining the parameter values ​​of the initial model that maximizes the likelihood function can be by determining the likelihood function based on the true label corresponding to the training data, then taking the logarithm of the likelihood function to obtain the log-likelihood function, and taking the derivative of the log-likelihood function to obtain the likelihood equation, and finally solving the likelihood equation to obtain the parameter values, which are used to adjust the model to obtain the student model.

[0083] 103. Use the student model to identify target samples in the content safety sample set and the categories of the target samples.

[0084] Among them, the target sample refers to the sample containing harmful information.

[0085] Content recognition has many application scenarios, including:

[0086] Social media content review: identifying and filtering harmful information on social platforms;

[0087] News review: Review malicious comments in news comments and maintain order on the Internet;

[0088] Online game content review: Review in-game chat interactions to see if there is any evidence of provoking conflict or insults;

[0089] E-commerce product review: Identify and remove products containing harmful content;

[0090] Search engine safety retrieval: Filter inappropriate content in search results and provide a healthy search experience.

[0091] Among them, each application scenario contains multiple different categories of harmful information. In addition to identifying harmful information, the student model of the present invention also needs to identify the category of harmful information, and train the student model's ability to identify the category of harmful information based on the teacher model, so that the student model has the ability to efficiently and accurately identify different categories of information.

[0092] 104. Based on the teacher model, samples that are inconsistent with the recognition results of the student model are identified as hard samples, and according to the categories of the hard samples, teacher training samples of corresponding categories are generated.

[0093] Among them, the teacher training samples are samples used to train the student model's ability to identify harmful content and normal content.

[0094] In one embodiment, the step of identifying hard samples whose recognition results of the student model do not meet preset conditions based on the teacher model includes the following steps:

[0095] Using the teacher model to judge the samples in the content safety sample set, and generating corresponding soft labels, wherein the soft labels are used to indicate the probability that the teacher model judges the samples as target content;

[0096] The student model is used to predict the sample to obtain an initial prediction probability. When the difference between the initial prediction probability and the soft label is greater than a preset judgment threshold, the sample corresponding to the soft label is identified as a hard sample.

[0097] Among them, the soft label can be used to represent the probability that the teacher model determines the sample as the target content, and the hard sample can be a sample whose soft label corresponding to the sample has a large difference in probability with the probability predicted by the student model.

[0098] After the teacher model judges the samples in the content security sample set and generates corresponding soft labels, the student model is used to predict the samples to obtain an initial prediction probability. When the difference between the initial prediction probability and the soft label is greater than a preset judgment threshold, the sample corresponding to the soft label is identified as a hard sample.

[0099] Specifically, according to the category of the hard sample, the teacher training sample of the corresponding category is generated. The teacher model can first identify the hard samples of different categories, and then for each category, the teacher model will use its powerful natural language generation capability to generate new samples with different expressions but consistent categories according to the semantic features of the samples in that category, and obtain the teacher training sample.

[0100] There are many ways for the teacher model to generate teacher training samples. For example, text enhancement techniques such as changing the wording, replacing synonyms, and modifying the grammatical structure can be used to generate new samples with the same classification but different expressions. Alternatively, the teacher model can be directly used to rewrite or create at the meaning level according to the sample intention. Alternatively, a certain degree of randomness can be added to avoid all new samples being too similar. By controlling the generation difficulty, the new samples can be neither too simple nor too difficult.

[0101] 105. Based on the teacher training samples of different categories, the student model is iteratively trained to obtain a trained target content security review model.

[0102] The teacher training samples are samples used to train the student model to identify harmful content and normal content.

[0103] Based on the teacher training samples of different categories, the student model is iteratively trained to obtain a trained target content security review model, including the following steps:

[0104] Generate target content samples and non-target content samples based on the teacher model as auxiliary samples;

[0105] The teacher model is used to generate a soft label corresponding to the auxiliary sample and a soft label corresponding to the teacher training sample, wherein the soft label is used to indicate the probability that the teacher model determines that the sample is the target content;

[0106] The teacher training samples and the auxiliary samples are used as a teacher training sample set, and based on the teacher training sample set, the student model is iteratively trained to obtain a trained target content security review model.

[0107] The target content sample refers to a sample containing harmful information, and the non-target content sample refers to a sample not containing harmful information.

[0108] Auxiliary samples include target content samples and non-target content samples to ensure the diversity of the teacher training set. There are not only targeted teacher training samples, but also general non-target content samples and simple target content samples. This can prevent the model from being overly biased towards teacher training samples and overfitting.

[0109] Auxiliary samples can better evaluate the performance of the model on general samples. It is difficult to fully evaluate the model effect using only teacher training samples.

[0110] Adding auxiliary samples within a certain ratio can make the training more stable and prevent the model performance from fluctuating too much because each training only focuses on failure cases.

[0111] The soft label may be used to indicate the probability that the teacher model determines that the sample is a target content sample.

[0112] Among them, in order to enable the student model to acquire the ability to identify multiple different categories of harmful information, it is necessary to use samples of different categories to train the student model. Specifically, based on the teacher training sample set, the student model is iteratively trained to obtain a trained target content security review model, including multiple methods, which are explained in two specific embodiments below.

[0113] Embodiment 1

[0114] The method of iteratively training the student model based on the teacher training samples of different categories to obtain a trained target content security review model includes the following steps:

[0115] Selecting teacher training samples and auxiliary samples of different categories and mixing them to obtain the teacher training sample set;

[0116] Based on the teacher training sample set, the student model is iteratively trained to obtain a trained target content security review model.

[0117] In each round of training, samples of different categories are mixed together and trained in a shuffled order to enhance the model's ability to adapt to different categories.

[0118] Embodiment 2

[0119] Specifically, the iterative training of the student model based on the teacher training sample set to obtain a trained target content security review model includes the following steps:

[0120] Select teacher training samples and auxiliary samples of the same category as a category teacher training sample set;

[0121] The student model is alternately trained based on the teacher training sample sets of different categories to obtain a trained target content security review model.

[0122] During the training process, the training is divided into multiple times, and only samples of the same category are used in each training process. Then, teacher training sample sets of different categories are trained alternately, so as to achieve a more focused improvement in the performance of a certain category.

[0123] In addition, a multi-task training framework can be used to optimize the judgment loss of each category at the same time. The training goal is to enable the model to process samples of different categories under a unified command interface.

[0124] In some embodiments, iterative training of the student model to obtain a trained target content security review model may generally include the following steps:

[0125] Using the student model to identify samples in the teacher training sample set to obtain a recognition result;

[0126] If the difference between the soft label and the recognition result is greater than a preset recognition threshold, a loss function is calculated according to the recognition result and the soft label, and the parameters of the student model are updated according to the loss function;

[0127] Repeat the steps of generating teacher training samples of corresponding categories according to the categories of the hard samples, generating target content samples and non-target content samples as auxiliary samples based on the teacher model; using the teacher model to generate soft labels corresponding to the auxiliary samples and soft labels corresponding to the teacher training samples, using the teacher training samples and the auxiliary samples as a teacher training sample set, and using the student model to identify samples in the teacher training sample set to obtain recognition results, until the difference between the soft label and the recognition result is less than a preset recognition threshold.

[0128] 106. Use the target content security audit model to identify the content to be audited, and identify the target content and the category of the target content.

[0129] Among them, the target content security review model refers to a student model that has been trained iteratively and has the ability to quickly and efficiently identify samples of different categories.

[0130] The user uploads the content to be reviewed to the server based on the terminal page. The server uses the target content security review model to identify the content to be reviewed, and returns the identified target content and the category of the target content to the terminal. The terminal can filter the target content according to the returned recognition result.

[0131] As can be seen from the above, the embodiments of the present application provide an adaptive content recognition method and related equipment, which can collect a predetermined number of samples to obtain a content security sample set; obtain pre-trained language models of different magnitudes as student models and teacher models respectively; use the student model to identify the target samples in the content security sample set, as well as the category of the target samples; identify the hard samples whose recognition results of the student model do not meet the preset conditions based on the teacher model, and generate teacher training samples of the corresponding category according to the category of the hard samples; iteratively train the student model based on the teacher training samples of different categories to obtain a trained target content security audit model; use the target content security audit model to identify the content to be audited, and identify the target content and the category of the target content. The present application trains a student model through a powerful teacher model, and trains it using samples of different categories, so that it can obtain the ability to quickly and efficiently process multiple content security categories under a unified command response interface.

[0132] According to the method described in the previous embodiment, the training process of different categories is further described in detail below.

[0133] The present application embodiment provides an adaptive content recognition method, such as Figure 2 As shown, the specific process of the adaptive content recognition method can be as follows:

[0134] 201. Collect a predetermined number of samples to obtain a content security sample set, and obtain pre-trained language models of different magnitudes as student models and teacher models respectively.

[0135] 202. Use the student model to identify the target samples in the content security sample set and the category of the target samples, identify the samples that are inconsistent with the recognition results of the student model based on the teacher model as hard samples, and generate teacher training samples of the corresponding category according to the category of the hard samples.

[0136] The student model is used to identify harmful information in the content safety sample set, and its judgment ability is used to automatically identify the category of harmful information.

[0137] In some embodiments, the sample identified based on the teacher model and inconsistent with the student model recognition result is used as a hard sample, and according to the category of the hard sample, a teacher training sample of the corresponding category is generated, including the following steps:

[0138] Using the teacher model to judge the samples in the content safety sample set, and generating corresponding soft labels, wherein the soft labels are used to indicate the probability that the teacher model judges the samples as target content;

[0139] The student model is used to predict the sample to obtain an initial prediction probability, and when the difference between the initial prediction probability and the soft label is greater than a preset judgment threshold, the sample corresponding to the soft label is identified as a hard sample;

[0140] Using the teacher model to identify the category of the hard sample;

[0141] According to the semantic features of the hard samples, samples with the same category as the hard samples but different contents are generated as teacher training samples.

[0142] 203. Generate target content samples and non-target content samples based on the teacher model as auxiliary samples, use the teacher model to generate soft labels corresponding to the auxiliary samples and soft labels corresponding to the teacher training samples, and use the teacher training samples and the auxiliary samples as a teacher training sample set.

[0143] There are two ways to obtain the teacher training sample set, one of which is to select the teacher training samples and the auxiliary samples of different categories and mix them to obtain the teacher training sample set, and the other is to select the teacher training samples and the auxiliary samples of the same category and mix them to obtain the teacher training sample set.

[0144] 204. Based on the teacher training sample set, the student model is iteratively trained to obtain a trained target content security review model.

[0145] The method of iteratively training the student model based on the teacher training sample set composed of the teacher training samples and the auxiliary samples of different categories to obtain a trained target content security review model includes the following steps:

[0146] The student model and the teacher model are used to identify the teacher training samples. If the identified categories are inconsistent, the number of inconsistent categories is counted to determine the recognition error ratios corresponding to the different categories;

[0147] When the recognition error ratio exceeds a first preset category threshold, determining the category as a weak category, and using the teacher model to generate weak category samples for the weak category;

[0148] According to the recognition error ratio, the weak category ratio of the weak category samples in the teacher training sample set is determined, and the teacher training sample set is updated based on the weak category ratio.

[0149] Among them, the first preset category threshold refers to the number of samples whose categories recognized by the student model set in advance by the developer are inconsistent with the categories pre-recognized by the teacher model.

[0150] Among them, weak categories refer to sample categories with a higher probability of being recognized incorrectly by the student model.

[0151] Among them, the weak category samples can be samples generated by the teacher model and used to train the student model's ability to identify weak categories.

[0152] The recognition error ratio may be the ratio of the number of samples with category recognition errors to the total number of samples of a preset category in the sample set.

[0153] The weak category ratio may be the ratio of the number of samples with category recognition errors to the number of samples of the preset category in the teacher training sample set.

[0154] The method of iteratively training the student model based on the teacher training sample set composed of the teacher training sample and the auxiliary sample of the same category to obtain a trained target content security review model includes the following steps:

[0155] The teacher training samples and the auxiliary samples of the same category identified are mixed together to form a type of teacher training sample set, so that the teacher training samples and the auxiliary samples of multiple types are mixed together to obtain multiple different types of teacher training sample sets;

[0156] The student model is alternately trained based on the multiple different types of teacher training sample sets to obtain a trained target content security review model.

[0157] Specifically, the alternate training of the student model based on the multiple different types of teacher training sample sets to obtain a trained target content security review model includes the following steps:

[0158] The student model is used to identify the teacher training samples, and the number of inconsistencies between the categories identified by the student model and the categories identified by the teacher model is counted to determine the recognition error ratio corresponding to the current category;

[0159] When the recognition error ratio exceeds a second preset category threshold, determining the category as a weak category, and using the teacher model to generate weak category samples for the weak category;

[0160] Determine the number of training times for the weak class according to the recognition error ratio, and combine the weak class samples based on the number of training times to obtain multiple groups of weak class sample sets, wherein the weak class sample sets include teacher training samples and auxiliary samples;

[0161] The student model is alternately trained based on the multiple groups of weak category sample sets to obtain a trained target content security review model.

[0162] Among them, the second preset category threshold refers to the proportion of samples whose categories recognized by the student model set in advance by the developer are inconsistent with the categories pre-recognized by the teacher model.

[0163] Among them, weak categories refer to sample categories with a higher probability of being recognized incorrectly by the student model.

[0164] The number of training times refers to the number of times during the training process, the proportion of training for category samples is adjusted according to the performance of the model on samples of different categories, and more training is performed on weak category samples.

[0165] The recognition error ratio may be the ratio of the number of samples with category recognition errors to the total number of samples of a preset category in the sample set.

[0166] The recognition result may be the result of determining which category a sample belongs to after the student model recognizes the sample.

[0167] After obtaining the recognition result, if the difference between the soft label and the recognition result is greater than a preset recognition threshold, a loss function is calculated according to the recognition result and the soft label, and the parameters of the student model are updated according to the loss function.

[0168] As can be seen from the above, the embodiments of the present application provide an adaptive content identification method and related equipment, which can collect a predetermined number of samples to obtain a content security sample set; obtain pre-trained language models of different magnitudes as student models and teacher models respectively; use the student model to identify the target samples in the content security sample set, as well as the category of the target samples; identify samples that are inconsistent with the recognition results of the student model based on the teacher model as hard samples, and generate teacher training samples of corresponding categories according to the category of the hard samples; iteratively train the student model based on the teacher training samples of different categories to obtain a trained target content security audit model; use the target content security audit model to identify the content to be audited, and identify the target content and the category of the target content. The present application trains a student model through a powerful teacher model, and trains it using harmful content samples of different categories, so that it can quickly and efficiently process multiple content security categories under a unified command response interface.

[0169] In order to better implement the above method, the present application embodiment also provides an adaptive content recognition device, such as Figure 3 As shown, the adaptive content recognition device may include a collection unit 301, an acquisition unit 302, a first recognition unit 303, a recognition generation unit 304, a training unit 305, and a second recognition unit 306, as follows:

[0170] (1) Collection unit 301;

[0171] Used to collect a predetermined number of samples to obtain a content security sample set.

[0172] (2) Acquisition unit 302;

[0173] Used to obtain pre-trained language models of different magnitudes, which are used as student models and teacher models respectively.

[0174] (3) a first recognition unit 303;

[0175] The student model is used to identify target samples in the content safety sample set and the category of the target samples.

[0176] (4) identification generation unit 304;

[0177] Based on the teacher model, samples that are inconsistent with the recognition results of the student model are identified as hard samples, and according to the categories of the hard samples, teacher training samples of corresponding categories are generated.

[0178] (5) training unit 305;

[0179] It is used to iteratively train the student model based on the teacher training samples of different categories to obtain a trained target content security review model.

[0180] Optionally, in some embodiments of the present application, the acquisition unit may include a first acquisition subunit, a selection and marking subunit, and an adjustment subunit, as follows:

[0181] The first acquisition subunit is used to acquire a lightweight language model as an initial model;

[0182] A selection and labeling subunit is used to select a predetermined number of training data from the content safety sample set, and label the real labels corresponding to the training data to obtain a training sample set;

[0183] The adjustment subunit is used to determine the parameter values ​​of the initial model that maximize the likelihood function based on the training sample set, and adjust the language model according to the parameter values ​​to obtain the student model.

[0184] Optionally, in some embodiments of the present application, the recognition generation unit may include a judgment subunit, a prediction subunit, and a first generation subunit, as follows:

[0185] The judgment subunit is used to use the teacher model to judge the samples in the content safety sample set and generate corresponding soft labels, wherein the soft labels are used to indicate the probability that the teacher model judges the samples as target content;

[0186] The prediction subunit is used to use the student model to predict the sample to obtain an initial prediction probability. When the difference between the initial prediction probability and the soft label is greater than a preset judgment threshold, the sample corresponding to the soft label is identified as a hard sample.

[0187] The first generating subunit is used to use the teacher model to identify the category of the hard sample, and generate a sample with the same category as the hard sample but different content according to the semantic features of the hard sample as a teacher training sample.

[0188] Optionally, in some embodiments of the present application, the training unit may include a second generation subunit, a third generation subunit and a training subunit, as follows:

[0189] The second generating subunit is used to generate a target content sample and a non-target content sample as auxiliary samples based on the teacher model;

[0190] A third generating subunit is used to generate a soft label corresponding to the auxiliary sample and a soft label corresponding to the teacher training sample by using the teacher model, wherein the soft label is used to indicate the probability that the teacher model determines that the sample is the target content;

[0191] The training sub-unit is used to use the teacher training sample and the auxiliary sample as a teacher training sample set, and based on the teacher training sample set, iteratively train the student model to obtain a trained target content security review model.

[0192] Optionally, in some embodiments of the present application, the training subunit may include a first selection subunit, a second selection subunit, a first training subunit, and a second training subunit, as follows:

[0193] The first selection subunit is used to select teacher training samples and auxiliary samples of different categories for mixing to obtain the teacher training sample set;

[0194] A first training subunit is used to iteratively train the student model based on the teacher training sample set to obtain a trained target content security audit model, and then repeatedly execute the steps of generating teacher training samples of corresponding categories according to the categories of the hard samples, generating target content samples and non-target content samples based on the teacher model as auxiliary samples, and then using the teacher model to generate soft labels corresponding to the auxiliary samples and soft labels corresponding to the teacher training samples, using the teacher training samples and the auxiliary samples as the teacher training sample set, and using the student model to identify samples in the teacher training sample set to obtain identification results, until the difference between the soft label and the identification result is less than a preset identification threshold;

[0195] The second selection subunit is used to select teacher training samples and auxiliary samples of the same category as a teacher training sample set of the same category;

[0196] The second training sub-unit is used to alternately train the student model based on the teacher training sample sets of different categories to obtain a trained target content security review model, and then repeatedly execute the steps of generating teacher training samples of corresponding categories according to the categories of the hard samples, generating target content samples and non-target content samples based on the teacher model as auxiliary samples, and then using the teacher model to generate soft labels corresponding to the auxiliary samples and soft labels corresponding to the teacher training samples, taking the teacher training samples and the auxiliary samples as the teacher training sample sets, and using the student model to identify the samples in the teacher training sample set to obtain the recognition result, until the difference between the soft label and the recognition result is less than a preset recognition threshold.

[0197] Optionally, in some embodiments of the present application, the first training subunit may be specifically used to use the student model to identify the teacher training sample, and if the identified category is inconsistent with the preset category, a weak category sample is generated according to the current category, and the weak category sample includes the teacher training sample and the auxiliary sample;

[0198] Counting the number of inconsistencies between the categories identified by the student model and the preset categories, and determining the recognition error ratio corresponding to the preset categories;

[0199] According to the recognition error ratio, the weak category ratio of the weak category samples in the teacher training sample set is determined, and the teacher training sample set is updated based on the weak category ratio.

[0200] Optionally, in some embodiments of the present application, the second training subunit may be specifically used to use the student model to identify the teacher training sample, and if the identified category is inconsistent with the preset category, a weak category sample is generated according to the current category; the weak category sample is a sample used to train the student model's ability to identify the category of the sample;

[0201] Counting the number of inconsistencies between the categories identified by the student model and the preset categories, and determining the recognition error ratio corresponding to the current category;

[0202] According to the recognition error ratio, the number of training times for the current category is determined, and based on the number of training times, multiple groups of weak category sample sets are generated, wherein the weak category sample sets include teacher training samples and auxiliary samples.

[0203] (6) a second identification unit 306;

[0204] It is used to identify the content to be audited by adopting the target content security audit model, and identify the target content and the category of the target content.

[0205] As can be seen from the above, the embodiment of the present application can collect a predetermined number of samples through the collection unit 301 to obtain a content security sample set; obtain pre-trained language models of different magnitudes through the acquisition unit 302, respectively as student models and teacher models; use the student model to identify the target samples in the content security sample set and the category of the target samples through the first recognition unit 303; use the recognition generation unit 304 to identify samples inconsistent with the recognition results of the student model based on the teacher model as hard samples, and generate teacher training samples of the corresponding category according to the category of the hard samples; use the training unit 305 to iteratively train the student model based on the teacher training samples of different categories to obtain a trained target content security audit model; use the target content security audit model to identify the content to be audited through the second recognition unit 306, and identify the target content and the category of the target content. The present application trains the student model through a powerful teacher model, and trains it using samples of different categories, so that it can quickly and efficiently process multiple content security categories under a unified command response interface.

[0206] 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:

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

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

[0209] 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 identifying harmful information, 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.

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

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

[0212] 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:

[0213] Collect a predetermined number of samples to obtain a content security sample set; obtain pre-trained language models of different magnitudes as student models and teacher models respectively; use the student model to identify target samples in the content security sample set and the category of the target samples; based on the teacher model, identify samples that are inconsistent with the recognition results of the student model as hard samples, and generate teacher training samples of corresponding categories according to the categories of the hard samples; iteratively train the student model based on the teacher training samples of different categories to obtain a trained target content security review model; use the target content security review model to identify the content to be reviewed, and identify the target content and the category of the target content.

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

[0215] As can be seen from the above, this embodiment can collect a predetermined number of samples to obtain a content security sample set; obtain pre-trained language models of different magnitudes as student models and teacher models respectively; use the student model to identify the target samples in the content security sample set, as well as the category of the target samples; identify samples that are inconsistent with the recognition results of the student model based on the teacher model as hard samples, and generate teacher training samples of the corresponding category according to the category of the hard samples; iteratively train the student model based on the teacher training samples of different categories to obtain a trained target content security review model; use the target content security review model to identify the content to be reviewed, and identify the target content and the category of the target content. The present application trains a student model through a powerful teacher model, and trains it using harmful content samples of different categories, so that it can quickly and efficiently process multiple content security categories under a unified command response interface.

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

[0217] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the adaptive content recognition methods provided in the embodiments of the present application. For example, the instructions can execute the following steps:

[0218] Collect a predetermined number of samples to obtain a content security sample set; obtain pre-trained language models of different magnitudes as student models and teacher models respectively; use the student model to identify target samples in the content security sample set and the category of the target samples; based on the teacher model, identify samples that are inconsistent with the recognition results of the student model as hard samples, and generate teacher training samples of corresponding categories according to the categories of the hard samples; iteratively train the student model based on the teacher training samples of different categories to obtain a trained target content security review model; use the target content security review model to identify the content to be reviewed, and identify the target content and the category of the target content.

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

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

[0221] Since the instructions stored in the computer-readable storage medium can execute the steps in any one of the adaptive content recognition methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the adaptive content recognition methods provided in the embodiments of the present application can be achieved. For details, please refer to the previous embodiments and will not be repeated here.

[0222] 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 including 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 above-mentioned adaptive content recognition method.

[0223] The above is a detailed introduction to an adaptive content recognition method and related equipment 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. An adaptive content recognition method, characterized in that: include: Collecting a predetermined number of samples to obtain a content security sample set; Obtain pre-trained language models of different sizes as student models and teacher models respectively; Using the student model to identify a target sample in the content safety sample set and a category of the target sample; Based on the teacher model, samples that are inconsistent with the recognition results of the student model are identified as hard samples, and according to the categories of the hard samples, teacher training samples of corresponding categories are generated; Based on the teacher training samples of different categories, the student model is iteratively trained to obtain a trained target content security review model; The target content security audit model is used to identify the content to be audited, and the target content and the category of the target content are identified.

2. The adaptive content recognition method according to claim 1, characterized in that: The student model is iteratively trained based on the teacher training samples of different categories to obtain a trained target content security review model, including: Generate target content samples and non-target content samples based on the teacher model as auxiliary samples; The teacher model is used to generate a soft label corresponding to the auxiliary sample and a soft label corresponding to the teacher training sample, wherein the soft label is used to indicate the probability that the teacher model determines that the sample is the target content; The teacher training samples and the auxiliary samples are used as a teacher training sample set, and based on the teacher training sample set, the student model is iteratively trained to obtain a trained target content security review model.

3. The adaptive content recognition method according to claim 2, characterized in that: The student model is iteratively trained based on the teacher training samples of different categories to obtain a trained target content security review model, including: Selecting teacher training samples and auxiliary samples of different categories and mixing them to obtain the teacher training sample set; Based on the teacher training sample set, the student model is iteratively trained to obtain a trained target content security review model.

4. The adaptive content recognition method according to claim 3, characterized in that: Selecting different categories of teacher training samples and auxiliary samples for mixing to obtain the teacher training sample set also includes: The student model and the teacher model are used to identify the teacher training samples. If the identified categories are inconsistent, the number of inconsistent categories is counted to determine the recognition error ratios corresponding to the different categories; When the recognition error ratio exceeds a first preset category threshold, determining the category as a weak category, and using the teacher model to generate weak category samples for the weak category; According to the recognition error ratio, the weak category ratio of the weak category samples in the teacher training sample set is determined, and the teacher training sample set is updated based on the weak category ratio.

5. The adaptive content recognition method according to claim 2, characterized in that: The iterative training of the student model based on the teacher training sample set to obtain a trained target content security review model also includes: Select teacher training samples and auxiliary samples of the same category as a category teacher training sample set; The student model is alternately trained based on the teacher training sample sets of different categories to obtain a trained target content security review model.

6. The adaptive content recognition method according to claim 4, characterized in that: The student model is alternately trained based on the teacher training sample sets of different categories to obtain a trained target content security review model, and further includes: The student model is used to identify the teacher training samples, and the number of inconsistencies between the categories identified by the student model and the categories identified by the teacher model is counted to determine the recognition error ratio corresponding to the current category; When the recognition error ratio exceeds a second preset category threshold, determining the category as a weak category, and using the teacher model to generate weak category samples for the weak category; Determining the number of training times for the weak category according to the recognition error ratio, and combining the weak category samples based on the number of training times to obtain multiple groups of weak category sample sets; The student model is alternately trained based on the multiple groups of weak category sample sets to obtain a trained target content security review model.

7. The adaptive content recognition method according to claim 1, characterized in that: Obtain pre-trained language models of different sizes as student models and teacher models, including: Get a lightweight language model as the initial model; Selecting a predetermined amount of training data from the content safety sample set, and marking the real labels corresponding to the training data, to obtain a training sample set; Based on the training sample set, the parameter values ​​of the initial model that maximize the likelihood function are determined, and the language model is adjusted according to the parameter values ​​to obtain the student model.

8. The adaptive content recognition method according to claim 1, characterized in that: The identifying, based on the teacher model, samples that are inconsistent with the identification results of the student model as hard samples includes: Using the teacher model to judge the samples in the content safety sample set, and generating corresponding soft labels, wherein the soft labels are used to indicate the probability that the teacher model judges the samples as target content; The student model is used to predict the sample to obtain an initial prediction probability. When the difference between the initial prediction probability and the soft label is greater than a preset judgment threshold, the sample corresponding to the soft label is identified as a hard sample.

9. The adaptive content recognition method according to claim 7, characterized in that: The step of generating teacher training samples of corresponding categories according to the categories of the hard samples comprises: Using the teacher model to identify the category of the hard sample; According to the semantic features of the hard samples, samples with the same category as the hard samples but different contents are generated as teacher training samples.

10. The adaptive content recognition method according to claim 2, characterized in that: The iterative training of the student model based on the teacher training sample set to obtain a trained target content security review model includes: Using the student model to identify samples in the teacher training sample set to obtain a recognition result; If the difference between the soft label and the recognition result is greater than a preset recognition threshold, a loss function is calculated according to the recognition result and the soft label, and the parameters of the student model are updated according to the loss function; Repeat the steps of generating teacher training samples of corresponding categories according to the categories of the hard samples, generating target content samples and non-target content samples as auxiliary samples based on the teacher model; using the teacher model to generate soft labels corresponding to the auxiliary samples and soft labels corresponding to the teacher training samples, using the teacher training samples and the auxiliary samples as a teacher training sample set, and using the student model to identify samples in the teacher training sample set to obtain recognition results, until the difference between the soft label and the recognition result is less than a preset recognition threshold.

11. An adaptive content recognition device, characterized in that: include: A collection unit, used to collect a predetermined number of samples to obtain a content security sample set; An acquisition unit, used to acquire pre-trained language models of different magnitudes, which are used as student models and teacher models respectively; A first identification unit, configured to use the student model to identify a target sample in the content safety sample set and a category of the target sample; An identification and generation unit, which identifies samples inconsistent with the identification results of the student model based on the teacher model as hard samples, and generates teacher training samples of corresponding categories according to the categories of the hard samples; A training unit, used for iteratively training the student model based on the teacher training samples of different categories to obtain a trained target content security review model; The second identification unit is used to identify the content to be audited by using the target content security audit model, and identify the target content and the category 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 perform the operations in the adaptive content recognition method according to 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 adaptive content identification 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 adaptive content recognition method according to any one of claims 1 to 10 are implemented.