Method for detecting fake news by subject embedding multi-mask prompt template

By designing a theme-embedded multi-mask prompt template and combining it with multilayer perceptron processing of word vectors, the accuracy problem of fake news detection in cases with few samples was solved, achieving more efficient fake news detection.

CN115688414BActive Publication Date: 2026-05-15BEIJING INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING INST OF TECH
Filing Date
2022-10-27
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing fake news detection methods have low accuracy with small sample sizes, ignore the intrinsic link between the likelihood of news occurrence and its falsity, and are insufficient in providing template prompts.

Method used

The design incorporates a multi-mask prompt template for embedding news text. The LDA topic model is used to extract the news text topic and embed it into the template. The word vectors at the mask positions are processed by a multilayer perceptron, and the probability distribution of news falsity and occurrence probability is output. The softmax layer is used to make the decision detection results.

Benefits of technology

The accuracy of fake news detection was improved under conditions of few samples. By combining the falsity and probability of occurrence of news, the detection effect was enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115688414B_ABST
    Figure CN115688414B_ABST
Patent Text Reader

Abstract

The application relates to a fake news detection method of a subject embedding multi-mask prompt template and belongs to the field of natural language processing and machine learning. First, a template is made for a fake news detection task, and answer words are designed respectively according to the falsity of news texts and the possibility of news occurrence; then, an LDA subject model is used to extract news subject word embedding templates, the templates and the news texts are input into a pre-trained language model to obtain word vectors; finally, two word vectors at mask positions are output through a multi-layer perception machine to obtain the probability distribution of the answer words, the probability distribution of the answer words is input into a softmax layer to obtain the probability distribution of the news falsity and the possibility of news occurrence, and a detection result is output through decision. The application provides a method for embedding a multi-mask prompt template of news subjects, and multiple perception machines are used for fusion decision, so that the fake news detection precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for detecting fake news by embedding multiple masked prompt templates in the topic, and belongs to the field of natural language processing and machine learning. Background Technology

[0002] Early methods used textual or social context features based on statistical information for fake news detection; or they used sentiment and style features from articles to assist in fake news detection tasks. The accuracy of statistical machine learning methods typically depends on feature engineering.

[0003] Deep learning methods, with their powerful feature extraction capabilities, are widely used in fake news detection. Commonly used deep learning models for fake news detection include TextCNN and LSTM. To avoid training new models from scratch, many excellent pre-trained language models have emerged in recent years, such as BERT and RoBERTa. base Models such as GPT can achieve high detection accuracy in fake news detection tasks with only minor adjustments. Accurately determining the truth or falsehood of newly emerging events has been a research hotspot in recent years. However, newly emerging events are often accompanied by a series of problems such as a small number of labeled samples, making it difficult for existing methods to effectively detect fake news with limited samples. Cue learning addresses this issue by constructing cue templates, modeling the target task as a task paradigm of a pre-trained language model. Guided by these templates, the text generation capabilities of the pre-trained language model can be fully utilized to better complete the task. However, the cue templates in existing methods are insufficient, neglecting the intrinsic connection between the probability of news occurrence and its falsity, resulting in low detection accuracy with limited samples. Summary of the Invention

[0004] The purpose of this invention is to enhance the prompting function of prompt templates, taking into account the probability and falsity of news occurrences, and using multiple perceptrons to fuse decisions, thereby improving the detection accuracy of the model under conditions of few samples.

[0005] The design principle of this invention is as follows: First, a template is designed, specifically in the format: Here is a piece of newsabout <theme>with <maskl>information.[sep]In <theme>,it is <mask2>To determine whether the news story is false or likely to happen, response words are designed for each element. Secondly, thematic information from the news text is extracted using LDA topic modeling and embedded into the template. <theme>The system first identifies the location of the news text and then concatenates it with the template. This concatenation is then input into a pre-trained language model to output word vectors. Finally, the two word vectors located at the mask position are processed by a multilayer perceptron to output the probability distribution of the response word. This probability distribution is then input into a softmax layer to obtain the probability distribution of the news's falsity and the likelihood of its occurrence. Finally, the system makes a decision and outputs the detection result.

[0006] The technical solution of the present invention is achieved through the following steps:

[0007] Step 1: Design templates and tag mappings, and embed the news topic into the templates;

[0008] Step 1.1, design the template with the content: Here is a piece of news about <theme>with <mask1>information. <sep>In <theme>,it is <mask2>to happen;

[0009] Step 1.2: Design a mapping of false / true news tags;

[0010] Step 1.3: Design a tag mapping for news events with a high probability / low probability;

[0011] Step 1.4: Input the news text into the LDA topic model, output the topic of the news text, and embed it into the template;

[0012] Step 2: Input the template and news text into the pre-trained language model and output word vectors;

[0013] Step 2.1: Concatenate the template with the embedded topic and the news text, and input them into the pre-trained language model to output word vectors;

[0014] Step 3: Construct the loss function and train the model;

[0015] Step 3.1, Construct the loss function Training the model;

[0016] Step 4: Input the news text into the model and output the fake news detection results;

[0017] Step 4.1, <mask1>The word vectors of the location are input into the multilayer perceptron α to obtain the probability distribution of the answer words for the news falsehood label. The probability distribution of the answer words is then input into the softmax layer to obtain the probability distribution of news falsehood. The corresponding label is output based on the probability distribution.

[0018] Step 4.2, will <mask2>The word vectors of the location are input into the multilayer perceptron β to obtain the probability distribution of the answer words of the news occurrence probability label. The probability distribution of the answer words is input into the softmax layer to obtain the probability distribution of the news occurrence probability. The corresponding label is output according to the probability distribution.

[0019] Step 4.3, if <mask1>The word vectors of the location are processed in step 4.1 to output news fake tags or <mask2>The word vectors of the location are processed in step 4.2 to output labels with a low probability of news occurrence. The final judgment result of this sample is fake news; otherwise, the final judgment result of this sample is real news.

[0020] Beneficial effects

[0021] Compared to previous fake news detection methods, the fake news detection method that embeds multiple mask prompt templates into the topic is more suitable for fake news detection in cases with few samples. This invention embeds the news topic into the template to enhance the prompting effect of the template, and combines the falsity of the news with the probability of the news occurring to make a judgment, thereby improving the accuracy of fake news detection. Attached Figure Description

[0022] Figure 1 This is a schematic diagram illustrating the principle of a fake news detection method that embeds multiple masked prompt templates for the subject of this invention. Detailed Implementation

[0023] To better illustrate the purpose and advantages of the present invention, the implementation methods of the present invention will be further described in detail below with reference to examples.

[0024] This invention uses accuracy to evaluate the results of fake news detection. The accuracy calculation method is as follows:

[0025]

[0026] Among them, TP is the number of real news items predicted as true, FN is the number of real news items predicted as false, FP is the number of fake news items predicted as true, and TN is the number of fake news items predicted as false.

[0027] The specific process of this invention is as follows:

[0028] Step 1: Design a tag mapping to embed the theme of the news article into the template;

[0029] Step 1.1: Design an effective and summarizing template that includes a mask. <mask1> 、 <mask2>,in <theme>The location is where the topic words output by the LDA topic model are embedded. The template content is: Here is a piece of news about <theme>with <mask1>information. <sep>In <theme>,it is <mask2>to happen;

[0030] Step 1.2: Map the tags for "fake news" and "true news". See Table 1 for details.

[0031] Table 1. Response words for the "True News / False News" label

[0032]

[0033] Z label:real Z is a collection of answer terms tagged with "real news". label:fake A collection of response terms labeled as fake news;

[0034] Step 1.3: Map the tags for "high probability of news occurrence" and "low probability of news occurrence". See Table 2 for details.

[0035] Table 2. Response words for tags indicating high probability / low probability of news occurrence

[0036]

[0037] C label:p C is a set of answer words tagged with "high probability of news occurrence". label:n The set of response words tagged with "low probability of news occurrence";

[0038] Step 1.4: Input the news text x into the LDA topic model, output the top three topics with the highest probabilities, and embed them into the template. <theme>Location;

[0039] Step 2: Input the template tm and the news text x into the pre-trained language model RoBERTa base Output word vectors;

[0040] Step 2.1: Concatenate the embedded topic template tm and the news text x into x′, where x′ = [tm; x]. Input x′ into the pre-trained language model; this invention uses RoBERTa. base As a pre-trained language model, it outputs word vectors. in This represents the i-th word vector of the template, where m is the length of the template. They are respectively in <mask1> 、 <mask2>Location-based word vectors Let x be the vector of the j-th word in the input text.

[0041] Step 3, construct the loss function Training the model;

[0042] Step 3.1, Construct the loss function Training the model, using parameter ω to control Compared to The importance of

[0043]

[0044]

[0045]

[0046] in Represents the truth label of news falsehood. The truth label represents the probability of a news event occurring; Θ is the parameter of the entire model; and λ is the L2 regularization coefficient.

[0047] Step 4: Input the news text into the model and output the fake news detection results;

[0048] Step 4.1, will <mask1>Location-based word vectors Inputting a multilayer perceptron α, the output probability of the news falsehood label answer word z is: Tag y α The probability distribution is as follows:

[0049]

[0050] σ α For learnable weights, Z y For label y α Given a set of answer words, output corresponding labels based on probability distribution;

[0051] Step 4.2, will <mask2>Location-based word vectors Input a multilayer perceptron β, output the probability of the news occurrence label answer word c. Tag y β The probability distribution is as follows:

[0052]

[0053] σ β For learnable weights, C y For label y β Given a set of answer words, output corresponding labels based on probability distribution;

[0054] Step 4.3, if <mask1>The word vectors of the location are processed in step 4.1 to output fake news labels, or <mask2>If the word vector of a location is processed in step 4.2 and outputs a label indicating a low probability of news occurrence, then the final judgment result for that sample is fake news; otherwise, the final judgment result for that sample is real news.

[0055] The above detailed description further illustrates the purpose, technical solution, and beneficial effects of the invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention. < / mask1> < / theme> < / theme> < / sep> < / theme> < / theme> < / mask1> < / theme> < / sep> < / theme> < / theme> < / theme> < / maskl> < / theme>

Claims

1. A method for detecting fake news by embedding multiple masked prompt templates in the theme, characterized in that... The method includes the following steps: Step 1: Design a tag mapping, embedding the news article's theme into a template. Design a prompt template containing a first mask position <mask1> and a second mask position <mask2>. The template format is: "Here is a piece of news about..." <theme>with <mask1>information. [sep] In <theme>, it is <mask2>"tohappen", among which <theme>The document defines the embedding location for the topic; defines a tag mapping for news falsity, mapping "real news" and "fake news" to their respective first tag sets; defines a tag mapping for the probability of news occurrence, mapping "high probability of occurrence" and "low probability of occurrence" to their respective second tag sets; and extracts topic words from the news text using a topic model and embeds these topic words into the prompt template. <theme> Location;< / theme> < / theme> < / theme> < / theme> Step 2, use the template and news text Input pre-trained language model Output word vectors, and concatenate the embedded topic prompt template obtained in step 1 with the news text to obtain... The input is fed into a pre-trained language model to obtain the word vector sequence output by the model, which includes word vectors corresponding to the <mask1> and <mask2> positions; Step 3, construct the loss function The model is trained, and a loss function is constructed for model training. The loss function consists of a news falsehood classification loss based on the word vector at the <mask1> position and a news occurrence probability classification loss based on the word vector at the <mask2> position. Step 4: Input the news text into the model, output the fake news detection results, and use the word vector at the <mask1> position obtained in Step 2 to classify the news as fake and obtain the news fake label; The word vectors at the <mask2> position obtained in step 2 are used to classify the probability of news occurrence and obtain the news occurrence probability labels. The final detection result is output based on the following decision rules: if the news falsity classification result is "fake" or the news occurrence probability classification result is "low probability", then the news is determined to be fake news; otherwise, it is determined to be real news.

2. The fake news detection method based on the topic embedding multi-mask prompt template according to claim 1, characterized in that: In step 1, the news text Input an LDA topic model, output the top three topics with the highest probabilities, and embed them into a template. <theme> Location.< / theme> 3. The fake news detection method based on the topic-embedded multi-mask prompt template according to claim 1, characterized in that: Step 1 involves mapping tags for "low probability of news occurrence" and "high probability of news occurrence," as detailed below: C label:p C is a set of answer words tagged with "high probability of news occurrence". label:n This is a set of response words tagged with "low probability of news occurrence".

4. The method for detecting fake news by embedding a multi-mask prompt template in the theme according to claim 1, characterized in that: In step 3, construct the loss function. Training the model, using parameters control Compared to The importance of in Represents the truth label of news falsehood. The label represents the likelihood of a news event occurring. These are the parameters for the entire model. for Regularization coefficient.

5. The method for detecting fake news by embedding a multi-mask prompt template in the theme according to claim 1, characterized in that: In step 4, <mask2>Location-based word vectors Input multilayer perceptron Output the likelihood of news occurring in the answer. The possibility is ,Label The probability distribution is For learnable weights, For tags The set of answer words.

6. The method for detecting fake news by embedding a multi-mask prompt template in the theme according to claim 1, characterized in that: If in step 4 <mask1>The word vectors of position are obtained through a multilayer perceptron. After the probability distribution of the softmax layer is output, the fake news labels are obtained, or <mask2>The word vectors of position are obtained through a multilayer perceptron. If the probability distribution of the softmax layer outputs a label indicating a low probability of news occurrence, then the final judgment result for that sample is fake news; otherwise, the final judgment result for that sample is real news.