Dual-channel multi-level contrast learning vertical field detection method based on hybrid auto-encoder
By adopting a hybrid autoencoder and a dual-channel multi-level contrast learning method in position detection, integrating text and social relationship information, the problem of degradation in position detection performance in cross-domain settings is solved, and higher accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202411753890.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-04-01
AI Technical Summary
The existing position detection methods have deteriorated performance in cross-domain settings, making it difficult to capture the deep meaning and contextual information behind the text, especially on social media, which affects the accuracy of the model.
The dual-channel multi-level contrast learning method based on hybrid autoencoder is adopted to integrate text information and social relationship information, extract deep social relationship characteristics through social relationship diagrams and hybrid autoencoder, and improve the learning ability and robustness of the model through dual-channel multi-level contrast learning.
Improved the accuracy and robustness of position detection, especially in cross-domain settings, and better performance over existing baseline models, enabling a better understanding of user positions and attitudes.
Smart Images

Figure CN119739862A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of stance detection, and in particular to a dual-channel multi-level contrast learning stance detection method based on a hybrid autoencoder. Background Art
[0002] With the rapid development of social media, the amount of information on online social platforms has exploded, containing a wealth of user opinions and attitudes. Against this background, stance detection technology has emerged, aiming to automatically identify and classify the attitude or stance expressed by the author in a specific text, such as agreement, disagreement, or neutrality. Stance detection technology has important application value in many fields, including but not limited to social media analysis, public opinion monitoring, political opinion analysis, etc.
[0003] Traditional stance detection methods mainly rely on text information, extracting text features and applying machine learning or deep learning models to perform stance classification. However, these methods have certain limitations, especially in cross-domain settings, that is, when the topics or content of training data and test data are different, the performance of the model will drop significantly. This is because there are significant differences in text expressions and contexts in different fields, making it difficult for the model to adapt to new fields.
[0004] In addition, stance detection methods that rely solely on text information have difficulty capturing the deep meaning and contextual information behind the text, especially on social media, where text noise is high, informal language, spelling errors, and phrases may affect the accuracy of the model. Therefore, in order to improve the accuracy and robustness of stance detection, it is necessary to introduce additional information sources to assist stance judgment.
[0005] In recent years, researchers have begun to explore the use of social relationship information to enhance the performance of stance detection models. Social relationship information, such as interactions between users and information flows in social networks, can provide rich context beyond text and help better understand users' stances and attitudes. For example, if a user often interacts with users with a specific point of view, then their stance may be similar to those of these users. However, how to effectively extract and utilize social relationship information from social data, and how to combine this information with textual information, remains a challenge. Figure 1 Taking the example in as an example, if social relationship information can be effectively used to enable the model to understand that the author of the reply is a supporter of the comment author (based on previous interactions), then it becomes easier to identify the reply author's position on the comment author.
[0006] In order to solve the above problems, the present invention proposes a dual-channel multi-level contrastive learning stance detection method based on a hybrid autoencoder. Summary of the invention
[0007] To solve the above technical problems, the present invention provides a dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoders. This method not only utilizes text information, but also integrates social relationship information, extracts deep social relationship features by constructing a social relationship graph and using a hybrid autoencoder, and combines dual-channel multi-level contrastive learning to further improve the learning ability and robustness of the model. In this way, the present invention aims to improve the accuracy of stance detection, especially in cross-domain settings, and provide a new technical solution for the field of stance detection.
[0008] The dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoder provided by the present invention comprises the following steps:
[0009] S1. Perform social relationship pre-training, extract social relationship information from comment-reply interactions in chronological order to summarize the social relationship graph, and pre-train a graph autoencoder to encode social relationships through a relationship graph convolutional network encoder and a knowledge graph embedding decoder;
[0010] S2, introduce hybrid autoencoder, combine autoencoder and variational autoencoder to extract social relationship features;
[0011] S3, introduce dual-channel multi-level contrastive learning to improve the model's ability to learn social relationships through global contrast, inter-group contrast, and intra-group contrast;
[0012] S4. Combine text information and social relationship features to classify stances.
[0013] Preferably, the social relationship pre-training in S1 includes:
[0014] S1.1. Build a social relationship graph to provide common information for different social platforms and offline scenarios;
[0015] S1.2. Train the graph autoencoder to extract potential social relationship information.
[0016] Preferably, constructing a social relationship graph in S1.1 includes:
[0017] S1.1.1, extract the author set corresponding to the comments and replies;
[0018] S1.1.2, summarize the social relationship graph according to time intervals;
[0019] S1.1.3. Weight the frequencies of edges to build a temporal network model and obtain the type of social relationships.
[0020] Preferably, the hybrid autoencoder comprises:
[0021] Autoencoders, used to learn latent social relationship features;
[0022] Variational autoencoders for learning latent features of social relations from latent space.
[0023] Preferably, the introduction of a hybrid autoencoder in S2 comprises:
[0024] S2.1, learn the potential social relationship features by inputting the initially learned social relationship features of the comment-reply pair into the autoencoder;
[0025] S2.2. Using variational autoencoders to learn latent features of social relationships from latent space;
[0026] S2.3. Introduce contrastive learning to improve the quality of latent social relationship features generated by the autoencoder.
[0027] Preferably, the dual-channel multi-level contrastive learning in S3 includes:
[0028] S3.1, global contrastive learning, comparing different social relationship graphs;
[0029] S3.2, inter-group contrast learning, comparing the autoencoders under different channels;
[0030] S3.3, intra-group comparative learning, compares different encoders within a single channel.
[0031] Preferably, the S4 neutral classification includes:
[0032] S4.1. Encode the text of comments and replies using the RoBERTa model.
[0033] S4.2, concatenating the encoded text features with the social relationship features;
[0034] S4.3. Perform stance prediction and calculate training loss.
[0035] Compared with the related art, the dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoder provided by the present invention has the following beneficial effects:
[0036] a) The present invention proposes a hybrid autoencoder, which combines an autoencoder and a variational autoencoder, which can not only retain the representation ability of the autoencoder, but also utilize the generation ability of the variational autoencoder, and finally obtain a richer and more diverse representation of the author social relationship features.
[0037] b) This paper proposes a new dual-channel multi-level contrastive learning framework for stance detection, including global contrast, inter-group contrast and intra-group contrast, to capture the differences in features at different levels, thereby improving the model's social relationship learning ability.
[0038] c) The test results of the model of the present invention on intra-domain and cross-domain tasks are better than those of the existing baseline models, and the present invention proves the effectiveness of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is an example diagram of stance detection in the DEBAGREEMENT dataset of the present invention;
[0040] Figure 2 An example diagram of a social relationship graph constructed using time sequence information in the present invention;
[0041] Figure 3 This is the overall structure diagram of the dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoder proposed in the present invention;
[0042] Figure 4 This is a histogram of the ablation experiment of the model in the present invention in the in-domain test;
[0043] Figure 5 This is a bar graph of different sequence lengths of comment-reply pairs in the present invention;
[0044] Figure 6 This is the T-SNE visualization experiment result diagram in the present invention;
[0045] Figure 7 This is a diagram of the confusion matrix experimental results in the present invention. DETAILED DESCRIPTION
[0046] It should be noted that the present invention describes the stance detection task as a classification task. The dataset is represented as Contains N samples, each of which contains a comment c i and the author of the comment One reply i and the author of the reply And reply to the comment with the position label y i The task is to predict a stance label for each comment-reply pair.
[0047] The dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoder proposed in the present invention is further described below in conjunction with the accompanying drawings.
[0048] 1. Methods
[0049] The overall model of the present invention is as follows Figure 3 As shown in FIG. 1 , the model mainly consists of four parts: a) social relationship pre-training; b) hybrid autoencoder; c) dual-channel multi-level contrastive learning; d) stance classification. Next, the present invention will introduce each part in detail.
[0050] 1.1 Social Relationship Pre-training
[0051] The social relationships are extracted from the comment-reply interaction in chronological order to summarize the social relationship graph, which provides common information for different social platforms and offline scenarios. The present invention pre-trains a graph autoencoder to encode social relationships through a relationship graph convolutional network encoder and a knowledge graph embedding decoder. The relationship graph is represented as a directed graph G = {N, E, R}, where N represents the set of author nodes, and each edge in the graph is defined as (n i ,r,n j )∈ε, where r∈R represents the type of relationship between two nodes. The relationship types include {supporters, opponents, acquaintances, and interactors}.
[0052] 1.1.1. Construction of social relationship graph
[0053] In order to construct the relationship graph, the present invention first extracts the set of all authors in the data set, corresponding to the node set N. Since the social relationship between individuals has a time effect, it is an important factor to summarize the social relationship graph according to the time interval. The present invention establishes a temporal network model by weighting the frequency of the edges to obtain the type of social relationship. For the sequence of the graph weighted adjacency matrix S(w,τ)=[A 0 ,A 1 ,…A (w-1) ], where A k is the weighted adjacency matrix in the time period [kτ, (k+1)τ], for each weighted adjacency matrix A k For example, if the author n i Reply to author n j If the comment expresses an agree\disagree\neutral position, then If there are multiple different positions, the most frequent position is selected to determine like Figure 2 As shown, the summarized graph is the sum of the weighted adjacency matrices A in the time segment [0, (w-1)] * =A 0 +A 1 +…+A (w-1) The edge types are defined as follows:
[0054]
[0055] In order to avoid label leakage in the validation and test sets, the present invention adds a new type of interactor edge for edges that do not appear in the training set but appear in the validation and test sets. In semi-supervised learning of graph neural network tasks, node features can usually be observed. It also aims to solve the problem that node features are unknown if the node is not added to the social relationship graph before pre-training. At the same time, in order to avoid overfitting during model training, the present invention selects G with probability ρ. R and set them as Interactor type.
[0056] 1.1.2. Graph Autoencoder Training
[0057] In order to extract potential social relationship information, the present invention trains a graph autoencoder. First, from G R Randomly select 50% of the edges and form an edge set Then, data enhancement is performed on these edges to obtain a complete edge sample set U. Then, values are assigned to the edges in U to determine whether those edges are enhanced or belong to In the present invention, the false triples and the real triples in the enhanced triples are taken as true triples. Finally, the present invention uses the relational graph convolutional network (RGCN) as an encoder to obtain the potential social relationship representation of the author, and uses DistMult as a decoder to reconstruct the edges to achieve the effect of training the graph autoencoder.
[0058] Encoder: The present invention first randomly initializes the author feature to u i , and then use RGCN to convolve each author’s own neighbor information to learn the author’s social relationship characteristics
[0059]
[0060]
[0061]
[0062] Where f is the RGCN network, is the set of neighbors of author i. σ is the activation function. is the learnable parameter matrix.
[0063] Training: The present invention uses DistMult as a decoder as the edge reconstruction function. For a given triple (n i ,r,n j ), points can be obtained in the following ways:
[0064]
[0065] where σ is a logistic function, Is the author i and n j The social relationship feature vector.
[0066] The obtained scores are then used as prediction results and the triples in the sample set U are used for binary classification of true / false triples:
[0067]
[0068] After training the graph autoencoder, in order to extract the author social relationship features of the comment c and reply t, the present invention extracts a relationship subgraph from the relationship graph, which contains and All first-order neighbors. Then the subgraph is input into the trained RGCN to extract the social relationship features between them:
[0069] h RG =RGCN(G A ) (4)
[0070] Then the present invention obtains the comment-reply social relationship matrix B represents the batch size.
[0071] 1.2. Hybrid Autoencoder
[0072] Using only a single autoencoder will not be able to learn the author's potential social relationship characteristics well due to the weak learning ability of the autoencoder. In order to make up for the shortcomings of the autoencoder, the present invention introduces a hybrid autoencoder. The hybrid autoencoder consists of an autoencoder and a variational autoencoder. The learning ability of the autoencoder is improved by borrowing the powerful learning and generation capabilities of the variational autoencoder. Specifically, the present invention first inputs the social relationship features of the initially learned comment-reply pairs into the autoencoder to learn the potential social relationship features:
[0073] H R =f(W R H RG +b R ) (5)
[0074] Where f represents the encoder of the autoencoder.
[0075] In order to ensure the invariance constraint of social relationship features, the present invention achieves this goal by decoding the potential social relationship features back to the original social relationship features and calculating the reconstruction loss. The specific formula is defined as follows:
[0076]
[0077]
[0078] in Represents the decoder of the autoencoder.
[0079] Similarly, the present invention uses a variational autoencoder to learn the potential features of social relationships from the latent space. Specifically, the mean and standard deviation of social relationship features are first learned through different multi-layer perceptrons:
[0080] μ=MLP μ (H RG )
[0081] σ=MLP σ (H RG ) (7)
[0082] Since the features sampled from the distribution cannot be gradient-backed, the present invention uses the reparameterization technique to obtain the potential features Z in the latent relation space. R :
[0083] Z R =μ+σ·ò (8)
[0084] Where ò~N(0,I) is Gaussian noise.
[0085] Similarly, the present invention ensures the invariance of social relationship characteristics by reconstructing constraints. The specific process is defined as follows:
[0086]
[0087]
[0088] L recon =L ae +L vae (9)
[0089] in Represents the decoder of a variational autoencoder.
[0090] After obtaining the potential social relationship features of the autoencoder and the variational autoencoder, the present invention introduces contrastive learning to improve the quality of the potential social relationship features generated by the autoencoder. First, the present invention introduces the formula of contrastive learning:
[0091]
[0092] Since the present invention obtains two different sets of potential social relationship features, there are two potential features for a comment-reply pair. Therefore, the positive sample pairs are the same comment-reply pairs with different potential social relationship features, and the negative sample pairs are different comment-reply pairs. F represents the set of negative sample pairs.
[0093] According to formula 10, the present invention can obtain the contrast constraint loss:
[0094]
[0095] 1.3 Dual-channel multi-level contrastive learning
[0096] In order to further learn high-quality social relationship features, this paper adopts a dual-channel learning paradigm and introduces multi-level contrastive learning to improve the learning ability of the model. Specifically, this paper trains another RGCN based on the previously trained RGCN. The specific method is the same as in Section 1.1. For ease of understanding, this paper names the initial social relationship features extracted by the two trained RGCNs as and Multi-level contrastive learning mainly consists of global contrastive learning, intra-group contrastive learning, and inter-group contrastive learning. For global contrastive learning, the ability to learn the characteristics of initial social relationships is improved by contrastive learning between two different groups of initial social relationships:
[0097]
[0098] Inter-group contrastive learning is to conduct contrastive learning on the same autoencoder (variational autoencoder) under different channels to comprehensively improve the learning ability of the autoencoder (variational autoencoder). The specific formula of inter-group contrastive learning is defined as follows:
[0099]
[0100]
[0101]
[0102] Intra-group contrastive learning is contrastive learning between different encoders in a single channel, and its purpose is to improve the learning ability of the autoencoder. The specific formula is the formula (11) mentioned above, which is written in dual-channel mode here:
[0103]
[0104]
[0105]
[0106] The final overall loss of multi-level contrastive learning is as follows:
[0107]
[0108] In addition, the reconstruction loss of the hybrid autoencoder for each channel is reformulated as follows:
[0109]
[0110]
[0111] The reconstruction loss of each channel is then added together to get the overall reconstruction loss of the model:
[0112]
[0113] 1.4. Position Classification
[0114] Feature encoding of the present invention: The RoBERTa model has been proven to be effective in various natural language processing applications. The present invention concatenates the original text of the comments and replies and then inputs them into RoBERTa to obtain their text features:
[0115]
[0116] where x i =[cls]c i [sep]t i [sep] represents the input format of the i-th comment-reply pair. Then the present invention obtains the comment-reply pair text feature matrix H corresponding to the batch size text .
[0117] Stance classification: After obtaining the potential social relationship between authors in the comment-reply pairs learned by the autoencoder under different channels, the present invention adds them together to obtain the final comment-reply potential social relationship features and then performs prediction after splicing the corresponding text information to obtain the final prediction result. The specific formula is defined as follows:
[0118]
[0119]
[0120]
[0121] The predicted results and the true stance labels of the comment-reply pairs are then used to calculate the task loss:
[0122]
[0123] Where y represents the true label, Represents the predicted label.
[0124] Training: The training loss includes task loss, reconstruction loss and contrastive learning loss:
[0125] L train =L stance +L recon +L multi_cl (twenty one)
[0126] Next, the method of the present invention will be further specifically analyzed in an experimental manner.
[0127] 2. Experiment
[0128] The present invention verifies the effectiveness of social relationship information for in-domain tasks (training the model on all subreddits and evaluating on the corresponding test data) in Section 2.2 and cross-domain tasks (training the model on four subreddits and evaluating on the remaining one subreddit) in Section 2.3, and further analyzes the model of the present invention in some subsequent sections.
[0129] 2.1. Settings
[0130] Dataset: This paper uses the dataset DEBAGREEMENT for stance detection. The dataset consists of 42,804 pairs of comments and replies from the popular discussion website reddit, which contains author identity and time information. The data topics include Brexit, Climate, BlackLivesMatter, Republican, and Democrats. The statistical information of the dataset is shown in Table 1. It can be seen that the interactions of the dataset are sparse, especially in the BlackLivesMatter and Republican datasets.
[0131] Table 1 Statistics of the DEBAGREEMENT dataset
[0132]
[0133] Training details: The present invention uses the Adam optimizer to train the model on 1 GPU (Nvidia GTX2080Ti). In order to construct the relationship graph, the edges in the training set are selected as interaction edges with a probability of ρ=0.3. The present invention shows the statistics of the inductive social relationships in Table 2. It can be seen that the interactions between authors in the dataset are sparse (23,101 nodes and 42,804 edges). For the stance detection training process, the initial learning rate of the model is 2e-6, the maximum sequence length is 256, the training batch size is 8, and the model is trained for 3 epochs. The data is divided into 80% / 10% 10% training / validation / test sets while maintaining the chronological order, where the test is done on the latest data. The present invention uses the macro-F1 score to find the best model configuration, and the final result takes the average of 5 rounds of results.
[0134] Table 2 summarizes the statistics of the social relationship graph on each subreddit
[0135]
[0136]
[0137] Baselines: We provide several baselines for stance detection, such as BiLSTM-based models: BiLSTM and BiLSTM-rel, BERT-based models: BERT-sep, BERT-joint, BERT-rel, and RoBERTa-based models: RoBERTa-joint and RoBERTa-rel.
[0138] BiLSTM: Use the same BiLSTM to encode comments and replies, and treat the average hidden state of each word as their sentence representation. Then concatenate the sentence representations of comments and replies. Use a linear layer to reduce the dimension, and then use a softmax layer to obtain the probability distribution of the labels.
[0139] BiLSTM-rel: Combines the text information encoded by BiLSTM with the relational feature h R Concatenate them and use linear layers and softmax layers to identify stance detection.
[0140] BERT-sep: Encode comments and replies in the format of [CLS]comment[SEP] and [CLS]reply[SEP] through BERT, and concatenate the hidden states of [CLS] as the representation of comment-reply pairs for classification.
[0141] BERT-joint: [CLS]comment[SEP]reply[SEP] is fed into BERT and a linear layer is applied to reduce the dimension of the [CLS] hidden state, followed by a softmax layer to obtain a probability distribution.
[0142] BERT-rel: Input [CLS]comment[SEP]reply[SEP] into BERT, and combine the text information encoded by BERT with the relational feature h R Put it together and use linear layer and softmax layer to identify stance detection.
[0143] RoBERTa-joint: Input [CLS]comment[SEP]reply[SEP] into RoBERTa, apply a linear layer to reduce the dimension of [CLS] hidden state, and then use a softmax layer to obtain the probability distribution.
[0144] RoBERTa-rel: Input [CLS]comment[SEP]reply[SEP] into RoBERTa, and compare the text information encoded by RoBERTa with the relational feature h learned using RGCN. R Concatenate them and use linear layers and softmax layers to identify stance detection.
[0145] 2.2 In-domain Experiment
[0146] The present invention uses five subreddits datasets for unified training, and the results are shown in Table 3, where bold indicates the best result and underline indicates the suboptimal result. The model proposed in the present invention improves the overall indicators macro-F1 and ACC by 0.67% and 0.57% respectively compared with the optimal baseline model RoBERTa-rel, and in each category, the model proposed in the present invention also surpasses the optimal baseline model in most indicators. This is because the model of the present invention can learn richer and more diverse social relationship information through different channels, thereby helping the model to identify the position relationship between comment-reply pairs.
[0147] 2.3 Cross-domain Experiments
[0148] The present invention aims to evaluate the generalization ability of the model in a cross-domain setting and reduce the cost and demand of manual annotation of the model. In particular, the model is trained on four subreddits datasets and tested on the remaining subreddit dataset. The results are shown in Table 5. As a cross-domain test result, the model of the present invention improves by 0.89% and 1.42% respectively on the overall indicators macro-F1 and ACC compared with the optimal baseline model RoBERTa-rel. This is because social relations are complex and changeable. The model proposed in the present invention can learn diverse potential social relationship information by using different channels and different encoders. RoBERTa-rel simply uses autoencoders to learn potential social relationship information, so it cannot capture the diversity in social relations well.
[0149] 2.4 Ablation Experiment
[0150] Figure 4 The results of the ablation experiment are shown. The loss function of the autoencoder (w / o ae), the loss function of the variational autoencoder (w / o vae), inter-group contrast learning (w / o inter cl) and intra-group contrast learning (w / o intra cl) are removed respectively. From the results, it can be found that removing any module will lead to a decrease in model performance, which proves the effectiveness of each module in the model of the present invention. After removing inter-group contrast learning, the macro-F1 and ACC of the model decreased by 0.51% and 0.53% respectively, which is the most obvious decrease, indicating that the present invention can accurately capture complex social relationship information by using a dual-channel paradigm, thereby improving the performance of stance detection.
[0151] Table 3 Overall experimental results
[0152]
[0153] Table 4 Cross-domain experimental results
[0154]
[0155] 2.5 Impact of different sequence lengths
[0156] Figure 5The model is tested with comment-reply for different sequence lengths. The results show that the macro-F1 score of the model in the stance detection task is significantly improved compared with RoBERTa-rel. For the data with sequence length of (100, 200] and greater than 200, the model is improved by 2.61% and 5.2% respectively, but for the data with length of (0, 100], the model is only 1.11% better than RoBERTa-rel. The results show that the model proposed in the present invention shows excellent results for both short and long texts. Especially in long texts, the model performance of the present invention far exceeds that of RoBERTa-rel, which shows that the method proposed in the present invention is more capable of learning social relationships than RoBERTa-rel. Since RoBERTa-rel learns social relationship information that is not robust, it will be dominated by text information when the text information is too long, and thus the social relationship cannot be used. However, the social relationship information learned by the model proposed in the present invention will not lose its own function due to too much text information.
[0157] 2.6 T-SNE Visualization
[0158] Figure 6 The performance of the model in processing the three stance categories of "agree", "disagree" and "neutral" is shown in a visual way. In order to prove the distinguishability of stance categories, Figure 6 Use t-SNE dimensionality reduction method to show
[0159] The representation of the comment-reply pair obtained by the method proposed in the present invention on the dataset and the representation obtained by the baseline model RoBERTa-rel. From the results shown in the figure, the clustering of the stance representation obtained by the model of the present invention is more obvious and shows a clearer boundary than RoBERTa-rel, which shows that the model has a strong stance recognition ability.
[0160] 2.7 Confusion Matrix
[0161] The present invention visualizes the prediction results of the model through confusion matrix to analyze the shortcomings of the model. Figure 7The results show that compared with the "agree" and "disagree" categories, the model has some challenges in processing the "neutral" category. This may be because the number of samples in the "agree" and "disagree" categories in the training data is much larger than that in the "neutral" category. Therefore, when training the model, it is more inclined to learn the "agree" and "disagree" categories, resulting in the problem of inductive bias in the model, making it easier to misclassify the "neural" category into other categories. Therefore, how to better solve the problem of imbalanced sample category data is a challenge in the stance detection task.
[0162] 2.8 Case Study
[0163] In order to verify the powerful ability of the model in learning social information, the present invention designed a case study, and the results are shown in Table 5. In the first example, the author of the reply post and the author of the comment In the social relationship, the author is in a clear opposing position, so both RoBERTa-rel and the model proposed in this invention can well learn this simple social relationship and use this information to identify the correct position. However, in the second example, the author of the reply and the author of the comment Although there is interaction in the social relationship, in the relationship graph, the two authors have the same neighbors n c , Support c , Oppose c , which suggests that the authors of the comment-reply pair may be antagonistic. RoBERTa-rel cannot capture this potential complex social relationship and therefore incorrectly identifies the stance. The model proposed in this invention, by combining a hybrid autoencoder with a dual-channel learning paradigm, can well mine this potential social relationship information and accurately identify the correct stance.
[0164] Table 5 Case studies
[0165]
[0166] Compared with the related art, the dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoder provided by the present invention has the following beneficial effects:
[0167] The present invention provides a dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoders, which constructs an inductive social relationship graph from comment-reply data to assist in the implementation of stance detection tasks. The model uses a hybrid autoencoder to extract deep social relationship information, and combines a dual-channel hierarchical contrastive learning method to further mine and learn this social relationship information. The model has achieved good performance on the DEBAGREEMENT dataset with intra-domain and cross-domain settings. The ablation study further shows the specific role of each module, proving the effectiveness of the model of the present invention in stance detection tasks. Studies have shown that general external information can significantly promote the effect of stance detection tasks, such as modeling the author's views on different topics, and deeply analyzing the formation mechanism of social relationships and the way views spread on social platforms. In future work, it will be a very promising research direction to consider adding effective time information and other dynamic features to sparse social graph networks.
[0168] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoder, characterized in that: The following steps are involved: S1. Perform social relationship pre-training, extract social relationship information from comment-reply interactions in chronological order to summarize the social relationship graph, and pre-train a graph autoencoder to encode social relationships through a relationship graph convolutional network encoder and a knowledge graph embedding decoder; S2, introduce hybrid autoencoder, combine autoencoder and variational autoencoder to extract social relationship features; S3, introduce dual-channel multi-level contrastive learning to improve the model's ability to learn social relationships through global contrast, inter-group contrast, and intra-group contrast; S4. Combine text information and social relationship features to classify stances.
2. The dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoder according to claim 1 is characterized in that: The social relationship pre-training in S1 includes: S1.
1. Build a social relationship graph to provide common information for different social platforms and offline scenarios; S1.
2. Train the graph autoencoder to extract potential social relationship information.
3. The dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoder according to claim 2 is characterized in that: The social relationship graph constructed in S1.1 includes: S1.1.1, extract the author set corresponding to the comments and replies; S1.1.2, summarize the social relationship graph according to time intervals; S1.1.
3. Weight the frequencies of edges to build a temporal network model and obtain the type of social relationships.
4. The dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoder according to claim 1 is characterized in that: The hybrid autoencoder comprises: Autoencoders, used to learn latent social relationship features; Variational autoencoders for learning latent features of social relations from latent space.
5. The dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoder according to claim 1 is characterized in that: The hybrid autoencoder introduced in S2 includes: S2.1, learn the potential social relationship features by inputting the initially learned social relationship features of the comment-reply pair into the autoencoder; S2.
2. Using variational autoencoders to learn latent features of social relationships from latent space; S2.
3. Introduce contrastive learning to improve the quality of latent social relationship features generated by the autoencoder.
6. The dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoder according to claim 1 is characterized in that: The dual-channel multi-level contrastive learning in S3 includes: S3.1, global contrastive learning, comparing different social relationship graphs; S3.2, inter-group contrast learning, comparing the autoencoders under different channels; S3.3, intra-group comparative learning, compares different encoders within a single channel.
7. The dual-channel multi-level contrastive learning stance detection method based on hybrid autoencoder according to claim 1 is characterized in that: The S4 neutral ground classification includes: S4.
1. Use the RoBERTa model to encode the text of comments and replies; S4.
2. Concatenate the encoded text features with the social relationship features; S4.
3. Perform stance prediction and calculate training loss.