Text stance detection method and device based on user preference information enhancement
By constructing a user preference association graph and a graph convolutional neural network, combined with an attention mechanism, the problem of ignoring user preferences and global modeling in existing text stance detection methods is solved, achieving more accurate and reliable text stance detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA ELECTRONICS CYBERSPACE RESEARCH INSTITUTE CO LTD
- Filing Date
- 2024-12-31
- Publication Date
- 2026-06-30
AI Technical Summary
Existing text stance detection methods mainly rely on feature modeling of text content, ignoring user preferences and their importance to text expression style, resulting in poor detection accuracy. Furthermore, they lack the ability to globally model the relationships between texts, failing to effectively capture users' personalized information and the potential connections between multiple texts.
By constructing a user preference association graph, utilizing a graph convolutional neural network model, and combining attention mechanisms with graph convolutional neural networks, text feature vectors are extracted using pre-trained word vectors. Then, text representation vectors are generated using pre-trained word vectors, and text feature vectors are generated using pre-trained word vectors. Finally, text stance detection is performed by combining the user preference association graph and the adjacency matrix.
It achieves automated detection of textual stance, improves the model's global detection and generalization capabilities, enhances the accuracy and reliability of textual stance detection results, and can better capture the potential connections between user-personalized information and text.
Smart Images

Figure CN122309735A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method and apparatus for detecting textual stance based on enhanced user preference information. Background Technology
[0002] Stance detection aims to automatically determine the stance (e.g., support, opposition) of user opinion texts under a given target topic. With the development of the internet, more and more people are expressing their opinions and stances online regarding trending events, generating a large amount of valuable commentary on people and events. Mining the stance information from these texts is of great significance for intelligent recommendation, trending topic data analysis, and user demand prediction.
[0003] However, current text stance detection schemes primarily rely on feature extraction and neural networks for stance detection. These methods mostly focus only on the text itself, neglecting the characteristics of users within social media. Furthermore, existing technologies lack the ability to globally model the relationships between texts. Due to differences in language expression styles and preferences among different users, detection methods based solely on text features cannot effectively capture personalized user information, resulting in weak judgment of implicit stance expressions. Current text stance detection methods typically analyze individual text data, failing to fully explore the potential connections between different texts related to users. For example, multiple comments from the same user may reflect a consistent stance; neglecting these relationships limits the model's global detection capabilities. Summary of the Invention
[0004] In view of this, embodiments of this application provide a text stance detection method and apparatus based on user preference information enhancement, so as to eliminate or improve one or more defects existing in the prior art.
[0005] One aspect of this application provides a text stance detection method based on user preference information enhancement, including:
[0006] A text representation vector corresponding to the target text data is generated based on the text feature vector and the text enhancement feature vector corresponding to the target text data. The text enhancement feature vector is generated in advance based on the user attribute information of the target user who published the target text data and the target text data.
[0007] The text representation vector and the adjacency matrix corresponding to the preset user preference association graph are input into the text stance detection model so that the text stance detection model outputs the text stance detection result data corresponding to the target text data. The user preference association graph is used to represent the correspondence between users who publish each historical text data and preset user preference information.
[0008] In some embodiments of this application, before generating the text representation vector corresponding to the target text data based on the text feature vector and the text enhancement feature vector corresponding to the target text data, the method further includes:
[0009] The text word vectors corresponding to the target text data are extracted using pre-trained word vectors.
[0010] The text word vectors are input into a text encoder to obtain the text feature vectors corresponding to the target text data.
[0011] In some embodiments of this application, before generating the text representation vector corresponding to the target text data based on the text feature vector and the text enhancement feature vector corresponding to the target text data, the method further includes:
[0012] For the user attribute information corresponding to the target user who published the target text data, obtain the user vector representation corresponding to the user attribute information;
[0013] Based on the attention mechanism, the importance of the text word vectors corresponding to the target text data is adjusted according to the user vector representation to obtain the text enhancement feature vector corresponding to the target text data.
[0014] In some embodiments of this application, before extracting the text word vectors corresponding to the target text data using pre-trained word vectors, the method further includes:
[0015] Acquire historical text data published by each user within a preset time range, as well as user attribute information of each user within the preset time range;
[0016] Based on the historical text data published by each user and the preset user preference information, a user preference relationship graph is constructed; wherein, the user preference information includes: sharing users, participating users, lurking users, and influential users;
[0017] The user preference association graph includes user nodes and preference nodes. The user node represents a user's unique identifier and a historical text data published by the user. Different user nodes correspond to different historical text data. Each preference node represents the same user preference information. Different user nodes corresponding to the same user's unique identifier are connected, and each user node is connected to at least one preference node.
[0018] In some embodiments of this application, before extracting the text word vectors corresponding to the target text data using pre-trained word vectors, the method further includes:
[0019] Based on the user preference association graph, obtain the corresponding connection matrix between users and text, and the connection matrix between users, text and preference nodes.
[0020] Generate the adjacency matrix corresponding to the user preference association graph based on the connection matrix between the user and the text, and the connection matrix between the user, the text, and the preference node.
[0021] In some embodiments of this application, before extracting the text word vectors corresponding to the target text data using pre-trained word vectors, the method further includes:
[0022] Pre-trained word vectors are used to extract the text word vectors corresponding to each of the historical text data.
[0023] Input the text word vectors corresponding to each of the historical text data into the text encoder to obtain the text feature vectors corresponding to each of the historical text data respectively;
[0024] A user vector matrix is initialized and generated based on the user attribute information of each user within the preset time range, wherein the user vector matrix contains the user vector representation corresponding to each user.
[0025] Furthermore, based on the attention mechanism, the importance of the text word vectors corresponding to each of the historical text data is adjusted according to the user vector representations, so as to obtain the text enhancement feature vectors corresponding to each of the historical text data.
[0026] Based on the text feature vector and the text enhancement feature vector corresponding to each of the historical text data, a text representation vector corresponding to each of the historical text data is generated to form a corresponding feature matrix;
[0027] A text stance detection model is trained based on the labels corresponding to each of the pre-acquired historical text data, the feature matrix, and the adjacency matrix corresponding to the user preference association graph. This text stance detection model is used to output text stance detection result data corresponding to the text data based on the text data and the user preference association graph. The labels are used to identify the stance type of the corresponding historical text data, and the stance type includes: support, neutral, and opposition.
[0028] In some embodiments of this application, the text encoder includes a max pooling layer.
[0029] In some embodiments of this application, the text stance detection model includes: a multi-layer graph convolutional neural network connected in sequence.
[0030] Another aspect of this application provides a text stance detection device based on user preference information enhancement, comprising:
[0031] The text feature enhancement module is used to generate a text representation vector corresponding to the target text data based on the text feature vector corresponding to the target text data and the text enhancement feature vector. The text enhancement feature vector is generated in advance based on the user attribute information corresponding to the target user who published the target text data and the target text data.
[0032] The user preference enhancement stance detection module is used to input the text representation vector and the adjacency matrix corresponding to the preset user preference association graph into the text stance detection model, so that the text stance detection model outputs the text stance detection result data corresponding to the target text data. The user preference association graph is used to represent the correspondence between users who publish each historical text data and preset user preference information.
[0033] A third aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the aforementioned text stance detection method based on user preference information enhancement.
[0034] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the aforementioned text stance detection method based on user preference information enhancement.
[0035] A fifth aspect of this application provides a computer program product including a computer program that, when executed by a processor, implements the aforementioned text stance detection method based on user preference information enhancement.
[0036] The text stance detection method based on user preference information enhancement provided in this application generates a text representation vector corresponding to the target text data based on the text feature vector and the text enhancement feature vector. The text enhancement feature vector is pre-generated based on the user attribute information of the target user who published the target text data and the target text data itself. The text representation vector and the adjacency matrix corresponding to a preset user preference association graph are input into a text stance detection model, so that the text stance detection model outputs text stance detection result data corresponding to the target text data. The user preference association graph is used to represent the correspondence between users who published each historical text data and preset user preference information. This method enables automated detection of text stance, improves the global detection capability and generalization capability of the text stance detection model, and enhances the accuracy and reliability of the text stance detection results.
[0037] Additional advantages, objectives, and features of this application will be set forth in part in the description which follows, and will in part become apparent to those skilled in the art upon review of the following description, or may be learned by practice of the application. The objectives and other advantages of this application can be realized and obtained by means of the structures specifically pointed out in the specification and drawings.
[0038] Those skilled in the art will understand that the purposes and advantages that can be achieved with this application are not limited to those specifically described above, and that the above and other purposes that this application can achieve will be more clearly understood from the following detailed description. Attached Figure Description
[0039] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, do not constitute a limitation thereof. The components in the drawings are not drawn to scale but are merely for illustrating the principles of this application. For ease of illustration and description of certain parts of this application, corresponding portions in the drawings may be enlarged, i.e., may appear larger relative to other components in an exemplary device actually manufactured according to this application. In the drawings:
[0040] Figure 1 This is a schematic diagram of the first process of a text stance detection method based on user preference information enhancement in one embodiment of this application.
[0041] Figure 2 This is a schematic diagram of a second process of a text stance detection method based on user preference information enhancement in one embodiment of this application.
[0042] Figure 3 This is a schematic diagram of the third process of the text stance detection method based on user preference information enhancement in one embodiment of this application.
[0043] Figure 4 This is a schematic diagram of the fourth process of the text stance detection method based on user preference information enhancement in one embodiment of this application.
[0044] Figure 5 This is a schematic diagram illustrating the execution logic of the text stance detection method based on user preference information enhancement in an application example of this application.
[0045] Figure 6 This is a schematic diagram of the system architecture used to execute the text stance detection method based on user preference information enhancement in an application example of this application.
[0046] Figure 7 This is a schematic diagram of the structure of a text stance detection device based on user preference information enhancement in one embodiment of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and their descriptions are used to explain this application, but are not intended to limit it.
[0048] It should also be noted that, in order to avoid obscuring this application with unnecessary details, only the structures and / or processing steps closely related to the solution according to this application are shown in the accompanying drawings, while other details that are not closely related to this application are omitted.
[0049] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.
[0050] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.
[0051] In the following description, embodiments of the present application will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.
[0052] It's important to note that text stance detection methods based on feature extraction manually extract linguistic or structural features, such as sentiment and dependency syntax information, and then use traditional machine learning models to perform stance detection. This approach typically requires significant manual intervention and struggles to handle complex contexts. In contrast, neural network-based stance detection methods often use deep learning models to automatically extract features, such as using RNNs or Transformer models to model the target and text. While these methods offer some effectiveness, they largely focus only on the text itself, neglecting user-specific features and the global relationships between the text and the target.
[0053] However, the aforementioned methods primarily rely on feature modeling of text content for stance detection, neglecting the user preferences behind the text and their importance to the text's expression style. Since different users have different language expression styles and preferences, detection methods based solely on text features cannot effectively capture users' personalized information, resulting in weak judgment of implicit stance expressions. Furthermore, the above schemes lack the ability to globally model the relationships between texts. Current methods typically analyze individual texts, failing to fully explore the potential connections between different texts related to users. For example, multiple comments from the same user may reflect a consistent stance; failing to consider these relationships limits the model's global detection capability.
[0054] Based on this, in order to address the problems of poor accuracy in existing text stance detection methods due to ignoring user preferences behind the text and the lack of global detection capabilities in the detection model, this application provides a text stance detection method based on user preference information enhancement, a text stance detection device based on user preference information enhancement for executing the text stance detection method based on user preference information enhancement, a physical device, a computer-readable storage medium, and a computer program product. It can achieve significant breakthroughs in the deep fusion of user information and text features, global correlation modeling, and stance feature extraction, and can effectively make up for the shortcomings of existing technologies in terms of accuracy and practicality.
[0055] The following examples will provide a detailed description.
[0056] Based on this, embodiments of this application provide a text stance detection method based on user preference information enhancement, which can be implemented by a text stance detection device based on user preference information enhancement. See [link to relevant documentation]. Figure 1 The text stance detection method based on user preference information enhancement specifically includes the following:
[0057] Step 100: Generate a text representation vector corresponding to the target text data based on the text feature vector and the text enhancement feature vector corresponding to the target text data. The text enhancement feature vector is generated in advance based on the user attribute information of the target user who published the target text data and the target text data.
[0058] In step 100, the text stance detection device based on user preference information enhancement can generate a text representation vector Q corresponding to the target text data based on the text feature vector Qe and the text enhancement feature vector Qu corresponding to the target text data. The text enhancement feature vector Qu corresponding to the target text data is generated in advance by enhancing the text word vectors corresponding to the target text data based on the user attribute information of the target user who published the target text data.
[0059] In one or more embodiments of this application, the text stance detection refers to automatically determining the stance (such as support, neutrality, or opposition) of text data posted by a user on the Internet under a given target topic.
[0060] Step 200: Input the text representation vector and the adjacency matrix corresponding to the preset user preference association graph into the text stance detection model so that the text stance detection model outputs the text stance detection result data corresponding to the target text data. The user preference association graph is used to represent the correspondence between users who publish each historical text data and preset user preference information.
[0061] In step 200, the user preference information can be the analysis results that are pre-classified based on social behavior and preferences, used to describe the user's behavioral tendencies on the social platform, specifically divided into sharing users, participating users, lurking users, and influential users, etc.
[0062] Understandably, to further improve the reliability and generalization ability of the text stance detection model, the text stance detection model can employ a series of interconnected multi-layer graph convolutional neural networks. A graph convolutional neural network (GCN) is a multi-layer neural network that can operate directly on graph-structured data and derive node embedding vectors based on the node's neighborhood attributes.
[0063] As can be seen from the above description, the text stance detection method based on user preference information enhancement provided in this application can realize automated detection of text stance, improve the global detection capability and generalization capability of the text stance detection model, and improve the accuracy and reliability of text stance detection results.
[0064] To further improve the effectiveness and reliability of text feature vector applications, a text stance detection method based on user preference information enhancement is provided in this application embodiment, see [link to relevant documentation]. Figure 2 The text stance detection method based on user preference information enhancement includes the following steps prior to step 100:
[0065] Step 011: Extract the text word vectors corresponding to the target text data using pre-trained word vectors.
[0066] In one or more embodiments of this application, the pre-trained word vector refers to GloVe (Global Vectors for Word Representation). The pre-trained word vector is a distributed vector representation learned for each word in the vocabulary through a pre-training process using global contextual information, in order to capture the semantic and syntactic features of the words.
[0067] Step 012: Input the text word vectors into the text encoder to obtain the text feature vectors corresponding to the target text data.
[0068] In order to further improve the effectiveness and efficiency of text feature vector application, the text encoder may employ a max-pooling layer.
[0069] To further improve the effectiveness and reliability of text-enhanced feature vector applications, this application provides a text stance detection method based on user preference information enhancement, see [link to relevant documentation]. Figure 2 The text stance detection method based on user preference information enhancement includes the following steps prior to step 100:
[0070] Step 021: For the user attribute information corresponding to the target user who published the target text data, obtain the user vector representation corresponding to the user attribute information.
[0071] It is understood that the user attribute information may include information such as the user's gender, name, and occupation.
[0072] Step 022 (executed after step 011): Based on the attention mechanism, the importance of the text word vectors corresponding to the target text data is adjusted according to the user vector representation to obtain the text enhancement feature vector corresponding to the target text data.
[0073] Understandably, attention mechanisms are techniques that enhance a model's focus on important information, used to strengthen the weights of key features in text representations.
[0074] To further improve the effectiveness and reliability of user preference association graphs, this application provides a text stance detection method based on enhanced user preference information, see [link to relevant documentation]. Figure 3 The text stance detection method based on user preference information enhancement also includes the following content before step 011:
[0075] Step 001: Obtain historical text data published by each user within a preset time range, as well as user attribute information of each user within the preset time range.
[0076] Step 002: Construct a user preference association graph based on the historical text data published by each user and the preset user preference information; wherein, the user preference information includes: sharing users, participating users, lurking users and influential users.
[0077] The user preference association graph includes user nodes and preference nodes. The user node represents a user's unique identifier and a historical text data published by the user. Different user nodes correspond to different historical text data. Each preference node represents the same user preference information. Different user nodes corresponding to the same user's unique identifier are connected, and each user node is connected to at least one preference node.
[0078] It is understood that the user preference relationship graph can be written as a user-text-preference relationship graph, or simply a relationship graph. User connection refers to modeling the relationships between users as a graph structure to capture specific user stance patterns.
[0079] To further improve the effectiveness and reliability of the adjacency matrix corresponding to the user preference association graph, a text stance detection method based on user preference information enhancement is provided in this application embodiment. (See also...) Figure 3 The text stance detection method based on user preference information enhancement also includes the following content before step 011:
[0080] Step 003 (executed after step 002): Obtain the corresponding connection matrix between users and text, and the connection matrix between users, text and preference nodes, respectively, based on the user preference association graph.
[0081] Step 004: Generate the adjacency matrix corresponding to the user preference association graph based on the connection matrix between the user and the text and the connection matrix between the user, the text and the preference node.
[0082] It is understood that the user-text connection matrix can be written as a user-text connection matrix, where the rows and columns represent the node pairs corresponding to the user and the text, and the matrix values represent the connection relationships between different texts under the same user. The user, text, and preference node connection matrix can also be written as a user-text and preference node connection matrix. In this matrix, the rows represent the node pairs corresponding to the user and the text, and the columns represent preference nodes.
[0083] To further improve the effectiveness and reliability of text stance detection models, this application provides a text stance detection method based on user preference information enhancement, see [link to relevant documentation]. Figure 4 The text stance detection method based on user preference information enhancement also includes the following content before step 011:
[0084] Step 005: Use pre-trained word vectors to extract the text word vectors corresponding to each of the historical text data;
[0085] Step 006: Input the text word vectors corresponding to each of the historical text data into the text encoder to obtain the text feature vectors corresponding to each of the historical text data respectively;
[0086] Step 007: Initialize and generate a user vector matrix based on the user attribute information of each user within the preset time range, wherein the user vector matrix contains the user vector representation corresponding to each user;
[0087] Step 008 (executed after step 005): Based on the attention mechanism, the importance of the text word vectors corresponding to each of the historical text data is adjusted according to each of the user vector representations, so as to obtain the text enhancement feature vectors corresponding to each of the historical text data.
[0088] Step 009: Generate text representation vectors corresponding to each of the historical text data according to the text feature vectors and text enhancement feature vectors corresponding to each of the historical text data, so as to form corresponding feature matrices;
[0089] Step 010 (executed after step 004): Train a text stance detection model based on the labels corresponding to each of the pre-acquired historical text data, the feature matrix, and the adjacency matrix corresponding to the user preference association graph, so that the text stance detection model can be used to output the text stance detection result data corresponding to the text data according to the text data and the user preference association graph. The labels are used to identify the stance type of the corresponding historical text data, and the stance type includes: support, neutral, and opposition.
[0090] In summary, the text stance detection method based on enhanced user preference information provided in this application addresses existing problems through the following innovative design:
[0091] 1) Introduce a user information enhancement mechanism, which deeply integrates user features with text features through an attention mechanism, strengthens the model’s sensitivity to users’ personalized stance expressions, and thus improves the ability to judge implicit stances.
[0092] 2) Construct a user association graph network and use graph convolutional neural networks to model the relationships between texts from a global perspective. Fully explore the position features of multiple texts from the same user and the potential connections between user preferences, thereby improving the model's global detection capability.
[0093] 3) Combining attention mechanisms and graph convolutional neural networks, text features are used, and feature vectors of the text are constructed through the attention mechanism of the text and the users behind it. At the same time, a graph network structure is constructed through the user preference information behind different texts. Finally, based on the learned text features and user relationship graph, graph convolutional neural networks are used to classify the text and complete the stance detection.
[0094] To further illustrate the above embodiments, this application also provides a specific application example of a text stance detection method based on user preference information enhancement, the basic principle of which is as follows:
[0095] This application example enhances stance detection by combining user preference information and Graph Convolutional Neural Networks (GCNs) from both text content and user relationship perspectives. User data is sourced from Twitter's public API, including tweets, users, and trends, ensuring the legality and privacy compliance of data collection. First, in the text representation stage, a user information enhancement mechanism is introduced, utilizing an attention mechanism to deeply integrate user preference information with text features, thereby enhancing the model's ability to perceive implicit relationships between user characteristics and text stances. Specifically, based on user preference information and the semantic features of the text, the attention mechanism automatically adjusts the weights of different features in the final text representation, highlighting the role of personalized user features in stance prediction. In the user association modeling stage, a fully connected graph based on the relationships between users, text, and user preference information is constructed. By capturing potential connections between multiple texts from the same user, and simultaneously acquiring the user's corresponding preference information through a large model, stance features are extracted from a global perspective. During feature extraction, a multi-layer stacked Graph Convolutional Neural Network is used to extract high-order neighborhood features from the user relationship graph layer by layer, and a linear classifier is combined for final stance prediction. The model is designed to address the shortcomings of existing technologies from multiple levels by deeply fusing user preference information with text features, modeling global graph relationships, and optimizing attention mechanisms, thereby improving the accuracy and generalization ability of stance detection.
[0096] See Figure 5 An application example of the text stance detection method based on user preference information enhancement can be as follows: Figure 6 The execution system implementation shown uses user-authorized text data posted on the network and corresponding user attribute information (such as age, gender, residence, and occupation) from open-source internet datasets. For example, it can use data such as tweets, users, and trends from Twitter's public API. This is accomplished through the following steps:
[0097] 1) Text Feature Extraction Module: For input text data such as user comments and tweets, the module uses pre-trained word vectors GloVe to extract text word vectors from the text data. Then, it passes through a text encoder such as max-pooling to obtain a fixed-length text representation, and outputs the text feature vector Qe corresponding to the text data. At the same time, it initializes and generates a user vector matrix with user attribute information that is close to the time of publication of the text, and obtains the user vector representation corresponding to each text data to increase the correlation between user information encoding and text.
[0098] For example: Text data X = (x1, x2, ..., x...) n ), respectively belonging to users (s1, s2, ..., s n ), x1~x n Each represents a different piece of text data, s1 to x. n These represent different users, and for text data x j = (w1, w2, ..., w m ), w1~w m Let each word in the text data represent a word. Using pre-trained word vectors (Gloves), we obtain the word vector for each word in the text, thus forming the corresponding text word vector for each piece of text data. Here, Emb = (e1, e2, ..., e...). m ), e1~e m Let n represent the word vectors of each word in the text data; then, max pooling is used to obtain the text feature vector Qe for the entire text data, where n is the number of texts, m is the length of the text, and e is the word vector of each word. i For text data x j The word vector representation of the i-th word in the text.
[0099] At this point, for user (s1, s2, ..., s...) n The user vector matrix is initialized with user representation information that is close to the publication time of the text, resulting in the user vector representation U = (u1, u2, ..., u3) for each text data. n ), where u j The user vector representation of the j-th text data.
[0100] 2) User information enhancement module: After the text word vectors and their user vector representations are obtained from the input text feature extraction module, the importance of the corresponding text word vectors is dynamically adjusted according to the user vector representation by combining the attention mechanism, and the enhanced text enhancement feature vector is generated and output, thereby strengthening the model's ability to recognize users' personalized stance expressions.
[0101] 3) User-Text-Preference Association Graph Construction Module: Based on the attribution relationship between users and text, and the association between users and user preference categories, this module constructs a user-text-preference association graph using input user information, text information, and user preferences. This integrates different information and enhances the understanding of users' multi-dimensional preferences. If a user has published multiple texts on the same topic, the texts form a fully connected directed graph through that user, with each text node also connected to itself. All text nodes are then categorized through this fully connected user relationship graph, and a relationship matrix is constructed based on all the fully connected graphs. Simultaneously, large models (such as the GPT series) are used to construct the graph based on data such as the social behavior of different users, extracting user preference features and matching these features with users to form an association graph between users and user preferences. After obtaining the user-text-preference association information, the corresponding adjacency matrix is constructed and output, providing a foundation for subsequent graph processing. The association graph consists of user nodes (carrying text information) and preference nodes. Each user node represents specific text data carried by a user (i.e., a user-text pair). Preference nodes represent user behavior preference categories, such as sharing users, participating users, and lurking users. The edges of the association graph include user-text edges (different text nodes of the same user) and edges between users and preference nodes. If two nodes belong to the same user, a user-text edge is added between them, and all text nodes belonging to the same user are fully connected by default. If a user's behavioral characteristics match a preference category, all text nodes carried by that user are connected to the preference node to form a user-preference node pair.
[0102] exist Figure 5 In the table, User 1, User 2, and User 3 represent user identifiers corresponding to different user nodes, and X1 to X6 represent different historical text data.
[0103] Based on the above association graph, the user-text connection matrix (i.e., the user-text connection matrix) U can be obtained. TXUT And the user-text and preference node connection matrix (i.e., the user, text, and preference node connection matrix) U TXP User-text connection matrix U TXUT The rows and columns in the matrix represent user-text node pairs, and the matrix values represent the connection relationships between different texts belonging to the same user. The user-text and preference node connection matrix U... TXP The rows in the matrix represent user-text node pairs, and the columns represent preference nodes. The preference node and user-text connection matrix U... PXUT Rows represent preference nodes, and columns represent user-text nodes. The connection matrix U between preference nodes... PXP The rows and columns represent preferred nodes.
[0104] Then, the adjacency matrix of the directed graph is obtained: A = [U TXUT U TXP U PXUT U PXP ].
[0105] 4) Stance Detection Module: Input feature matrix X and adjacency matrix of user-text-preference association graph. Use GCN to encode the association graph accordingly. Since a single convolution of GCN can only capture local neighborhood information, stacking multiple layers of GCN can gradually extract higher-order neighborhood information, so that features can be continuously transferred and fused between the connection nodes in the association graph.
[0106] The corresponding loss function is:
[0107]
[0108] The parameters in the above formula have the following meanings:
[0109] H(p,q): Cross-entropy loss value, representing the deviation between the model's predicted distribution q(x) and the true distribution p(x).
[0110] p(x): This is the target distribution (true distribution), representing the distribution of the true stance labels of a sample. Represented by a one-hot distribution, if the true label is support, then p(x) = [1, 0, 0].
[0111] q(x): This is the prediction distribution, representing the probability distribution of the model's prediction of the position label. If the predicted target has three positions (support, neutral, and oppose), then q(x) could be [0.7, 0.2, 0.1], indicating that the model predicts the probability of the sample belonging to "support" is 0.7.
[0112] x i The i-th category of sample x, i.e., a specific stance category (such as support, neutral, or opposition).
[0113] n: represents the total number of categories. Since there are 3 categories in the position classification (support, neutral, and oppose), n = 3 here.
[0114] By integrating these high-order features, we can not only capture the complex relationships between nodes, but also use the features of connected nodes to predict unknown nodes, thereby outputting the stance prediction result (support or opposition) for each text.
[0115] 5) Offline Training and Online Application of the Model: During the offline training phase, to improve the overall performance of the model and provide a reliable foundation for online applications, the input data includes user historical data and labeled data, with explicit support / opposition labels. This data is large in volume and comprehensively distributed, containing multiple historical text messages and preference features of users, enabling the capture of global user relationships. Simultaneously, stacked multi-layer graph convolutional neural networks (GCNs) are used to capture high-order relationships between multiple user texts from a global perspective, and a user preference prediction subtask is added to the stance detection task to improve the model's ability to perceive user features. In the online application phase, to provide fast and accurate stance prediction in real-time response to user input text, the input data consists of real-time generated user comments or tweets without explicit labels, thus achieving lightweight feature construction. Utilizing the user-text-preference association graph constructed in the offline phase, the online phase only incrementally updates the nodes and edges of newly input data, while dynamically adjusting based on the user's recent behavioral features.
[0116] Understandably, in this application example, a more comprehensive stance detection can be achieved by combining features from text with other modalities in social media (such as images and videos). A cross-modal attention mechanism can be used to handle the information interaction between text and images, thus compensating for the shortcomings of relying solely on text features. This approach is suitable for scenarios where users simultaneously publish multimodal content, helping to enrich the model's feature representation.
[0117] In other words, this application introduces a user text information enhancement mechanism, which deeply integrates user text information with text features through an attention mechanism, strengthening the model's ability to perceive users' personalized expressions and implicit stance features, and significantly improving the accuracy of stance detection. It utilizes graph convolutional neural networks to construct a global graph network based on user relationships, capturing high-order correlation features between texts layer by layer under multi-layer convolutional operations, addressing the problem of insufficient modeling of potential connections between texts in existing technologies. Through fully connected modeling of the user-text-preference correlation graph, it effectively combines users' historical behavior and stance expression, mining the commonalities and differences between multiple related texts, and incorporating judgments on user preference information to ensure that the model extracts more accurate stance information from a global perspective. The model design implements an end-to-end training architecture, eliminating the need for additional user-labeled data, avoiding complex preprocessing, and improving the practicality and generalizability of the method.
[0118] Based on this, the text stance detection method based on user preference information enhancement provided in the application examples of this application has the following characteristics:
[0119] Beneficial effects:
[0120] 1) Deep integration of user information: The model proposed in this paper deeply integrates user text information, text features, and user preferences through user association graphs and attention mechanisms, which can more effectively capture users' personalized expressions and implicit stance information. In contrast, traditional methods simply introduce user information without comprehensively modeling the interaction between users and text.
[0121] 2) Global Relationship Modeling: By constructing a user relationship graph, graph convolutional neural networks are used to capture the relationships between different texts from a global perspective, especially the potential connections between multiple comments from the same user. Traditional neural network methods are mainly based on single-text modeling, making it difficult to fully explore the global relationships between texts.
[0122] 3) Ease of end-to-end training: This model, based on user association and graph convolutional neural networks, eliminates the need for complex data labeling and additional pre-training stages, achieving more efficient end-to-end training. Traditional methods typically rely on additional user attribute labels or pre-trained models, which limits their practical applications.
[0123] 4) Significant improvement in detection performance: By introducing user association graphs and attention mechanisms, the model in this paper significantly outperforms traditional neural network methods in the position detection task, especially in the handling of implicit position expressions and complex contexts, demonstrating stronger adaptability.
[0124] From a software perspective, this application also provides a device for performing all or part of the text stance detection method based on user preference information enhancement, see [link to relevant documentation]. Figure 7 The text stance detection device based on user preference information enhancement specifically includes the following:
[0125] The text feature enhancement module 10 is used to generate a text representation vector corresponding to the target text data based on the text feature vector corresponding to the target text data and the text enhancement feature vector, wherein the text enhancement feature vector is generated in advance based on the user attribute information corresponding to the target user who published the target text data and the target text data;
[0126] The user preference enhancement stance detection module 20 is used to input the text representation vector and the adjacency matrix corresponding to the preset user preference association graph into the text stance detection model, so that the text stance detection model outputs the text stance detection result data corresponding to the target text data. The user preference association graph is used to represent the correspondence between users who publish each historical text data and each preset user preference information.
[0127] The embodiments of the text stance detection device based on user preference information enhancement provided in this application can be used to execute the processing flow of the embodiments of the text stance detection method based on user preference information enhancement in the above embodiments. Its functions will not be repeated here, but can be referred to the detailed description of the embodiments of the text stance detection method based on user preference information enhancement in the above embodiments.
[0128] The text stance detection device based on user preference information enhancement can perform the text stance detection based on user preference information enhancement either on a server or on a client device. The choice can be made based on the processing power of the client device and the limitations of the user's usage scenario. This application does not impose any limitations in this regard. If all operations are performed on the client device, the client device may further include a processor for the specific processing of the text stance detection based on user preference information enhancement.
[0129] The aforementioned client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission. The server may include a server on the task scheduling center side; in other implementation scenarios, it may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, a server cluster consisting of multiple servers, or a distributed server structure.
[0130] The server and the client device can communicate using any suitable network protocol, including those not yet developed as of the date of this application. Such network protocols may include, for example, TCP / IP, UDP / IP, HTTP, HTTPS, etc. Furthermore, such network protocols may also include RPC (Remote Procedure Call Protocol) and REST (Representational State Transfer Protocol) protocols used on top of the aforementioned protocols.
[0131] As can be seen from the above description, the text stance detection device based on user preference information enhancement provided in this application embodiment can realize the automated detection of text stance, improve the global detection capability and generalization capability of the text stance detection model, and improve the accuracy and reliability of the text stance detection results.
[0132] This application also provides an electronic device, which may include a processor, a memory, a receiver, and a transmitter. The processor is used to execute the text stance detection method based on user preference information enhancement mentioned in the above embodiments. The processor and memory can be connected via a bus or other means, taking a bus connection as an example. The receiver can be connected to the processor and memory via wired or wireless means.
[0133] The processor can be a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.
[0134] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the text stance detection method based on user preference information enhancement in the embodiments of this application. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory, thereby implementing the text stance detection method based on user preference information enhancement in the above method embodiments.
[0135] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0136] The one or more modules are stored in the memory, and when executed by the processor, they perform the text stance detection method based on user preference information enhancement in the embodiment.
[0137] In some embodiments of this application, the user equipment may include a processor, a memory, and a transceiver unit. The transceiver unit may include a receiver and a transmitter. The processor, memory, receiver, and transmitter may be connected via a bus system. The memory is used to store computer instructions, and the processor is used to execute the computer instructions stored in the memory to control the transceiver unit to send and receive signals.
[0138] As one implementation method, the functions of the receiver and transmitter in this application can be implemented by transceiver circuits or dedicated transceiver chips, and the processor can be implemented by dedicated processing chips, processing circuits or general-purpose chips.
[0139] As another implementation approach, the server provided in this application embodiment can be implemented using a general-purpose computer. That is, the program code implementing the processor, receiver, and transmitter functions is stored in memory, and the general-purpose processor implements the processor, receiver, and transmitter functions by executing the code in memory.
[0140] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the aforementioned text stance detection method based on user preference information enhancement. The computer-readable storage medium can be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium known in the art.
[0141] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the aforementioned text stance detection method based on user preference information enhancement.
[0142] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave.
[0143] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0144] In this application, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.
[0145] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to the embodiments of this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A text stance detection method based on user preference information enhancement, characterized in that, include: A text representation vector corresponding to the target text data is generated based on the text feature vector and the text enhancement feature vector corresponding to the target text data. The text enhancement feature vector is generated in advance based on the user attribute information of the target user who published the target text data and the target text data. The text representation vector and the adjacency matrix corresponding to the preset user preference association graph are input into the text stance detection model so that the text stance detection model outputs the text stance detection result data corresponding to the target text data. The user preference association graph is used to represent the correspondence between users who publish each historical text data and preset user preference information.
2. The method for stance detection of text enhanced by user preference information according to claim 1, wherein, Before generating the text representation vector corresponding to the target text data based on the text feature vector and the text enhancement feature vector corresponding to the target text data, the method further includes: The text word vectors corresponding to the target text data are extracted using pre-trained word vectors. The text word vectors are input into a text encoder to obtain the text feature vectors corresponding to the target text data. 3.The method for text stance detection enhanced by user preference information based on claim 2, characterized in that, Before generating the text representation vector corresponding to the target text data based on the text feature vector and the text enhancement feature vector corresponding to the target text data, the method further includes: For the user attribute information corresponding to the target user who published the target text data, obtain the user vector representation corresponding to the user attribute information; Based on the attention mechanism, the importance of the text word vectors corresponding to the target text data is adjusted according to the user vector representation to obtain the text enhancement feature vector corresponding to the target text data. 4.The method for text stance detection enhanced by user preference information according to claim 2, wherein, Before extracting the text word vectors corresponding to the target text data using pre-trained word vectors, the method further includes: Acquire historical text data published by each user within a preset time range, as well as user attribute information of each user within the preset time range; Based on the historical text data published by each user and the preset user preference information, a user preference relationship graph is constructed; wherein, the user preference information includes: sharing users, participating users, lurking users, and influential users; The user preference association graph includes user nodes and preference nodes. The user node represents a user's unique identifier and a historical text data published by the user. Different user nodes correspond to different historical text data. Each preference node represents the same user preference information. Different user nodes corresponding to the same user's unique identifier are connected, and each user node is connected to at least one preference node.
5. The method for stance detection of text enhanced by user preference information according to claim 4, characterized in that, Before extracting the text word vectors corresponding to the target text data using pre-trained word vectors, the method further includes: Based on the user preference association graph, obtain the corresponding connection matrix between users and text, and the connection matrix between users, text and preference nodes. The adjacency matrix corresponding to the user preference association graph is generated based on the connection matrix between the user and the text, and the connection matrix between the user, the text, and the preference node.
6. The text stance detection method based on user preference information enhancement according to claim 5, characterized in that, Before extracting the text word vectors corresponding to the target text data using pre-trained word vectors, the method further includes: Pre-trained word vectors are used to extract the text word vectors corresponding to each of the historical text data. Input the text word vectors corresponding to each of the historical text data into the text encoder to obtain the text feature vectors corresponding to each of the historical text data respectively; A user vector matrix is initialized and generated based on the user attribute information of each user within the preset time range, wherein the user vector matrix contains the user vector representation corresponding to each user. Furthermore, based on the attention mechanism, the importance of the text word vectors corresponding to each of the historical text data is adjusted according to the user vector representations, so as to obtain the text enhancement feature vectors corresponding to each of the historical text data. Based on the text feature vector and the text enhancement feature vector corresponding to each of the historical text data, a text representation vector corresponding to each of the historical text data is generated to form a corresponding feature matrix; A text stance detection model is trained based on the labels corresponding to each of the pre-acquired historical text data, the feature matrix, and the adjacency matrix corresponding to the user preference association graph. This text stance detection model is used to output text stance detection result data corresponding to the text data based on the text data and the user preference association graph. The labels are used to identify the stance type of the corresponding historical text data, and the stance type includes: support, neutral, and opposition.
7. The text stance detection method based on user preference information enhancement according to claim 2 or 6, characterized in that, The text encoder includes a max pooling layer.
8. The text stance detection method based on user preference information enhancement according to any one of claims 1 to 6, characterized in that, The text stance detection model comprises: a series of interconnected multi-layer graph convolutional neural networks.
9. A text stance detection device based on user preference information enhancement, characterized in that, include: The text feature enhancement module is used to generate a text representation vector corresponding to the target text data based on the text feature vector corresponding to the target text data and the text enhancement feature vector. The text enhancement feature vector is generated in advance based on the user attribute information corresponding to the target user who published the target text data and the target text data. The user preference enhancement stance detection module is used to input the text representation vector and the adjacency matrix corresponding to the preset user preference association graph into the text stance detection model, so that the text stance detection model outputs the text stance detection result data corresponding to the target text data. The user preference association graph is used to represent the correspondence between users who publish each historical text data and preset user preference information.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the text stance detection method based on user preference information enhancement as described in any one of claims 1 to 8.