A cross-topic rumor detection method based on time-aware attention mechanism

By introducing a time-aware attention mechanism and a topic enhancement mechanism, a cross-topic rumor detection method is proposed, which solves the problem of poor generalization ability of rumor detection models in topic migration scenarios. It achieves efficient identification and early response to the rumor propagation process and is applicable to social network content moderation and network security.

CN120725025BActive Publication Date: 2025-11-04JIANGXI POLICE COLLEGE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511215384.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-11-04
Estimated Expiration
2045-08-28

AI Technical Summary

Technical Problem

Existing rumor detection models have poor generalization ability in topic shifting scenarios and fail to make full use of time-evolving information, resulting in a decline in detection performance.

Method used

We employ a cross-topic rumor detection method based on a time-aware attention mechanism. By combining topic-enhanced attention and time-aware attention mechanisms with topic tags and timestamps, we construct a cross-topic comparative learning task to improve the model's sensitivity to dynamic time features and its cross-topic adaptability.

Benefits of technology

It improves the model's robustness in multi-topic environments, enhances its ability to capture the temporal evolution of rumor propagation, enables early identification and rapid response, and is applicable to diverse social media platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120725025B_ABST
    Figure CN120725025B_ABST
Patent Text Reader

Abstract

The application belongs to the field of artificial intelligence and natural language processing, and discloses a rumor detection method across topics based on a time-aware attention mechanism, which comprises the following steps: constructing input samples containing text, timestamps and topic labels based on multi-source social media data, and using a pre-trained language model to perform semantic encoding on the text; introducing a topic-enhanced attention mechanism to capture the semantic differences of samples in different topics and improve the perception ability of topic structures; introducing a time-aware attention mechanism to dynamically adjust the information weight by modeling the time interval of the samples and enhance the robustness of the time sequence characteristics; using topic labels to divide positive and negative sample pairs, and guiding the model to learn topic-independent discriminative representations through a contrast loss function; and performing rumor judgment on the features fused with multi-dimensional information. The method has good cross-topic transferability and time-sensitive modeling capability, and can significantly improve the detection performance in unknown topics and the early stage of transmission.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence and natural language processing, in particular to a cross-topic rumor detection method based on a time-aware attention mechanism, which is suitable for social network content review, public opinion monitoring and network security and other application scenarios. BACKGROUND

[0002] Traditional rumor detection methods mainly rely on language features, propagation structures or single-topic data training of text. These methods usually assume that the training data and the test data come from the same topic distribution, ignoring the significant differences in user behavior, language style and information propagation patterns between different topics. This leads to poor generalization ability of the model when facing new topics or cross-domain applications due to topic distribution shift, resulting in a significant decline in detection performance.

[0003] In addition, the information propagation process is essentially dynamic evolution, and in the life cycle of rumors (such as incubation period, outbreak period, and decline period), the spread speed, influence and content features change over time. Most existing methods fail to fully exploit the important role of time series features and time sensitivity in rumor detection, for example, the length of the time interval between posts often contains important propagation pattern information. This neglect of time dynamics limits the model's ability to identify rumors early and respond quickly.

[0004] In the face of massive and diverse social media data, how to effectively combine text semantics, propagation structure and time evolution features while improving the model's adaptability and robustness in multi-topic and multi-scenario applications has become a key technical problem that needs to be solved in the field of rumor detection. Therefore, developing a rumor detection technology that can integrate time-aware attention mechanisms and have cross-topic generalization ability has important theoretical value and wide application prospects. SUMMARY

[0005] Therefore, the present application aims to solve the problem of poor generalization ability of existing rumor detection models in topic migration scenarios and insufficient use of time evolution information, thereby providing a cross-topic rumor detection method based on a time-aware attention mechanism.

[0006] In a first aspect, the present application provides a cross-topic rumor detection method based on a time-aware attention mechanism, comprising the following steps:

[0007] S1, input data construction and preprocessing: obtaining data samples containing text content, timestamps and topic labels, and performing semantic encoding on the text content to obtain context embedding representation;

[0008] S2, topic semantic encoding: a topic-enhanced attention mechanism is introduced, the context embedding representation is processed based on the topic label to capture the semantic difference of the text under different topics, and a topic-aware semantic representation is formed;

[0009] S3, time-aware attention modeling: a time-aware attention mechanism is introduced, the time distance between samples is calculated according to the timestamps of each data sample, and the information weight is dynamically adjusted based on the time distance to enhance the sensitivity of the model to the time sequence dynamic characteristics, and a time-aware weighted semantic representation is generated;

[0010] S4, cross-topic contrast learning optimization: a contrast learning task based on topic labels is constructed, positive and negative sample pairs are divided, and a contrast loss function is used to guide the model to learn a discriminative representation with topic-independent features;

[0011] S5, classification detection and rumor determination: the topic-aware semantic representation, the time-aware weighted semantic representation, and the discriminative representation are fused, and the fused features are input into a pre-set classifier to determine whether the data sample is a rumor.

[0012] As an optional implementation of the first aspect of the application, in the S1 step, the input data construction and preprocessing step further comprises: dividing the original input data set into a plurality of independent event topic sets, and sorting the text information in each topic set according to the timestamp order to construct an event-level time sequence; standardizing the text content, the standardization preprocessing including word segmentation, removing stop words and special characters; using a pre-trained language model to extract context embedding from the standardized text content, and performing pooling operation on the extracted word sequence to obtain sentence-level context embedding representation.

[0013] As an optional implementation of the first aspect of the application, in the S1 step, it further includes a time encoding step, specifically: using a time encoder to convert the timestamp information into a learnable time embedding vector, the time embedding vector being used to represent the position distribution characteristics of the data sample on the time axis; the context embedding representation and the time embedding vector are spliced and fused to form a joint representation of the sample, providing a time representation basis for the subsequent time-aware attention modeling.

[0014] As an optional implementation of the first aspect of the application, in the S2 step, the topic semantic encoding step further includes: dividing all text embedding representations in the training set into a preset number of topic clusters by using an unsupervised clustering algorithm, to obtain topic prototype vectors of each topic cluster; calculating the similarity of each data sample with all topic prototype vectors, and obtaining a topic distribution vector of the sample based on the similarity; weighting and fusing the topic prototype vectors according to the topic distribution vector to form a topic context vector of the sample; and fusing the context embedding representation and the topic context vector through a gating mechanism to generate a final topic-aware semantic representation.

[0015] As an optional implementation of the first aspect of the application, in the S3 step, the time-aware attention modeling step specifically includes: normalizing the timestamps of each data sample, and inputting the normalized timestamps into a time embedding layer to generate a time embedding vector; calculating the time interval between any two data samples, and encoding the time interval into a time weight factor by using a preset time decay function, the time decay function making the time weight factor smaller as the time interval is larger; fusing the time weight factor and the semantic attention weight calculated based on semantic similarity to form a time-aware attention score; and weighting and summing the semantic representations of other samples by using the time-aware attention score, thereby generating a time-aware weighted semantic representation of the current sample.

[0016] As an optional implementation of the first aspect of the application, in the S4 step, the cross-topic contrastive learning optimization step further includes: constructing any two samples with the same topic label as a positive sample pair; constructing any two samples with different topic labels as a negative sample pair; and training by using a contrastive loss function, to guide the model to learn discriminative feature representation insensitive to topic information by maximizing the cosine similarity between the positive sample pairs and minimizing the cosine similarity between the negative sample pairs in the representation space.

[0017] As an optional implementation of the first aspect of the application, in the S5 step, the classifier is a multilayer perceptron; and the training of the classifier uses a joint loss function, the joint loss function being composed of a classification loss and the contrastive loss function weighted and summed, the classification loss being a binary cross-entropy loss.

[0018] In a second aspect, the embodiments of the application provide an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and the program or instructions are executed by the processor to implement the steps of the method according to the first aspect.

[0019] In a third aspect, the embodiments of the present application provide a readable storage medium, and the readable storage medium stores programs or instructions, and the programs or instructions are executed by a processor to implement the steps of the method in the first aspect.

[0020] Compared with the prior art, the present application has the following beneficial effects:

[0021] 1. Improve cross-topic generalization ability: by introducing a contrast learning mechanism based on topic labels, the performance degradation problem of traditional rumor detection models in new topics or low-resource topics is effectively alleviated, and the model realizes robust adaptation and accurate judgment in a multi-topic environment.

[0022] 2. Enhance time dynamic perception: adopt time-aware attention mechanism, fully utilize time sequence information such as user forwarding time interval, dynamically adjust text representation weight, improve the sensitivity and capture ability of the model to the time evolution characteristics in the rumor propagation process.

[0023] 3. Realize multi-dimensional feature fusion: combine context semantic representation and time information, construct a rich multi-dimensional feature space, effectively fuse topic and time features, and realize more comprehensive and fine rumor discrimination ability.

[0024] 4. Improve early detection efficiency: the method has strong early rumor recognition ability, can make accurate judgment quickly in the early stage of rumor propagation, and reduce the negative impact of rumor spread.

[0025] 5. Good scalability and applicability: suitable for different social media platforms and diverse topic scenarios, meets the diverse needs of rumor detection in actual applications, has wide application prospect and promotion value. BRIEF DESCRIPTION OF DRAWINGS

[0026] Figure 1 is a flowchart of a cross-topic rumor detection method based on a time-aware attention mechanism according to an embodiment of the present application.

[0027] The following specific embodiments will further illustrate the present application in conjunction with the above drawings. DETAILED DESCRIPTION

[0028] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0029] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a particular order or chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means that the front and rear associated objects are in an "or" relationship. In the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise explicitly specified.

[0030] Embodiment 1

[0031] Please refer to Figure 1 A flow chart of a rumor detection method across topics based on a time-aware attention mechanism provided by an embodiment of the present application. The method can include the following steps:

[0032] S1, input data construction and preprocessing: obtaining data samples containing text content, timestamp and topic label, and performing semantic encoding on the text content to obtain context embedding representation;

[0033] This step aims to systematically construct and preprocess the input cross-topic social media data, laying a solid data foundation for subsequent rumor detection based on the time-aware attention mechanism. This step specifically includes data division, text preprocessing, time information standardization and time coding, etc.

[0034] Step 1.1: Data input and division. Import the cross-topic social media data set into the model, and the data samples contain text content , publication timestamp and corresponding topic label . According to the topic label, the data is divided into several independent event topic sets , where T is the total number of topics, and each topic set contains text samples belonging to the topic.

[0035] Step 1.2: Text content preprocessing. Standardize each text , including Tokenization, removing stop words and special characters (such as punctuation marks, emoticons). The processed text is input into a pre-trained language model (e.g. RoBERTa) to extract context semantic embedding representation, obtaining a text feature matrix:

[0036] (1)

[0037] where d represents the vector dimension of each token, and L represents the number of tokens (number of tokenization) in the text, denotes the vector representation of the jth token. The sequence is pooled (e.g., mean pooling) to obtain the sentence vector representation of the whole text:

[0038] (2)

[0039] Step 1.3: Timestamp standardization. The publication timestamps of texts in the same topic set are unified into a standard format (e.g., UTC time) and sorted from early to late according to the timestamps, forming an event-level time series:

[0040] (3)

[0041] wherein, denotes the jth text content.

[0042] Step 1.4: Time encoder construction. To convert time information into features that can be used for model learning, a time encoder is designed to map the timestamps into time density distribution embedding vectors , expressing the position distribution features of texts on the time axis:

[0043] (4)

[0044] wherein, k is the time embedding dimension, which can be constructed based on Gaussian kernel density estimation or a learnable parameterized function, capturing the distribution information of time points.

[0045] Step 1.5: Time feature fusion. Finally, the text semantic features are fused with the corresponding time embeddings to form the joint representation of the sample:

[0046] (5)

[0047] wherein, denotes the concatenation of vectors.

[0048] Step S1 achieves the construction of time-series semantic representation of cross-topic events through fine data division and preprocessing, context semantic extraction, and accurate time coding, providing accurate and rich input features for the subsequent time-aware attention mechanism, effectively improving the performance of the rumor detection model in complex cross-topic scenarios.

[0049] ​S2, topic semantic encoding: introduce topic-enhanced attention mechanism, process the context embedding representation based on the topic label to capture the semantic difference of text under different topics, and form a topic-aware semantic representation;

[0050] This step is one of the core modules in the implementation process of the application, which aims to enhance the discriminability of text semantic representation using topic information and improve the robustness of the model in cross-topic scenarios. This step mainly includes four key sub-processes: topic clustering, topic distribution modeling, topic-aware attention mechanism and cross-topic representation space construction, as follows:

[0051] Step 2.1: Topic clustering. Collect all text embeddings in the training set , use unsupervised clustering algorithms (such as K-Means, LDA or Nearest-Prototype Matching) to assign texts to K topic clusters, and get topic prototype vectors:

[0052] (6)

[0053] where represents the semantic representation of the topic.

[0054] Step 2.2: Topic distribution modeling. For each sample i, calculate the similarity distribution with all topic prototypes as the topic distribution vector of the sample:

[0055] (7)

[0056] where represents the probability that sample i belongs to topic k. represents the transpose of the text semantic feature vector of sample i.

[0057] Step 2.3: Topic-aware attention mechanism (Topic-Aware Semantic Attention, TASA). In order to make the text semantics more consistent with the topic context it is in, introduce a topic-enhanced semantic attention mechanism. Specifically, use the probability distribution of each text in each topic cluster to weight and fuse the topic prototype vectors to form the topic context vector of the sample:

[0058] (8)

[0059] Then design a topic-aware attention function to model the matching relationship between text embedding and topic context. Given the original text representation , the final topic-aware semantic representation is:

[0060] (9)

[0061] (10)

[0062] where, is the gating coefficient, controlling the fusion weight of the original semantics and topic semantics; denotes vector concatenation; denotes the Sigmoid activation function; and b are learnable parameters.

[0063] Step 2.4: Cross-topic representation space construction. After all the text passes through the above modules, it obtains its topic-aware representation , which is used as the input for subsequent models. Since the position of each sample in the topic space is a soft distribution representation (rather than a hard label), this module has strong cross-topic transferability. This mechanism supports the model to generate more discriminative representations in new topics, scarce topics, or topic drift scenarios, significantly improving the generalization ability and semantic robustness.

[0064] Step S2 constructs a semantic encoding method that dynamically adapts to topic context by fusing unsupervised topic modeling and attention mechanism, achieving "semantic-topic" dual enhancement. The topic-aware semantic representation generated by it provides a high-quality feature basis for subsequent time-aware modeling and comparative optimization of the model.

[0065] S3, Time-aware attention modeling: Introduce a time-aware attention mechanism, calculate the time distance between samples according to their timestamps, and dynamically adjust the information weight based on the time distance to enhance the model's sensitivity to time sequence dynamic features, generating time-aware weighted semantic representation;

[0066] This step aims to improve the model's ability to model temporal information between texts. By introducing a time-aware attention mechanism, it dynamically depicts the temporal relevance between samples and captures key temporal clues in the rumor propagation and evolution process. This step mainly includes four key sub-processes: timestamp preprocessing and regularization, time difference calculation and time decay function design, time-aware attention fusion mechanism, and weighted semantic representation generation, as follows:

[0067] Step 3.1: Timestamp regularization. Given a set of text samples , each sample has a corresponding timestamp representing its publication time. First, normalize all timestamps to facilitate subsequent modeling:

[0068] (11)

[0069] wherein denotes the normalized timestamp, denotes the minimum time value, denotes the maximum time value.

[0070] Next, the normalized timestamp is input into a time embedding layer to generate a time embedding vector:

[0071] (12)

[0072] wherein is a vector representing the position information of the sample on the time axis, with a dimension of .

[0073] Step 3.2: Time difference calculation and time decay function design. For any two samples and , calculate the time interval (absolute time difference):

[0074] (13)

[0075] Based on the time difference, design a time decay function to reduce the attention weight between samples with a large time span:

[0076] (14)

[0077] wherein is the time decay coefficient, controlling the time sensitivity. This function has a higher weight when the time difference is small, and quickly decays when the time difference increases.

[0078] Step 3.3: Time-aware attention fusion mechanism. Given the semantic representation vector of each sample (obtained from step S2) as , construct the basic attention weight (without time information):

[0079] (15)

[0080] wherein, is a learnable attention parameter; N is the number of samples; is the semantic attention weight of text i to text j.

[0081] Combine the time decay factor to construct the time-aware fusion attention score:

[0082] (16)

[0083] In this way, the constructed The dynamic attention weight distribution is realized by considering semantic similarity and time proximity.

[0084] Step 3.4: Weighted semantic representation generation. The time-aware attention weight is used to obtain the context weighted representation of the current sample :

[0085] (17)

[0086] The representation sufficiently integrates semantic similarity and time proximity structure, has stronger time series modeling capability, and helps to capture the key change points in the life cycle of rumors.

[0087] Through step S3, the model can use the time embedding and time decay mechanism to model the time sequence correlation between samples;

[0088] Dynamic focus on time-proximal context, suppress irrelevant historical information interference; capture the time dynamics in the propagation process, and improve the understanding ability of rumor evolution pattern. The time-aware semantic representation obtained finally will be an important input for the subsequent contrast learning and classification module, effectively improving the accuracy and robustness of rumor detection.

[0089] S4, cross-topic contrast learning optimization: construct a contrast learning task based on topic labels, divide positive and negative sample pairs, and use a contrast loss function to guide the model to learn discriminative representations with topic-independent features;

[0090] This step aims to improve the discriminative ability and generalization ability of the model in cross-topic scenarios. By constructing a contrast learning task based on topic labels, the model is guided to learn more robust and topic-independent representation features, thereby alleviating the performance degradation problem caused by topic drift or topic data imbalance. This step mainly includes three key sub-processes: positive and negative sample pair construction, contrast loss function design, and joint optimization strategy, as follows:

[0091] Step 4.1: Positive and negative sample pair construction. Let the training sample set be . Wherein, represents whether it is a rumor, represents its topic label, and the semantic representation of the topic is . The contrast learning sample pair is constructed as follows:

[0092] (1) Positive sample pair: any two samples , if , i.e., belong to the same topic, then it is recorded as a positive sample pair, and the distance between its representation is expected to be closer.

[0093] (2) Negative sample pair: any two samples , if If they belong to different topics, they are marked as negative sample pairs, and are expected to have a larger distance.

[0094] Let the set of all positive sample pairs be , and the set of negative sample pairs be .

[0095] Step 4.2: Contrastive loss function design. To train the model to capture topic- independent discriminative features, an improved contrastive loss function is used to encourage the model to compress the representation distance between positive sample pairs and expand the distance between negative sample pairs. The loss is defined as follows (with sample as the anchor point):

[0096] (18)

[0097] where is the cosine similarity; represents the time-semantic fusion representation vector of sample (Step 3); is the temperature coefficient (the lower the temperature, the more the model focuses on high similarity pairs); is the index set of samples that form positive sample pairs with sample ; is the index set of samples that form negative sample pairs with sample . The final contrastive learning loss is the sum of the losses of all sample pairs:

[0098] (19)

[0099] Step 4.3: Joint optimization strategy. To achieve unified optimization of classification accuracy and cross-topic robustness, a multi-task joint training method is used. The overall loss function is as follows:

[0100] (20)

[0101] where is the standard binary cross-entropy loss; is the contrastive learning loss described above; is the weight coefficient, used to balance the two task objectives.

[0102] This step strengthens the model's ability to extract topic-independent representations by introducing a topic-aware contrastive learning mechanism, with the following significant advantages: (1) improving the model's robustness in topic drift scenarios; (2) compensating for semantic drift caused by uneven distribution of training data; (3) significantly enhancing the model's generalization ability in low-resource topics or emerging events. Finally, the time-semantic contrastive optimization representation output by this module is input to the classification module, achieving more robust rumor detection performance.

[0103] S5, rumor determination: the topic-aware semantic representation, the time-aware weighted semantic representation, and the discriminative representation are fused, and the fused features are input into a preset classifier to determine whether the data sample is a rumor.

[0104] This step aims to input the fused time-aware and topic semantic text representation obtained in the previous stage into a classification model to complete accurate rumor recognition. This step uses a multi-layer perceptron (MLP) structure for binary classification determination, and considers the accuracy and robustness of the model through joint loss optimization. This step mainly includes four key sub-processes: feature fusion, classifier design, rumor determination strategy, and joint loss function training, as follows:

[0105] Step 5.1: Feature fusion. After steps S2 (topic semantic encoding) and S3 (time-aware attention modeling), each social media text sample obtains a fused representation vector:

[0106] (21)

[0107] wherein represents its topic semantic feature; represents its time-aware feature; represents vector concatenation operation.

[0108] Step 5.2: MLP classifier design. The fused representation is input into a multi-layer perceptron (MLP) classifier. The MLP structure is as follows:

[0109] (22)

[0110] (23)

[0111] wherein represents the output of the multi-layer perceptron (MLP), , , and are the weight matrix and bias of the model; is the activation function, ReLU is selected; represents the sample is the predicted probability of a rumor, represents the activation function. The output dimension is 1, indicating binary classification.

[0112] Step 5.3: rumor determination strategy. According to the predicted probability , set a confidence threshold , for binarizing the prediction results:

[0113] (24)

[0114] threshold It can be tuned by the validation set, and commonly set to 0.5, but in practice it can be adjusted according to the sensitivity of the task (such as emphasizing recall or precision).

[0115] Step 5.4: Joint loss function training. In order to enhance the generalization robustness of the model, the training process of the classification module introduces a joint loss function , which is composed of classification loss and contrast loss (as shown in formula (20) in step 4.3), where is the standard binary cross-entropy loss:

[0116] (25)

[0117] where N represents the total number of samples; represents the true label of sample ; represents the predicted probability of sample . Finally, the model outputs the predicted label and the corresponding probability of each sample .

[0118] Step S5 balances the accuracy and generalization ability by constructing input features that fuse semantic and time representations, using MLP to complete binary classification prediction, and optimizing through a joint loss function. This method is not only suitable for rumor detection under known topics, but also has strong new topic transfer ability and practical deployment feasibility.

[0119] Optionally, the embodiment of the present application further provides an electronic device, which comprises a processor, a memory, a program or instructions stored on the memory and executable on the processor, the program or instructions being executed by the processor to implement each process of the above-mentioned rumor detection method embodiment across topics based on a time-aware attention mechanism, and achieve the same technical effects. To avoid repetition, it will not be repeated here.

[0120] The embodiment of the present application further provides a readable storage medium, which stores a program or instructions, the program or instructions being executed by a processor to implement each process of the above-mentioned rumor detection method embodiment across topics based on a time-aware attention mechanism, and achieve the same technical effects. To avoid repetition, it will not be repeated here.

[0121] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0122] It should be noted that, in this document, the terms "comprises", "comprising", or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that includes the element. In addition, it should be noted that the scope of the methods and apparatus of the present embodiments are not limited by the order of the steps or the order of the functions performed in the steps, and can include performing the functions in different orders, or substantially simultaneously, or in reverse order, such as described, for example, the described methods can be performed in an order different from that described, and various steps can be added, omitted, or combined, in addition, features described with reference to certain examples can be combined in other examples.

[0123] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and the necessary general hardware platform, of course, they can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for making a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present application.

[0124] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above specific embodiments, which are merely illustrative and not limiting, and those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims.

Claims

1. A cross-topic rumor detection method based on a time-aware attention mechanism, characterized in that, Includes the following steps: S1. Input data construction and preprocessing: Obtain data samples containing text content, timestamps and topic tags, and perform semantic encoding on the text content to obtain a context embedding representation; S2. Topic Semantic Encoding: A topic-enhanced attention mechanism is introduced to process the context embedding representation based on the topic tags in order to capture the semantic differences of the text under different topics and form a topic-aware semantic representation. S3. Time-aware attention modeling: A time-aware attention mechanism is introduced to calculate the time distance between samples based on the timestamps of each data sample, and to dynamically adjust the information weights based on the time distance to enhance the model’s sensitivity to time-series dynamic features and generate a time-aware weighted semantic representation. S4. Cross-topic contrastive learning optimization: Construct a contrastive learning task based on topic tags, divide positive and negative sample pairs, and use the contrastive loss function to guide the model to learn discriminative representations with topic-independent features; S5. Classification and Rumor Determination: The topic-aware semantic representation, the time-aware weighted semantic representation, and the discriminative representation are fused together, and the fused features are input into a preset classifier to determine whether the data sample is a rumor.

2. The cross-topic rumor detection method based on a time-aware attention mechanism according to claim 1, characterized in that, In step S1, the input data construction and preprocessing step further includes: The original input dataset is divided into multiple independent event topic sets, and the text information in each topic set is sorted according to timestamp order to construct an event-level time series. The text content is subjected to standardization preprocessing, which includes word segmentation, removal of stop words and special characters; A pre-trained language model is used to extract context embeddings from the standardized preprocessed text content, and pooling is performed on the extracted word sequences to obtain context embedding representations at the sentence vector level.

3. The cross-topic rumor detection method based on a time-aware attention mechanism according to claim 1, characterized in that, The S1 step also includes a time encoding step, specifically: A time encoder is used to convert timestamp information into learnable time embedding vectors, which are used to represent the positional distribution features of the data samples on the time axis. The context embedding representation and the temporal embedding vector are concatenated and fused to form a joint representation of the sample, providing a temporal representation basis for the subsequent time-aware attention modeling.

4. The cross-topic rumor detection method based on a time-aware attention mechanism according to claim 1, characterized in that, In step S2, the topic semantic encoding step further includes: An unsupervised clustering algorithm is used to divide all text embeddings in the training set into a preset number of topic clusters to obtain the topic prototype vectors of each topic cluster. Calculate the similarity between each data sample and all topic prototype vectors, and obtain the topic distribution vector of the sample based on the similarity. The topic prototype vector is weighted and fused based on the topic distribution vector to form the topic context vector of the sample. The context embedding representation is fused with the topic context vector through a gating mechanism to generate the final topic-aware semantic representation.

5. The cross-topic rumor detection method based on a time-aware attention mechanism according to claim 1, characterized in that, In step S3, the time-aware attention modeling step specifically includes: The timestamps of each data sample are normalized, and the normalized timestamps are input into the time embedding layer to generate time embedding vectors; Calculate the time interval between any two data samples, and encode the time interval as a time weight factor using a preset time decay function, wherein the time decay function makes the time weight factor smaller as the time interval increases. The time weight factor is fused with the semantic attention weight calculated based on semantic similarity to form a time-aware attention score; The time-aware attention score is used to perform a weighted summation of the semantic representations of other samples to generate a time-aware weighted semantic representation of the current sample.

6. The cross-topic rumor detection method based on a time-aware attention mechanism according to claim 5, characterized in that, The time decay function is an exponential decay function, and its form is: in, Let λ be the time interval between sample i and sample j, and λ be an adjustable time decay coefficient used to control the model's sensitivity to time differences.

7. The cross-topic rumor detection method based on a time-aware attention mechanism according to claim 1, characterized in that, In step S4, the cross-topic contrastive learning optimization step further includes: Construct any two samples with the same topic tag into a positive sample pair; Construct any two samples with different topic tags into a negative sample pair; The model is trained using a contrastive loss function. By maximizing the cosine similarity between positive sample pairs and minimizing the cosine similarity between negative sample pairs in the representation space, the model is guided to learn discriminative feature representations that are insensitive to topic information.

8. The cross-topic rumor detection method based on a time-aware attention mechanism according to claim 1, characterized in that, In step S5, the classifier is a multilayer perceptron; and the classifier is trained using a joint loss function, which is a weighted sum of the classification loss and the contrastive loss function, wherein the classification loss is a binary cross-entropy loss.

9. An electronic device, characterized in that, The method includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the steps of a cross-topic rumor detection method based on a time-aware attention mechanism as described in any one of claims 1-8.

10. A readable storage medium, characterized in that, The program or instructions are stored on the readable storage medium, and when the program or instructions are executed by the processor, they implement the steps of the cross-topic rumor detection method based on a time-aware attention mechanism as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Rumor detection method based on attention mechanism and bidirectional GRU

    CN114238738A

  • A Multimodal Fusion Method and System for Early Detection of Rumors Based on Gating Mechanism

    CN114936266A