Method and device for detecting fake news in real time based on historical news comments
By employing a teacher-student network structure and historical news commentary as supplementary methods, the problem of balancing immediacy and accuracy in fake news detection was solved, achieving efficient detection of newly released fake news and improving detection accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INST OF COMPUTING TECH CHINESE ACAD OF SCI
- Filing Date
- 2023-10-12
- Publication Date
- 2026-05-01
AI Technical Summary
Existing methods for detecting fake news fail to strike a balance between immediacy and accuracy, resulting in an inability to detect newly published fake news in a timely and effective manner.
By constructing a teacher-student network structure and training it with historical news commentaries, the teacher network acquires knowledge from these commentaries and guides the student network, enabling real-time detection of newly released news. This method incorporates mutual attention and multi-layered perception mechanisms, combined with sentiment analysis tools, to fuse and weight semantic and sentiment features, thereby improving detection accuracy.
Without relying on real-time comments, it significantly improves the detection accuracy of newly published fake news, with experimental results showing a 3.2% and 1.6% improvement in macro F1 scores on Chinese and English datasets, respectively.
Smart Images

Figure CN117332043B_ABST
Abstract
Description
A method and device for real-time detection of fake news based on historical news commentary. Technical Field
[0001] This invention belongs to the field of computer application and text semantic recognition and classification technology, and specifically relates to a method and device for real-time detection of fake news assisted by historical news comments. Background Technology
[0002] Fake news on social media primarily comprises news content and the social context information it evokes (such as comments). Based on the differences in the information utilized, existing fake news detection methods can be categorized into content-based methods and social context-based methods. Content-based methods focus on mining features within news content that distinguish between true and false information. Early work relied on data statistics and analysis to design manually crafted features to determine the authenticity of news, such as word frequency, text length, and part-of-speech tags. Later work utilized neural networks to automatically learn feature representations to classify news as true or false. Social context-based methods, building upon news content, leverage information such as comments and dissemination structures to improve fake news detection capabilities. These include modeling news and comments along the dissemination path using tree-like or temporal structures, and enhancing semantic understanding through the information interaction between news content and comments. Of these two types of methods, content-based methods offer high detection immediacy due to their reliance solely on the content itself, but their accuracy is lower due to the lack of social context information. Social context-based methods, on the other hand, offer higher accuracy, but their detection is less immediate because the social context information they rely on requires time to accumulate.
[0003] Among existing methods, content-based methods can detect newly published fake news instantly, but due to insufficient information, they must wait for a period of time to obtain a sufficient number of comments, resulting in low detection accuracy. Social context-based methods benefit from richer information and have higher accuracy, but because social context information such as comments requires time to accumulate, these methods cannot detect it instantly. Therefore, existing methods face the problem of balancing immediacy and accuracy, leading to an inability to detect newly published fake news promptly and effectively, and an inability to take timely and effective intervention measures. Summary of the Invention
[0004] The purpose of this invention is to solve the problem that the timeliness and accuracy of fake news detection in the prior art cannot be achieved simultaneously, and to propose a real-time fake news detection method that utilizes historical news comments.
[0005] Specifically, the present invention provides a method for real-time detection of fake news based on historical news comments, comprising:
[0006] Step 1: Obtain historical news with news content and corresponding comments as training samples, and construct teacher networks and student networks including encoders and classifiers respectively;
[0007] Step 2: The encoder of the teacher network encodes the news content and comments of the training sample, and assigns the teacher attention weight to each encoding result to obtain the teacher content semantic features and comment semantic features; the sentiment extractor obtains the sentiment features of the comments in the training sample; the teacher content semantic features, the comment semantic features and the sentiment features are fused to obtain the teacher fused features, which are then fed into the classifier of the teacher network to obtain the teacher prediction results. Based on the teacher prediction results and the true and false category labels of the training sample, a loss function is constructed to train the teacher network.
[0008] Step 3: The encoder of the student network encodes only the news content of the training sample to obtain the student content code. Student attention weights are assigned to this student content code to obtain the student content semantic features. The sentiment features of the student content code are extracted using a social sentiment predictor to obtain virtual social sentiment features. These virtual social sentiment features and the student content semantic features are fused to obtain student fusion features, which are then fed into the classifier of the student network to obtain student prediction results. Based on the student prediction results and the true / false category labels, a classification loss is obtained. Based on the teacher attention weights of the teacher network after training and the student attention weights of the content, an attention loss is obtained. Based on the sentiment features and the virtual social sentiment features, an sentiment loss is obtained. Based on the teacher fusion features and the student fusion features, a fusion loss is obtained. The attention loss, sentiment loss, and fusion loss are weighted and fused together, then added to the classification loss to obtain the final loss, which is used to train the student network.
[0009] Step 4: Input the news content to be detected as fake into the student's network and obtain the classification result of whether it belongs to true or false news.
[0010] The aforementioned method for real-time detection of fake news based on historical news comments, wherein step 2 includes:
[0011] The encoder of this teacher network performs word segmentation and encoding on the news content P and comment C respectively, and obtains the encoding features P = [p1, p2, ..., p] of the training sample P. M ]∈R d×M M represents the number of tokens in the news content after word segmentation. For comment C, it is first concatenated in chronological order. Word segmentation and encoding yield C = [c1, c2, ..., c N ]∈R d×N N represents the number of tokens in all comments after word segmentation; the content teacher attention weight F∈R is constructed using the following formula. M×N :
[0012]
[0013] Among them, W l ∈R d×d It is a learnable weight matrix, where d is the encoding dimension; based on this content-based teacher attention weight, the attention weight distribution based on different lexical units in news content and comments is calculated. and
[0014] H p =tanh(W p P+(W c C)F)
[0015]
[0016]
[0017]
[0018] Among them, W p W c ∈R k×d , Here, k represents the weight parameter, and k is the hidden layer encoding dimension of the mutual attention mechanism. These are attention vectors composed of the weights of different words in the news content and user comments, respectively. Utilizing... and Weighting the encoded features of different lexical units in news content and user comments yields the final semantic features of both.
[0019]
[0020]
[0021] Using a sentiment extractor that includes sentiment analysis tools, discrete sentiment features of comments are obtained through sentiment analysis. The discrete emotional features are then processed into a continuous form using a multilayer perceptron.
[0022]
[0023] Where the continuous feature e t ∈R d and semantic features and Same dimensions; and e t The fusion yields the overall feature f used for classifying the teacher network. t ∈R d :
[0024]
[0025] in These are learnable parameters. f t The prediction results of the teacher network were obtained through a multilayer perceptron:
[0026]
[0027] in For the true / false category label, the teacher network is optimized by minimizing the cross-entropy loss function:
[0028]
[0029] Where θ tea y represents the parameter of the teacher network, and y represents the actual value of the news authenticity label.
[0030] The aforementioned method for real-time detection of fake news based on historical news comments, wherein step 3 includes:
[0031] The encoder of the student network segments and encodes the news content to obtain p1, p2, ..., p M M represents the number of lexical units in the news content. A masked attention mechanism is applied to the news content, assigning learnable content student attention weights to different lexical units, resulting in a weight vector.
[0032]
[0033] The semantic features of student content are obtained by weighting the encoded features of different words in the news content using this weight vector.
[0034]
[0035] The student network uses a social sentiment predictor to predict the virtual social sentiment characteristics that news content might evoke. s ∈R d :
[0036] e s=EmoPredictor(p1,p2,…,p M )
[0037] Features of the student network used for final classification are weighted and fused. and e s get:
[0038]
[0039] and These are learnable weights;
[0040] The classification task constructs the classification loss using cross-entropy. Optimize the parameters θ of the student network stu :
[0041]
[0042]
[0043] Where y is the true / false category label. Predicting outcomes for students;
[0044] Utilizing attention loss The weighting of student attention to this content distributed across news articles online. Weighting of teacher attention in teacher networks study:
[0045]
[0046] Exploiting emotional loss Guide students to predict the virtual social emotional characteristics e in the network s This sentiment feature e from comments in the teacher network t study:
[0047]
[0048] Utilizing fusion loss The student integration characteristics of the student network. s The teacher integration feature f of the teacher network t study:
[0049]
[0050] By utilizing a knowledge preference scorer, the weight values corresponding to the attention loss, sentiment loss, and fusion loss are calculated based on the news content, thereby achieving adaptive weighting of the three aspects of knowledge:
[0051] Score = Scorer(p1,p2,…,p) M )
[0052] This knowledge preference scorer consists of a masked attention module, a multilayer perceptron module, and a Softmax normalization function, where Score = [Score]. sem Score emo Score overall The training of the student network minimizes the final loss. accomplish:
[0053]
[0054]
[0055] Where α∈[0,1] is the preset trade-off value between the two types of loss.
[0056] The aforementioned method for real-time detection of fake news based on historical news comments includes a social sentiment predictor composed of a masked attention mechanism layer and a multi-layered perception mechanism.
[0057] This invention also proposes a real-time fake news detection device based on historical news comments, including:
[0058] The initial module is used to obtain historical news with news content and corresponding comments as training samples, and to construct teacher networks and student networks including encoders and classifiers respectively.
[0059] The teacher training module is used to encode the news content and comments of the training samples by the encoder of the teacher network, and to assign the teacher attention weight to each encoding result to obtain the semantic features of the teacher content and the semantic features of the comments. The sentiment extractor obtains the sentiment features of the comments in the training samples. The semantic features of the teacher content, the semantic features of the comments, and the sentiment features are fused to obtain the teacher fused features, which are fed into the classifier of the teacher network to obtain the teacher prediction results. Based on the teacher prediction results and the true and false category labels of the training samples, a loss function is constructed to train the teacher network.
[0060] The student training module uses an encoder in the student network to encode only the news content of the training samples, resulting in student content encoding. Student attention weights are assigned to these student content encodings to obtain semantic features. A social sentiment predictor extracts sentiment features from the student content encodings to obtain virtual social sentiment features. These virtual social sentiment features are then fused with the student content semantic features to obtain student fusion features, which are fed into the classifier of the student network to obtain student prediction results. Based on these prediction results and the true / false category labels, a classification loss is obtained. An attention loss is obtained based on the teacher attention weights of the trained teacher network and the student attention weights of the content. An emotion loss is obtained based on the sentiment features and the virtual social sentiment features. A fusion loss is obtained based on the teacher fusion features and the student fusion features. Finally, the attention loss, emotion loss, and fusion loss are weighted and fused together, then added to the classification loss to obtain the final loss, which is used to train the student network.
[0061] The monitoring module is used to input the news content to be detected as fake into the student's network and obtain the classification result of whether it belongs to true or false news.
[0062] The aforementioned fake news real-time detection device based on historical news comments, wherein the teacher training module is used for:
[0063] The encoder of this teacher network performs word segmentation and encoding on the news content P and comment C respectively, and obtains the encoding features P = [p1, p2, ..., p] of the training sample P. M ]∈R d×M M represents the number of tokens in the news content after word segmentation. For comment C, it is first concatenated in chronological order. Word segmentation and encoding yield C = [c1, c2, ..., c N ]∈R d ×N N represents the number of tokens in all comments after word segmentation; the content teacher attention weight F∈R is constructed using the following formula. M×N :
[0064]
[0065] Among them, W l ∈R d×d It is a learnable weight matrix, where d is the encoding dimension; based on this content-based teacher attention weight, the attention weight distribution based on different lexical units in news content and comments is calculated. and
[0066] H p =tanh(W p P+(W c C)F)
[0067]
[0068]
[0069]
[0070] Among them, W p W c ∈R k×d , Here, k represents the weight parameter, and k is the hidden layer encoding dimension of the mutual attention mechanism. These are attention vectors composed of the weights of different words in the news content and user comments, respectively. Utilizing... and Weighting the encoded features of different lexical units in news content and user comments yields the final semantic features of both.
[0071]
[0072]
[0073] Using a sentiment extractor that includes sentiment analysis tools, discrete sentiment features of comments are obtained through sentiment analysis. The discrete emotional features are then processed into a continuous form using a multilayer perceptron.
[0074]
[0075] Where the continuous feature e t ∈R d and semantic features and Same dimensions; and e t The fusion yields the overall feature f used for classifying the teacher network. t ∈R d :
[0076]
[0077] in These are learnable parameters. f t The prediction results of the teacher network were obtained through a multilayer perceptron:
[0078]
[0079] in For the true / false category label, the teacher network is optimized by minimizing the cross-entropy loss function:
[0080]
[0081] Where θ tea y represents the parameter of the teacher network, and y represents the actual value of the news authenticity label.
[0082] The aforementioned fake news real-time detection device based on historical news comments, wherein the student training module is used for:
[0083] The encoder of the student network segments and encodes the news content to obtain p1, p2, ..., p M M represents the number of lexical units in the news content. A masked attention mechanism is applied to the news content, assigning learnable content student attention weights to different lexical units, resulting in a weight vector.
[0084]
[0085] The semantic features of student content are obtained by weighting the encoded features of different words in the news content using this weight vector.
[0086]
[0087] The student network uses a social sentiment predictor to predict the virtual social sentiment characteristics that news content might evoke. s ∈R d :
[0088] e s =EmoPredictor(p1,p2,…,p M )
[0089] Features of the student network used for final classification are weighted and fused. and e s get:
[0090]
[0091] and These are learnable weights;
[0092] The classification task constructs the classification loss using cross-entropy. Optimize the parameters θ of the student network stu :
[0093]
[0094]
[0095] Where y is the true / false category label. Predict the results for students;
[0096] Utilizing attention loss The weighting of student attention to this content distributed across news articles online. Weighting of teacher attention in teacher networks study:
[0097]
[0098] Exploiting emotional loss Guide students to predict the virtual social emotional characteristics e in the network s This sentiment feature e from comments in the teacher network t study:
[0099]
[0100] Utilizing fusion loss The student integration characteristics of the student network. s The teacher integration feature f of the teacher network t study:
[0101]
[0102] By utilizing a knowledge preference scorer, the weight values corresponding to the attention loss, sentiment loss, and fusion loss are calculated based on the news content, thereby achieving adaptive weighting of the three aspects of knowledge:
[0103] Score = Scorer(p1,p2,…,p) M )
[0104] This knowledge preference scorer consists of a masked attention module, a multilayer perceptron module, and a Softmax normalization function, where Score = [Score]. sem Score emo Score overall The training of the student network minimizes the final loss. accomplish:
[0105]
[0106]
[0107] Where α∈[0,1] is the preset trade-off value between the two types of loss.
[0108] The aforementioned fake news real-time detection device based on historical news comments, wherein the social sentiment predictor consists of a masked attention mechanism layer and a multi-layer perception mechanism.
[0109] The present invention also proposes a server, including the aforementioned fake news real-time detection device based on historical news comments.
[0110] The present invention also proposes a storage medium for storing a computer program that executes the aforementioned method for real-time detection of fake news based on historical news comments.
[0111] As can be seen from the above solutions, the advantages of the present invention are:
[0112] Compared with existing technologies, this invention has higher detection accuracy for newly published fake news. Experiments on publicly available Chinese and English datasets show that the technology improves the macro F1 score by 3.2% and 1.6% respectively in the case of immediate detection compared with the best existing technology. Attached Figure Description
[0113] Figure 1 is a flowchart of the overall process of the present invention;
[0114] Figure 2 is a diagram of the overall structure of the teacher network of the present invention;
[0115] Figure 3 is a diagram of the overall structure of the student network of the present invention. Detailed Implementation
[0116] While conducting research on fake news detection, the inventors discovered that the deficiency in existing technologies stems from insufficient information available for immediate detection, leading to inadequate detection performance. Through analysis of the relationship between news content and its social context, such as comments, the inventors found that this deficiency can be addressed by utilizing historical news with comments to learn from newly published news and provide a "substitute representation" of the comments it may generate. This improves the understanding of newly published news content and provides a certain information gain, achieving higher detection accuracy even without relying on comments, thus enabling immediate and effective detection of newly published fake news.
[0117] To achieve the above-mentioned technical effects, the present invention includes the following key technical points:
[0118] Key point 1: Semantic interaction between news and comments is achieved through mutual attention mechanism, and effective information in comments is obtained by using various sentiment analysis tools to acquire sentiment in comments;
[0119] Key point 2: Effective transfer of various information from comments is achieved through knowledge distillation at the semantic, emotional, and overall levels;
[0120] Key point 3: Through an adaptive weighting mechanism, flexible and effective utilization of different migration information can be achieved.
[0121] To make the above-mentioned features and effects of the present invention clearer and easier to understand, specific embodiments are described below in conjunction with the accompanying drawings. This specification discloses one or more embodiments incorporating the features of the present invention. The disclosed embodiments are merely illustrative. The scope of protection of the present invention is not limited to the disclosed embodiments, but is defined by the appended claims.
[0122] This application adopts a "teacher-student" training structure. The teacher network is trained to acquire knowledge from historical news comments, and the student network is trained to transfer this knowledge to its parameters, achieving detection independent of comments. The overall process is shown in Figure 1. Step 1 simultaneously trains the teacher network using historical news and comments. The trained teacher network parameters are then frozen and no longer participate in the subsequent training process. Step 2 trains the student network solely using historical news, guided by the teacher network trained in Step 1. Finally, the trained student network is used to detect newly published fake news. The following sections describe each step in detail.
[0123] To facilitate the introduction of the model training process, we will first explain the basic symbols related to social media news:
[0124] O: Social media news;
[0125] P: News content;
[0126] C = {c 1 ,c 2 ,…,c |C|}: User comments (|C| represents the total number of comments)
[0127] That is: O = (P, C)
[0128] 1) Training of teachers in online training
[0129] The overall structure of the teacher network is shown in Figure 2. In the training process of the teacher network, this application utilizes comment information from both semantic and emotional perspectives.
[0130] In terms of semantics, firstly, an encoder (such as BERT) is used to segment (resulting in several word units) and encode the news content P and user comments C in the social media news O, respectively, to obtain the encoding features P = [p1, p2, ..., p] of the news content P. M ]∈R d×M (M represents the number of tokens after word segmentation of the news content). For comment C, it is first concatenated in chronological order to obtain... Further word segmentation and encoding yield C = [c1, c2, ..., c N ]∈R d×N (N is the number of lexical units after segmentation of all comments). To enhance the semantic understanding of news content, this application utilizes a mutual attention mechanism to enable different lexical units of news content and comments to interact. First, an affinity matrix F∈R needs to be calculated. M×N The calculation method is as follows:
[0131]
[0132] Among them, W l ∈R d×d This is a learnable weight matrix, where d is the encoding dimension. Based on this weight matrix, the attention weight distribution based on different lexical units in news content and comments can be calculated. and
[0133] H p =tanh(W p P+(W c C)F)
[0134]
[0135]
[0136]
[0137] Among them, W p W c ∈R k×d , Here, k represents the weight parameter, and k is the hidden layer encoding dimension of the mutual attention mechanism. These are attention vectors composed of the weights of different words in the news content and user comments, respectively. Utilizing... and Weighting the encoded features of different lexical units in news content and user comments yields the final semantic features of both. The calculation method is as follows:
[0138]
[0139]
[0140] Regarding sentiment analysis, considering that the sentiment in comments reflects the collective reaction to news content and can serve as supplementary information to enhance understanding of the news content, this application utilizes various sentiment analysis tools, such as VADER and NRC dictionaries, to perform sentiment analysis on user comments and obtain their discrete sentiment characteristics. To capture the deep relationships among discrete emotional features and obtain emotional features with stronger representational capabilities, this invention utilizes a Multi-Layer Perceptron (MLP) to process the discrete emotional features into a continuous form:
[0141]
[0142] Where the continuous feature e t ∈R d Is and semantic features and Sentiment features of the same dimension. The parameters of the sentiment analysis tool remain unchanged when training the teacher network, but the parameters of the multilayer perceptron, which performs continuous processing of discrete sentiment features, can be updated and adjusted during the training of the teacher network.
[0143] final and e t The overall feature f used for teacher network classification is obtained by weighted fusion. t ∈R d :
[0144]
[0145] in These are learnable parameters. f t The prediction results of the teacher network are obtained through a Multi-Layer Perceptron (MLP):
[0146]
[0147] in Let be the teacher network's prediction of the news authenticity label. The optimization of the teacher network is achieved by minimizing the cross-entropy loss:
[0148]
[0149] Where θ tea y represents the parameter of the teacher network, and y represents the actual value of the news authenticity label.
[0150] 2) Training in student networks
[0151] During the student network training phase, the parameters of the optimized teacher network are frozen and not used in the training; the student network is only guided through knowledge distillation. To facilitate the distillation of knowledge from the teacher network to the student network, this application constructs the student network isomorphically similar to the teacher network.
[0152] In terms of semantics, the encoder in the student network (e.g., BERT) segments and encodes the news content to obtain p1, p2, ..., p M (M represents the number of words in the news content), and the masked attention mechanism is applied to the news content, assigning learnable weights (i.e., content attention weights) to different words, resulting in a weight vector.
[0153]
[0154] The semantic features of the news content are obtained by weighting the encoded features of different words in the news content using this weight vector.
[0155]
[0156] In terms of emotion, to enhance dissemination capabilities, fake news often evokes stronger emotional expressions from groups. Therefore, there is a correlation between news content and the user emotional characteristics it triggers. Based on this correlation, this application uses a feature mapping approach to employ a "social sentiment predictor" (EmoPredictor) in the student model to predict the user emotional characteristics that news content may trigger. Specifically, the encoded features of the news content after word segmentation serve as the input to the "social sentiment predictor EmoPredictor" to predict the user emotional characteristics e it may trigger. s ∈R d :
[0157] e s =EmoPredictor(p1,p2,…,p M )
[0158] The "EmoPredictor" consists of a masked attention mechanism module and a multilayer perceptron module. Features used by the student network for final classification are fused using weighted methods. and e s get:
[0159]
[0160] in, and These are the learnable weights.
[0161] The training process for the student network consists of two parts: ① a binary classification task for detecting fake news and ② guidance from the teacher network to the student network.
[0162] In the classification task, the parameters θ of the student network are optimized using cross-entropy loss. stu :
[0163]
[0164]
[0165] Where y represents the real tag of the news content. To utilize f s Predicted labels obtained through a multi-layer perceptron (MLP).
[0166] The teacher network guides the student network through knowledge distillation in three aspects: semantics, sentiment, and overall coherence. In each aspect, the student network's parameters are optimized by minimizing the mean squared error. Semantically, the teacher network guides the weight vectors distributed across news content in the student network. To the corresponding part of the teacher network study:
[0167]
[0168] In terms of emotion, the predicted emotion features e in the teacher network are used to guide the student network. s The true emotional characteristics of comments from teachers' networks t study:
[0169]
[0170] Overall, the teacher network guides the student network in using features f for final classification. s To the corresponding part of the teacher network f t study:
[0171]
[0172] Considering that the relative importance of transferred knowledge from teachers in the three aspects of semantics, sentiment, and overall coherence varies with sample differences, this application utilizes a "knowledge preference scorer" (Scorer) to calculate three different weight values based on news content, thereby achieving adaptive weighting of the three aspects of knowledge:
[0173] Score = Scorer(p1,p2,…,p) M )
[0174] The "Knowledge Preference Scorer" consists of a masked attention module, a multilayer perceptron module, and a Softmax normalization function. The masked attention module aggregates the encoded features of all words to obtain the features of the entire sentence. The multilayer perceptron module maps the sentence features into a 3-dimensional score vector (corresponding to the weights of the three knowledge aspects). The Softmax normalization function transforms each value in the score vector to the range [0,1], thus representing the relative importance of the three knowledge aspects. Score = [Score...] sem Score emo Score overall These correspond to the weights for semantics, sentiment, and overall meaning, respectively. The student network is trained by minimizing the loss function. accomplish:
[0175]
[0176]
[0177] Where α∈[0,1] is the preset trade-off value between the two types of loss.
[0178] The resulting student network was used for real-time detection of fake news.
[0179] The following are system embodiments corresponding to the above method embodiments. This embodiment can be implemented in conjunction with the above embodiments. The relevant technical details mentioned in the above embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above embodiments.
[0180] This invention also proposes a real-time fake news detection device based on historical news comments, including:
[0181] The initial module is used to obtain historical news with news content and corresponding comments as training samples, and to construct teacher networks and student networks including encoders and classifiers respectively.
[0182] The teacher training module is used to encode the news content and comments of the training samples by the encoder of the teacher network, and to assign the teacher attention weight to each encoding result to obtain the semantic features of the teacher content and the semantic features of the comments. The sentiment extractor obtains the sentiment features of the comments in the training samples. The semantic features of the teacher content, the semantic features of the comments, and the sentiment features are fused to obtain the teacher fused features, which are fed into the classifier of the teacher network to obtain the teacher prediction results. Based on the teacher prediction results and the true and false category labels of the training samples, a loss function is constructed to train the teacher network.
[0183] The student training module uses an encoder in the student network to encode only the news content of the training samples, resulting in student content encoding. Student attention weights are assigned to these student content encodings to obtain semantic features. A social sentiment predictor extracts sentiment features from the student content encodings to obtain virtual social sentiment features. These virtual social sentiment features are then fused with the student content semantic features to obtain student fusion features, which are fed into the classifier of the student network to obtain student prediction results. Based on these prediction results and the true / false category labels, a classification loss is obtained. An attention loss is obtained based on the teacher attention weights of the trained teacher network and the student attention weights of the content. An emotion loss is obtained based on the sentiment features and the virtual social sentiment features. A fusion loss is obtained based on the teacher fusion features and the student fusion features. Finally, the attention loss, emotion loss, and fusion loss are weighted and fused together, then added to the classification loss to obtain the final loss, which is used to train the student network.
[0184] The monitoring module is used to input the news content to be detected as fake into the student's network and obtain the classification result of whether it belongs to true or false news.
[0185] The aforementioned fake news real-time detection device based on historical news comments, wherein the teacher training module is used for:
[0186] The encoder of this teacher network performs word segmentation and encoding on the news content P and comment C respectively, and obtains the encoding features P = [p1, p2, ..., p] of the training sample P. M ]∈R d×M M represents the number of tokens in the news content after word segmentation. For comment C, it is first concatenated in chronological order. Word segmentation and encoding yield C = [c1, c2, ..., c N ]∈R d×N N represents the number of tokens in all comments after word segmentation; the content teacher attention weight F∈R is constructed using the following formula. M×N :
[0187] F = tanh(P) T W l C)
[0188] Among them, W l ∈R d×d It is a learnable weight matrix, where d is the encoding dimension; based on this content-based teacher attention weight, the attention weight distribution based on different lexical units in news content and comments is calculated. and
[0189] H p =tanh(W p P+(W c C)F)
[0190]
[0191]
[0192]
[0193] Among them, W p W c ∈R k×d , Here, k represents the weight parameter, and k is the hidden layer encoding dimension of the mutual attention mechanism. These are attention vectors composed of the weights of different words in the news content and user comments, respectively. Utilizing... and Weighting the encoded features of different lexical units in news content and user comments yields the final semantic features of both.
[0194]
[0195]
[0196] Using a sentiment extractor that includes sentiment analysis tools, discrete sentiment features of comments are obtained through sentiment analysis. The discrete emotional features are then processed into a continuous form using a multilayer perceptron.
[0197]
[0198] Where the continuous feature e t ∈R d and semantic features and Same dimensions; and e tThe fusion yields the overall feature f used for classifying the teacher network. t ∈R d :
[0199]
[0200] in These are learnable parameters. f t The prediction results of the teacher network were obtained through a multilayer perceptron:
[0201]
[0202] in For the true / false category label, the teacher network is optimized by minimizing the cross-entropy loss function:
[0203]
[0204] Where θ tea y represents the parameter of the teacher network, and y represents the actual value of the news authenticity label.
[0205] The aforementioned fake news real-time detection device based on historical news comments, wherein the student training module is used for:
[0206] The encoder of the student network segments and encodes the news content to obtain p1, p2, ..., p M M represents the number of lexical units in the news content. A masked attention mechanism is applied to the news content, assigning learnable content student attention weights to different lexical units, resulting in a weight vector.
[0207]
[0208] The semantic features of student content are obtained by weighting the encoded features of different words in the news content using this weight vector.
[0209]
[0210] The student network uses a social sentiment predictor to predict the virtual social sentiment characteristics that news content might evoke. s ∈R d :
[0211] e s =EmoPredictor(p1,p2,…,p M )
[0212] Features used by the student network for final classification are weighted and fused. and e s get:
[0213]
[0214] and These are learnable weights;
[0215] The classification task constructs the classification loss using cross-entropy. Optimize the parameters θ of the student network stu :
[0216]
[0217]
[0218] Where y is the true / false category label. Predict the results for students;
[0219] Utilizing attention loss The weighting of student attention to this content distributed across news articles online. Weighting of teacher attention in teacher networks study:
[0220]
[0221] Exploiting emotional loss Guide students to predict the virtual social emotional characteristics e in the network s This sentiment feature e from comments in the teacher network t study:
[0222]
[0223] Utilizing fusion loss The student integration characteristics of the student network. s The teacher integration feature f of the teacher network t study:
[0224]
[0225] By utilizing a knowledge preference scorer, the weight values corresponding to the attention loss, sentiment loss, and fusion loss are calculated based on the news content, thereby achieving adaptive weighting of the three aspects of knowledge:
[0226] Score = Scorer(p1,p2,…,p) M )
[0227] This knowledge preference scorer consists of a masked attention module, a multilayer perceptron module, and a Softmax normalization function, where Score = [Score]. sem Score emo Score overall The training of the student network minimizes the final loss. accomplish:
[0228]
[0229]
[0230] Where α∈[0,1] is the preset trade-off value between the two types of loss.
[0231] The aforementioned fake news real-time detection device based on historical news comments, wherein the social sentiment predictor consists of a masked attention mechanism layer and a multi-layer perception mechanism.
[0232] The present invention also proposes a server, including the aforementioned fake news real-time detection device based on historical news comments.
[0233] The present invention also proposes a storage medium for storing a computer program that executes the aforementioned method for real-time detection of fake news based on historical news comments.
[0234] Although embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and embodiments. They can be applied to various fields suitable for the present invention. For those skilled in the art, other modifications can be easily made. Therefore, without departing from the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details and illustrations shown and described herein.
Claims
1. A method for real-time detection of fake news based on historical news commentary, characterized in that, include: Step 1: Obtain historical news with news content and corresponding comments as training samples, and construct teacher network and student network including encoder and classifier respectively; Step 2: The encoder of the teacher network encodes the news content and comments of the training samples respectively, and assigns the content teacher attention weight to each encoding result to obtain teacher content semantic features and comment semantic features; The sentiment features of the comments in the training sample are obtained through the sentiment extractor; the semantic features of the teacher content, the semantic features of the comment, and the sentiment features are fused to obtain the teacher fused features, which are then fed into the classifier of the teacher network to obtain the teacher prediction results. Based on the teacher prediction results and the true / false category labels of the training sample, a loss function is constructed to train the teacher network; Step 3: The encoder of the student network only encodes the news content of the training sample to obtain the student content encoding, and assigns the student attention weight to the student content encoding to obtain the student content semantic features; The student's content encoding emotional features are extracted using a social sentiment predictor to obtain virtual social sentiment features. These virtual social sentiment features are then fused with the student's content semantic features to obtain student fusion features, which are fed into the classifier of the student network to obtain student prediction results. Based on the student prediction results and the true / false category label, a classification loss is obtained. Based on the teacher attention weights of the teacher network after training and the student attention weights of the content, an attention loss is obtained. Based on the emotional features and the virtual social sentiment features, an emotional loss is obtained. Based on the teacher fusion features and the student fusion features, a fusion loss is obtained. The attention loss, emotional loss, and fusion loss are weighted and fused together, and then added to the classification loss to obtain the final loss, which is used to train the student network. Step 4: The news content to be detected for falsehood is input into the student network to obtain the classification result of whether it belongs to true or false news.
2. The method for real-time detection of fake news based on historical news comments as described in claim 1, characterized in that, This social sentiment predictor consists of a masked attention mechanism layer and a multi-layered perception mechanism.
3. A real-time fake news detection device based on historical news commentary, characterized in that, include: The initial module is used to obtain historical news with news content and corresponding comments as training samples, and to construct teacher networks and student networks including encoders and classifiers respectively. The teacher training module is used by the encoder of the teacher network to encode the news content and comments of the training samples, and assigns the teacher attention weight of the content to each encoding result to obtain the teacher content semantic features and comment semantic features; The sentiment features of the comments in the training sample are obtained by using a sentiment extractor; the semantic features of the teacher's content, the semantic features of the comments, and the sentiment features are fused to obtain the teacher fused features, which are then fed into the classifier of the teacher network to obtain the teacher prediction results. Based on the teacher prediction results and the true / false category labels of the training sample, a loss function is constructed to train the teacher network. The student training module is used for the encoder of the student network to encode the news content of the training sample only, to obtain the student content code. The student attention weight of the content is assigned to the student content code to obtain the student content semantic features. The student network extracts the emotional features of the student's content encoding using a social sentiment predictor to obtain virtual social sentiment features. These virtual social sentiment features are then fused with the student's content semantic features to obtain student fusion features, which are fed into the student network's classifier to obtain student prediction results. Based on these prediction results and the true / false category label, a classification loss is calculated. An attention loss is obtained based on the teacher attention weights of the trained teacher network and the student attention weights of the content. An emotional loss is obtained based on the emotional features and the virtual social sentiment features. A fusion loss is obtained based on the teacher fusion features and the student fusion features. The attention loss, emotional loss, and fusion loss are weighted and fused together, then added to the classification loss to obtain the final loss, which is used to train the student network. A monitoring module is used to input news content to be detected as fake news into the student network to obtain a classification result indicating whether it belongs to true or false news.
4. The real-time fake news detection device based on historical news comments as described in claim 3, characterized in that, This social sentiment predictor consists of a masked attention mechanism layer and a multi-layered perception mechanism.
5. A server, characterized in that, This includes a fake news real-time detection device based on historical news comments, as described in claim 3 or 4.
6. A storage medium for storing a computer program that performs the real-time fake news detection method based on historical news comments as described in claim 1 or 2.
Citation Information
Patent Citations
Few-sample false news detection method based on knowledge distillation
CN112183670A
Cross-modal image aesthetics quality evaluation method based on knowledge distillation
CN112613303A