A multi-dimensional feature fusion controversy detection method and system based on an attention mechanism
By constructing a comment propagation network in social networks, extracting multi-dimensional features and performing weighted fusion, the problems of single feature dimensions and insufficient fusion mechanisms in existing technologies are solved, achieving high-precision identification and robust detection of controversial content.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-03-17
AI Technical Summary
Existing social network controversy detection technologies are mostly based on single-dimensional features, which makes it difficult to fully capture the complex characteristics of controversial topics, and lacks an effective feature weighting mechanism, affecting the accuracy and generalization ability of the detection model.
A multi-dimensional feature fusion method based on attention mechanism is adopted. By constructing a comment propagation network, user behavior, network structure and emotion propagation features are extracted and standardized. Then, a feature attention mechanism is used for weighted fusion to generate a fused feature vector. Finally, the LightGBM classification model is used to identify controversial content.
It improves the accuracy and robustness of controversial content detection and enhances the ability of social media platforms to monitor public opinion and issue risk warnings.
Smart Images

Figure CN121093290B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of social network data analysis and controversial content detection technology, and in particular relates to a multi-dimensional feature fusion controversy detection method and system based on attention mechanism. Background Technology
[0002] With the rapid development of social networks, users' interactions such as posting, commenting, and forwarding in public discussions and the dissemination of social hot topics not only transmit information content but also carry rich emotional inclinations and stances. The fusion and dissemination of multi-dimensional information has formed a complex network topology, exhibiting exponential diffusion and significant emotional polarization. Against this backdrop, social platforms urgently need to establish efficient mechanisms for identifying controversial content to achieve early warning, analysis of dissemination trends, and precise intervention, thereby improving content governance capabilities. Currently, existing controversy detection technologies are mostly based on single-dimensional features, such as relying solely on user behavior analysis or text sentiment analysis, making it difficult to comprehensively capture the complex characteristics involved in controversial topics. While some studies attempt to integrate multi-source features—for example, patent CN118887028A discloses a multimodal, multi-view dispute detection method and system that obtains multimodal features through video and text feature extraction and uses context graph learning to model the relationship between videos and comments, thereby capturing semantic and emotional inconsistencies to improve detection accuracy; another patent, CN118377817B, relates to a method for generating industrial data maps, capable of identifying and marking disputed or inconsistent parts during data processing—these existing methods still have significant limitations. Their feature dimensions are mainly limited to consistency checks at the video and text modal or data level, lacking in-depth modeling of user interaction patterns, the topology of comment propagation networks, and the evolution of emotions during propagation. Furthermore, these methods lack effective feature weighting mechanisms in the feature fusion stage, failing to adaptively differentiate the importance of different features for the dispute identification task, resulting in limited feature representation capabilities and consequently affecting the accuracy and generalization ability of the detection model.
[0003] Therefore, in the complex and dynamic propagation environment of social networks, how to fully integrate multi-dimensional features such as user behavior, network structure, and emotion propagation, and achieve adaptive weighting of features to improve the accuracy and robustness of controversial content identification, has become a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention proposes a multi-dimensional feature fusion dispute detection method and system based on an attention mechanism, thereby resolving the issues present in the prior art.
[0005] Firstly, to achieve the above objectives, this invention provides a multi-dimensional feature fusion dispute detection method based on an attention mechanism, comprising the following steps:
[0006] Load the dataset of posts and comments from social media platforms, and perform sentiment labeling on the comments;
[0007] Construct a comment propagation network with posts as root nodes and comments as child nodes, establishing connections based on comment IDs and parent comment IDs;
[0008] User behavior features, network structure features, and emotion propagation features are extracted from the comment propagation network.
[0009] The user behavior features, network structure features, and emotion propagation features are standardized and then weighted and fused using a feature attention mechanism to generate a fused feature vector.
[0010] The fused feature vectors are used to train a LightGBM classification model to identify controversial content.
[0011] Optionally, the process of loading the social media platform post and comment dataset and performing sentiment tagging on the comment content includes:
[0012] Web scraping technology was used to scrape post and comment data from social media platforms on multiple topics and store them in JSON format.
[0013] Load the post dataset and the comment dataset. The post dataset contains the post ID, post title, and post content fields, and the comment dataset contains the post ID, comment ID, parent comment ID, and comment content fields.
[0014] Nodes in the comment dataset whose comment content is marked for deletion are retained and marked as deleted.
[0015] Sentiment analysis tools were used to assign sentiment categories to comments, including negative, neutral, and positive, and the results were stored in a sentiment labeling file.
[0016] Optionally, the process of constructing the comment propagation network includes:
[0017] Read the post dataset, concatenate the post titles and post content, and use keyword matching methods to filter posts related to the target topic;
[0018] The graph uses the comment ID as the node, the post ID as the root node, and other fields of the comment record and the sentiment value as node attributes.
[0019] Establish edges based on comment ID and parent comment ID. For comments with empty parent comment IDs, connect them to the root node to form a complete comment propagation graph.
[0020] Optionally, the process of extracting user behavior features from the comment propagation network includes:
[0021] Traverse the edges in the comment propagation network, calculate the time difference between a comment and its parent comment or post, and obtain the shortest reply time and average reply time;
[0022] Calculate comment density, defined as the ratio of the total number of comments to the time span from the post's publication to the last comment;
[0023] Based on the shortest response time, average response time, and comment density, a user interaction intensity index is constructed, which represents the comment density per unit response time.
[0024] Optionally, the process of extracting network structure features from the comment propagation network includes:
[0025] Extract the number of nodes, maximum propagation depth, maximum propagation width, average degree, and proportion of real nodes in the comment propagation network;
[0026] Based on the number of nodes, maximum propagation depth, maximum propagation width, average degree, and proportion of real nodes, a structural dispute index is constructed. This index is calculated by multiplying the propagation depth, propagation width, average degree, and proportion of real nodes.
[0027] Optionally, the process of extracting emotion propagation features from the comment propagation network includes:
[0028] Traverse the nodes in the comment propagation network, obtain the direct neighbor nodes of each node, and calculate the average neighbor sentiment value of nodes of different sentiment categories.
[0029] Using the node's sentiment value as the independent variable and the neighbor's average sentiment value as the dependent variable, a linear regression model was fitted to obtain the slope of the sentiment propagation trend.
[0030] Calculate the weighted average neighbor sentiment value using the number of neighbors of nodes in different sentiment categories as the weight.
[0031] Multiplying the slope by the weighted average neighbor sentiment value yields the weighted sentiment propagation index.
[0032] Secondly, the present invention also provides a multi-dimensional feature fusion dispute detection system based on an attention mechanism, used to implement a multi-dimensional feature fusion dispute detection method based on an attention mechanism, the system comprising:
[0033] The data loading and preprocessing module is used to load social media platform posts and comment datasets and to perform sentiment tagging on the comment content;
[0034] The comment propagation network construction module is used to build a comment propagation network, with posts as the root node and comments as child nodes, and establishes connections based on comment ID and parent comment ID;
[0035] The feature extraction module is used to extract user behavior features, network structure features, and emotion propagation features from the comment propagation network;
[0036] The feature fusion module is used to standardize the user behavior features, network structure features, and emotion propagation features, and then use a feature attention mechanism to perform weighted fusion to generate a fused feature vector.
[0037] The dispute detection model training module is used to train the LightGBM classification model using the fused feature vectors to identify disputed content.
[0038] Thirdly, the present invention also provides a computer terminal device, comprising:
[0039] One or more processors;
[0040] A memory, coupled to the processor, for storing one or more programs;
[0041] When the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the attention-based multidimensional feature fusion dispute detection method in the first aspect described above.
[0042] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the steps of the multi-dimensional feature fusion dispute detection method based on the attention mechanism described in the first aspect above.
[0043] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the attention-based multidimensional feature fusion dispute detection method described in the first aspect.
[0044] Compared with the prior art, the present invention has the following advantages and technical effects:
[0045] This invention provides a multi-dimensional feature fusion-based controversy detection method and system based on an attention mechanism. By comprehensively integrating user behavior features, network structure features, and emotion propagation features, and introducing a feature attention mechanism to achieve adaptive weighting, this invention effectively improves the expressive power and discrimination accuracy of controversial content detection. This method overcomes the shortcomings of existing technologies, such as single feature dimensions and insufficient fusion mechanisms, enhancing the model's accuracy and robustness in identifying controversial content, and providing reliable technical support for social media platform public opinion monitoring and risk warning. Attached Figure Description
[0046] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0047] Figure 1 This is a flowchart of a method according to an embodiment of the present invention;
[0048] Figure 2 This is a feature importance map extracted from an embodiment of the present invention. Detailed Implementation
[0049] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0050] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0051] This invention proposes a comprehensive controversy detection method based on an attention mechanism that integrates user behavior features, network structure features, and emotion propagation features. By constructing a comment propagation network, it extracts user interaction behavior features, propagation network structure features, and emotion propagation features, maps multiple features to a unified dimension, and introduces a feature attention mechanism for weighted fusion to generate a highly expressive comprehensive feature vector. Finally, it uses a LightGBM-based classification model to achieve intelligent identification of controversial content, effectively improving the accuracy and robustness of social media controversy detection and providing reliable technical support for public opinion monitoring and risk warning.
[0052] This invention first loads and processes a dataset; then, it constructs a comment propagation network to characterize the interactions between users; subsequently, it extracts user behavior features, network structure features, and sentiment propagation features based on the constructed comment network; further, it introduces a feature attention mechanism to learn feature weights and fuse the above multi-dimensional features; finally, it uses the LightGBM model for training and prediction to construct a classification model for judging the degree of controversy of posts, achieving automatic identification of controversial topics. This invention not only effectively analyzes the relevant features of comment propagation networks but also provides reliable technical support for public opinion monitoring and risk warning.
[0053] Example 1
[0054] This embodiment provides a multi-dimensional feature fusion dispute detection method based on an attention mechanism, including:
[0055] Load the dataset of posts and comments from social media platforms, and perform sentiment labeling on the comments;
[0056] Construct a comment propagation network with posts as root nodes and comments as child nodes, establishing connections based on comment IDs and parent comment IDs;
[0057] User behavior features, network structure features, and emotion propagation features are extracted from the comment propagation network.
[0058] The user behavior features, network structure features, and emotion propagation features are standardized and then weighted and fused using a feature attention mechanism to generate a fused feature vector.
[0059] The fused feature vectors are used to train a LightGBM classification model to identify controversial content.
[0060] S1. Load the Reddit original text and comment datasets. The original text dataset contains fields such as "post ID", "post title", and "post content". The comment dataset contains fields such as "post ID", "user ID who posted the post", "post content", "post time", "topic", "comment ID", "comment user ID", "parent comment ID", "comment content", and "comment post time". Then, perform sentiment tagging and other processing on the "comment content".
[0061] S2. Construct a comment propagation network based on the processed data. This is used to characterize the interaction relationships between users for subsequent feature extraction.
[0062] S3, based on the established comment propagation network We extract user discussion interaction characteristics, including average response time, shortest response time, and comment density, and further construct a fusion secondary feature that reflects user participation intensity and discussion activity—the user interaction intensity index. ;
[0063] S4, based on the established comment propagation network The structural features of the network are extracted, including basic structural indicators such as the number of nodes, maximum propagation depth and width, average degree, and proportion of real nodes. Further, a secondary feature of fusion—the structural controversy index—is constructed. ;
[0064] S5, based on the established comment propagation network Based on this, the emotion propagation features of the network are extracted, including the average emotion polarity of the neighbors of different emotion nodes, and the weighted emotion propagation index, a secondary fusion feature calculated based on linear trends and weights. ;
[0065] S6. After extracting user behavior features, structural features, and emotion propagation features, this step introduces a feature attention mechanism to learn feature weights and fuse the above multi-dimensional features to capture the importance distribution of various features to the controversial identification task. Subsequently, based on the feature weighting results, the LightGBM model is used for training and prediction to build a classification model for judging the degree of controversy of posts, thereby realizing the automatic identification of controversial topics.
[0066] As one implementation method in this embodiment, the process of loading the social platform post and comment dataset and performing sentiment tagging on the comment content includes:
[0067] Web scraping technology was used to scrape post and comment data from social media platforms on multiple topics and store them in JSON format.
[0068] Load the post dataset and the comment dataset. The post dataset contains the post ID, post title, and post content fields, and the comment dataset contains the post ID, comment ID, parent comment ID, and comment content fields.
[0069] Nodes in the comment dataset whose comment content is marked for deletion are retained and marked as deleted.
[0070] Sentiment analysis tools were used to assign sentiment categories to comments, including negative, neutral, and positive, and the results were stored in a sentiment labeling file.
[0071] Furthermore, the steps for loading and processing the dataset described in step S1 are as follows:
[0072] S1.1: Using web crawling technology to crawl data from the Reddit platform, in order to avoid the influence of a single topic on the detection results, this invention selects multiple different types of topics and stores the original text and comment datasets of different topics in different files, which are saved in JSON format;
[0073] S1.2: Load the original Reddit dataset and comment dataset ,in Representing different topics, Each record contains fields such as "post ID", "post title", and "post content". Each record contains the fields "Post ID", "User ID who posted the post", "Post content", "Post posting time", "Topic", "Comment ID", "Comment User ID", "Parent Comment ID", "Comment content", and "Comment posting time".
[0074] S1.3: In If a comment has a field with the value "[deleted]" in the dataset, it means that the comment has been deleted. In order not to disrupt the connectivity of the comment network, the comment is inserted into the network and the node is marked as "deleted".
[0075] S1.4: Using a multilingual sentiment analysis toolkit The “comment content” in the dataset is assigned a sentiment category, where -1 is negative, 0 is neutral, and 1 is positive. The labeling results are stored in a sentiment labeling file.
[0076] As one implementation method in this embodiment, the process of constructing the comment propagation network includes:
[0077] Read the post dataset, concatenate the post titles and post content, and use keyword matching methods to filter posts related to the target topic;
[0078] The graph uses the comment ID as the node, the post ID as the root node, and other fields of the comment record and the sentiment value as node attributes.
[0079] Establish edges based on comment ID and parent comment ID. For comments with empty parent comment IDs, connect them to the root node to form a complete comment propagation graph.
[0080] Furthermore, the step of constructing the comment network propagation graph described in step S2 is as follows:
[0081] S2.1: To ensure that the crawled posts are relevant to the target topic, read... The dataset is processed by concatenating "post titles" and "post content," and a keyword matching method is used to filter out posts relevant to the target topic. If a match is found, the "post ID" is used to retrieve the relevant posts from the comment dataset. We retrieved all of their comments to provide foundational data support for subsequent network construction.
[0082] S2.2: Since "Comment ID" is the unique identifier of a comment, "Comment ID" is used as a graph node, the remaining fields of the comment record and "sentiment value" are used as node attributes, and "Post ID" is used as the root node;
[0083] S2.3: Determine an edge based on the "Comment ID" and "Parent Comment ID" of each comment record. For first-level comments, their "Parent Comment ID" field is empty, so connect them to the root node to form a complete comment propagation graph.
[0084] As one implementation method in this embodiment, the process of extracting user behavior features from the comment propagation network includes:
[0085] Traverse the edges in the comment propagation network, calculate the time difference between a comment and its parent comment or post, and obtain the shortest reply time and average reply time;
[0086] Calculate comment density, defined as the ratio of the total number of comments to the time span from the post's publication to the last comment;
[0087] Based on the shortest response time, average response time, and comment density, a user interaction intensity index is constructed, which represents the comment density per unit response time.
[0088] Furthermore, the steps for extracting user discussion interaction features in step S3 are as follows:
[0089] S3.1: Traversing the Network For all edges in the graph, calculate the time difference between the comment represented by each edge and its parent comment or post, and record all reply time differences in a list. Then, calculate the minimum and average values in the list, and use them as the shortest reply times. With average response time This is used to characterize user activity and the rate of change in discussion popularity. To further measure the frequency of user discussions within a unit of time, this invention introduces comment density. As a dynamic characteristic of network structure, it is defined as:
[0090]
[0091] in, This represents the total number of comments in the propagation network, excluding the source post node. This indicates the time span from when the post was published to the last comment.
[0092] S3.2: Based on the extracted primary features of user behavior, further construct secondary features that reflect the intensity of user participation and the activity level of discussion. The calculation formula is as follows:
[0093]
[0094] This indicates the comment density per unit of response time; a higher density indicates a higher frequency of interaction during the dissemination period.
[0095] As one implementation method in this embodiment, the process of extracting network structure features from the comment propagation network includes:
[0096] Extract the number of nodes, maximum propagation depth, maximum propagation width, average degree, and proportion of real nodes in the comment propagation network;
[0097] Based on the number of nodes, maximum propagation depth, maximum propagation width, average degree, and proportion of real nodes, a structural dispute index is constructed. This index is calculated by multiplying the propagation depth, propagation width, average degree, and proportion of real nodes.
[0098] Furthermore, in step S4, the network... The structural features are extracted using the following steps:
[0099] S4.1: This step extracts key structural features from the comment propagation network to characterize the hierarchical relationships and interaction intensity of user discussions, specifically including the number of nodes and the maximum propagation depth. The propagation width is calculated by finding the shortest path from the root node of the post to all other nodes and taking the maximum value among them. The average degree was obtained by counting the number of first-level comment nodes directly connected to the post node. The actual node ratio is calculated by dividing the sum of the in-degree and out-degree of all nodes by the number of nodes. It is calculated by dividing the number of nodes that were not deleted by the total number of nodes.
[0100] S4.2: Based on the extracted basic structural features, in order to further capture the controversial and polarized characteristics that may exist in the comment dissemination structure, a fusion-based secondary indicator structure, the controversy index, is constructed. The definition is as follows:
[0101]
[0102] The higher the value, the more complex the network structure, the denser the interaction, and the stronger the controversy.
[0103] As one implementation method in this embodiment, the process of extracting emotion propagation features from the comment propagation network includes:
[0104] Traverse the nodes in the comment propagation network, obtain the direct neighbor nodes of each node, and calculate the average neighbor sentiment value of nodes of different sentiment categories.
[0105] Using the node's sentiment value as the independent variable and the neighbor's average sentiment value as the dependent variable, a linear regression model was fitted to obtain the slope of the sentiment propagation trend.
[0106] Calculate the weighted average neighbor sentiment value using the number of neighbors of nodes in different sentiment categories as the weight.
[0107] Multiplying the slope by the weighted average neighbor sentiment value yields the weighted sentiment propagation index.
[0108] Furthermore, in step S5, the specific implementation steps for extracting emotion propagation features are as follows:
[0109] S5.1: Traversing the Propagation Network For each comment node, its direct neighbor nodes are obtained. The average emotional value of each node's neighbors is calculated based on the node's "emotion value" attribute. The nodes are then grouped and statistically analyzed according to their own emotional categories. Finally, the following three primary features are obtained: the average emotional value of the neighbors of nodes with emotional values of -1, 0, and 1.
[0110] S5.2: Based on obtaining the average emotion values of neighbors for nodes of different emotion categories, a weighted emotion propagation intensity index is further constructed. First, using the node emotion value (-1, 0, 1) as the independent variable and the average emotion value of neighbors as the dependent variable, a linear regression model is fitted to obtain the slope of the emotion propagation trend. Then, using the number of neighboring nodes for each of the three types of emotion nodes as weights, the average emotion values of the neighbors are weighted and summed to obtain the overall weighted average neighbor emotion value. Finally, the slope is multiplied by the weighted average to obtain a secondary indicator that comprehensively reflects the trend and consistency of emotional contagion. The formula is defined as follows:
[0111]
[0112] This index comprehensively measures the directionality and intensity of the spread of emotional polarization in the network.
[0113] In step S6, the specific implementation steps for fusing multi-dimensional features and training the controversy detection model are as follows:
[0114] S6.1: After constructing the initial feature vector from the extracted user behavior features, network structure features, and emotion propagation features, standardization is used to normalize the feature values of different dimensions. The standardization process calculates the mean and standard deviation of the training set for each dimension of features. The formula for calculating the standardized feature values is as follows:
[0115]
[0116] in, These are the original eigenvalues. This represents the mean of the feature in this dimension. The standard deviation of this dimension of features;
[0117] S6.2: Based on the extracted user behavior features, network structure features, and emotion propagation features, different types of feature vectors are constructed. Due to the different dimensions, a fully connected layer is used to linearly map the above feature vectors, converting them into a unified 8-dimensional embedding vector. The linear transformation formula of the fully connected layer is as follows:
[0118]
[0119] in The output vector is 8-dimensional. For the input vector, This is the weight matrix, which has 8 rows and the number of columns equal to the input vector. dimensionality It is an 8-dimensional bias vector;
[0120] S6.3: Convert the feature vectors of each class The formula for scoring the linear layer is as follows:
[0121]
[0122] in It is the scoring scalar for the corresponding feature. It is a scoring vector. It is the scoring bias vector. and It was obtained by training the attention mechanism using 60% of the sample data as the training set;
[0123] S6.4: The score obtained through the attention scoring function Input the Softmax function to calculate the attention weights for various features. The function is defined as follows:
[0124]
[0125] in, The number of feature vector types. For the first The score of the class feature is obtained through Various features are fused and used as input for downstream classification tasks;
[0126] S6.5: Using the fused and weighted feature vectors as input, a controversy detection model based on LightGBM is constructed. The input feature vectors are divided into training and test sets in a 6:4 ratio. The model training adopts an early stopping mechanism to monitor the binary log loss and AUC index on the validation set. The model hyperparameters are optimized through grid search. Finally, the model weights and training parameters that perform best on the test set are saved.
[0127] A second aspect of the present invention relates to a system for implementing a multi-dimensional feature fusion dispute detection method based on an attention mechanism, comprising:
[0128] The data loading and preprocessing module is used to load the original Reddit dataset, clean invalid data, and perform sentiment tagging on the comments.
[0129] The comment network propagation graph construction module is used to construct a propagation graph with the post ID as the root node based on the relationship between the comment ID and the parent comment ID in the comment dataset.
[0130] The user behavior feature extraction module is used to mine user participation behavior patterns in the constructed comment propagation network;
[0131] The comment network structure feature extraction module is used to extract key structural indicators that characterize the information diffusion pattern in the comment network;
[0132] The emotion propagation feature extraction module is used to mine the emotion contagion relationship between nodes in the comment network;
[0133] The module for training the controversy model using fused features is used to fuse user, structural, and sentiment propagation features. It dynamically learns the importance weights of various features using a feature attention mechanism. Based on the fused weighted feature vector, the LightGBM model is used for training and classification to complete the identification and prediction of the controversy of posts.
[0134] Further, see Figure 1 and Figure 2 The multi-dimensional feature fusion dispute detection method based on attention mechanism proposed in this embodiment can be widely applied in social network environments to extract features from the constructed comment network graph and then determine controversial posts based on the features. This embodiment uses a dataset from the Reddit platform for experimental verification. To avoid the influence of a single topic on the detection results, this invention selects multiple different types of topics. Among them, topics that are prone to controversy include "Gun," "War," and "Religion," while more moderate topics include "Scenery," "Shopping," and "Music." The "Gun" topic dataset contains approximately 80 posts and approximately 19,370 comments; the "War" topic dataset contains approximately 70 posts and approximately 17,560 comments; the "Religion" topic dataset contains approximately 120 posts and approximately 25,670 comments; the "Scenery" topic dataset contains approximately 70 posts and approximately 7,900 comments; the "Shopping" topic dataset contains approximately 110 posts and approximately 26,500 comments; and the "Music" topic dataset contains approximately 93 posts and approximately 13,300 comments. The specific implementation steps are as follows:
[0135] S1. Load the dataset and process it. The steps are as follows:
[0136] S1.1. Web scraping technology was used to scrape data from the Reddit platform, scraping multiple different types of topics. Among them, the topics that are prone to controversy are "Gun", "War", and "Religion", while the more moderate topics are "Scenery", "Shopping", and "Music". The original text and comment datasets of different topics were stored in different files and saved in JSON format.
[0137] S1.2: Load the original Reddit dataset and comment dataset ,in Representing different topics, Each record contains fields such as "post ID", "post title", and "post content". Each record contains the fields "Post ID", "User ID who posted the post", "Post content", "Post posting time", "Topic", "Comment ID", "Comment User ID", "Parent Comment ID", "Comment content", and "Comment posting time".
[0138] S1.3: In If a comment has a field with the value "[deleted]" in the dataset, it means that the comment has been deleted. In order not to disrupt the connectivity of the comment network, the comment is inserted into the network and the node is marked as "deleted".
[0139] S1.4: Using a multilingual sentiment analysis toolkit The “comment content” in the dataset is assigned a sentiment category, where -1 is negative, 0 is neutral, and 1 is positive. The labeling results are stored in a sentiment labeling file, thus completing S1.
[0140] S2, according to For each record in the dataset, use the "Comment ID" and "Parent Comment ID" fields to construct a comment network propagation graph. The steps are as follows:
[0141] S2.1, Read The dataset is processed by concatenating "post titles" and "post content," and a keyword matching method is used to filter out posts relevant to the target topic. If a match is found, the "post ID" is used to retrieve the relevant posts from the comment dataset. Get all of its comments in [the relevant section].
[0142] S2.2 Since "Comment ID" is the unique identifier of a comment, "Comment ID" is used as a graph node, the remaining fields of the comment record and "Mood Value" are used as node attributes, and "Post ID" is used as the root node;
[0143] S2.3. Determine an edge based on the "Comment ID" and "Parent Comment ID" of each comment record. For first-level comments, their "Parent Comment ID" field is empty, so connect them to the root node to form a complete comment propagation graph. Finally, the "Gun" topic forms 79 comment networks, the "War" topic forms 66 comment networks, the "Religion" topic forms 122 comment networks, the "Shopping" topic forms 111 comment networks, the "Scenery" topic forms 71 comment networks, and the "Music" topic forms 93 comment networks, for a total of 542 comment networks. Subsequently, extract the relevant features of each network to complete S2.
[0144] S3. Based on the established comment propagation network, extract user discussion interaction features. The steps are as follows:
[0145] S3.1 Based on node attributes, extract the user's shortest response time, average response time, average number of likes, and comment density. Partial data for each topic is shown in Table 1:
[0146] Table 1
[0147]
[0148] S3.2 The User Interaction Index (UII) values of the secondary feature of integration for each topic section are shown in Table 1.
[0149] S4. Based on the constructed comment propagation network, the network structure features are extracted. The steps are as follows:
[0150] S4.1, according to The number of nodes, average node degree, maximum depth, maximum width, and the proportion of real nodes were extracted as first-level features. Partial data for each topic is shown in Table 2.
[0151] Table 2
[0152]
[0153] S4.2 The SCI (Structure Controversy Index) values for the integrated secondary feature structure of each topic are shown in Table 2.
[0154] S5. Based on the constructed comment propagation network, extract the emotion propagation features. The steps are as follows:
[0155] S5.1 Based on the node's sentiment attribute, extract the average sentiment value of the neighbors of nodes with sentiment values of -1, 0, and 1 respectively. Partial data for each topic is shown in Table 3:
[0156] Table 3
[0157]
[0158] S5.2 The weighted sentiment propagation intensity index (ESI_weighted) values of the secondary features of the integration of each topic are shown in Table 3.
[0159] S6. The steps for fusing multi-dimensional features and training a controversial detection model are as follows:
[0160] S6.1. Due to the significant differences in numerical ranges among the extracted user behavior features, network structure features, and emotion propagation features (e.g., some feature values reach tens of thousands, while others are close to 0), to avoid the impact of feature scale differences on subsequent model training, this invention standardizes all feature values before feature fusion, mapping each feature value to a relatively uniform numerical range. Table 4 below shows the original feature values and the results after standardization:
[0161] Table 4
[0162]
[0163] S6.2. Since different types of feature vectors have different dimensions, a fully connected layer is used to linearly map the above feature vectors, converting them into a unified 8-dimensional embedding vector. Based on the normalization results in Table 4, the mapping results for different types of feature vectors are shown in Table 5 below:
[0164] Table 5
[0165]
[0166] S6.3. Input each type of feature vector from Table 5 into the linear layer to score its importance. The scores for the three types of features are -0.1304, -0.1774, and -0.0929, respectively.
[0167] S6.4. Convert the scores from the above steps into weights between 0 and 1 using Softmax. The weights for the three types of features are 0.3342, 0.3189, and 0.3470, respectively. Then, fuse the three types of feature vectors based on the obtained attention weights.
[0168] S6.5 After obtaining the fused 8-dimensional feature vector, it is used as input. The dataset is divided into training and test sets using hierarchical sampling, with the training set accounting for 60% and the test set accounting for 40%. For the binary classification controversy detection task, a classification model based on LightGBM is constructed. The model objective function is binary cross-entropy loss, and gradient boosting decision tree (GBDT) is used as the base learner. During training, 5-fold cross-validation and early stopping mechanisms are used to prevent overfitting. In the training phase, the loss is calculated using labeled samples through forward propagation, and the model parameters are updated through backpropagation. The iteration continues until the validation set loss converges. The final model is evaluated on the test set. Experimental results show that the accuracy of the method in this invention reaches 96.77% on the test set, which is significantly better than the baseline model that does not introduce secondary features and does not use feature attention mechanism (accuracy improvement of about 3.4%), proving the effectiveness of introducing multi-dimensional feature fusion of user behavior, network structure and emotion propagation and attention mechanism.
[0169] In detecting controversial topics on the Reddit platform, this embodiment effectively identifies the propagation characteristics of controversial posts and their potential for controversy by integrating user behavior features, network structure features, and sentiment propagation features, along with a feature attention mechanism and LightGBM classification. This method not only models the impact of user interaction and sentiment evolution on controversy but also automatically assigns weights to different feature categories through a feature attention mechanism, thereby highlighting features that contribute more to controversy identification. Compared to traditional detection methods that rely solely on text or single structural features, this invention fully utilizes multi-dimensional information fusion and dynamic feature modeling to achieve high-precision detection of controversial content, demonstrating good adaptability and potential for widespread application.
[0170] In summary, the working principle of this invention is as follows: This invention proposes a multi-dimensional feature fusion dispute detection method based on an attention mechanism. First, a directed propagation network is constructed based on the relationship between comments and replies on a social platform, and deleted or invalid user nodes are marked, and basic attributes such as the proportion of real nodes are calculated. Then, user behavior features, structural features, and emotional propagation features are extracted from this propagation network. On this basis, the three types of features are uniformly projected to a latent vector space of the same dimension through a fully connected mapping, and a feature attention mechanism is introduced to calculate the weight scores of user, structural, and emotional features to achieve adaptive fusion between features. Finally, using the fused multi-dimensional feature vector, a dispute detection model based on LightGBM is constructed to accurately determine the controversial nature of the propagated comment content, thereby improving the accuracy and robustness of the detection.
[0171] The innovation of this invention is as follows: This invention proposes a multi-dimensional feature fusion dispute detection method based on an attention mechanism. Addressing the problems of existing dispute detection methods that rely solely on single semantic or emotional features, lack propagation structure and user behavior modeling, and fail to adaptively fuse multi-dimensional features, this invention proposes a comprehensive and innovative solution. It extracts user behavior features, propagation structure features, and emotional propagation features from the constructed network as primary features, and further constructs secondary fusion features: a user interaction index, a structural dispute index, and a weighted emotional propagation intensity index, to comprehensively characterize the dynamic characteristics of the comment propagation network. Subsequently, a fully connected mapping is used to unify multiple features into a latent space of the same dimension, and a feature attention mechanism is introduced to adaptively weight and fuse user, structural, and emotional features to generate a dispute representation vector. Finally, the fused feature vector is input into a LightGBM-based dispute detection model to achieve high-precision identification of the dispute nature of social media content.
[0172] The main innovative points of this invention are summarized as follows:
[0173] (1) In view of the problem that existing methods have only one dimension for identifying controversy, this invention introduces user behavior features, propagation structure features and emotion propagation features to comprehensively depict the multi-level characteristics of the comment propagation network and achieve a more comprehensive model of controversy.
[0174] (2) In view of the problem that existing methods only extract isolated basic features and are difficult to capture deep propagation characteristics, this invention constructs a user interaction index that integrates indicators such as comment density and average response time, a structural controversy index that integrates indicators such as propagation depth, width and node average degree, and a weighted emotion propagation intensity index based on emotion polarity gradient, so as to realize the deep quantification of propagation polarization and controversy, and significantly improve the ability to capture controversy characteristics.
[0175] (3) In view of the problem that traditional methods simply splice features and ignore the differences in the contribution of different features to controversy, this invention maps all kinds of features to the same dimension of latent space through a fully connected layer, and uses an attention scoring network to calculate the weight scores of user, structure and emotion features, adaptively adjusts the contribution of each feature in controversy detection, and generates a fused representation vector, which significantly improves the model’s discrimination ability and generalization performance.
[0176] The advantages of this invention are: it can comprehensively integrate three types of features: user behavior, propagation structure, and emotional propagation, and adaptively adjust the weights of different features in the model through a feature attention mechanism, thereby effectively improving the ability to express and judge controversial content.
[0177] Example 2
[0178] In this embodiment, a computer terminal device is provided, including:
[0179] One or more processors;
[0180] A memory, coupled to the processor, for storing one or more programs;
[0181] When the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the above-described attention-based multidimensional feature fusion dispute detection method.
[0182] In this embodiment, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the above-described multi-dimensional feature fusion dispute detection method based on an attention mechanism.
[0183] In this embodiment, an electronic device is also provided, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to perform the steps of the above-described attention-based multidimensional feature fusion dispute detection method.
[0184] In this embodiment, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the above-described attention-based multidimensional feature fusion dispute detection method.
[0185] The aforementioned program can run on a processor or be stored in memory (or a computer-readable medium). Computer-readable media includes both permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random-access memory (SRAM), dynamic random-access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0186] These computer programs may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps for the functions specified in one or more boxes can be implemented by different modules for different steps.
[0187] This embodiment provides such a device or system. The system, referred to as an attention-based multidimensional feature fusion dispute detection system, includes:
[0188] The data loading and preprocessing module is used to load social media platform posts and comment datasets and to perform sentiment tagging on the comment content;
[0189] The comment propagation network construction module is used to build a comment propagation network, with posts as the root node and comments as child nodes, and establishes connections based on comment ID and parent comment ID;
[0190] The feature extraction module is used to extract user behavior features, network structure features, and emotion propagation features from the comment propagation network;
[0191] The feature fusion module is used to standardize the user behavior features, network structure features, and emotion propagation features, and then use a feature attention mechanism to perform weighted fusion to generate a fused feature vector.
[0192] The dispute detection model training module is used to train the LightGBM classification model using the fused feature vectors to identify disputed content.
[0193] As one implementation method in this embodiment, the data loading and preprocessing module includes:
[0194] The data crawling unit is used to crawl post and comment data from social platforms using web crawling technology and store them in JSON format;
[0195] The data loading unit is used to load the post dataset and the comment dataset. The post dataset contains the post ID, post title, and post content fields, while the comment dataset contains the post ID, comment ID, parent comment ID, and comment content fields.
[0196] The data cleaning unit is used to retain nodes in the comment dataset whose comment content is marked for deletion and mark them as deleted.
[0197] The sentiment tagging unit is used to assign sentiment categories to comment content using sentiment analysis tools. Sentiment categories include negative, neutral, and positive, and the tagging results are stored in the sentiment tagging file.
[0198] As one implementation method in this embodiment, the comment propagation network construction module includes:
[0199] The post filtering unit is used to read the post dataset, concatenate the post titles and post content, and use keyword matching methods to filter posts that are relevant to the target topic.
[0200] The node creation unit is used to use the comment ID as the graph node, the post ID as the root node, and other fields of the comment record and the sentiment value as node attributes;
[0201] The edge establishment unit is used to establish edges based on the comment ID and the parent comment ID. For comments with an empty parent comment ID, it connects the comment to the root node to form a complete comment propagation graph.
[0202] As one implementation method in this embodiment, the feature extraction module includes a user behavior feature extraction unit, used to extract user behavior features from the comment propagation network;
[0203] The user behavior feature extraction unit performs the following steps: traversing the edges in the comment propagation network, calculating the time difference between a comment and its parent comment or post, and obtaining the shortest reply time and the average reply time.
[0204] Calculate comment density, defined as the ratio of the total number of comments to the time span from the post's publication to the last comment;
[0205] A user interaction intensity index is constructed based on the shortest response time, average response time, and comment density.
[0206] As one implementation method in this embodiment, the feature extraction module includes a network structure feature extraction unit, used to extract network structure features from the comment propagation network;
[0207] The network structure feature extraction unit performs the following operations: extracting the number of nodes, maximum propagation depth, maximum propagation width, average degree, and proportion of real nodes in the comment propagation network;
[0208] Based on the number of nodes, maximum propagation depth, maximum propagation width, average degree, and proportion of real nodes, a structural dispute index is constructed.
[0209] As one implementation method in this embodiment, the feature extraction module includes an emotion propagation feature extraction unit, used to extract emotion propagation features from the comment propagation network;
[0210] The emotion propagation feature extraction unit performs the following steps: traversing the nodes in the comment propagation network, obtaining the direct neighbor nodes of each node, and calculating the average emotion value of the neighbors of nodes of different emotion categories.
[0211] Using the node's sentiment value as the independent variable and the neighbor's average sentiment value as the dependent variable, a linear regression model was fitted to obtain the slope of the sentiment propagation trend.
[0212] Calculate the weighted average neighbor sentiment value using the number of neighbors of nodes in different sentiment categories as the weight.
[0213] Multiplying the slope by the weighted average neighbor sentiment value yields the weighted sentiment propagation index.
[0214] The system or apparatus is used to implement the functions of the methods in the above embodiments. Each module in the system or apparatus corresponds to each step in the method, as has been described in the method and will not be repeated here.
[0215] The above implementation method solves the problem of multi-dimensional feature fusion dispute detection based on attention mechanism in related technologies, thereby ensuring that the problems existing in the prior art are resolved.
[0216] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An attention mechanism-based multi-dimensional feature fusion controversy detection method, characterized in that, The method comprises the following steps: loading a social platform post and comment dataset and marking the comment content with emotions; building a comment propagation network, taking posts as root nodes and comments as child nodes, and establishing a connection relationship according to comment IDs and parent comment IDs; extracting user behavior features, network structure features and emotion propagation features from the comment propagation network; the process of extracting user behavior features from the comment propagation network comprises: traversing edges in the comment propagation network, calculating the time difference between comments and upper-level comments or posts, and recording all reply time differences as a list to obtain the shortest reply time and the average reply time; calculating the comment density, defined as the ratio of the total number of comments to the time span from the post publication to the last comment; based on the shortest reply time, the average reply time and the comment density, constructing a user interaction intensity index, which represents the comment density under unit reply time; the process of extracting network structure features from the comment propagation network comprises: extracting the number of nodes, the maximum propagation depth, the maximum propagation width, the average degree and the proportion of real nodes of the comment propagation network; based on the number of nodes, the maximum propagation depth, the maximum propagation width, the average degree and the proportion of real nodes, constructing a structure controversy index, which is calculated by the product of the propagation depth, the propagation width, the average degree and the proportion of real nodes; the process of constructing the structure controversy index comprises: wherein, is the maximum propagation depth, is the propagation width, is the average degree, is the real node ratio; the process of extracting emotion propagation features from the comment propagation network comprises: traversing the nodes in the comment propagation network, obtaining the direct neighbor nodes of each node, and calculating the neighbor average emotion value of nodes of different emotion categories; taking the node emotion value as the independent variable and the neighbor average emotion value as the dependent variable, fitting a linear regression model to obtain the slope of the emotion propagation trend; taking the number of neighbors of nodes of different emotion categories as the weight, calculating the weighted average neighbor emotion value; multiplying the slope and the weighted average neighbor emotion value to obtain a weighted emotion propagation index; wherein, is the slope of the trend of the emotion propagation, is the weighted average neighbor emotion value; standardizing the user behavior features, network structure features and emotion propagation features, and using a feature attention mechanism for weighted fusion to generate a fusion feature vector; based on the user behavior features, network structure features and emotion propagation features, constructing different types of feature vectors, and using a fully connected layer to linearly map the three types of feature vectors to unified 8-dimensional embedding vectors; for each type of feature vector after unifying the dimensions, calculating a score value through a linear layer; inputting the score value obtained through the attention scoring function into a Softmax function to calculate the attention weight of each type of feature, and the function is defined as follows: wherein, is the number of feature vector categories, is the score value of the category feature, is the attention weight; fusing the feature vectors of each type according to the attention weight as the input of the downstream classification task; training a LightGBM classification model using the fusion feature vector to realize the identification of controversial content.
2. The method of claim 1, wherein, The process of loading the social platform post and comment dataset and marking the comment content with emotions comprises: using a crawler to crawl post data and comment data of multiple topics from a social platform and storing them in JSON format; loading a post dataset and a comment dataset, where the post dataset includes post ID, post title and post content fields, and the comment dataset includes post ID, comment ID, parent comment ID and comment content fields; retaining and marking as deleted nodes in the comment dataset whose comment content is a deletion mark; assigning an emotion category to the comment content using a sentiment analysis tool, the emotion category including negative, neutral and positive, and storing the tagging result in an emotion annotation file.
3. The method of claim 1, wherein, The process of constructing a comment propagation network includes: reading the post dataset, concatenating the post title and the post content, and using a keyword matching method to filter posts related to the target topic; using the comment ID as a graph node, the post ID as the root node, and other fields of the comment record and the emotion value as node attributes; establishing an edge according to the comment ID and the parent comment ID, and connecting the root node for comments with an empty parent comment ID to form a complete comment propagation graph.
4. An attention mechanism-based multi-dimensional feature fusion controversy detection system, characterized in that, The system for implementing the method of any one of claims 1-3 includes: a data loading and preprocessing module for loading social platform post and comment datasets and performing emotion tagging on comment content; a comment propagation network construction module for constructing a comment propagation network with posts as root nodes and comments as child nodes, and establishing a connection relationship according to the comment ID and the parent comment ID; a feature extraction module for extracting user behavior features, network structure features and emotion propagation features from the comment propagation network; a feature fusion module for standardizing the user behavior features, network structure features and emotion propagation features, and using a feature attention mechanism for weighted fusion to generate a fusion feature vector; a controversy detection model training module for training a LightGBM classification model using the fusion feature vector to achieve identification of controversial content.
5. A computer terminal device, characterized by comprises: one or more processors; a memory coupled to the processors therefor storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the method of any one of claims 1-3.
6. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-3.
7. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-3. The computer program is executed by the processor to implement the steps of the method of any one of claims 1-3.
Citation Information
Patent Citations
A method and system for intelligently generating industrial data graphs
CN118377817B
Multi-modal multi-view dispute detection method and system
CN118887028A
Online social media news dispute detection method based on comment tree
CN114625944A
Social network rumor detection method based on emotion perception and graph convolutional network
CN116431760A