False news detection method and device, storage medium and electronic equipment
By calculating scores for news and reporting sentences, generating an evidence set, and utilizing a news interpretation generation model, the accuracy problem of fake news detection is solved. It provides explanatory texts for authenticity and falsity, ensuring the accuracy and transparency of the detection results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JILIN UNIVERSITY
- Filing Date
- 2023-12-07
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies are insufficient to effectively detect fake news, making it difficult for the public to accurately judge the veracity of news due to a lack of supporting evidence.
By acquiring target news and its reported sentences, calculating the first and second scores, generating an evidence set, and using a news interpretation generation model to generate explanatory texts for real and fake news, the authenticity of the news is finally tested.
It achieves accurate results for detecting the authenticity of news and provides explanatory texts for those results, thereby improving the accuracy and transparency of fake news detection.
Smart Images

Figure CN118132690B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, storage medium, and electronic device for detecting fake news. Background Technology
[0002] The prevalence of fake news on various social media platforms today has a serious impact on individuals and society. Examples include pseudoscientific rumors and inaccurate reporting of social events. Even when someone points out that a news story is fake, the public often struggles to determine its veracity due to a lack of evidence and explanation. Therefore, providing the public with effective fake news detection capabilities is a pressing technical problem that needs to be solved. Summary of the Invention
[0003] This application provides a method, apparatus, computer storage medium, and electronic device for detecting fake news. Based on accurately identifying both a set of evidence supporting the news's authenticity and a set of evidence supporting its falsity, a news interpretation generation model accurately generates both a genuine news interpretation text indicating the target news is genuine and a fake news interpretation text indicating the target news is fake. Then, based on the accurate genuine and fake news interpretation texts, a authenticity detection is performed to obtain accurate target authenticity detection results and target authenticity interpretation texts. Therefore, it not only ensures the accuracy of the news authenticity detection results but also provides authenticity interpretation texts for the detection results, achieving the effect of effectively detecting the authenticity of news and providing news authenticity interpretation texts. The technical solution is as follows:
[0004] In a first aspect, embodiments of this application provide a method for detecting fake news, the method comprising:
[0005] Obtain a target news item and at least one corresponding reporting sentence. Based on the target news item and the reporting sentence, perform probability calculation to obtain a first score and a second score for the reporting sentence. The first score is the score that the reporting sentence supports the target news item as real news, and the second score is the score that the reporting sentence supports the target news item as fake news.
[0006] Based on the first score, the reported sentences are sorted to obtain a first set of evidence corresponding to the target news; based on the second score, the reported sentences are sorted to obtain a second set of evidence corresponding to the target news.
[0007] Based on the target news, the first set of evidence, and the second set of evidence, a news interpretation generation model is used to generate real news interpretation text and fake news interpretation text corresponding to the target news.
[0008] Based on the target news, the explanatory text of the real news, and the explanatory text of the fake news, a authenticity detection process is performed to obtain the target authenticity detection result and the target authenticity explanation text corresponding to the target news.
[0009] Secondly, embodiments of this application provide a fake news detection device, the device comprising:
[0010] The scoring calculation module is used to obtain the target news and at least one reporting sentence corresponding to the target news, and to perform probability calculation based on the target news and the reporting sentence to obtain a first score and a second score for the reporting sentence. The first score is the score of the reporting sentence supporting that the target news is real news, and the second score is the score of the reporting sentence supporting that the target news is fake news.
[0011] The evidence filtering module is used to sort the reported sentences based on the first score to obtain a first set of evidence corresponding to the target news, and to sort the reported sentences based on the second score to obtain a second set of evidence corresponding to the target news.
[0012] The explanation generation module is used to generate real news explanation text and fake news explanation text corresponding to the target news based on the target news, the first evidence set and the second evidence set using a news explanation generation model;
[0013] The result detection module is used to perform authenticity detection processing based on the target news, the explanation text of the real news, and the explanation text of the fake news, to obtain the target authenticity detection result and the target authenticity explanation text corresponding to the target news.
[0014] Thirdly, embodiments of this application provide a computer storage medium having multiple instructions adapted for loading by a processor and executing the above-described method steps.
[0015] Fourthly, embodiments of this application provide an electronic device, which may include: a memory and a processor; wherein the memory stores a computer program adapted to be loaded by the memory and to execute the above-described method steps.
[0016] The beneficial effects of the technical solutions provided in this application include at least the following:
[0017] In this embodiment, a target news item and at least one corresponding reporting sentence are obtained. Probability calculations are performed on the target news item and the reporting sentence to obtain a first score supporting the target news item as real news and a second score supporting the target news item as fake news. Then, a first set of evidence corresponding to the target news item is obtained from the reporting sentences based on the first score, and a second set of evidence corresponding to the target news item is obtained from the reporting sentences based on the second score. Then, a news interpretation generation model is used to generate real news interpretation text and fake news interpretation text about the target news item based on the target news item, the first set of evidence, and the second set of evidence. Finally, the target news item, the real news interpretation text, and the fake news interpretation text are subjected to authenticity detection processing to obtain the final target authenticity detection result and the target authenticity interpretation text. Using the above method, based on accurately finding the evidence sets supporting that the news is real news and the evidence sets supporting that the news is fake news, the news interpretation generation model accurately generates real news interpretation text indicating that the target news is real news and fake news interpretation text indicating that the target news is fake news. Then, based on the accurate real news interpretation text and the accurate fake news interpretation text, a truth-or-falseness detection is performed to obtain accurate target truth-or-falseness detection results and target truth-or-falseness interpretation text. Therefore, not only is the accuracy of the news truth-or-falseness detection results guaranteed, but also truth-or-falseness interpretation texts are provided for the truth-or-falseness detection results, achieving the effect of effectively detecting the truth-or-falseness of news and providing truth-or-falseness interpretation texts for news. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating a method for detecting fake news provided in an embodiment of this application;
[0020] Figure 2 This is a flowchart illustrating another method for detecting fake news provided in this application embodiment;
[0021] Figure 3 This is a schematic diagram of the structure of a fake news detection device provided in an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of the score calculation module in the fake news detection device provided in this application embodiment;
[0023] Figure 5This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0024] To make the inventive objectives, features, and advantages of the embodiments of this application more apparent and understandable, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0025] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. In the description of this application, it should be noted that, unless otherwise expressly specified and limited, "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances. Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0026] The present application will now be described in detail with reference to specific embodiments.
[0027] In the following method embodiments, for ease of explanation, only electronic devices are described as the subjects performing each step.
[0028] Please see Figure 1 This is a flowchart illustrating a method for detecting fake news provided in an embodiment of this application. Figure 1 As shown, the method described in this application embodiment may include the following steps:
[0029] S101, obtain the target news and at least one corresponding reporting sentence, and perform probability calculation based on the target news and the reporting sentence to obtain a first score and a second score for the reporting sentence.
[0030] In simple terms, target news refers to information that describes recent changes in facts.
[0031] Reporting sentences refer to sentences in reports that describe the target news. Reports refer to articles published on various social media platforms that describe the target news. Some reports are factual, while others spread misinformation. Some reports contain both factual and misleading sentences.
[0032] The first score refers to the score by which the reported sentence supports the claim that the target news is true. The second score refers to the score by which the reported sentence supports the claim that the target news is false.
[0033] For each reported sentence, there is a first score and a second score.
[0034] In one or more embodiments of this application, the step of obtaining target news can be: receiving target news uploaded by other devices. Other devices can be user terminals, servers, or other devices. Taking a user terminal as an example, in this scenario, the user is unaware of the authenticity of the target news, and wants to use the electronic device of this application embodiment to find out the authenticity of the target news and the explanatory text of its authenticity. The user can upload the target news to the electronic device through the user terminal. The electronic device, using the method of this application embodiment, after obtaining at least one reporting sentence corresponding to the target news, performs subsequent processing to obtain the target detection result and the explanatory text of the target's authenticity.
[0035] The step of obtaining at least one report sentence corresponding to the target news can be as follows: obtain at least one report corresponding to the target news through web crawling, split each report to obtain at least one report sentence corresponding to each report, and this report sentence is the at least one report sentence corresponding to the target news.
[0036] The steps of performing probability calculations based on the target news and the reported sentences to obtain the first score and the second score for the reported sentences can be as follows: For each reported sentence, determine the semantic relationship vector between the reported sentence and the target news, and use a binary classifier to calculate the probability distribution vector corresponding to the reported sentence based on the semantic relationship vector. This probability distribution vector is a two-dimensional vector, where one dimension of the probability distribution vector is the first score for the reported sentence, and the other dimension of the probability distribution vector is the second score for the reported sentence.
[0037] When determining the semantic relationship vector between the reported sentence and the target news, the target news can first be converted into a news vector corresponding to the target news by a pre-trained Transformer encoder, the reported sentence can be converted into a sentence vector by a pre-trained Transformer encoder, and then the news vector, the cross product vector of the news vector and the sentence vector, the subtraction vector of the news vector and the sentence vector, and the sentence vector are concatenated to obtain the semantic relationship vector.
[0038] When calculating the probability distribution vector corresponding to the reported sentence using a binary classifier based on the semantic relation vector, the semantic relation vector can be input into a pre-trained binary classifier for operation to obtain the probability distribution vector corresponding to the reported sentence.
[0039] S102, based on the first score, sort the reported sentences to obtain the first set of evidence corresponding to the target news, and based on the second score, sort the reported sentences to obtain the second set of evidence corresponding to the target news.
[0040] In simple terms, the first set of evidence refers to the set of sentences in a news report that support the claim that the target news is true. The second set of evidence refers to the set of sentences in a news report that support the claim that the target news is false.
[0041] In one or more embodiments of this application, all first scores can be sorted in descending order, and the report sentences corresponding to the first scores with preset values at the top are taken as sentences in the first set of evidence corresponding to the target news. Similarly, all second scores can be sorted in descending order, and the report sentences corresponding to the second scores with preset values at the top are taken as sentences in the second set of evidence corresponding to the target news.
[0042] S103, based on the target news, the first set of evidence, and the second set of evidence, a news interpretation generation model is used to generate real news interpretation text and fake news interpretation text corresponding to the target news.
[0043] In essence, a news explanation generation model can be a model with the ability to generate news explanations, based on a Large Language Model (LLM). An LLM is an artificial intelligence model designed to understand and generate natural language text. In this embodiment, the news explanation generation model can employ models such as a Large Language Model Meta AI (LLaMA) or a pre-trained chat generative pretrained transformer (ChatGPT).
[0044] Explanatory text for real news refers to text used to explain that the target news is real news.
[0045] Explanatory text for fake news refers to text used to explain why a target news story is fake news.
[0046] In one or more embodiments of this application, a real tag can be generated for the target news, and a first prompt word can be generated based on the target news, the real tag, and a first set of evidence. The first prompt word is then input into a news explanation generation model to obtain the real news explanation text corresponding to the target news. The real tag can be used to identify the target news as real news. The first prompt word can be used to prompt the news explanation generation model to generate real news explanation text describing the target news as real news based on the target news, the real tag, and the first set of evidence.
[0047] It can generate false tags for target news, and generate second prompt words based on the target news, false tags, and a second set of evidence. These second prompt words are then input into a news explanation generation model to obtain a false news explanation text corresponding to the target news. The false tags are used to identify the target news as false. The second prompt words are used to prompt the news explanation generation model to generate a false news explanation text describing the target news as false, based on the target news, false tags, and the second set of evidence.
[0048] S104. Based on the target news, the explanation text of the real news, and the explanation text of the fake news, perform authenticity detection processing to obtain the target authenticity detection result and the target authenticity explanation text corresponding to the target news.
[0049] In simple terms, the target truth / falsehood detection result refers to the detection result used to indicate the truthfulness or falsity of the target news. The target truth / falsehood detection result can include three types of results: true news, fake news, and partially true / partially false news. The target truth / falsehood explanation text is the text used to explain the truthfulness or falsity of the target news. When the target truth / falsehood detection result is true news, the target truth / falsehood explanation text explains that the target news is true news. When the target truth / falsehood detection result is fake news, the target truth / falsehood explanation text explains that the target news is fake news. When the target truth / falsehood detection result is partially true / partially false news, the target truth / falsehood explanation text explains that the target news is partially true / partially false news.
[0050] In one or more embodiments of this application, a text relationship vector is determined among the target news, the explanatory text of the real news, and the explanatory text of the fake news. Based on the text relationship vector, a three-classifier is used to calculate the target probability distribution vector corresponding to the target news. The target probability distribution vector is detected to determine the target authenticity detection result corresponding to the target news. Based on the target authenticity detection result, the explanatory text of the real news, and the explanatory text of the fake news, the target authenticity explanation text is determined.
[0051] When determining the text relationship vectors between the target news, the explanatory text of the real news, and the explanatory text of the fake news, the target news, the explanatory text of the real news, and the explanatory text of the fake news can be concatenated to obtain the target text. The target text is then encoded using a pre-trained Transformer to obtain the text relationship vector.
[0052] When calculating the target probability distribution vector corresponding to the target news using a three-classifier based on the text relationship vector, the text relationship vector can be input into the pre-trained three-classifier for operation to obtain the target probability distribution vector. The target probability distribution vector is a vector containing the probabilities of three types of labels: real news, fake news, and half-true and half-false news.
[0053] When detecting the target probability distribution vector to determine the authenticity of the target news, the target probability distribution vector can be input into the argmax function. The argmax function can output the label with the highest probability in the target probability distribution vector. The label with the highest probability in the target probability distribution vector is the authenticity detection result of the target news.
[0054] When determining the target's true / false explanation text based on the target's true / false detection result, the explanation text of real news, and the explanation text of fake news, if the target's true / false detection result is real news, then the explanation text of real news is used as the target's true / false explanation text; if the target's true / false detection result is fake news, then the explanation text of fake news is used as the target's true / false explanation text; if the target's true / false detection result is partially true / false, then the explanation text of real news and the explanation text of fake news are concatenated to obtain the target's partially true / false explanation text.
[0055] In this embodiment, a target news item and at least one corresponding reporting sentence are obtained. Probability calculations are performed on the target news item and the reporting sentence to obtain a first score supporting the target news item as real news and a second score supporting the target news item as fake news. Then, a first set of evidence corresponding to the target news item is obtained from the reporting sentences based on the first score, and a second set of evidence corresponding to the target news item is obtained from the reporting sentences based on the second score. Then, a news interpretation generation model is used to generate real news interpretation text and fake news interpretation text about the target news item based on the target news item, the first set of evidence, and the second set of evidence. Finally, the target news item, the real news interpretation text, and the fake news interpretation text are subjected to authenticity detection processing to obtain the final target authenticity detection result and the target authenticity interpretation text. Using the above method, based on accurately finding the evidence sets supporting that the news is real news and the evidence sets supporting that the news is fake news, the news interpretation generation model accurately generates real news interpretation text indicating that the target news is real news and fake news interpretation text indicating that the target news is fake news. Then, based on the accurate real news interpretation text and the accurate fake news interpretation text, a truth-or-falseness detection is performed to obtain accurate target truth-or-falseness detection results and target truth-or-falseness interpretation text. Therefore, not only is the accuracy of the news truth-or-falseness detection results guaranteed, but also truth-or-falseness interpretation texts are provided for the truth-or-falseness detection results, achieving the effect of effectively detecting the truth-or-falseness of news and providing truth-or-falseness interpretation texts for news.
[0056] Please see Figure 2 This is a flowchart illustrating a method for detecting fake news provided in an embodiment of this application. Figure 2 As shown, the method described in this application embodiment may include the following steps:
[0057] S201, Obtain the target news and at least one corresponding report sentence.
[0058] Specifically, see Figure 1 The description of S101 in the illustrated embodiment will not be repeated here.
[0059] S202, determine the news vector corresponding to the target news and the sentence vector corresponding to each report sentence, and concatenate the news vector and sentence vector to obtain the semantic relationship vector between the target news and the report sentences.
[0060] In one or more embodiments of this application, a first calculation formula can be used to calculate the target news to obtain the news vector corresponding to the target news; the first calculation formula satisfies the following formula:
[0061] h c =Pool(Transformer-Enc(c;θ (ec)))
[0062] Among them, h c Let θ represent the news vector corresponding to the target news c, Pool(·) represent the pooling layer, Transformer-Enc(·) represent the pre-trained Transformer encoder, c represent the target news, and θ represent the target news. (ec) This represents the learnable parameters of the Transformer encoder.
[0063] For each reported sentence, the second calculation formula is used to calculate the sentence vector corresponding to the reported sentence; the second calculation formula satisfies the following formula:
[0064]
[0065] in, Sentences indicating reports j The corresponding sentence vectors, Pool(·) represent pooling layers, Transformer-Enc(·) represent pre-trained Transformer encoders, s j Let θ represent the j-th report sentence. (ec) This represents the learnable parameters of the Transformer encoder.
[0066] When performing the step of concatenating the news vector and sentence vector to obtain the semantic relationship vector between the target news and the reported sentence, the specific steps can be as follows: The third calculation formula is used to concatenate the news vector and sentence vector to obtain the semantic relationship vector between the target news and the reported sentence; the third calculation formula satisfies the following formula:
[0067]
[0068] Among them, u j Sentences indicating reports j The semantic relationship vector h between the target news c and the target news c c This represents the news vector corresponding to the target news c. Sentences indicating reports j The corresponding sentence vector, h c and The cross product operation, h c and Subtraction operations.
[0069] S203. Probability calculation is performed based on semantic relation vectors to obtain the probability distribution vector for the reported sentence. The first score and second score for the reported sentence are determined based on the probability distribution vector.
[0070] In one or more embodiments of this application, when performing the step of calculating the probability based on the semantic relation vector to obtain the probability distribution vector for the reported sentence, it can specifically be as follows: Calculate the probability distribution vector for the reported sentence using a first probability calculation formula based on the semantic relation vector; the first probability calculation formula satisfies the following formula:
[0071]
[0072] Where, p j Let z represent the probability distribution vector, P(·) denotes finding the probability distribution. (vp) Represents a latent variable, u j Represents a semantic relation vector, θ (vp) Let represent the learnable parameters in MLP(·), where MLP(·) represents a multilayer perceptron, and softmax(·) represents the normalization function. p j Dimensions.
[0073] The steps for determining the first and second scores for a reported sentence based on a probability distribution vector can be as follows: Obtain the vector dimension mapping relationship; find the first dimension corresponding to the true score type and the second dimension corresponding to the false score type in the vector dimension mapping relationship; use the value of the first dimension in the probability distribution vector as the first score, and the value of the second dimension in the probability distribution vector as the second score. The vector dimension mapping relationship can store the correspondence between reference score types and reference dimensions. The reference score types can include both true and false score types, and the reference dimensions can include the first and second dimensions.
[0074] Optionally, before calculating the probability distribution vector for the reported sentence based on the semantic relation vector, the method further includes: A1, obtaining the sample probability distribution vector corresponding to the sample news, which is calculated based on the sample reported sentence corresponding to the sample news; A2, determining the first loss function based on the sample probability distribution vector using relative entropy, and determining the second loss function based on the sample probability distribution vector using a three-classifier; A3, calculating the target loss function based on the first and second loss functions, and optimizing the target learnable parameters in the multilayer perceptron based on the target loss function.
[0075] When performing step A1, the specific steps are as follows: a1. Calculate the sample news using the first calculation formula to obtain the sample news vector corresponding to the sample news; a2. Obtain the sample report sentences corresponding to the sample news. For each sample report sentence corresponding to the sample news, calculate the sample report sentence using the second calculation formula to obtain the sample sentence vector corresponding to the sample report sentence; a3. Concatenate the sample news vector and the sample sentence vector using the third calculation formula to obtain the sample semantic relationship vector between the sample news and the sample report sentence; a4. Calculate the first probability distribution vector for the sample report sentence based on the sample semantic relationship vector using the first probability calculation formula; a5. Determine the first sample score and the second sample score for the report sentence based on the first probability distribution vector. The first sample score is the score that the sample report sentence supports the sample news as real news, and the second score is the score that the sample report sentence supports the sample news as fake news; a6. Based on the sample news vector and sample sentence vector, a weighting formula is used to calculate the first sample weight and the second sample weight corresponding to the sample report sentence. The first sample weight is the contribution weight of the sample report sentence to support the sample news being real news, and the second sample weight is the contribution weight of the sample report sentence to support the sample news being fake news; a7, based on the first sample score and the first sample weight, a first product formula is used to calculate the third sample score corresponding to the sample report sentence, and based on the second sample score and the second sample weight, a second product formula is used to calculate the fourth sample score corresponding to the sample report sentence; a8, the third product formula is used to sum the third sample score to calculate the first news score corresponding to the sample news, and the fourth product formula is used to sum the fourth sample score to calculate the second news score corresponding to the sample news; a9, the sample probability distribution vector corresponding to the sample news is determined based on the first news score and the second news score.
[0076] Specifically, the first calculation formula in step a1 is the same as the first calculation formula shown in step S202; the second calculation formula in step a2 is the same as the second calculation formula shown in step S202; and the third calculation formula in step a3 is the same as the third calculation formula shown in step S202. The calculation principles for step a1 using the first calculation formula, step a2 using the second calculation formula, and step a3 using the third calculation formula are detailed in the description in S202 and will not be repeated here. The first probability calculation formula in step a4 is the same as the first probability calculation formula shown in step S203. The calculation principle for step a4 using the first probability calculation formula is detailed in the description in S203 and will not be repeated here. The implementation process of step a5 is detailed in the description in step S203 and will not be repeated here.
[0077] The weight calculation formula in step a6 satisfies the following formula:
[0078]
[0079]
[0080] in, Let h represent the weight of the first sample, exp(·) represent the exponential function with base e, MLP(·) represent the multilayer perceptron, and h c This represents the sample news vector corresponding to sample news c. Sentences representing sample reports j The corresponding sample sentence vector, θ (attn-T) This represents the learnable parameters in MLP(·). Let represent the sample sentence vector corresponding to each of the s sample report sentences. θ represents the weight of the second sample. (attn-F) This represents the learnable parameters in MLP(·).
[0081] The first product calculation formula in step a7 satisfies the following formula:
[0082]
[0083] in, Indicates the weight of the first sample. This represents the score of the first sample. This represents the score of the third sample.
[0084] The second product calculation formula in step a7 satisfies the following formula:
[0085]
[0086] in, Indicates the weight of the second sample. This represents the score of the second sample. This represents the score of the fourth sample.
[0087] The third product calculation formula in step a8 satisfies the following formula:
[0088]
[0089] in, This indicates the score for the first news story. This represents the score of the third sample.
[0090] The fourth product calculation formula in step a8 satisfies the following formula:
[0091]
[0092] in, This indicates the score for the second news item. This represents the score of the fourth sample.
[0093] When performing step a9, the sample probability distribution vector can be obtained using a vector assignment formula based on the first news score and the second news score. The vector assignment formula satisfies the following equation:
[0094]
[0095] Where, p c Represents the sample probability distribution vector. This indicates the score for the second news item. This indicates the score for the first news story.
[0096] When performing step A2, the step of determining the first loss function based on the sample probability distribution vector using relative entropy is performed. Specifically, this can be: determining the reference probability distribution vector based on a preset vector formula; obtaining the sample probability distribution vector; and calculating the first loss function based on the sample probability distribution vector and the reference probability distribution vector using the relative entropy calculation formula.
[0097] The preset vector form is as follows:
[0098]
[0099] Where p represents the reference probability distribution vector.
[0100] The formula for calculating relative entropy satisfies the following:
[0101]
[0102] in, Let p represent the first loss function, KL(·) represent the relative entropy (Kullback-Leibler divergence, or KL divergence for short), and p c Let represent the sample probability distribution vector, and p represent the reference probability distribution vector.
[0103] When performing step A2, the step of determining the second loss function based on the sample probability distribution vector using a three-classifier can be performed. Specifically, this can be: calculating the predicted sample probability distribution vector using the second probability calculation formula based on the sample probability distribution vector; and calculating the second loss function using the first loss calculation formula based on the predicted sample probability distribution vector.
[0104] The second probability calculation formula satisfies the following formula:
[0105]
[0106] Where, p (cls) Let z represent the probability distribution vector of the predicted sample, and P(·) represent finding the probability distribution.(cls) h represents a latent variable. c p represents the sample news vector corresponding to the sample news. c Let θ represent the sample probability distribution vector. (cls) Let represent the learnable parameters in MLP(·), where MLP(·) represents a multilayer perceptron, and softmax(·) represents the normalization function. p (cls) Dimensions.
[0107] The first loss calculation formula satisfies the following formula:
[0108]
[0109] in, This represents the second loss function. This indicates the number of all sample reports corresponding to the sample news. This represents the prediction probability when the predicted label and the temporary label are the same. Indicates the predicted label, y t Indicates a temporary label, y t The value of is the aforementioned preset vector y. t The value of .
[0110] When performing step A3, the step of calculating the target loss function based on the first loss function and the second loss function is performed. Specifically, the target loss function can be obtained by using the second loss calculation formula based on the first loss function and the second loss function.
[0111] The second loss calculation formula satisfies the following formula:
[0112]
[0113] in, Describes the target loss function. This represents the second loss function. Let γ represent the first loss function, γ represent the weight of the second loss function, and 1-γ represent the weight of the first loss function. γ is a hyperparameter, which is a parameter set before training, not a parameter obtained through training. In the embodiments of this application, γ can be set based on prior experience.
[0114] The learnable parameter of the target refers to the θ parameter, which can be the θ in the first probability calculation formula in step S203. (vp) θ can be the weight calculation formula in step a6. (attn-T) and θ (attn-F) θ can be the second probability calculation formula in step A2. (cls) .
[0115] When performing step A3, optimizing the target learnable parameters in the multilayer perceptron based on the target loss function can be achieved by optimizing the target learnable parameters in the multilayer perceptron according to the target loss function, so that the target learnable parameters reach a more suitable value. Optimizing the target learnable parameters in the multilayer perceptron through the loss function used in the training phase allows the multilayer perceptron to obtain more accurate model recognition results in the application phase. This results in a more accurate probability distribution vector when using the first probability calculation formula in this embodiment, thereby obtaining a more accurate first score and second score for the reported sentence.
[0116] S204, based on the first score, sort the reported sentences to obtain the first set of evidence corresponding to the target news, and based on the second score, sort the reported sentences to obtain the second set of evidence corresponding to the target news.
[0117] Specifically, all first scores can be sorted from highest to lowest, and the report sentences corresponding to the top-ranked first scores can be included in the first set of evidence for the target news. Similarly, all second scores can be sorted from highest to lowest, and the report sentences corresponding to the top-ranked second scores can be included in the second set of evidence for the target news.
[0118] S205. Generate a first prompt word based on the target news, the first set of evidence, and the first tag corresponding to the first set of evidence. Input the first prompt word into the news explanation generation model to obtain the real explanation text corresponding to the target news.
[0119] For a detailed explanation of the news explanation generation model, please refer to [link / reference]. Figure 1 The explanation of S103 in the illustrated embodiment will not be repeated here.
[0120] The first prompt word refers to the prompt word used to guide the news interpretation generation model to generate explanatory text when the target news is real news.
[0121] The first label refers to the authentic label used to identify the target news as real news.
[0122] Specifically, a preset prompt template can be obtained, which includes the positions for writing the target news, the first set of evidence, and the first tag. The target news, the first set of evidence, and the first tag are written into the corresponding positions in the preset prompt template to obtain the first prompt word. Furthermore, the first prompt word is input into the news explanation generation model to obtain the actual explanation text corresponding to the target news.
[0123] For example, the first prompt could be: Given a claim: [c], a veracity label pleasegive me a streamlined rationale associated with the claim,for how it is reasoned as Below are some sentences that may be helpful for reasoning,but they are mixed with noise:[ε v [c] indicates the location where the target news will be written. For the position where the label is written, [ε v [] indicates the location where the evidence is written into the evidence set.
[0124] S206, a second prompt word is generated based on the target news, the second set of evidence, and the second tag corresponding to the second set of evidence. The second prompt word is then input into the news explanation generation model to obtain the fake news explanation text corresponding to the target news.
[0125] The second cue word refers to the cue word used to guide the news interpretation generation model to generate explanatory text when the target news is fake news.
[0126] The second label refers to a fake label used to characterize the target news as fake news.
[0127] Specifically, a preset prompt template can be obtained, which includes the positions for writing the target news, the second set of evidence, and the second tag. The target news, the second set of evidence, and the second tag are written into the corresponding positions in the preset prompt template to obtain the second prompt word. Furthermore, the second prompt word is input into the news explanation generation model to obtain the actual explanation text corresponding to the target news.
[0128] S207. Based on the target news, the explanation text of the real news, and the explanation text of the fake news, text concatenation is performed to obtain the target semantic relationship vector between the target news, the explanation text of the real news, and the explanation text of the fake news.
[0129] Specifically, the target semantic relationship vector can be obtained by using a concatenation calculation formula based on the target news, the explanatory text of the real news, and the explanatory text of the fake news.
[0130] The splicing calculation formula can satisfy the following formula:
[0131] x=Transformer-Enc([c;[SEP];eF ;[SEP];e T ];θ (ed) )
[0132] Where x represents the target semantic relation vector, Transformer-Enc(·) represents the pre-trained encoder, c represents the target news, and e represents the target news. F This indicates the text explaining the fake news, e T This represents the explanatory text of real news, θ (ed) This represents the learnable parameters in Transformer-Enc(·), where [SEP] represents a specific delimiter that separates c and e. F e T Three elements.
[0133] S208, based on the target semantic relationship vector, the third probability calculation formula is used to calculate and obtain the reference probability distribution vector corresponding to the target news.
[0134] The third probability calculation formula satisfies the following formula:
[0135]
[0136] Where, p (ver) Let z represent the reference probability distribution vector, P(·) denotes finding the probability distribution. (ver) Let x represent the latent variable, θ represent the target semantic relation vector, and θ represent the latent variable. (ver) Let represent the learnable parameters in MLP(·), where MLP(·) represents a multilayer perceptron, and softmax(·) represents the normalization function. p (ver) Dimensions.
[0137] Optionally, before calculating the reference probability distribution vector corresponding to the target news using the third probability calculation formula based on the target semantic relationship vector, the method further includes: B1, obtaining the sample news, the first real news explanation text and the second fake news explanation text corresponding to the sample news, and performing text concatenation processing based on the sample news, the first real news explanation text and the second fake news explanation text to obtain the sample semantic relationship vector between the sample news, the first real news explanation text and the second fake news explanation text; B2, calculating the third loss function using the third loss calculation formula based on the sample semantic relationship vector, and optimizing the preset learnable parameters in the multilayer perceptron based on the third loss function.
[0138] Specifically, in step B1, text concatenation is performed based on the sample news, the first real news explanation text, and the second fake news explanation text to obtain the sample semantic relationship vector between the sample news, the first real news explanation text, and the second fake news explanation text. Refer to the concatenation calculation formula shown in step S207. Replace the target semantic relationship vector in the concatenation calculation formula with the sample semantic relationship vector, replace the target news in the concatenation calculation formula with the sample news, replace the real news explanation text in the concatenation calculation formula with the first real news explanation text, and replace the fake news explanation text in the concatenation calculation formula with the second fake news explanation text. The sample semantic relationship vector can then be obtained using the concatenation calculation formula.
[0139] When performing step B2, the third loss calculation formula satisfies the following formula:
[0140]
[0141] in, This represents the third loss function. This indicates the number of all sample reports corresponding to the sample news. This represents the prediction probability when the predicted label is the same as the true label. 'y' represents the predicted label, and 'y' represents the true label. Predicted labels can include three types: true news, fake news, and partially true / false. True labels can also include three types: true news, fake news, and partially true / false.
[0142] The preset learnable parameter refers to θ in the third probability calculation formula. (ver) .
[0143] In step B2, the preset learnable parameters in the multilayer perceptron are optimized based on the third loss function. This can be understood as optimizing the preset learnable parameters in the multilayer perceptron according to the third loss function, so that the preset learnable parameters reach a more suitable value. By optimizing the preset learnable parameters in the multilayer perceptron through the loss function in the training phase, the multilayer perceptron obtains more accurate model recognition results in the application phase. This allows the embodiments of this application to obtain a more accurate probability distribution vector when using the third probability calculation formula, thereby obtaining more accurate target authenticity detection results for the target news.
[0144] S209, based on the reference probability distribution vector, the detection formula is used to calculate and obtain the target news's true or false detection result.
[0145] The detection calculation formula satisfies the following formula:
[0146] y * =argmaxp (ver)
[0147] Where, p (ver) p represents the reference probability distribution vector. (ver) It can be a vector containing the probabilities of three types of labels. In this embodiment, these three labels can be real news, fake news, and partially true / false news; argmax represents the vector used to find p. (ver) The function y is the label with the highest probability. * This indicates the result of the target's authenticity detection. The result can include three types of results: real news, fake news, and partially true / false news.
[0148] S210, Based on the target authenticity detection results, determine the target authenticity explanation text corresponding to the target news.
[0149] Specifically, when the target news detection result is real news, the real news explanation text can be used as the target news's corresponding real / fake explanation text. When the target news detection result is fake news, the fake news explanation text can be used as the target news's corresponding real / fake explanation text. When the target news detection result is partially real / partially fake, the real news explanation text and the fake news explanation text can be concatenated, and the concatenated explanation text can be used as the target news's corresponding real / fake explanation text.
[0150] In this embodiment, a pre-trained multilayer perceptron accurately identifies the probability distribution vector of semantic relation vectors, thereby obtaining an accurate first score and a second score for the reported sentence. Then, based on the accurate first score and the second score, an accurate first evidence set and a second evidence set are obtained. Subsequently, based on the accurate first evidence set and the second evidence set, an accurate explanatory text for the reported sentence is generated. Then, the pre-trained multilayer perceptron accurately identifies the reference probability distribution vector corresponding to the target news, thereby obtaining an accurate news authenticity detection result and an accurate authenticity explanatory text.
[0151] The following will combine Figure 3 This application provides a detailed description of the fake news detection device provided in its embodiments. It should be noted that... Figure 3 The fake news detection device shown is used to perform the functions described in this application. Figures 1-2 The methods shown in the embodiments are for illustrative purposes only, illustrating the parts relevant to the embodiments of this application. For specific technical details not disclosed, please refer to this application. Figures 1-3 The example shown.
[0152] Please see Figure 3This diagram illustrates the structure of a fake news detection device according to an embodiment of this application. The fake news detection device 1 can be implemented as all or part of a device through software, hardware, or a combination of both. According to some embodiments, the fake news detection device 1 includes a score calculation module 11, an evidence screening module 12, an interpretation generation module 13, and a result detection module 14, specifically used for:
[0153] The scoring calculation module 11 is used to obtain the target news and at least one reporting sentence corresponding to the target news, and to perform probability calculation based on the target news and the reporting sentence to obtain a first score and a second score for the reporting sentence. The first score is the score of the reporting sentence supporting that the target news is real news, and the second score is the score of the reporting sentence supporting that the target news is fake news.
[0154] The evidence filtering module 12 is used to sort the reported sentences based on the first score to obtain a first set of evidence corresponding to the target news, and to sort the reported sentences based on the second score to obtain a second set of evidence corresponding to the target news.
[0155] The explanation generation module 13 is used to generate real news explanation text and fake news explanation text corresponding to the target news based on the target news, the first evidence set and the second evidence set using a news explanation generation model;
[0156] The result detection module 14 is used to perform authenticity detection processing based on the target news, the explanation text of the real news, and the explanation text of the fake news, to obtain the target authenticity detection result and the target authenticity explanation text corresponding to the target news.
[0157] Optionally, please see Figure 4 The schematic diagram of the score calculation module 11 shown above includes a first calculation unit 112, a second calculation unit 114, and a third calculation unit 116, specifically used for:
[0158] The first calculation unit 112 is used to determine the news vector corresponding to the target news and the sentence vector corresponding to each of the reported sentences;
[0159] The second calculation unit 114 is used to concatenate the news vector and the sentence vector to obtain a semantic relationship vector between the target news and the reported sentence.
[0160] The third calculation unit 116 is used to perform probability calculation based on the semantic relationship vector to obtain the probability distribution vector for the reported sentence, and to determine the first score and the second score for the reported sentence based on the probability distribution vector.
[0161] Optionally, the third computing unit is used for:
[0162] Based on the semantic relationship vector, the probability distribution vector for the reported sentence is calculated using the first probability calculation formula.
[0163] The first probability calculation formula satisfies the following formula:
[0164]
[0165] Where, p j Let z represent the probability distribution vector, P(·) denotes finding the probability distribution. (vp) Represents a latent variable, u j θ represents the semantic relation vector. (vp) Let represent the learnable parameters in MLP(·), where MLP(·) represents a multilayer perceptron, and softmax(·) represents the normalization function. p j Dimensions.
[0166] Optionally, the third computing unit also includes:
[0167] The first training unit is used to obtain the sample probability distribution vector corresponding to the sample news, which is calculated based on the sample report sentence corresponding to the sample news.
[0168] The second training unit is used to determine the first loss function based on the sample probability distribution vector using relative entropy, and to determine the second loss function based on the sample probability distribution vector using a three-classifier.
[0169] The third training unit is used to calculate the target loss function based on the first loss function and the second loss function, and to optimize the target learnable parameters in the multilayer perceptron based on the target loss function.
[0170] Optionally, the second training unit is specifically used for:
[0171] The reference probability distribution vector is determined based on a preset vector formula;
[0172] The first loss function is obtained by calculating the relative entropy based on the sample probability distribution vector and the reference probability distribution vector.
[0173] The preset vector expression is the following formula:
[0174]
[0175] Where p represents the reference probability distribution vector;
[0176] The formula for calculating relative entropy satisfies the following equation:
[0177]
[0178] in, Let KL(·) represent the first loss function, and let p represent the relative entropy. c This represents the probability distribution vector of the sample.
[0179] Optionally, the second training unit is specifically used for:
[0180] The predicted sample probability distribution vector is obtained by using the second probability calculation formula based on the sample probability distribution vector.
[0181] Based on the predicted sample probability distribution vector, the second loss function is obtained by calculating the first loss formula.
[0182] The second probability calculation formula satisfies the following formula:
[0183]
[0184] Where, p (cls) Let z represent the probability distribution vector of the predicted sample, P(·) denotes finding the probability distribution. (cls) h represents a latent variable. c p represents the sample news vector corresponding to the sample news. c Let θ represent the sample probability distribution vector. (cls) Let represent the learnable parameters in MLP(·), where MLP(·) represents a multilayer perceptron, and softmax(·) represents the normalization function. p (cls) The dimension;
[0185] The first loss calculation formula satisfies the following formula:
[0186]
[0187] in, This represents the second loss function. This indicates the number of all sample reports corresponding to the sample news. This represents the prediction probability when the predicted label and the temporary label are the same. Indicates the predicted label, y t This indicates a temporary tag.
[0188] Optionally, the third training unit is specifically used for:
[0189] The target loss function is obtained by calculating using the second loss formula based on the first loss function and the second loss function;
[0190] The second loss calculation formula satisfies the following formula:
[0191]
[0192] in, Represents the target loss function. This represents the second loss function. Let represent the first loss function, γ represent the weight of the second loss function, and 1-γ represent the weight of the first loss function.
[0193] Optionally, the interpretation and generation module 13 is specifically used for:
[0194] Based on the target news, the first set of evidence, and the first tag corresponding to the first set of evidence, a first prompt word is generated, and the first prompt word is input into the news explanation generation model to obtain the real explanation text corresponding to the target news.
[0195] Based on the target news, the second set of evidence, and the second tag corresponding to the second set of evidence, a second prompt word is generated. The second prompt word is then input into the news explanation generation model to obtain the fake news explanation text corresponding to the target news.
[0196] Optionally, the result detection module 14 includes:
[0197] The first detection unit is used to perform text splicing processing based on the target news, the real news explanation text, and the fake news explanation text to obtain a target semantic relationship vector between the target news, the real news explanation text, and the fake news explanation text;
[0198] The second detection unit is used to calculate the reference probability distribution vector corresponding to the target news based on the target semantic relationship vector using a third probability calculation formula.
[0199] The third detection unit is used to perform calculations based on the reference probability distribution vector using a detection formula to obtain the target news's true / false detection result.
[0200] The fourth detection unit is used to determine the target truth or falsehood explanation text corresponding to the target news based on the target truth or falsehood detection result.
[0201] Optionally, the third probability calculation formula satisfies the following formula:
[0202]
[0203] Where, p (ver) Let z represent the reference probability distribution vector, P(·) denotes finding the probability distribution. (ver)Let θ represent the latent variable, x represent the target semantic relation vector, and θ represent the latent variable. (ver) Let represent the learnable parameters in MLP(·), where MLP(·) represents a multilayer perceptron, and softmax(·) represents the normalization function. p (ver) Dimensions.
[0204] Optionally, the result detection module 14 further includes:
[0205] Obtain sample news, the first real news explanation text and the second fake news explanation text corresponding to the sample news, and perform text concatenation processing based on the sample news, the first real news explanation text and the second fake news explanation text to obtain the sample semantic relationship vector between the sample news, the first real news explanation text and the second fake news explanation text.
[0206] The third loss function is calculated using the third loss formula based on the sample semantic relationship vector, and the preset learnable parameters in the multilayer perceptron are optimized based on the third loss function.
[0207] The third loss calculation formula satisfies the following formula:
[0208]
[0209] in, This represents the third loss function. This indicates the number of all sample reports corresponding to the sample news. This represents the prediction probability when the predicted label is the same as the true label. y represents the predicted label, and y represents the true label.
[0210] Optionally, the detection calculation formula satisfies the following formula:
[0211] y * =argmaxp (ver)
[0212] Where, p (ver) Let argmax represent the reference probability distribution vector, and let p be the vector used to find the probability distribution. (ver) The function y is the label with the highest probability. * This indicates the result of the target's authenticity detection.
[0213] Optionally, the fourth detection unit is specifically used for:
[0214] If the target's authenticity detection result is real news, then the explanation text of the real news will be used as the target's authenticity explanation text corresponding to the target news;
[0215] If the target's authenticity detection result is fake news, then the fake news explanation text will be used as the target's authenticity explanation text corresponding to the target news;
[0216] If the target's authenticity detection result is partially true and partially false, then the true news explanation text and the false news explanation text will be used as the target's authenticity explanation text corresponding to the target news.
[0217] Please refer to Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 The diagram illustrates the structure of an electronic device provided in an exemplary embodiment of this application. The electronic device in this embodiment may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and output device 140 can be connected via the bus 150.
[0218] Processor 110 may include one or more processing cores. Processor 110 connects to various parts of the electronic device using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 120, and by calling data stored in memory 120. Optionally, processor 110 may be implemented using at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). Processor 110 may integrate one or more of a central processing unit (CPU), graphics processing unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 110 and may be implemented separately using a communication chip.
[0219] The memory 120 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 120 may include non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (e.g., touch function, sound playback function, image playback function, etc.), instructions for implementing the various method embodiments described below, etc. The operating system may be the Android system, including systems deeply developed based on the Android system, the iOS system developed by Apple Inc., including systems deeply developed based on the iOS system, or other systems.
[0220] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to establish data communication between the third-party applications and the operating system. This would allow the operating system to obtain the current scenario information of the third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.
[0221] The input device 130 is used to receive input instructions or data, and includes, but is not limited to, a keyboard, mouse, camera, microphone, or touch device. The output device 140 is used to output instructions or data, and includes, but is not limited to, a display device and a speaker. In one example, the input device 130 and the output device 140 can be combined, and the input device 130 and the output device 140 can be a touch display screen.
[0222] The touch display screen can be designed as a full-screen, curved screen, or irregularly shaped screen. It can also be designed as a combination of a full-screen and a curved screen, or a combination of an irregularly shaped screen and a curved screen; however, this application does not limit the specific design of the touch display screen.
[0223] In addition, those skilled in the art will understand that the structure of the electronic device shown in the above figures does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the electronic device may also include radio frequency circuits, input units, sensors, audio circuits, Wireless Fidelity (WiFi) modules, power supplies, Bluetooth modules, etc., which will not be described in detail here.
[0224] exist Figure 5In the illustrated electronic device, the processor 110 can be used to call the program for the fake news detection method stored in the memory 120, and specifically perform the following operations:
[0225] Obtain a target news item and at least one corresponding reporting sentence. Based on the target news item and the reporting sentence, perform probability calculation to obtain a first score and a second score for the reporting sentence. The first score is the score that the reporting sentence supports the target news item as real news, and the second score is the score that the reporting sentence supports the target news item as fake news.
[0226] Based on the first score, the reported sentences are sorted to obtain a first set of evidence corresponding to the target news; based on the second score, the reported sentences are sorted to obtain a second set of evidence corresponding to the target news.
[0227] Based on the target news, the first set of evidence, and the second set of evidence, a news interpretation generation model is used to generate real news interpretation text and fake news interpretation text corresponding to the target news.
[0228] Based on the target news, the explanatory text of the real news, and the explanatory text of the fake news, a authenticity detection process is performed to obtain the target authenticity detection result and the target authenticity explanation text corresponding to the target news.
[0229] In one embodiment, when the processor 110 performs the step of calculating the first score and the second score for the reporting sentence based on the target news and the reporting sentence, it specifically performs the following operations:
[0230] Determine the news vector corresponding to the target news and the sentence vector corresponding to each of the reported sentences;
[0231] The news vector and the sentence vector are concatenated to obtain a semantic relationship vector between the target news and the reported sentence.
[0232] Based on the semantic relationship vector, probability calculation is performed to obtain the probability distribution vector for the reported sentence, and the first score and the second score for the reported sentence are determined based on the probability distribution vector.
[0233] In one embodiment, when the processor 110 performs the step of calculating the probability based on the semantic relation vector to obtain the probability distribution vector for the reported sentence, it specifically performs the following operations:
[0234] Based on the semantic relationship vector, the probability distribution vector for the reported sentence is calculated using the first probability calculation formula.
[0235] The first probability calculation formula satisfies the following formula:
[0236]
[0237] Where, p j Let z represent the probability distribution vector, P(·) denotes finding the probability distribution. (vp) Represents a latent variable, u j θ represents the semantic relation vector. (vp) Let represent the learnable parameters in MLP(·), where MLP(·) represents a multilayer perceptron, and soffmax(·) represents the normalization function. p j Dimensions.
[0238] In one embodiment, before performing the probability calculation based on the semantic relation vector to obtain the probability distribution vector for the reported sentence, the processor 110 also performs the following operations:
[0239] Obtain the sample probability distribution vector corresponding to the sample news, which is calculated based on the sample report sentence corresponding to the sample news.
[0240] The first loss function is determined by relative entropy based on the sample probability distribution vector, and the second loss function is determined by a three-class classifier based on the sample probability distribution vector.
[0241] The target loss function is calculated based on the first loss function and the second loss function, and the target learnable parameters in the multilayer perceptron are optimized based on the target loss function.
[0242] In one embodiment, when the processor 110 performs the step of determining the first loss function based on the sample probability distribution vector using relative entropy, it specifically performs the following operations:
[0243] The reference probability distribution vector is determined based on a preset vector formula;
[0244] The first loss function is obtained by calculating the relative entropy based on the sample probability distribution vector and the reference probability distribution vector.
[0245] The preset vector expression is the following formula:
[0246]
[0247] Where p represents the reference probability distribution vector;
[0248] The formula for calculating relative entropy satisfies the following equation:
[0249]
[0250] in, Let KL(·) represent the first loss function, and let p represent the relative entropy. c This represents the probability distribution vector of the sample.
[0251] In one embodiment, when the processor 110 performs the step of determining the second loss function using a three-class classifier based on the sample probability distribution vector, it specifically performs the following operations:
[0252] The predicted sample probability distribution vector is obtained by using the second probability calculation formula based on the sample probability distribution vector.
[0253] Based on the predicted sample probability distribution vector, the second loss function is obtained by calculating using the first loss formula:
[0254] The second probability calculation formula satisfies the following formula:
[0255]
[0256] Where, p (cls) Let z represent the probability distribution vector of the predicted sample, P(·) denotes finding the probability distribution. (cls) h represents a latent variable. c p represents the sample news vector corresponding to the sample news. c Let θ represent the sample probability distribution vector. (cls) Let represent the learnable parameters in MLP(·), where MLP(·) represents a multilayer perceptron, and softmax(·) represents the normalization function. p (cls) The dimension;
[0257] The first loss calculation formula satisfies the following formula:
[0258]
[0259] in, This represents the second loss function. This indicates the number of all sample reports corresponding to the sample news. This represents the prediction probability when the predicted label and the temporary label are the same. Indicates the predicted label, y t This indicates a temporary tag.
[0260] In one embodiment, when the processor 110 performs the step of calculating the target loss function based on the first loss function and the second loss function, it specifically performs the following operations:
[0261] The target loss function is obtained by calculating using the second loss formula based on the first loss function and the second loss function;
[0262] The second loss calculation formula satisfies the following formula:
[0263]
[0264] in, Represents the target loss function. This represents the second loss function. Let represent the first loss function, γ represent the weight of the second loss function, and 1-γ represent the weight of the first loss function.
[0265] In one embodiment, when processor 110 performs the step of generating real news explanation text and fake news explanation text corresponding to the target news using a news explanation generation model based on the target news, the first evidence set, and the second evidence set, it specifically performs the following operations:
[0266] Based on the target news, the first set of evidence, and the first tag corresponding to the first set of evidence, a first prompt word is generated, and the first prompt word is input into the news explanation generation model to obtain the real explanation text corresponding to the target news.
[0267] Based on the target news, the second set of evidence, and the second tag corresponding to the second set of evidence, a second prompt word is generated. The second prompt word is then input into the news explanation generation model to obtain the fake news explanation text corresponding to the target news.
[0268] In one embodiment, when the processor 110 performs the step of performing authenticity detection processing based on the target news, the real news explanation text, and the fake news explanation text to obtain the target authenticity detection result and the target authenticity explanation text corresponding to the target news, it specifically performs the following operations:
[0269] Based on the target news, the explanation text of the real news, and the explanation text of the fake news, text concatenation processing is performed to obtain the target semantic relationship vector among the target news, the explanation text of the real news, and the explanation text of the fake news;
[0270] Based on the target semantic relationship vector, a third probability calculation formula is used to calculate and obtain the reference probability distribution vector corresponding to the target news.
[0271] Based on the reference probability distribution vector, a detection calculation formula is used to calculate the target news's authenticity detection result.
[0272] Based on the target authenticity detection results, the target news item's corresponding target authenticity explanation text is determined.
[0273] In one embodiment, the third probability calculation formula satisfies the following formula:
[0274]
[0275] Where, p (ver) Let z represent the reference probability distribution vector, P(·) denotes finding the probability distribution. (ver) Let θ represent the latent variable, x represent the target semantic relation vector, and θ represent the latent variable. (ver) Let represent the learnable parameters in MLP(·), where MLP(·) represents a multilayer perceptron, and softmax(·) represents the normalization function. p (ver) Dimensions.
[0276] In one embodiment, before executing the calculation based on the target semantic relationship vector using the third probability formula to obtain the reference probability distribution vector corresponding to the target news, the processor 110 also performs the following operations:
[0277] Obtain sample news, the first real news explanation text and the second fake news explanation text corresponding to the sample news, and perform text concatenation processing based on the sample news, the first real news explanation text and the second fake news explanation text to obtain the sample semantic relationship vector between the sample news, the first real news explanation text and the second fake news explanation text.
[0278] The third loss function is calculated using the third loss formula based on the sample semantic relationship vector, and the preset learnable parameters in the multilayer perceptron are optimized based on the third loss function.
[0279] The third loss calculation formula satisfies the following formula:
[0280]
[0281] in, This represents the third loss function. This indicates the number of all sample reports corresponding to the sample news. This represents the prediction probability when the predicted label is the same as the true label. y represents the predicted label, and y represents the true label.
[0282] In one embodiment, the detection calculation formula satisfies the following formula:
[0283] y * =argmaxp (ver)
[0284] Where, p (ver) Let argmax represent the reference probability distribution vector, and let p be the vector used to find the probability distribution. (ver) The function y is the label with the highest probability. * This indicates the result of the target's authenticity detection.
[0285] In one embodiment, when the processor 110 performs the step of determining the target truth or falsehood explanation text corresponding to the target news based on the target truth or falsehood detection result, it specifically performs the following operations:
[0286] If the target's authenticity detection result is real news, then the explanation text of the real news will be used as the target's authenticity explanation text corresponding to the target news;
[0287] If the target's authenticity detection result is fake news, then the fake news explanation text will be used as the target's authenticity explanation text corresponding to the target news;
[0288] If the target's authenticity detection result is partially true and partially false, then the true news explanation text and the false news explanation text will be used as the target's authenticity explanation text corresponding to the target news.
[0289] This application also provides a computer-readable storage medium storing at least one instruction that is executed by a processor to implement the fake news detection method as described in the above embodiments.
[0290] This application also provides a computer program product that stores at least one instruction, which is loaded and executed by the processor to implement the fake news detection method described in the above embodiments.
[0291] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0292] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for detecting fake news, characterized in that, The method includes: The process involves: acquiring a target news article and at least one corresponding reporting sentence; determining a news vector corresponding to the target news article and sentence vectors corresponding to each reporting sentence; concatenating the news vector and sentence vectors to obtain a semantic relationship vector between the target news article and the reporting sentences; performing probability calculations based on the semantic relationship vector to obtain a probability distribution vector for the reporting sentences; and determining a first score and a second score for the reporting sentences based on the probability distribution vector. The first score is the score indicating that the reporting sentence supports the target news article as real news, and the second score is the score indicating that the reporting sentence supports the target news article as fake news. The step of calculating the probability based on the semantic relationship vector to obtain the probability distribution vector for the reported sentence includes: Based on the semantic relationship vector, the probability distribution vector for the reported sentence is calculated using the first probability calculation formula. The first probability calculation formula satisfies the following formula: in, Represents the probability distribution vector. P (·) indicates finding the probability distribution. Represents latent variables. This represents the semantic relation vector. The parameters to be learned in MLP(·) represent the multilayer perceptron. (·) denotes the normalization function. express The dimension; Based on the first score, the reported sentences are sorted to obtain a first set of evidence corresponding to the target news; based on the second score, the reported sentences are sorted to obtain a second set of evidence corresponding to the target news. Based on the target news, the first set of evidence, and the second set of evidence, a news interpretation generation model is used to generate real news interpretation text and fake news interpretation text corresponding to the target news. Based on the target news, the explanation text of the real news, and the explanation text of the fake news, text concatenation processing is performed to obtain the target semantic relationship vector among the target news, the explanation text of the real news, and the explanation text of the fake news; Based on the target semantic relationship vector, a third probability calculation formula is used to calculate and obtain the reference probability distribution vector corresponding to the target news. Based on the reference probability distribution vector, a detection calculation formula is used to calculate the target news's authenticity detection result. Based on the target authenticity detection results, the target news item's corresponding target authenticity explanation text is determined.
2. The method according to claim 1, characterized in that, Before performing probability calculation based on the semantic relation vector to obtain the probability distribution vector for the reported sentence, the method further includes: Obtain the sample probability distribution vector corresponding to the sample news, which is calculated based on the sample report sentence corresponding to the sample news. The first loss function is determined by relative entropy based on the sample probability distribution vector, and the second loss function is determined by a three-class classifier based on the sample probability distribution vector. The target loss function is calculated based on the first loss function and the second loss function, and the target learnable parameters in the multilayer perceptron are optimized based on the target loss function.
3. The method according to claim 2, characterized in that, The determination of the first loss function based on the sample probability distribution vector using relative entropy includes: The reference probability distribution vector is determined based on a preset vector formula; The first loss function is obtained by calculating the relative entropy based on the sample probability distribution vector and the reference probability distribution vector. The preset vector expression is the following formula: in, Represents the reference probability distribution vector; The formula for calculating relative entropy satisfies the following equation: in, Let KL(·) represent the first loss function, and KL(·) represent the relative entropy. This represents the probability distribution vector of the sample.
4. The method according to claim 2, characterized in that, The step of determining the second loss function using a three-class classifier based on the sample probability distribution vector includes: The predicted sample probability distribution vector is obtained by using the second probability calculation formula based on the sample probability distribution vector. Based on the predicted sample probability distribution vector, the second loss function is obtained by calculating the first loss formula. The second probability calculation formula satisfies the following formula: in, This represents the probability distribution vector of the predicted sample. P (·) indicates finding the probability distribution. Represents latent variables. This represents the sample news vector corresponding to the sample news. Represents the sample probability distribution vector. The parameters to be learned in MLP(·) represent the multilayer perceptron. (·) denotes the normalization function. express The dimension; The first loss calculation formula satisfies the following formula: in, This represents the second loss function. This represents all sample reports corresponding to the sample news. Quantity, This represents the prediction probability when the predicted label and the temporary label are the same. Indicates the predicted label, This indicates a temporary tag.
5. The method according to claim 2, characterized in that, The step of calculating the target loss function based on the first loss function and the second loss function includes: The target loss function is obtained by calculating using the second loss formula based on the first loss function and the second loss function; The second loss calculation formula satisfies the following formula: in, Represents the target loss function. This represents the second loss function. Denotes the first loss function. Indicates the weights of the second loss function. This represents the weight of the first loss function.
6. The method according to claim 1, characterized in that, The step of generating a news interpretation generation model based on the target news, the first set of evidence, and the second set of evidence to produce real news interpretation text and fake news interpretation text corresponding to the target news includes: Based on the target news, the first set of evidence, and the first tag corresponding to the first set of evidence, a first prompt word is generated, and the first prompt word is input into the news explanation generation model to obtain the real explanation text corresponding to the target news. Based on the target news, the second set of evidence, and the second tag corresponding to the second set of evidence, a second prompt word is generated. The second prompt word is then input into the news explanation generation model to obtain the fake news explanation text corresponding to the target news.
7. The method according to claim 1, characterized in that, The third probability calculation formula satisfies the following formula: in, Represents the reference probability distribution vector. P (·) indicates finding the probability distribution. Represents latent variables. This represents the target semantic relation vector. The parameters to be learned in MLP(·) represent the multilayer perceptron. (·) denotes the normalization function. express Dimensions.
8. The method according to claim 1, characterized in that, Before calculating the reference probability distribution vector corresponding to the target news using the third probability calculation formula based on the target semantic relationship vector, the method further includes: Obtain sample news, the first real news explanation text and the second fake news explanation text corresponding to the sample news, and perform text concatenation processing based on the sample news, the first real news explanation text and the second fake news explanation text to obtain the sample semantic relationship vector between the sample news, the first real news explanation text and the second fake news explanation text. The third loss function is calculated using the third loss formula based on the sample semantic relationship vector, and the preset learnable parameters in the multilayer perceptron are optimized based on the third loss function. The third loss calculation formula satisfies the following formula: in, This represents the third loss function. This indicates the number of all sample reports corresponding to the sample news. This represents the prediction probability when the predicted label is the same as the true label. y represents the predicted label, and y represents the true label.
9. The method according to claim 1, characterized in that, The detection calculation formula satisfies the following formula: in, Represents the reference probability distribution vector. Indicates used to find The function that identifies the label with the highest probability. This indicates the result of the target's authenticity detection.
10. The method according to claim 1, characterized in that, The step of determining the target news's authenticity explanation text based on the target authenticity detection result includes: If the target's authenticity detection result is real news, then the explanation text of the real news will be used as the target's authenticity explanation text corresponding to the target news; If the target's authenticity detection result is fake news, then the fake news explanation text will be used as the target's authenticity explanation text corresponding to the target news; If the target's authenticity detection result is partially true and partially false, then the true news explanation text and the false news explanation text will be used as the target's authenticity explanation text corresponding to the target news.
11. A fake news detection device, characterized in that, The device includes: The scoring calculation module is used to obtain a target news article and at least one corresponding reporting sentence; determine the news vector corresponding to the target news article and the sentence vector corresponding to each reporting sentence; concatenate the news vector and the sentence vector to obtain a semantic relationship vector between the target news article and the reporting sentences; perform probability calculation based on the semantic relationship vector to obtain a probability distribution vector for the reporting sentences; and determine a first score and a second score for the reporting sentences based on the probability distribution vector; the first score is the score that the reporting sentence supports the target news article being true news, and the second score is the score that the reporting sentence supports the target news article being false news. The step of calculating the probability based on the semantic relationship vector to obtain the probability distribution vector for the reported sentence includes: Based on the semantic relationship vector, the probability distribution vector for the reported sentence is calculated using the first probability calculation formula. The first probability calculation formula satisfies the following formula: in, Represents the probability distribution vector. P (·) indicates finding the probability distribution. Represents latent variables. This represents the semantic relation vector. The parameters to be learned in MLP(·) represent the multilayer perceptron. (·) denotes the normalization function. express The dimension; The evidence filtering module is used to sort the reported sentences based on the first score to obtain a first set of evidence corresponding to the target news, and to sort the reported sentences based on the second score to obtain a second set of evidence corresponding to the target news; The explanation generation module is used to generate real news explanation text and fake news explanation text corresponding to the target news based on the target news, the first evidence set and the second evidence set using a news explanation generation model; The result detection module is used to perform text concatenation processing based on the target news, the explanation text of the real news, and the explanation text of the fake news to obtain a target semantic relationship vector among the target news, the explanation text of the real news, and the explanation text of the fake news; calculate the reference probability distribution vector corresponding to the target news using a third probability calculation formula based on the target semantic relationship vector; calculate the target authenticity detection result corresponding to the target news using a detection calculation formula based on the reference probability distribution vector; and determine the target authenticity explanation text corresponding to the target news based on the target authenticity detection result.
12. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions, which are adapted to be loaded by a processor and executed as method steps as claimed in any one of claims 1 to 10.
13. An electronic device, characterized in that, include: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed the method steps as claimed in any one of claims 1 to 10.