Illegal data detection method based on reading understanding
Through the illegal data detection method based on reading comprehension, and the large language model and self-rationalization method, the problem of the lack of effect in the detection of obscure and complex illegal speeches is solved, and efficient and accurate detection of illegal data is achieved.
Patent Information
- Application Number
- CN202411946843.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-26
AI Technical Summary
The existing technology is not effective in detecting obscure and complex illegal remarks, and it is difficult to achieve efficient and accurate detection of illegal data.
The illegal data detection method based on reading comprehension is adopted, and by obtaining multimodal data, using speech recognition and large language models to generate step-by-step reasoning and explanations, and finally training the illegal text classification model through self-rationalization method to improve the accuracy and robustness of the detection.
It significantly improves the accuracy of detection of obscure and complex illegal speeches, enhances the robustness of detection, and realizes efficient detection of illegal data, including hate speech.
Smart Images

Figure CN119884368A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing and artificial intelligence technology, and more specifically to a method for detecting illegal data based on reading comprehension. Background Art
[0002] With the popularization of the Internet, a large amount of user-generated content has been generated on platforms such as social media and online forums, which contains illegal information such as hate speech, seriously affecting the healthy development of the online environment.
[0003] In order to ensure the security of online platforms and the good experience of users, it is crucial to detect and filter these illegal contents. Current illegal content detection technologies mainly rely on methods based on keyword matching, machine learning models, and large-scale language models. Although these methods have improved the accuracy of detection to a certain extent, the effect is still not ideal when dealing with obscure and complex illegal remarks. Although the keyword matching-based method is simple and direct, it is prone to omissions and false positives when faced with obscure and complex illegal remarks. Although the machine learning model-based method has improved the accuracy of detection to a certain extent, it still faces challenges when dealing with illegal remarks with complex and diverse implicit meanings. Although large-scale language models perform well in understanding context and capturing complex semantic information, they may still be insufficient when faced with implicit and indirect illegal remarks.
[0004] Therefore, it is an urgent problem for those skilled in the art to propose a method for detecting illegal data based on reading comprehension to solve the difficulties existing in the prior art. Summary of the invention
[0005] In view of this, the present invention provides a method for detecting illegal data based on reading comprehension. First, by acquiring multimodal data containing hate speech and using a speech recognition system to convert the speech data into text data, cleaning and preprocessing it, and then using a large language model to generate step-by-step reasoning explanations. Finally, the illegal text classification model is trained through a self-rationalization method to improve the accuracy and robustness of detection.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] A method for detecting illegal data based on reading comprehension includes the following steps:
[0008] Obtain multimodal data containing hate speech, where the multimodal data includes voice data and text data;
[0009] Using a speech recognition system to convert speech data into text data to obtain text content;
[0010] The thinking chain prompts of the large language model are used to generate a step-by-step reasoning explanation of the text content, and a preliminary predicted category label is obtained based on the step-by-step reasoning explanation of the text content;
[0011] Based on the step-by-step reasoning explanation of the text content, the large language model is used again to generate the final predicted category label;
[0012] Generate training data based on the final predicted category labels;
[0013] The training data is used to train the illegal text classification model to obtain the trained detection results.
[0014] Optionally, the specific content of obtaining multimodal data containing hate speech is:
[0015] Use crawler technology to obtain multimodal data containing hate speech from social media platforms, forums, and news comments, identify and select keywords and phrases containing hate speech, and store the obtained multimodal data in a database.
[0016] Optionally, the specific content of converting voice data into text data using a voice recognition system is:
[0017] Using a speech recognition system based on the Transformer model, the speech data is converted into text data, and then the converted text data is cleaned and preprocessed. Finally, the processed text data is integrated with the original text data to form a unified text data set.
[0018] Optionally, the specific content of the step-by-step reasoning explanation of the generated text content using the thought chain prompts of the large language model is:
[0019] Provides two variants, namely the general detection framework and the conditional detection framework, for large language model extraction reasoning;
[0020] General detection framework: Through natural language prompts, using zero-shot thinking chains, and using large language models to interpret text content, we can generate reasoning explanations. The formula is:
[0021] R Fr =F Fr (N,P)
[0022] Conditional detection framework: Through natural language prompts, combined with human-written annotations, including the target objects and implicit meanings of hate speech, a chain of thought prompts is formed to generate reasoning explanations. The formula is:
[0023] R Co =F Co (N,T,I,P)
[0024] Among them, N is the natural language prompt, P is the text content, T is the target of hate speech, I is the implicit meaning, and F is the Fr Generate reasoning explanation R based on natural language prompts N and text content P Fr The natural language model reasoning process, F Co Generate reasoning explanation R based on natural language prompts N, hate speech target T, implicit meaning I and text content P Co The natural language model reasoning process.
[0025] Optionally, based on the step-by-step reasoning explanation of the obtained text content, the specific content of the final predicted category label generated by the large language model is as follows:
[0026] The generated step-by-step reasoning explanation and text content are taken as input. Through specific prompts, a large language model is used to comprehensively consider the step-by-step reasoning explanation and text content to make classification decisions and generate the final predicted category label.
[0027] Optionally, a self-consistency strategy is adopted in the inference process of the large language model. Following the hyperparameter setting, an inference set is formed by generating inference explanations of the text content, and different inference explanations are given their respective consistency scores, specifically:
[0028] V={v i ∣i∈N k},S={s i ∣i∈N k},N k ={1,2,...k
[0029]
[0030] Among them, V is the reasoning set, k is the total number of reasoning explanations of the generated text content, and s i is the self-consistency score of the i-th inference explanation, v best The inference explanation with the highest consistency score.
[0031] Optionally, the specific content of training the illegal text classification model using the training data is as follows:
[0032] Using the Adafactor optimizer, setting the batch size to 32 and the learning rate in the range of {5e-3, 5e-4, 5e-5}, the violation text classification model is trained through the self-rationalization method.
[0033] It can be seen from the above technical solutions that, compared with the prior art, the present invention discloses a method for detecting illegal data based on reading comprehension, which has the following beneficial effects:
[0034] The present invention can realize efficient detection of illegal data including hate speech, significantly improves the detection accuracy of obscure and complex illegal speech, and uses the generated training data to train the illegal text classification model through a self-rationalization method, thereby gradually improving the accuracy and robustness of detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0036] Figure 1 A flowchart of a method for detecting illegal data based on reading comprehension provided by the present invention;
[0037] Figure 2 A general detection framework diagram provided by the present invention;
[0038] Figure 3 This is a condition detection framework diagram provided by the present invention. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] See also Figure 1 As shown, the present invention discloses a method for detecting illegal data based on reading comprehension, comprising the following steps:
[0041] Obtain multimodal data containing hate speech, where the multimodal data includes voice data and text data;
[0042] Using a speech recognition system to convert speech data into text data to obtain text content;
[0043] The thinking chain prompts of the large language model are used to generate a step-by-step reasoning explanation of the text content, and a preliminary predicted category label is obtained based on the step-by-step reasoning explanation of the text content;
[0044] Based on the step-by-step reasoning explanation of the text content, the large language model is used again to generate the final predicted category label;
[0045] Generate training data based on the final predicted category labels;
[0046] The training data is used to train the illegal text classification model to obtain the trained detection results.
[0047] Furthermore, the specific content of obtaining multimodal data containing hate speech is as follows:
[0048] Use crawler technology to obtain multimodal data containing hate speech from social media platforms, forums, and news comments, identify and select keywords and phrases containing hate speech, and store the obtained multimodal data in a database.
[0049] Specifically, for text data, we searched through crawler scripts to obtain relevant posts, comments, and articles and stored them in the database. For voice data, we selected platforms that support voice content, such as YouTube and Twitter, and used crawler tools to collect voice data containing hate speech.
[0050] Furthermore, the specific content of converting voice data into text data using the voice recognition system is as follows:
[0051] Using a speech recognition system based on the Transformer model, the speech data is converted into text data, and then the converted text data is cleaned and preprocessed. Finally, the processed text data is integrated with the original text data to form a unified text data set.
[0052] Specifically, first, the collected voice data is input into the whisper model to obtain preliminary text transcription results. Then, natural language processing technology is used to clean and preprocess these transcriptions, including removing noise words, correcting spelling errors, and standardizing text formats. Then, the processed text data is integrated with the original text data collected from social media, forums, and news comment areas to form a unified text dataset.
[0053] Furthermore, the specific content of the step-by-step reasoning explanation of the generated text content using the thinking chain prompts of the large language model is as follows:
[0054] Provides two variants, namely the general detection framework and the conditional detection framework, for large language model extraction reasoning;
[0055] See also Figure 2 As shown in the figure, the general detection framework: through natural language prompts, using zero-sample thinking chains, using a large language model to interpret the text content, thereby generating reasoning explanations, the formula is:
[0056] R Fr =F Fr (N,P)
[0057] See also Figure 3As shown in the figure, the conditional detection framework: through natural language prompts, combined with human-written annotations, including the target objects of hate speech and implicit meanings, a thought chain prompt is formed to generate an inference explanation. The formula is:
[0058] R Co =F Co (N,T,I,P)
[0059] Among them, N is the natural language prompt, P is the text content, T is the target of hate speech, I is the implicit meaning, and F is the Fr Generate reasoning explanation R based on natural language prompts N and text content P Fr The natural language model reasoning process, F Co Generate reasoning explanation R based on natural language prompts N, hate speech target T, implicit meaning I and text content P Co The natural language model reasoning process.
[0060] Specifically, natural language prompts are used to guide the large language model to interpret the potential meaning of the text content. The large language model generates detailed step-by-step reasoning based on the prompts, including explaining the implicit logic and meaning in the text. The preliminary predicted category label is obtained based on the step-by-step reasoning interpretation of the text content, which is expressed as p([C; R]|P).
[0061] The specific implementation method for generating step-by-step reasoning explanations about text content includes: clarifying the type of task to be solved and understanding the relevant data. Then, create step-by-step reasoning examples for each problem in the training data, showing each step of solving the problem. Next, build these examples into model prompts in the form of natural language descriptions to guide the large language model for step-by-step reasoning. When training or reasoning, you can choose Zero-shot prompts, that is, providing step-by-step reasoning prompt templates without specific examples, or Few-shot prompts, providing a small number of specific examples to guide the model. Input the constructed prompts into the large language model for training or direct reasoning, and observe the generated step-by-step reasoning process and the final answer.
[0062] Furthermore, based on the step-by-step reasoning explanation of the obtained text content, the large language model is used again to generate the specific content of the final predicted category label:
[0063] The generated step-by-step reasoning explanation and text content are taken as input. Through specific prompts, a large language model is used to comprehensively consider the step-by-step reasoning explanation and text content to make classification decisions and generate the final predicted category label.
[0064] Specifically, the final predicted category label is expressed as p(C|R,P). If the final predicted category label predicted by the large language model is consistent with the true category label, the final predicted category label is connected to the generated step-by-step reasoning explanation; if not, the large language model only retains the final predicted category label.
[0065] Furthermore, a self-consistency strategy is adopted in the reasoning process of the large language model. Following the hyperparameter settings, a reasoning set is formed by generating reasoning explanations of the text content. Different reasoning explanations are given their respective consistency scores, specifically:
[0066] V={v i ∣i∈N k},S={s i ∣i∈N k},N k ={1,2,...k}
[0067]
[0068] Among them, V is the reasoning set, k is the total number of reasoning explanations of the generated text content, and s i is the self-consistency score of the i-th inference explanation, v best The inference explanation with the highest consistency score.
[0069] Furthermore, the specific content of using the training data to train the illegal text classification model is as follows:
[0070] Using the Adafactor optimizer, setting the batch size to 32 and the learning rate in the range of {5e-3, 5e-4, 5e-5}, the violation text classification model is trained through the self-rationalization method.
[0071] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0072] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting illegal data based on reading comprehension, characterized in that: The following steps are involved: Obtain multimodal data containing hate speech, where the multimodal data includes voice data and text data; Using a speech recognition system to convert speech data into text data to obtain text content; The thinking chain prompts of the large language model are used to generate a step-by-step reasoning explanation of the text content, and a preliminary predicted category label is obtained based on the step-by-step reasoning explanation of the text content; Based on the step-by-step reasoning explanation of the text content, the large language model is used again to generate the final predicted category label; Generate training data based on the final predicted category labels; The training data is used to train the illegal text classification model to obtain the trained detection results.
2. The method for detecting illegal data based on reading comprehension according to claim 1, characterized in that: The specific content of obtaining multimodal data containing hate speech is: Use crawler technology to obtain multimodal data containing hate speech from social media platforms, forums, and news comments, identify and select keywords and phrases containing hate speech, and store the obtained multimodal data in a database.
3. The method for detecting illegal data based on reading comprehension according to claim 1, characterized in that: The specific contents of converting voice data into text data using the speech recognition system are as follows: Using a speech recognition system based on the Transformer model, the speech data is converted into text data, and then the converted text data is cleaned and preprocessed. Finally, the processed text data is integrated with the original text data to form a unified text data set.
4. The method for detecting illegal data based on reading comprehension according to claim 1, characterized in that: The specific content of the step-by-step reasoning explanation of the text content generated by the thinking chain prompts of the large language model is as follows: Provides two variants, namely the general detection framework and the conditional detection framework, for large language model extraction reasoning; General detection framework: Through natural language prompts, using zero-shot thinking chains, and using large language models to interpret text content, we can generate reasoning explanations. The formula is: R Fr =F Fr (N,P) Conditional detection framework: Through natural language prompts, combined with human-written annotations, including the target objects and implicit meanings of hate speech, a chain of thought prompts is formed to generate reasoning explanations. The formula is: R Co =F Co (N,T,I,P) Among them, N is the natural language prompt, P is the text content, T is the target of hate speech, I is the implicit meaning, and F is the Fr Generate reasoning explanation R based on natural language prompts N and text content P Fr The natural language model reasoning process, F Co Generate reasoning explanation R based on natural language prompts N, hate speech target T, implicit meaning I and text content P Co The natural language model reasoning process.
5. The method for detecting illegal data based on reading comprehension according to claim 1, characterized in that: Based on the step-by-step reasoning explanation of the obtained text content, the specific content of the final predicted category label generated by the large language model is as follows: The generated step-by-step reasoning explanation and text content are taken as input. Through specific prompts, a large language model is used to comprehensively consider the step-by-step reasoning explanation and text content to make classification decisions and generate the final predicted category label.
6. The method for detecting illegal data based on reading comprehension according to claim 1, characterized in that: The self-consistency strategy is adopted in the reasoning process of the large language model. Following the hyperparameter settings, the reasoning explanation of the text content is generated to form a reasoning set. For different reasoning explanations, their respective consistency scores are obtained. Specifically: V={v i ∣i∈N k },S={s i ∣i∈N k },N k ={1,2,...k Among them, V is the reasoning set, k is the total number of reasoning explanations of the generated text content, and s i is the self-consistency score of the i-th inference explanation, v best The inference explanation with the highest consistency score.
7. The method for detecting illegal data based on reading comprehension according to claim 1, characterized in that: The specific content of using training data to train the illegal text classification model is as follows: Using the Adafactor optimizer, setting the batch size to 32 and the learning rate in the range of {5e-3, 5e-4, 5e-5}, the violation text classification model is trained through the self-rationalization method.
Citation Information
Patent Citations
Hidden hatred speech detection and fine classification method and device based on combined comparative learning
CN116303995A
Social media public opinion identification method based on cross-language transfer learning algorithm framework
CN118069843A
Hate speech detection system for online media content
GB201803954D0
Cited By
Detection method and system capable of explaining video hatred content based on multi-agent cooperation
CN120472370A
A method and system for detecting hate content in videos based on multi-agent collaboration
CN120472370B
Multi-mode private harmful content detection method and device, electronic equipment and storage medium
CN120744566A