Text content auditing method and device, equipment, storage medium and program product
By first using the risk type identification model to obtain the risk type confidence of the text to be detected, and then combining the large language detection model to perform risk detection, the problem of low accuracy of risk content recognition in the existing technology is solved, and a higher risk recall rate is achieved and lower disturbance rates.
Patent Information
- Application Number
- CN202411693882.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-02-18
AI Technical Summary
In the existing content security review, keyword-based logic leads to low accuracy in risk content recognition, which is prone to misjudgment or omissions.
By first using the risk type identification model to obtain the first confidence of each risk type of the text to be detected, then calling the large language detection model to determine the risk discrimination result and the second confidence, and finally determining the content review result.
It effectively improves the risk recall rate of risk review of text content, reduces the disturbance rate of misidentified as risk content, and thus improves the accuracy of recognition of risk content.
Smart Images

Figure CN119474273A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a text content review method, device, equipment, storage medium and program product. Background Art
[0002] With the rapid development and popularization of the Internet, content security auditing has become increasingly important. Content security auditing refers to the review and evaluation of content on online platforms to detect risky content contained in these contents.
[0003] Related technologies: content security review can be implemented through four modules: machine review, manual review, user complaint review, and result review. Among them, machine review is the most critical module. Most current machine reviews are implemented based on keyword logic, that is, the content security review platform maintains a risk keyword library. If the content posted by the user hits the keywords in the risk keyword library, the content can be confirmed as risky content and will be blocked.
[0004] However, if the keyword library is large in number, a lot of content will be mistakenly identified as risky content during the detection process. If the keyword library is small in number, a lot of risky content may be missed. Therefore, the current content security audit has a low accuracy rate in identifying risky content. Summary of the invention
[0005] Based on this, it is necessary to provide a text content review method, device, equipment, storage medium and program product that can improve the accuracy of identifying risky content in response to the above technical problems.
[0006] In a first aspect, the present application provides a text content review method, comprising:
[0007] Get the text to be detected;
[0008] Inputting the text to be detected into a risk type recognition model, and obtaining a first confidence level of each risk type of the text to be detected output by the risk type recognition model;
[0009] According to the first confidence of each risk type of the text to be detected, calling a large language detection model to determine the risk discrimination result of the text to be detected and the second confidence of each risk type of the text to be detected, wherein the large language detection model is generated by adjusting the parameters of a general large language model through positive sample text data and negative sample text data of multiple risk types;
[0010] The content review result of the text to be detected is determined according to the risk identification result and the second confidence level of each risk type of the text to be detected.
[0011] In one embodiment, the step of calling a large language detection model to determine a risk identification result of the text to be detected and a second confidence of each risk type of the text to be detected according to the first confidence of each risk type of the text to be detected includes:
[0012] If the first confidences of all risk types are less than or equal to the hit threshold and the first confidence of any risk type is greater than or equal to the suspected threshold, the large language detection model is called to determine the risk identification result of the text to be detected and the second confidence of each risk type of the text to be detected.
[0013] In one of the embodiments, after inputting the text to be detected into the risk type recognition model and obtaining the first confidence of each risk type of the text to be detected output by the risk type recognition model, the method further includes:
[0014] If the first confidence level of any risk type is greater than the hit threshold, determining that the content review result of the to-be-detected text is review failure;
[0015] If the first confidence levels of all risk types are less than the suspected threshold, the content review result of the text to be detected is determined to be passed.
[0016] In one embodiment, determining the content review result of the text to be detected based on the risk identification result and the second confidence level of each risk type of the text to be detected includes:
[0017] If the risk identification result indicates that the text to be detected contains risky content and the second confidence level of any risk type is greater than or equal to the target threshold, then determining that the content review result of the text to be detected is review failure;
[0018] If the risk identification result indicates that the text to be detected does not contain risky content or the second confidence of all risk types is less than the target threshold, it is determined that the content review result of the text to be detected is passed.
[0019] In one embodiment, the method further comprises:
[0020] Performing vectorization processing on the text to be detected to obtain a vectorized sentence;
[0021] Matching the vectorized statements with statements in a risk query library and a whitelist query library respectively;
[0022] If the risk query library includes a statement whose similarity to the vectorized statement is higher than the similarity threshold, determining that the content review result of the text to be detected is review failure;
[0023] If the whitelist query library includes a statement whose similarity to the vectorized statement is higher than the similarity threshold, determining that the content review result of the text to be detected is approved;
[0024] If neither the risk query library nor the whitelist query library includes a statement whose similarity to the vectorized statement is higher than a similarity threshold, the step of inputting the text to be detected into a risk type recognition model and obtaining a first confidence level of each risk type of the text to be detected output by the risk type recognition model is executed.
[0025] In one embodiment, the method further comprises:
[0026] Performing word segmentation on the text to be detected to obtain a word segmentation result of the text to be detected;
[0027] If the word segmentation result contains a preset risk keyword, determining that the content review result of the text to be detected is failed;
[0028] If the word segmentation result does not contain the preset risk keywords, the step of performing vectorization processing on the text to be detected to obtain a vectorized sentence is executed.
[0029] In a second aspect, the present application provides a text content review device, comprising:
[0030] An acquisition module is used to acquire the text to be detected;
[0031] A first detection module, used for inputting the text to be detected into a risk type recognition model, and obtaining a first confidence level of each risk type of the text to be detected output by the risk type recognition model;
[0032] The second detection module is used to call a large language detection model to determine the risk discrimination result of the text to be detected and the second confidence of each risk type of the text to be detected according to the first confidence of each risk type of the text to be detected, wherein the large language detection model is generated by adjusting the parameters of a general large language model through positive sample text data and negative sample text data of multiple risk types; and determine the content review result of the text to be detected according to the risk discrimination result and the second confidence of each risk type of the text to be detected.
[0033] In one of the embodiments, the second detection module is further used to call the large language detection model to determine the risk judgment result of the text to be detected and the second confidence of each risk type of the text to be detected if the first confidence of all risk types is less than or equal to the hit threshold and the first confidence of any risk type is greater than or equal to the suspected threshold.
[0034] In one of the embodiments, the first detection module is further configured to determine that the content review result of the to-be-detected text is a failed review if the first confidence level of any risk type is greater than the hit threshold;
[0035] If the first confidence levels of all risk types are less than the suspected threshold, the content review result of the text to be detected is determined to be passed.
[0036] In one of the embodiments, the second detection module is also used to determine that the content review result of the text to be detected is failed if the risk identification result indicates that the text to be detected contains risky content and the second confidence of any risk type is greater than or equal to the target threshold; if the risk identification result indicates that the text to be detected does not contain risky content or the second confidence of all risk types is less than the target threshold, then determine that the content review result of the text to be detected is passed.
[0037] In one embodiment, the text content audit device further includes:
[0038] The third detection module is used to vectorize the text to be detected to obtain vectorized sentences; match the vectorized sentences with the sentences in the risk query library and the whitelist query library respectively; if the risk query library includes sentences whose similarity with the vectorized sentences is higher than the similarity threshold, determine that the content review result of the text to be detected is failed; if the whitelist query library includes sentences whose similarity with the vectorized sentences is higher than the similarity threshold, determine that the content review result of the text to be detected is passed; if neither the risk query library nor the whitelist query library includes sentences whose similarity with the vectorized sentences is higher than the similarity threshold, input the text to be detected into the risk type recognition model, and obtain the first confidence of each risk type of the text to be detected output by the risk type recognition model.
[0039] In one embodiment, the text content audit device further includes:
[0040] The fourth detection module is used to perform word segmentation on the text to be detected to obtain the word segmentation result of the text to be detected; if the word segmentation result contains preset risk keywords, it is determined that the content review result of the text to be detected is review failure; if the word segmentation result does not contain the preset risk keywords, the text to be detected is vectorized to obtain a vectorized sentence.
[0041] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the text content review method of the first aspect when executing the computer program.
[0042] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the text content review method of the first aspect.
[0043] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the text content review method of the first aspect.
[0044] The above-mentioned text content audit method, device, equipment, storage medium and program product first obtain the text to be detected. Secondly, the text to be detected is input into the risk type recognition model, and the first confidence of each risk type of the text to be detected output by the risk type recognition model is obtained. Again, according to the first confidence of each risk type of the text to be detected, the large language detection model is called to determine the risk discrimination result of the text to be detected and the second confidence of each risk type of the text to be detected. The large language detection model is generated by adjusting the parameters of the general large language model through positive sample text data and negative sample text data of multiple risk types. Finally, according to the risk discrimination result and the second confidence of each risk type of the text to be detected, the content audit result of the text to be detected is determined. Since the first confidence of the risk type of the text to be detected is first identified by the risk type recognition model, and then the large language detection model is called for risk detection based on the recognition result of the risk type recognition model, the risk recall rate of the risk audit of the text content can be effectively improved, the interruption rate of being mistakenly identified as risk content is reduced, and the recognition accuracy of risk content is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0046] FIG1 is an application environment diagram of a text content review method provided by an embodiment of the present application;
[0047] Figure 2 A flowchart of a text content review method provided in an embodiment of the present application;
[0048] Figure 3 A flowchart of another text content review method provided in an embodiment of the present application;
[0049] Figure 4 A schematic diagram of the principle of a text content review method provided in an embodiment of the present application;
[0050] Figure 5 A structural block diagram of a text content review device provided in an embodiment of the present application;
[0051] FIG6 is a diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] First, the related technology will be described below.
[0054] With the rapid development and popularization of the Internet, content security auditing has become increasingly important. Content security auditing refers to the review and evaluation of content on online platforms to detect risky content contained in these contents.
[0055] Related technologies: content security audit can be implemented through four modules: machine audit, manual audit, user complaint audit, and result review. Among them, machine audit is the most critical module. 95% or even 99% of the content needs to be filtered by the machine audit module. The detection accuracy of machine audit directly determines the user experience and whether most risky content can be intercepted, and also determines the cost of subsequent manual audit.
[0056] Most of the current machine audits are implemented based on keyword logic, that is, the content security audit platform maintains a risk keyword library. If the content posted by the user hits the keywords in the risk keyword library, the content can be confirmed as risky content and will be blocked. However, although machine audits based on keyword logic are simple, easy to maintain, and low-cost, they are not flexible enough. If the keywords in the keyword library are large, more content will be mistakenly hit as risky content during the detection process. If the keywords in the keyword library are small, a large amount of risky content may be missed. In addition, risky keywords may be hit in normal content due to incorrect punctuation. Therefore, the accuracy of identifying risky content is low in current content security audits.
[0057] With the development of artificial intelligence, deep learning is now also being used for machine review. By collecting various types of risk content data and full risk content data, a classification model can be trained, and then the classification model can be used to determine whether the input text is safe or not. Compared with keyword review, the classification model has better generalization and can cope with more complex situations. However, risk content covers a wide range of content and types. At the same time, users will deliberately hide their purpose when making risky remarks, which brings great challenges to the identification of risky content. It is also difficult for classification models to take into account both risk recall rate and interruption rate. They often fall into the dilemma of letting go of a large amount of risky content by raising the risk threshold, and causing a lot of interruptions to users by lowering the risk threshold.
[0058] To solve the above problems, the embodiments of the present application provide a text content review method, apparatus, device, storage medium and program product, which first identify the first confidence of the risk type of the text to be detected through a risk type recognition model, and then call the large language detection model to perform risk detection based on the recognition result of the risk type recognition model, thereby effectively improving the risk recall rate of the risk review of the text content, reducing the interruption rate of being mistakenly identified as risky content, and thereby improving the recognition accuracy of risky content.
[0059] The following describes the application scenarios of the text content review method provided in the embodiments of the present application.
[0060] The text content review method provided in the embodiment of the present application can be applied in the application environment shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers.
[0061] The terminal 102 can send the text to be detected to the server 104. After the server 104 obtains the text to be detected, it can input the text to be detected into the risk type recognition model and obtain the first confidence of each risk type of the text to be detected output by the risk type recognition model. Subsequently, the server 104 calls the large language detection model to determine the risk discrimination result of the text to be detected and the second confidence of each risk type of the text to be detected according to the first confidence of each risk type of the text to be detected. The large language detection model is generated by adjusting the parameters of the general large language model through positive sample text data and negative sample text data of multiple risk types. Finally, the server 104 can determine the content review result of the text to be detected according to the risk discrimination result and the second confidence of each risk type of the text to be detected.
[0062] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices may be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.
[0063] In an exemplary embodiment, Figure 2 As shown, a text content audit method is provided, and the method is applied to the server in FIG. 1 as an example for explanation. The text content audit method includes S201-S204:
[0064] S201, obtaining the text to be detected.
[0065] In the present application, when text content review is required, the server can first obtain the text to be tested, thereby identifying risky content therefrom.
[0066] It should be understood that the embodiments of the present application do not limit how to obtain the text to be detected. In some embodiments, the above-mentioned text to be detected can be sent to the server by the user through a terminal device. In other embodiments, the server can obtain the text to be detected from the relevant data stored in the server.
[0067] The above-mentioned text to be detected can be any text input by the user, including user comments, barrage, chat content, etc.
[0068] In some embodiments, after obtaining the text to be detected, the server can perform word segmentation on the text to be detected to obtain the word segmentation result of the text to be detected. If the word segmentation result contains the preset risk keywords, the server determines that the content review result of the text to be detected is not passed. If the word segmentation result does not contain the preset risk keywords, the server performs a text content review on the text to be detected by querying the statements in the library.
[0069] It should be understood that the embodiment of the present application does not limit the word segmentation method of the text to be detected. For example, the word segmentation method of the text to be detected can be called by a Jieba word segmenter. The word segmentation result can be multiple words to be recognized in the text to be detected.
[0070] Exemplarily, the server can collect blacklist keywords to establish a vocabulary of risk keywords. After the server obtains the text to be detected, the jieba word segmenter can be used to segment the text to be detected to obtain multiple words to be identified in the text to be detected. Subsequently, the multiple words to be identified are matched with the risk keywords in the vocabulary in turn. If the multiple words to be identified include any risk keyword, it can be determined that the content review result of the text to be detected is that the review fails, the text to be detected is intercepted by the system, and the subsequent process is terminated. If the multiple words to be identified do not include risk keywords, the text content of the text to be detected can be reviewed by querying the statements in the library.
[0071] In this application, keyword detection adopts a strategy of first segmenting the input text to be detected and then matching it with risk keywords. Compared with traditional direct matching, it greatly reduces the interruption rate.
[0072] It should be understood that the embodiments of the present application illustrate how to perform text content review on the text to be detected through the statements in the query library. In some embodiments, the server vectorizes the text to be detected, and after obtaining the vectorized statements, the vectorized statements can be matched with the statements in the risk query library and the whitelist query library respectively, so as to perform text content review through the matching results.
[0073] In some embodiments, if the risk query library includes a statement whose similarity to the vectorized statement is higher than the similarity threshold, the content audit result of the text to be detected is determined to be audit failure. If the whitelist query library includes a statement whose similarity to the vectorized statement is higher than the similarity threshold, the content audit result of the text to be detected is determined to be audit passed. If neither the risk query library nor the whitelist query library includes a statement whose similarity to the vectorized statement is higher than the similarity threshold, S202 is executed to continue the text content audit.
[0074] The risk query library can be established by collecting risk questions, and the whitelist query library can be established based on business needs.
[0075] It should be understood that the embodiments of the present application do not limit how to vectorize the text to be detected. In some embodiments, the open source general vector model (BAAI General Embedding, BGE) model can be used to vectorize the text to be detected. It should be understood that the embodiments of the present application do not limit how to calculate the similarity, and any vector similarity detection algorithm can be used.
[0076] In some embodiments, the above-mentioned similarity threshold can be specifically set according to the actual situation. Exemplarily, the above-mentioned similarity threshold can be set to 0.8. Then, when the vector similarity detection algorithm calculates that the whitelist query library includes statements with a similarity higher than 0.8 with the vectorized statement, the content review result of the text to be detected is determined to be approved, and the subsequent process is terminated. When the vector similarity detection algorithm calculates that the risk query library includes statements with a similarity higher than 0.8 with the vectorized statement, the content review result of the text to be detected is determined to be unapproved, the text to be detected is intercepted, and the subsequent process is terminated. When the vector similarity detection algorithm calculates that the risk query library and the whitelist query library do not include statements with a similarity higher than 0.8 with the vectorized statement, subsequent further detection is performed.
[0077] S202: Input the text to be detected into a risk type recognition model, and obtain a first confidence level of each risk type of the text to be detected output by the risk type recognition model.
[0078] Among them, the risk type identification model can be used for all-in-one classification. The risk type identification model can be, for example, a neural network model. Exemplarily, the neural network model can include the Roberta model. The Roberta model is a language model based on the Transformer architecture. The Roberta model can generate a new masking pattern each time a sequence is input into the model, so that the model can learn more diverse language features and improve the generalization ability of the model.
[0079] Exemplarily, the server may collect risk texts of various risk types and a large amount of normal texts to train the Roberta model, thereby generating a trained risk type recognition model.
[0080] It should be understood that the above risk types can be specifically set according to actual conditions. For example, they can include risk types such as pornography, politics, terrorism and violence. Accordingly, the first confidence level can be the confidence level of each risk type identified by the above risk type identification model.
[0081] In some embodiments, if the first confidence of any risk type is greater than the hit threshold, the server can determine that the content review result of the text to be detected is not passed. If the first confidence of all risk types is less than the suspected threshold, the server can determine that the content review result of the text to be detected is passed.
[0082] It should be noted that the above-mentioned hit threshold and suspected threshold can be set according to actual conditions. The hit threshold is higher than the suspected threshold. The hit thresholds of different risk types can be the same or different, and the suspected thresholds of different risk types can be the same or different. The embodiments of the present application do not impose any restrictions on this.
[0083] For example, the hit threshold can be set to 0.9, and the suspected threshold can be set to 0.7. Then, when the first confidence of any risk type (for example, the first confidence of the terrorism risk type) is greater than 0.9, it can be determined that the content review result of the text to be detected is not passed, and the text to be detected is intercepted, and the subsequent process is terminated. When the first confidence of all risk types is less than 0.7, it can be determined that the content review result of the text to be detected is passed, and the subsequent process is terminated.
[0084] S203 . According to the first confidence level of each risk type of the text to be detected, call the large language detection model to determine the risk identification result of the text to be detected and the second confidence level of each risk type of the text to be detected.
[0085] In some embodiments, if the first confidences of all risk types are less than or equal to the hit threshold and the first confidence of any risk type is greater than or equal to the suspected threshold, the large language detection model is called to determine the risk identification result of the text to be detected and the second confidence of each risk type of the text to be detected.
[0086] Exemplarily, the hit threshold can be set to 0.9, and the suspected threshold can be set to 0.7. Then, when the first confidences of all risk types are less than or equal to 0.9 and the first confidence of any risk type is greater than or equal to 0.7, the large language detection model can be further called to determine the risk judgment result of the text to be detected and the second confidence of each risk type of the text to be detected.
[0087] The large language detection model is generated by adjusting the parameters of the general large language model through positive sample text data and negative sample text data of multiple risk types. Correspondingly, the second confidence level can be the confidence level of each risk type identified by the large language detection model.
[0088] Exemplarily, in the process of adjusting the parameters of the general large language model, the prompt of the general large language model can be set to allow the general large language model to judge whether the input text to be detected has risks according to the description of each risk type. The general large language model is trained with positive sample text data and negative sample text data of multiple risk types. If there is a risk, the large language detection model outputs a risk judgment result indicating that the text to be detected contains risk content and a second confidence level of the risk type, thereby adjusting the general large language model according to the output data to obtain a large language detection model.
[0089] The general large language model block in this application can use a lightweight 0.5B model and adopt a virtual large language model (VLLM) reasoning acceleration, which effectively reduces the reasoning cost and improves the reasoning speed and concurrency.
[0090] In some embodiments, the second confidence level may be indicated by a first token output by the large language detection model, where the token is used to reflect the probability that the text to be detected is “safe” or “no”.
[0091] It should be understood that a token is the basic unit for processing text data in a large language model. A token can be a word, a character, a subword, or a symbol with a specific meaning.
[0092] It should be understood that in the embodiment of the present application, the accuracy of the large language detection model is relatively high, but even if it is lightweight and inference accelerated, its cost and delay are still relatively high. Therefore, the text content can be reviewed first through keywords, risk query library, whitelist query library and risk type identification model. If the content review result cannot be determined, the large language detection model can be used to review the text content. In addition, the suspected threshold can be adjusted to determine how much proportion of the text to be detected needs to be called for detection by the large language model. The higher the suspected threshold, the less text to be detected is called for detection by the large language model, and the overall cost and delay of the text content review are lower, but the corresponding accuracy of the text content review will also be reduced.
[0093] S204: Determine a content review result of the text to be detected based on the risk identification result and the second confidence level of each risk type of the text to be detected.
[0094] In this step, after the server calls the large language detection model to determine the risk identification result of the text to be detected and the second confidence of each risk type of the text to be detected, the content review result of the text to be detected can be determined based on the risk identification result and the second confidence of each risk type of the text to be detected.
[0095] In some embodiments, if the risk identification result indicates that the text to be detected contains risky content and the second confidence level of any risk type is greater than or equal to the target threshold, the content review result of the text to be detected is determined to be unsuccessful. If the risk identification result indicates that the text to be detected does not contain risky content or the second confidence levels of all risk types are less than the target threshold, the content review result of the text to be detected is determined to be passed.
[0096] The target threshold can be set according to the actual situation. For example, it can be set to 0.7, 0.8, 0.9, etc. The target thresholds of different risk types can be the same or different. In addition, the size of the target threshold can be set according to actual needs to control the strictness of content review. The smaller the target threshold, the stricter the content review, and the larger the target threshold, the lower the strictness of content review.
[0097] The text content audit method provided by the embodiment of the present application first obtains the text to be detected. Secondly, the text to be detected is input into the risk type recognition model, and the first confidence of each risk type of the text to be detected output by the risk type recognition model is obtained. Again, according to the first confidence of each risk type of the text to be detected, the large language detection model is called to determine the risk discrimination result of the text to be detected and the second confidence of each risk type of the text to be detected. The large language detection model is generated by adjusting the parameters of the general large language model through positive sample text data and negative sample text data of multiple risk types. Finally, according to the risk discrimination result and the second confidence of each risk type of the text to be detected, the content audit result of the text to be detected is determined. Since the risk type of the text to be detected is first identified by the risk type recognition model, and then the large language detection model is called for risk detection based on the recognition result of the risk type recognition model, the risk recall rate of the risk audit of the text content can be effectively improved, the interruption rate of being mistakenly identified as risk content is reduced, and the recognition accuracy of risk content is thereby improved.
[0098] Figure 3 A flowchart of another text content review method provided in an embodiment of the present application is provided. Figure 4 A schematic diagram of the principle of a text content review method provided in an embodiment of the present application, such as Figure 3 and Figure 4 As shown, the text content review method includes S301-S316:
[0099] S301, obtaining the text to be detected.
[0100] S302: Segment the text to be detected to obtain a segmentation result of the text to be detected.
[0101] S303: Determine whether the word segmentation result contains a preset risk keyword.
[0102] If yes, execute S316, if no, execute S304.
[0103] S304: Perform vectorization processing on the text to be detected to obtain vectorized sentences.
[0104] S305: Match the vectorized statement with the statement in the whitelist query library.
[0105] S306: Determine whether the whitelist query library includes statements whose similarity to the vectorized statement is higher than a similarity threshold.
[0106] If yes, execute S315, if no, execute S307.
[0107] S307: Match the vectorized statement with the statement in the risk query library.
[0108] S308: Determine whether the risk query library includes statements whose similarity to the vectorized statement is higher than a similarity threshold.
[0109] If yes, execute S316, if no, execute S309.
[0110] S309: Input the text to be detected into the risk type recognition model, and obtain the first confidence level of each risk type of the text to be detected output by the risk type recognition model.
[0111] S310: Determine whether a first confidence level of any risk type is greater than a hit threshold.
[0112] If yes, execute S316, if no, execute S311.
[0113] S311. Determine whether the first confidences of all risk types are less than a suspected threshold.
[0114] If yes, execute S315, if no, execute S312.
[0115] S312: Calling the large language detection model to determine the risk identification result of the text to be detected and the second confidence level of each risk type of the text to be detected.
[0116] S313: Determine whether the risk identification result indicates that the text to be detected contains risky content.
[0117] If yes, execute S313, if no, execute S315.
[0118] S314: Determine whether the second confidence levels of all risk types are less than a target threshold.
[0119] If yes, execute S315, if no, execute S316.
[0120] S315: Determine that the content review result of the text to be tested is passed.
[0121] S316: Determine that the content review result of the text to be tested is failure to pass the review.
[0122] In this application, keyword detection, risk type identification model and large language detection model are combined, and risk query matching is added. On the one hand, the addition of large language detection model can effectively improve the risk recall rate of content security review and reduce the interruption rate. On the other hand, large language detection model is only used when keyword detection, risk type identification model and risk query matching cannot determine whether the text to be tested is risky, thereby reducing the overall review cost and speeding up the reasoning speed.
[0123] The text content audit method provided by the embodiment of the present application first obtains the text to be detected. Secondly, the text to be detected is input into the risk type recognition model, and the first confidence of each risk type of the text to be detected output by the risk type recognition model is obtained. Again, according to the first confidence of each risk type of the text to be detected, the large language detection model is called to determine the risk discrimination result of the text to be detected and the second confidence of each risk type of the text to be detected. The large language detection model is generated by adjusting the parameters of the general large language model through positive sample text data and negative sample text data of multiple risk types. Finally, according to the risk discrimination result and the second confidence of each risk type of the text to be detected, the content audit result of the text to be detected is determined. Since the risk type of the text to be detected is first identified by the risk type recognition model, and then the large language detection model is called for risk detection based on the recognition result of the risk type recognition model, the risk recall rate of the risk audit of the text content can be effectively improved, the interruption rate of being mistakenly identified as risk content is reduced, and the recognition accuracy of risk content is thereby improved.
[0124] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0125] Based on the same inventive concept, the embodiment of the present application also provides a text content review device for implementing the text content review method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more text content review device embodiments provided below can refer to the limitations of the text content review method above, and will not be repeated here.
[0126] In an exemplary embodiment, Figure 5 As shown, a text content audit device 400 is provided, comprising: an acquisition module 401, a first detection module 402 and a second detection module 403, wherein:
[0127] The acquisition module 401 is used to acquire the text to be detected.
[0128] A first detection module 402, configured to input the text to be detected into a risk type recognition model, and obtain a first confidence level of each risk type of the text to be detected output by the risk type recognition model;
[0129] The second detection module 403 is used to call the large language detection model to determine the risk discrimination result of the text to be detected and the second confidence of each risk type of the text to be detected according to the first confidence of each risk type of the text to be detected, and the large language detection model is generated by adjusting the parameters of the general large language model through positive sample text data and negative sample text data of multiple risk types; according to the risk discrimination result and the second confidence of each risk type of the text to be detected, the content review result of the text to be detected is determined.
[0130] In one embodiment, the second detection module 403 is further used to call the large language detection model to determine the risk judgment result of the text to be detected and the second confidence of each risk type of the text to be detected if the first confidence of all risk types is less than or equal to the hit threshold and the first confidence of any risk type is greater than or equal to the suspected threshold.
[0131] In one embodiment, the first detection module 402 is further configured to determine that the content review result of the text to be detected is a review failure if the first confidence level of any risk type is greater than a hit threshold;
[0132] If the first confidence levels of all risk types are less than the suspected threshold, the content review result of the text to be tested is determined to be passed.
[0133] In one of the embodiments, the second detection module 403 is also used to determine that the content review result of the text to be detected is failed if the risk identification result indicates that the text to be detected contains risky content and the second confidence of any risk type is greater than or equal to the target threshold; if the risk identification result indicates that the text to be detected does not contain risky content or the second confidence of all risk types is less than the target threshold, then determine that the content review result of the text to be detected is passed.
[0134] In one embodiment, the text content auditing device 400 further includes:
[0135] The third detection module 404 is used to vectorize the text to be detected to obtain vectorized sentences; match the vectorized sentences with the sentences in the risk query library and the whitelist query library respectively; if the risk query library includes sentences whose similarity with the vectorized sentences is higher than the similarity threshold, the content review result of the text to be detected is determined to be unsuccessful; if the whitelist query library includes sentences whose similarity with the vectorized sentences is higher than the similarity threshold, the content review result of the text to be detected is determined to be passed; if neither the risk query library nor the whitelist query library includes sentences whose similarity with the vectorized sentences is higher than the similarity threshold, the text to be detected is input into the risk type recognition model, and the first confidence of each risk type of the text to be detected output by the risk type recognition model is obtained.
[0136] In one embodiment, the text content auditing device 400 further includes:
[0137] The fourth detection module 405 is used to perform word segmentation on the text to be detected and obtain the word segmentation result of the text to be detected; if the word segmentation result contains preset risk keywords, the content review result of the text to be detected is determined to be failed review; if the word segmentation result does not contain the preset risk keywords, the text to be detected is vectorized to obtain a vectorized sentence.
[0138] Each module in the above-mentioned text content audit device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations of each module above.
[0139] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG6. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a text content audit method is implemented.
[0140] Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0141] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above-mentioned text content review method when executing the computer program.
[0142] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned text content review method is implemented.
[0143] In one embodiment, a computer program product is provided, including a computer program, which implements the above-mentioned text content review method when executed by a processor.
[0144] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0145] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0146] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0147] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A text content review method, characterized in that: The method comprises: Get the text to be detected; Inputting the text to be detected into a risk type recognition model, and obtaining a first confidence level of each risk type of the text to be detected output by the risk type recognition model; According to the first confidence of each risk type of the text to be detected, calling a large language detection model to determine the risk discrimination result of the text to be detected and the second confidence of each risk type of the text to be detected, wherein the large language detection model is generated by adjusting the parameters of a general large language model through positive sample text data and negative sample text data of multiple risk types; The content review result of the text to be detected is determined according to the risk identification result and the second confidence level of each risk type of the text to be detected.
2. The method according to claim 1, characterized in that The step of calling a large language detection model to determine the risk identification result of the text to be detected and the second confidence of each risk type of the text to be detected according to the first confidence of each risk type of the text to be detected includes: If the first confidences of all risk types are less than or equal to the hit threshold and the first confidence of any risk type is greater than or equal to the suspected threshold, the large language detection model is called to determine the risk identification result of the text to be detected and the second confidence of each risk type of the text to be detected.
3. The method according to claim 2, characterized in that After inputting the text to be detected into the risk type recognition model and obtaining the first confidence of each risk type of the text to be detected output by the risk type recognition model, the method further includes: If the first confidence level of any risk type is greater than the hit threshold, determining that the content review result of the to-be-detected text is review failure; If the first confidence levels of all risk types are less than the suspected threshold, the content review result of the text to be detected is determined to be passed.
4. The method according to claim 1, characterized in that: Determining the content review result of the text to be detected according to the risk identification result and the second confidence level of each risk type of the text to be detected includes: If the risk identification result indicates that the text to be detected contains risky content and the second confidence level of any risk type is greater than or equal to the target threshold, then determining that the content review result of the text to be detected is review failure; If the risk identification result indicates that the text to be detected does not contain risky content or the second confidence of all risk types is less than the target threshold, it is determined that the content review result of the text to be detected is passed.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Performing vectorization processing on the text to be detected to obtain a vectorized sentence; Matching the vectorized statements with statements in a risk query library and a whitelist query library respectively; If the risk query library includes a statement whose similarity to the vectorized statement is higher than the similarity threshold, determining that the content review result of the text to be detected is review failure; If the whitelist query library includes a statement whose similarity to the vectorized statement is higher than the similarity threshold, determining that the content review result of the text to be detected is approved; If neither the risk query library nor the whitelist query library includes a statement whose similarity to the vectorized statement is higher than a similarity threshold, the step of inputting the text to be detected into a risk type recognition model and obtaining a first confidence level of each risk type of the text to be detected output by the risk type recognition model is executed.
6. The method according to claim 5, characterized in that The method further comprises: Performing word segmentation on the text to be detected to obtain a word segmentation result of the text to be detected; If the word segmentation result contains a preset risk keyword, determining that the content review result of the text to be detected is failed; If the word segmentation result does not contain the preset risk keywords, the step of performing vectorization processing on the text to be detected to obtain a vectorized sentence is executed.
7. A text content review device, characterized in that: The device comprises: An acquisition module is used to acquire the text to be detected; A first detection module, used for inputting the text to be detected into a risk type recognition model, and obtaining a first confidence level of each risk type of the text to be detected output by the risk type recognition model; The second detection module is used to call a large language detection model to determine the risk discrimination result of the text to be detected and the second confidence of each risk type of the text to be detected according to the first confidence of each risk type of the text to be detected, wherein the large language detection model is generated by adjusting the parameters of a general large language model through positive sample text data and negative sample text data of multiple risk types; and determine the content review result of the text to be detected according to the risk discrimination result and the second confidence of each risk type of the text to be detected.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Risk detection method and device, equipment, storage medium and product
CN120162796A
Risk detection method, device, equipment, storage medium and product
CN120162796B
Method and device for identifying risk type of social session
CN120744593A