Social text site identification method and system based on claim generation and consistency analysis

By constructing text pairs and utilizing the weighted fusion of pre-trained models and sentiment dictionaries, the difficulty of capturing complex semantics in stance recognition in existing technologies is solved, and high-precision stance recognition is achieved in multi-topic scenarios.

CN120780844AActive Publication Date: 2025-10-14DATA SPACE RES INST
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202511296515.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-11
Publication Date
2025-10-14
Estimated Expiration
2045-09-11

AI Technical Summary

Technical Problem

Existing stance recognition technologies have difficulty capturing complex semantic relationships and contextual information, especially when the target does not appear explicitly or the semantics are obscure. They have difficulty handling complex language phenomena such as sarcasm and metaphor, and are not robust to domain transfer.

Method used

By constructing text pairs, including assertion sentences and pre-processed user tweet texts, the assertion sentences are generated using the pre-trained semantic consistency recognition model and generative language model, and weighted fusion is performed with the sentiment dictionary to comprehensively judge the user's position.

Benefits of technology

It achieves stability and reliability in scenarios with strong emotions and changing language styles, improves the accuracy and interpretability of social text stance recognition, and adapts to fine-grained stance recognition in multi-topic scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120780844A_ABST
    Figure CN120780844A_ABST
Patent Text Reader

Abstract

The invention discloses a social text standing recognition method and system based on claim generation and consistency analysis, and relates to the field of natural language processing, and the method comprises the steps: obtaining an original user tweet text of a user, and carrying out the preprocessing of the original user tweet text, and obtaining a preprocessed user tweet text; constructing a text pair according to the preprocessed user tweet text; inputting the text pair into a pre-trained semantic consistency recognition model to obtain a consistency recognition result; wherein the consistency identification result comprises a semantic consistency score and a semantic site classification result; performing sentiment analysis on the preprocessed user tweet text based on a preset sentiment dictionary, and calculating a sentiment tendency score; performing weighted fusion on the semantic consistency score and the emotion score to obtain a comprehensive standing tendency score; and according to the comprehensive standing tendency score and the semantic standing classification result, obtaining the standing of the user. According to the method, the stability and the reliability of social text standing recognition in a scene with strong emotion and changeable language styles are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of natural language processing, and particularly relates to a social text stance recognition method and system based on claim generation and consistency analysis. BACKGROUND

[0002] Stance recognition is a natural language processing task that aims to identify the attitude of the author towards a specific target (such as an event, opinion, person or thing) in the text, and usually classifies the stance as support, opposition or neutral.

[0003] Early stance recognition techniques rely on manually constructed sentiment dictionaries, syntactic rules or statistical features (such as bag of words, TF-IDF, sentiment dictionary, dependency relations, sentiment polarity scores, etc.), and combine traditional classification models for judgment, but such methods are difficult to capture complex semantic relationships and context information, have poor generalization ability, are not robust to domain migration, and rely on expert experience for feature design.

[0004] In recent years, the pre-trained language model BERT can better understand the relationship between context semantics and targets through joint modeling of text-target pairs, and has achieved leading results on multiple datasets, bringing significant performance improvements to the stance recognition task. However, this method does not fully model the relationship between the target and the text, making it difficult to handle cases where the target is not explicitly present or the semantics are ambiguous; and has limited understanding of complex language phenomena such as sarcasm and metaphor. SUMMARY

[0005] To solve the technical problems in the background art, the present application proposes a social text stance recognition method and system based on claim generation and consistency analysis.

[0006] In a first aspect, the present application proposes a social text stance recognition method and system based on claim generation and consistency analysis, comprising: obtaining an original user tweet text of a user; constructing a text pair according to the preprocessed user tweet text; wherein the text pair includes: a claim sentence and the preprocessed user tweet text; inputting the text pair into a pre-trained semantic consistency recognition model to obtain a consistency recognition result; wherein the consistency recognition result includes a semantic consistency score and a semantic stance classification result; performing sentiment analysis on the preprocessed user tweet text based on a pre-set sentiment dictionary to calculate a sentiment tendency score; weighting and fusing the semantic consistency score and the sentiment score to obtain a comprehensive stance tendency score; obtaining the user's stance according to the comprehensive stance tendency score and the semantic stance classification result.

[0007] Preferably, the original user tweet text is preprocessed to obtain preprocessed user tweet text, specifically including: Defining a keyword dictionary containing target topic keywords; Matching the original user tweet text with the target topic keywords in the keyword dictionary, and taking the target topic keywords that match successfully as the preprocessed user tweet text.

[0008] Preferably, according to the preprocessed user tweet text, a text pair is constructed, specifically including: When the number of preprocessed user tweet texts is 1, keyword extraction is performed on the preprocessed user tweet text to obtain M keywords corresponding to the preprocessed user tweet text; Using a pre-trained generative language model to automatically construct a claim sentence for the preprocessed user tweet text according to the keywords corresponding to the preprocessed user tweet text; When the number of preprocessed user tweet texts is multiple, unsupervised clustering method is used for clustering analysis of the preprocessed user tweet texts, and according to the clustering analysis result, the multiple preprocessed user tweet texts are divided into N classes, and M keywords are extracted from the preprocessed user tweet texts in each class to represent the preprocessed user tweet texts in the class; Using a pre-trained generative language model to automatically construct a claim sentence for each preprocessed user tweet text in each class according to the keywords of the preprocessed user tweet texts in each class; Each preprocessed user tweet text and the corresponding claim sentence form a text pair.

[0009] Preferably, M keywords are extracted from the preprocessed user tweet texts in each class to represent the preprocessed user tweet texts in the class, specifically including: Keyword extraction is performed on the preprocessed user tweet texts in each class to obtain initial keywords; Using a pre-trained part-of-speech tagging model to filter the initial keywords to obtain noun keywords; Statistical analysis of the noun keywords to obtain a noun keyword frequency list; Selecting the top M noun keywords in the noun keyword frequency list as the keywords of the preprocessed user tweet texts in each class.

[0010] Preferably, a pre-trained generative language model is used to automatically construct a claim sentence for each preprocessed user tweet text in each class according to the keywords of the preprocessed user tweet texts in each class, specifically including: Constructing a mapping relationship between the keywords of the preprocessed user tweet texts in each class and the preprocessed user tweet texts in each class; The pre-trained generative language model is used to automatically construct a claim sentence according to the keywords of the preprocessed user tweet text of each category; According to the mapping relationship between the keywords of the preprocessed user tweet text of each category and each preprocessed user tweet text in each category and the claim sentence corresponding to the keywords of the preprocessed user tweet text of each category, the claim sentence corresponding to each preprocessed user tweet text of each category is obtained.

[0011] Preferably, the semantic consistency recognition model comprises an input layer, a fusion layer, an encoding layer, a processing layer, a cosine similarity calculation layer, a full connection layer and an output layer. The input layer is used to input the text pair into the fusion layer and the encoding layer respectively; the fusion layer is used to splice and encode the claim sentence and the preprocessed user tweet text in the text pair to obtain a fusion sequence; the encoding layer is used to encode the claim sentence in the text pair to obtain a claim sentence encoding sequence; the processing layer is used to generate a viewpoint representation according to the fusion sequence and a claim representation according to the claim sentence encoding sequence; the cosine similarity calculation layer is used to calculate the cosine similarity between the claim representation and the viewpoint representation; the full connection layer is used to generate a semantic stance classification result according to the value of the cosine similarity and the viewpoint representation; and the output layer is used to take the value of the cosine similarity as a semantic consistency score and combine the semantic consistency score and the semantic stance classification result as a consistency recognition result for output.

[0012] Preferably, the processing layer is a large language model BERT based on a Transformer architecture.

[0013] Preferably, the preprocessed user tweet text is subjected to sentiment analysis based on a preset sentiment dictionary to calculate a sentiment tendency score, specifically including: Performing a word segmentation operation on the content of the preprocessed user tweet text to obtain one or more words; Matching the one or more words with positive words and negative words in the preset sentiment dictionary and obtaining the polarity label of the matching successful words in the sentiment dictionary; wherein the polarity label includes positive and negative; According to the polarity label of the matching successful words in the sentiment dictionary and the word frequency in the tweet content in the preprocessed user tweet text, a sentiment tendency score is calculated.

[0014] Preferably, the calculation formula of the comprehensive stance tendency score value is the semantic consistency score the sentiment tendency score In the formula, is a weight parameter, is the comprehensive stance tendency score value.

[0015] Preferably, according to the comprehensive stance tendency score value and the semantic stance classification result, the stance of the user is obtained, specifically including: when the comprehensive stance tendency score is greater than a set positive threshold value, determining that the user is a supporter of the semantic stance classification result; when the comprehensive stance tendency score is less than a set negative threshold value, determining that the user is an opponent of the semantic stance classification result; wherein the negative threshold value is less than the positive threshold value; when the comprehensive stance tendency score is less than or equal to the set positive threshold value and greater than or equal to the set negative threshold value, determining that the user is a neutral party of the semantic stance classification result.

[0016] In a second aspect, the present application further provides a social text stance recognition system based on claim generation and consistency analysis, comprising: an acquisition module configured to acquire original user tweet text of a user; a text pair construction module configured to construct a text pair according to the preprocessed user tweet text; wherein the text pair comprises a claim sentence and the preprocessed user tweet text; a consistency recognition module configured to input the text pair into a pre-trained semantic consistency recognition model to obtain a consistency recognition result; wherein the consistency recognition result comprises a semantic consistency score and a semantic stance classification result; an emotion analysis module configured to perform emotion analysis on the original user tweet text in the preprocessed user tweet text in the text pair based on a pre-set emotion dictionary, and calculate an emotion tendency score; a stance analysis module configured to weight and fuse the semantic consistency score and the emotion score to obtain a comprehensive stance tendency score, and obtain the stance of the user according to the comprehensive stance tendency score and the semantic stance classification result.

[0017] In specific implementation, the original user tweet text of the user is acquired; the original user tweet text is preprocessed to obtain the preprocessed user tweet text; a text pair is constructed according to the preprocessed user tweet text; the text pair is input into a pre-trained semantic consistency recognition model to obtain a consistency recognition result; emotion analysis is performed on the preprocessed user tweet text based on a pre-set emotion dictionary, and an emotion tendency score is calculated; the semantic consistency score and the emotion score are weighted and fused to obtain a comprehensive stance tendency score; and the stance of the user is obtained according to the comprehensive stance tendency score and the semantic stance classification result.

[0018] In the present application, the proposed social text stance recognition method and system based on claim generation and consistency analysis can realize comprehensive judgment of user stance from two dimensions of cognitive logic and emotional attitude, and improve the stability and reliability of social text stance recognition in the scene with strong emotion and variable language style by identifying text pairs through a pre-trained semantic consistency recognition model, obtaining semantic consistency scores and semantic stance classification results, introducing sentiment tendency scores on the basis of consistency judgment, quantifying the emotional tendency of users, weighting and fusing the sentiment tendency scores and consistency scores, and obtaining the comprehensive stance tendency scores and semantic stance classification results to obtain the user's stance. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 The flowchart of the social text stance recognition method based on claim generation and consistency analysis in an embodiment of the present application is shown.

[0020] Figure 2 The data flow diagram of the semantic consistency recognition model in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0021] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments.

[0022] REFERENCE Figure 1 The present application proposes a social text stance recognition method based on claim generation and consistency analysis, which comprises: obtaining the original user tweet text of a user; preprocessing the original user tweet text to obtain a preprocessed user tweet text; constructing a text pair according to the preprocessed user tweet text; wherein the text pair comprises a claim sentence and the preprocessed user tweet text; inputting the text pair into a pre-trained semantic consistency recognition model to obtain a consistency recognition result; wherein the consistency recognition result comprises a semantic consistency score and a semantic stance classification result; performing sentiment analysis on the preprocessed user tweet text based on a pre-set sentiment dictionary to calculate a sentiment tendency score; weighting and fusing the semantic consistency score and the sentiment score to obtain a comprehensive stance tendency score; obtaining the stance of the user according to the comprehensive stance tendency score and the semantic stance classification result.

[0023] In specific implementation, original user tweet texts of a user are acquired; the original user tweet texts are preprocessed to obtain preprocessed user tweet texts; text pairs are constructed according to the preprocessed user tweet texts; the text pairs are input into a pre-trained semantic consistency recognition model to obtain consistency recognition results; a pre-set sentiment dictionary is used to perform sentiment analysis on the preprocessed user tweet texts to calculate sentiment tendency scores; the semantic consistency scores and the sentiment scores are weighted and fused to obtain a comprehensive stance tendency score; and a stance of the user is obtained according to the comprehensive stance tendency score and the semantic stance classification result.

[0024] The semantic consistency recognition model is pre-trained, the semantic consistency scores and the semantic stance classification results are obtained by recognizing the text pairs, the sentiment tendency scores are introduced on the basis of the consistency judgment, the emotional tendency of the user is quantified, the sentiment tendency scores and the consistency scores are weighted and fused, the comprehensive stance tendency score and the semantic stance classification result are obtained by the weighted fusion, and the stance of the user is obtained, so that the user's stance is comprehensively judged from two dimensions of cognitive logic and emotional attitude, and the stability and reliability of social text stance recognition in a scene with strong emotions and variable language styles are improved.

[0025] The preprocessed user tweet texts include user identity information and user tweet information. The user identity information includes a user name and a user ID. The user tweet information includes a tweet ID, a publishing time, a tweet content, a number of likes, and a number of retweets of each preprocessed user tweet text.

[0026] In this embodiment, the text pairs are constructed according to the preprocessed user tweet texts, specifically including: When the number of preprocessed user tweet texts is one, keyword extraction is performed on the preprocessed user tweet text to obtain M keywords corresponding to the preprocessed user tweet text; A pre-trained generative language model is used to automatically construct a proposition sentence for the preprocessed user tweet text according to the keywords corresponding to the preprocessed user tweet text; When the number of preprocessed user tweet texts is multiple, unsupervised clustering is performed on the preprocessed user tweet texts, and the multiple preprocessed user tweet texts are divided into N classes according to the clustering results, and M keywords are extracted from the preprocessed user tweet texts in each class to represent the preprocessed user tweet texts in the class; A pre-trained generative language model is used to automatically construct a proposition sentence for each preprocessed user tweet text in each class according to the keywords of the preprocessed user tweet texts in the class; Each preprocessed user tweet text and the corresponding proposition sentence form a text pair.

[0027] The embodiment extracts keywords from the preprocessed user tweet text when the number of preprocessed user tweet texts is one, obtains M keywords corresponding to the preprocessed user tweet text, and uses an unsupervised clustering method to perform clustering analysis on the preprocessed user tweet text when the number of preprocessed user tweet texts is multiple, and divides the multiple preprocessed user tweet texts into N high-frequency and representative topic categories according to the clustering analysis result, to support fine-grained stance recognition in a multi-topic scenario, and significantly improve the accuracy and interpretability of stance recognition. Then, M keywords are extracted from the preprocessed user tweet text of each category to represent the preprocessed user tweet text of each category, to independently recognize the stance under each topic. In addition, a pre-trained generative language model is used to automatically construct a claim sentence for each preprocessed user tweet text in each category according to the keywords of the preprocessed user tweet text of each category, which can flexibly adapt to various topic contents and realize claim construction for any theme, greatly improving the universality and automation of the method.

[0028] Too many keywords can disturb the output of the large model, leading to homogenization of different categories of topics; too few keywords can make the output of the large model too empty and cannot accurately grasp the details of the discussion topic. In order to effectively generate high-quality claim sentences according to M keywords, M is 3 in the embodiment.

[0029] Among them, the content of the user tweet information is the core attribute. For the task of identifying user social stance, the original user tweet text is an important basis for judging the user's stance. Since the original user tweet text has complex original data, it is necessary to filter out tweets directly related to the theme or task to ensure that the final data set can effectively reflect the user's key points and stance. Therefore, in a further embodiment, the original user tweet text is preprocessed to obtain a preprocessed user tweet text, specifically including: Defining a keyword dictionary containing target topic keywords; Matching the original user tweet text with the target topic keywords in the keyword dictionary, and using the target topic keywords that match successfully as the preprocessed user tweet text.

[0030] In a further embodiment, M keywords are extracted from the preprocessed user tweet text of each category to represent the preprocessed user tweet text of each category, specifically including: Extracting keywords from the preprocessed user tweet text of each category to obtain initial keywords; Using a pre-trained part-of-speech tagging model to filter the initial keywords to obtain noun keywords; Counting the noun keywords to obtain a noun keyword frequency list; Select the top M nouns in the keyword frequency list as the keywords of the preprocessed user tweet text of each category.

[0031] In one specific embodiment, in the keyword extraction stage, first, the TextRank text summary algorithm is used to extract keywords from all filtered tweets to mine the core concepts and topic elements that users pay attention to. In order to improve the theme representativeness and entity of the keywords, the part-of-speech tagging model is further introduced to filter the preliminarily extracted keywords, and only the nouns are retained, so as to ensure that the keywords have clear semantic direction and can accurately reflect the theme or entity discussed by the user. After completing the keyword extraction, the keywords are counted, and the group of keywords with the highest frequency is selected as the keywords of the preprocessed user tweet text of each category, and the M keywords in each group represent an independent topic.

[0032] In a further embodiment, a pre-trained generative language model is used to automatically construct a claim sentence for each preprocessed user tweet text in each category according to the keywords of the preprocessed user tweet text of each category, specifically including: A mapping relationship between the keywords of the preprocessed user tweet text of each category and each preprocessed user tweet text in each category is constructed; A pre-trained generative language model is used to automatically construct a claim sentence according to the keywords of the preprocessed user tweet text of each category; According to the mapping relationship between the keywords of the preprocessed user tweet text of each category and each preprocessed user tweet text in each category and the claim sentence corresponding to the keywords of the preprocessed user tweet text of each category, the claim sentence corresponding to the preprocessed user tweet text of each category is obtained; According to the claim sentence corresponding to the preprocessed user tweet text of each category, the claim sentence corresponding to each preprocessed user tweet text of each category is obtained.

[0033] After obtaining the topic keyword set, the embodiment further introduces a generative language model to automatically construct a claim sentence. Since the user's position on a certain subject often varies with different topics, a claim sentence with clear position direction and related to the target subject needs to be generated for each topic.

[0034] In this embodiment, a generative language model with large-scale corpus pre-training capability is used, such as Deepseek, to guide the generative language model to generate a claim sentence with a position bias according to the keywords and the pre-set position bias input by the user, as the analysis target under this topic. The claim sentence positively represents the target subject in semantics, so that the position recognition problem is formalized as the problem of "judging whether the user supports the claim", which is convenient for model modeling and unified classification.

[0035] After the keyword extraction and the claim sentence generation, to determine whether the user supports the claim, the embodiment takes the user tweet as the user's viewpoint expression, combines the aforementioned generated claim sentence, and constitutes a set of "claim sentence and preprocessed user tweet text" text pairs to input a pre-trained semantic consistency recognition model to obtain a consistency recognition result; wherein the consistency recognition result includes a semantic consistency score and a semantic stance classification result.

[0036] To realize stance classification, as shown in Figure 2 In one specific embodiment, the semantic consistency recognition model includes an input layer, a fusion layer, an encoding layer, a processing layer, a cosine similarity calculation layer, a full connection layer, and an output layer. The input layer is connected to the input ends of the fusion layer and the encoding layer, the output ends of the fusion layer and the encoding layer are connected to the input end of the processing layer, the output end of the processing layer is connected to the input ends of the cosine similarity calculation layer and the full connection layer, the output end of the cosine similarity calculation layer is connected to the input ends of the output layer and the full connection layer, and the output end of the full connection layer is connected to the output layer.

[0037] In specific implementation, the input layer is used to input the text pairs into the fusion layer and the encoding layer respectively; the fusion layer is used to splice and encode the claim sentence and the preprocessed user tweet text in the text pair to obtain a fusion sequence; the encoding layer is used to encode the claim sentence in the text pair to obtain a claim sentence encoding sequence; the processing layer is used to generate a viewpoint representation according to the fusion sequence and a claim representation according to the claim sentence encoding sequence; the cosine similarity calculation layer is used to calculate the cosine similarity between the claim representation and the viewpoint representation; the full connection layer is used to generate a semantic stance classification result according to the value of the cosine similarity and the viewpoint representation; and the output layer is used to output the value of the cosine similarity as a semantic consistency score and combine the semantic consistency score and the semantic stance classification result as a consistency recognition result.

[0038] The semantic consistency recognition model in the embodiment is a joint modeling of claims and viewpoints, which uses consistency constraints to capture the consistency between claims and viewpoints, and predicts whether the user supports the claim according to the input claim and the user's viewpoint, to quickly and accurately realize stance recognition.

[0039] The processing layer is a large language model BERT based on a Transformer architecture. The large language model BERT based on the Transformer architecture can accurately understand the context of the text by using bidirectional context modeling capability, and is suitable for the recognition of semantic relationships in the embodiment.

[0040] In specific implementation, the input of the large language model BERT includes two sequences: one is the fusion sequence obtained by splicing the claim sentence and the user tweet, in the format of [CLS] claim sentence [SEP] tweet [SEP]; the other is the claim sentence encoding sequence. The two sequences of the fusion sequence and the claim sentence encoding sequence are encoded by the large language model BERT with shared weights to obtain two sets of semantic vector representations of the viewpoint representation and the claim representation; then, the large language model BERT further calculates the cosine similarity between the two sets of semantic vector representations as a semantic consistency score, which is used to measure the consistency between the claim and the viewpoint.

[0041] The viewpoint representation and the claim representation obtained according to the fusion sequence are used to calculate the cosine similarity, because the stance classification task is not only to judge whether the semantics of the two sentences are consistent, but also to capture more fine-grained context association and opposition relationship. If the claim sentence and the viewpoint sentence are independently encoded (i.e., the user tweet text is preprocessed), and then the similarity is calculated, only the overall semantic representation of the two sentences is obtained, and the model cannot explicitly learn the corresponding relationship and logical conflict between specific words, which is not enough for stance judgment. The fusion sequence obtained by splicing and encoding the claim sentence and the preprocessed user tweet text into the BERT to generate the fusion representation can make each word of the viewpoint sentence "focus" on the related word in the claim sentence through the multi-layer self-attention mechanism of BERT, so that the semantic clues of the opposite sentence are integrated when encoding, forming a more targeted viewpoint representation. Such a fusion sequence provides rich interactive features for subsequent classification, which can more accurately identify subtle stance differences, and combines the independent encoding of the claim representation and the consistency constraint, which is equivalent to optimizing from the perspectives of "interactive features" and "semantic alignment", so that the model has stronger performance in the stance recognition task.

[0042] Finally, the semantic consistency recognition model judges the stance tendency according to the semantic consistency score and the viewpoint representation through a fully connected layer: if the semantic consistency score is higher than a first preset threshold, it means that the viewpoint representation and the stance classification in the claim representation are highly consistent, so it is considered that the user supports the stance classification of the claim representation; if the semantic consistency score is lower than a second preset threshold, which is smaller than the first preset threshold, it means that there is a semantic conflict or a negative relationship between the viewpoint representation and the claim representation, so it is judged that the user opposes the stance classification of the claim representation; if the semantic consistency score is lower than or equal to the first preset threshold and higher than or equal to the second preset threshold, it means that the user has no obvious attitude, so it is classified as neutral. The semantic consistency recognition model supports outputting classification labels and continuous stance scores, and can realize the stance judgment of a single tweet under a specified topic.

[0043] Further, the standpoints expressed by the same user in multiple posts are statistically and hierarchically integrated to output the overall standpoint judgment result of the user level. The embodiment also supports the unified expression of the standpoint of a single user on multiple topics or in multiple time periods, thereby enhancing the completeness and coherence of the standpoint recognition at the user behavior level.

[0044] In the unified expression, if the same user has standpoints on multiple topics, the user's standpoint scores on the topics are output in the json format; If the user has standpoints on the same topic in multiple time periods, the standpoint scores are calculated by period and output in the json format according to the time sequence.

[0045] Of course, before the text pair is input into the pre-trained semantic consistency recognition model to obtain the consistency recognition result, the embodiment further includes: constructing a semantic consistency recognition model; and training the semantic consistency recognition model.

[0046] In the training process of the semantic consistency recognition model, the semantic consistency recognition model is optimized and trained using a total loss function. The total loss function is: ; in the formula, wherein, Ltotal represents the total loss function, and is used to represent the potential consistency between the viewpoint and the proposition; Lclass represents a semantic standpoint classification loss function, Lscore represents a semantic consistency score loss function.

[0047] wherein, ; in the formula, wherein, represents the proposition representation, represents the viewpoint representation, represents the cosine similarity, represents the maximum value.

[0048] In the embodiment, the preprocessed user tweet text is subjected to sentiment analysis based on a preset sentiment dictionary, and a sentiment tendency score is calculated, specifically including: Carrying out a word segmentation operation on the content of the preprocessed user tweet text to obtain one or more words; Matching the one or more words with positive words and negative words in the preset sentiment dictionary, and obtaining the polarity label of the matched word in the sentiment dictionary; According to the polarity label of the matched word in the sentiment dictionary and the word frequency in the tweet content in the preprocessed user tweet text, a sentiment tendency score is calculated.

[0049] wherein, the polarity label includes positive, negative, or neutral.

[0050] wherein the sentiment tendency score is a continuous value, and the range is usually set between -1 and +1, representing the emotional tendency from strong opposition to strong support.

[0051] wherein the sentiment dictionary is a Chinese sentiment dictionary, an English sentiment dictionary, or a Chinese-English sentiment dictionary.

[0052] Of course, the sentiment dictionary can also be a sentiment dictionary of various languages.

[0053] In the embodiment, the calculation formula of the comprehensive stance tendency score is the semantic consistency score the sentiment tendency score; wherein, is a weight parameter, is the comprehensive stance tendency score.

[0054] In order to facilitate the final stance classification judgment, in the embodiment, the stance of the user is obtained according to the comprehensive stance tendency score and the semantic stance classification result, specifically including: when the comprehensive stance tendency score is greater than a set positive threshold, the user is determined to be the support party of the semantic stance classification result; when the comprehensive stance tendency score is less than a set negative threshold, the user is determined to be the opposition party of the semantic stance classification result; when the comprehensive stance tendency score is less than or equal to the set positive threshold and greater than or equal to the set negative threshold, the user is determined to be the neutral party of the semantic stance classification result.

[0055] In one specific embodiment, when S > 0.5, the user is determined to be the support party of the semantic stance classification result; when S < -0.5, the user is determined to be the opposition party of the semantic stance classification result; when -0.5 ≤ S ≤ 0.5, the user is determined to be the neutral party of the semantic stance classification result.

[0056] The embodiment respectively calculates the sentiment tendency score of the post and the consistency score between the post and the claim sentence, and realizes the final stance classification judgment by setting a reasonable double-threshold strategy and fusing the two types of score information. The method fully utilizes the sentiment information and the semantic consistency information, and improves the robustness and interpretability of the stance recognition.

[0057] In a second aspect, the present application also provides a social text stance recognition system based on claim generation and consistency analysis, comprising: an acquisition module, configured to acquire an original user tweet text of a user; a preprocessing module, configured to preprocess original user tweet texts to obtain preprocessed user tweet texts; a text pair construction module, configured to construct text pairs according to the preprocessed user tweet texts; wherein the text pairs comprise claim sentences and the preprocessed user tweet texts; a consistency identification module, configured to input the text pairs into a pre-trained semantic consistency identification model to obtain consistency identification results; wherein the consistency identification results comprise semantic consistency scores and semantic stance classification results; an emotion analysis module, configured to perform emotion analysis on the preprocessed user tweet texts based on a pre-set emotion dictionary to calculate emotion tendency scores; a stance analysis module, configured to perform weighted fusion of the semantic consistency scores and the emotion scores to obtain comprehensive stance tendency scores, and obtain a stance of a user according to the comprehensive stance tendency scores and the semantic stance classification results.

[0058] The construction process of the text pairs comprises: when the number of the preprocessed user tweet texts is 1, performing keyword extraction on the preprocessed user tweet text to obtain M keywords corresponding to the preprocessed user tweet text; and using a pre-trained generative language model to automatically construct a claim sentence for the preprocessed user tweet text according to the keywords corresponding to the preprocessed user tweet text; when the number of the preprocessed user tweet texts is multiple, performing cluster analysis on the preprocessed user tweet texts using an unsupervised clustering method, and dividing the multiple preprocessed user tweet texts into N classes according to the cluster analysis results, and extracting M keywords from the preprocessed user tweet texts in each class to represent the preprocessed user tweet texts in the class; and using a pre-trained generative language model to automatically construct a claim sentence for each preprocessed user tweet text in each class according to the keywords of the preprocessed user tweet texts in the class; each preprocessed user tweet text and the corresponding claim sentence form a text pair.

[0059] The preprocessed user tweet texts are obtained by preprocessing the original user tweet texts, and specifically comprise: a keyword dictionary containing target topic keywords is defined; the target topic keywords in the keyword dictionary are used to match the original user tweet texts, and the target topic keywords that are successfully matched are used as the preprocessed user tweet texts.

[0060] The M keywords used to represent the preprocessed user tweet texts in each class are extracted from the preprocessed user tweet texts in each class, and specifically comprise: keywords are extracted from the preprocessed user tweet texts in each class to obtain initial keywords; The initial keywords are screened by using a pre-trained part-of-speech tagging model to obtain noun keywords; The noun keywords are counted to obtain a noun keyword frequency list; The noun keywords with the top M frequencies in the noun keyword frequency list are selected as the keywords of the preprocessed user tweet text of each category.

[0061] The pre-trained generative language model is used to automatically construct a claim sentence for each preprocessed user tweet text in each category according to the keywords of the preprocessed user tweet text of each category, and the process specifically includes: A mapping relationship between the keywords of the preprocessed user tweet text of each category and each preprocessed user tweet text in each category is constructed; A pre-trained generative language model is used to automatically construct a claim sentence according to the keywords of the preprocessed user tweet text of each category; According to the mapping relationship between the keywords of the preprocessed user tweet text of each category and each preprocessed user tweet text in each category and the claim sentence corresponding to the keywords of the preprocessed user tweet text of each category, a claim sentence corresponding to each preprocessed user tweet text of each category is obtained.

[0062] The semantic consistency recognition model in this embodiment includes an input layer, a fusion layer, an encoding layer, a processing layer, a cosine similarity calculation layer, a full connection layer, and an output layer; The input layer is used to input the text pair into the fusion layer and the encoding layer; the fusion layer is used to splice and encode the claim sentence and the preprocessed user tweet text in the text pair to obtain a fusion sequence; the encoding layer is used to encode the claim sentence in the text pair to obtain a claim sentence encoding sequence; the processing layer is used to generate a viewpoint representation according to the fusion sequence and generate a claim representation according to the claim sentence encoding sequence; the cosine similarity calculation layer is used to calculate the cosine similarity between the claim representation and the viewpoint representation; the full connection layer is used to generate a semantic stance classification result according to the value of the cosine similarity and the viewpoint representation; and the output layer is used to take the value of the cosine similarity as a semantic consistency score and combine the semantic consistency score and the semantic stance classification result as a consistency recognition result for output.

[0063] The processing layer is a large language model BERT based on a Transformer architecture.

[0064] The process of performing sentiment analysis on the preprocessed user tweet text based on the pre-set sentiment dictionary includes: The content of the preprocessed user tweet text is subjected to a word segmentation operation to obtain one or more words; The one or more words are matched with positive words and negative words in a preset sentiment dictionary, and a polarity label of the matched word in the sentiment dictionary is obtained; wherein the polarity label includes positive and negative; According to the polarity label of the matched word in the sentiment dictionary and the word frequency in the tweet content in the preprocessed user tweet text, a sentiment tendency score is calculated.

[0065] Wherein, the calculation formula of the comprehensive stance tendency score is S = α × semantic consistency score + (1-α) × sentiment tendency score; in the formula, α is a weight parameter, and S is the comprehensive stance tendency score.

[0066] Wherein, according to the comprehensive stance tendency score and the semantic stance classification result, the stance of the user is obtained, specifically including: When the comprehensive stance tendency score is greater than a set positive threshold, the user is determined as a support party of the semantic stance classification result; When the comprehensive stance tendency score is less than a set negative threshold, the user is determined as an opposite party of the semantic stance classification result; wherein the negative threshold is less than the positive threshold; When the comprehensive stance tendency score is less than or equal to the set positive threshold and greater than or equal to the set negative threshold, the user is determined as a neutral party of the semantic stance classification result.

[0067] The above is only the preferred specific embodiment of the present application, but the protection scope of the present application is not limited to this, any person skilled in the art in the technical range disclosed by the present application, according to the technical scheme and the inventive concept of the present application, equivalent replacement or change, should be covered in the protection scope of the present application.

Claims

1. A social text stance identification method based on proposition generation and consistency analysis, characterized by: include: Get the user's original tweet text; Preprocessing the original user tweet text to obtain preprocessed user tweet text; Constructing a text pair based on the pre-processed user tweet text; wherein the text pair includes the assertion sentence and the pre-processed user tweet text; Input the text pair into the pre-trained semantic consistency recognition model to obtain the consistency recognition result; wherein the consistency recognition result includes the semantic consistency score and the semantic stance classification result; Perform sentiment analysis on the pre-processed user tweet text based on the preset sentiment dictionary and calculate the sentiment tendency score; The semantic consistency score and the sentiment score are weighted and integrated to obtain the comprehensive stance tendency score; The user's stance is obtained based on the comprehensive stance tendency score and semantic stance classification results.

2. The social text stance identification method based on proposition generation and consistency analysis according to claim 1 is characterized in that: Preprocess the original user tweet text to obtain the preprocessed user tweet text, specifically including: Customize a keyword dictionary containing keywords for the target topic; The target topic keywords in the keyword dictionary are used to match the original user tweet text, and the successfully matched target topic keywords are used as the preprocessed user tweet text.

3. The social text stance identification method based on proposition generation and consistency analysis according to claim 1 is characterized in that: Based on the pre-processed user tweet text, construct text pairs, specifically including: When the number of pre-processed user tweet texts is 1, keyword extraction is performed on the pre-processed user tweet text to obtain M keywords corresponding to the pre-processed user tweet text; Using the pre-trained generative language model, a proposition sentence is automatically constructed for the pre-processed user tweet text based on the keywords corresponding to the pre-processed user tweet text. When there are multiple pre-processed user tweets, an unsupervised clustering method is used to perform cluster analysis on the pre-processed user tweets. Based on the results of the cluster analysis, the multiple pre-processed user tweets are divided into N categories, and M keywords representing the pre-processed user tweets of each category are extracted from the pre-processed user tweets of each category. Using a pre-trained generative language model, a claim sentence is automatically constructed for each pre-processed user tweet text in each category based on the keywords of the pre-processed user tweet text in each category. Each pre-processed user tweet text is paired with the corresponding claim sentence.

4. The social text stance identification method based on proposition generation and consistency analysis according to claim 3 is characterized in that: Extract M keywords from each category of pre-processed user tweet texts to represent the pre-processed user tweet texts of that category, specifically including: Perform keyword extraction on the pre-processed user tweet text of each category to obtain initial keywords; Use the pre-trained part-of-speech tagging model to filter the initial keywords and obtain noun keywords; Count the noun keywords and get a frequency list of noun keywords; The top M noun keywords in the noun keyword frequency list are selected as keywords for the preprocessed user tweet texts of each category.

5. The social text stance identification method based on claim generation and consistency analysis according to claim 3 utilizes a pre-trained generative language model to automatically construct a claim sentence for each pre-processed user tweet text in each category based on keywords in the pre-processed user tweet text in each category, specifically comprising: Construct a mapping relationship between the keywords of each category of pre-processed user tweet text and each pre-processed user tweet text in each category; Use the pre-trained generative language model to automatically construct a proposition sentence based on the keywords of each category of pre-processed user tweet text; According to the mapping relationship between the keywords of each category of preprocessed user tweet text and each preprocessed user tweet text in each category and the proposition sentences corresponding to the keywords of each category of preprocessed user tweet text, the proposition sentences corresponding to each preprocessed user tweet text in each category are obtained.

6. The social text stance identification method based on proposition generation and consistency analysis according to claim 1 is characterized in that: The semantic consistency recognition model includes input layer, fusion layer, encoding layer, processing layer, cosine similarity calculation layer, fully connected layer and output layer; The input layer is used to input text pairs into the fusion layer and encoding layer respectively; The fusion layer is used to concatenate and encode the assertion sentence in the text pair and the preprocessed user tweet text to obtain a fused sequence; the encoding layer is used to encode the assertion sentence in the text pair to obtain an assertion sentence encoding sequence; the processing layer is used to generate opinion representation based on the fused sequence, and to generate assertion representation based on the assertion sentence encoding sequence; the cosine similarity calculation layer is used to calculate the cosine similarity between the assertion representation and the opinion representation; the fully connected layer is used to generate a semantic stance classification result based on the cosine similarity value and the opinion representation; the output layer is used to use the cosine similarity value as a semantic consistency score, and combine the semantic consistency score and the semantic stance classification result as a consistency recognition result for output.

7. The social text stance identification method based on proposition generation and consistency analysis according to claim 6 is characterized in that: The processing layer is the large language model BERT based on the Transformer architecture.

8. The social text stance identification method based on proposition generation and consistency analysis according to claim 1 is characterized in that: Perform sentiment analysis on the pre-processed user tweets based on the preset sentiment dictionary and calculate the sentiment tendency score, including: Perform word segmentation on the content of the preprocessed user tweet text to obtain one or more words; Match one or more words with positive and negative words in a preset sentiment dictionary, and obtain polarity labels of the successfully matched words in the sentiment dictionary; polarity labels include positive, negative, or neutral; The sentiment tendency score is calculated based on the polarity labels of the successfully matched words in the sentiment dictionary and the word frequency in the tweet content in the preprocessed user tweet text.

9. The social text stance identification method based on proposition generation and consistency analysis according to claim 1 is characterized in that: The calculation formula for the comprehensive stance tendency score is: Semantic consistency score Affective tendency score; Where, is the weight parameter, It is a comprehensive position tendency score.

10. The social text stance identification method based on proposition generation and consistency analysis according to claim 1 is characterized in that: Based on the comprehensive stance tendency score and semantic stance classification results, the user's stance is obtained, including: When the comprehensive stance tendency score is greater than the set positive threshold, the user is judged to be a supporter of the semantic stance classification result; When the comprehensive stance tendency score is less than the set negative threshold, the user is judged to be against the semantic stance classification result; wherein the negative threshold is less than the positive threshold; When the comprehensive stance tendency score is less than or equal to the set positive threshold and greater than or equal to the set negative threshold, the user is judged to be neutral in the semantic stance classification result.

11. A social text stance recognition system based on proposition generation and consistency analysis, characterized by: include: The acquisition module is used to obtain the original user tweet text; A preprocessing module is used to preprocess the original user tweet text to obtain a preprocessed user tweet text; A text pair construction module is used to construct a text pair based on the pre-processed user tweet text; wherein the text pair includes: an assertion sentence and the pre-processed user tweet text; A consistency recognition module is used to input the text pair into a pre-trained semantic consistency recognition model to obtain a consistency recognition result; wherein the consistency recognition result includes a semantic consistency score and a semantic stance classification result; Sentiment analysis module, which is used to perform sentiment analysis on pre-processed user tweets based on a preset sentiment dictionary and calculate sentiment tendency scores; The stance analysis module is used to perform weighted fusion of the semantic consistency score and the sentiment score to obtain a comprehensive stance tendency score, and obtain the user's stance based on the comprehensive stance tendency score and the semantic stance classification results.

Citation Information

Patent Citations

  • Semantic sentiment analysis method and device

    CN113901171A

  • Multi-dimensional information fusion user standing detection method based on graph attention network

    CN116245110A

  • Zero sample interpretability field detection method and device based on prompt learning

    CN117764077A

  • Multi-model fusion data classification prediction method and system

    CN118069852A

  • Text viewpoint recognition method and device, storage medium and electronic equipment

    CN118820458A