A microblog text implicit sentiment recognition method fusing multiple features and expression sentiment dictionaries

By fusing multiple features and an emoji sentiment dictionary, the accuracy problem of implicit sentiment recognition in Weibo comments was solved. Deep semantic information was extracted using BERT, Word2Vec, and Bi-GRU networks, and weighted calculation was performed using an emoji sentiment dictionary, resulting in more accurate sentiment recognition of Weibo comments.

CN116737923BActive Publication Date: 2026-05-26ANHUI UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ANHUI UNIV OF SCI & TECH
Filing Date
2023-04-15
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing sentiment analysis methods struggle to accurately identify implicit sentiment in Weibo comments, especially since they neglect the importance of character shape and pronunciation features as well as emoticons, leading to significant errors in the analysis results.

Method used

This paper proposes an implicit sentiment recognition method for Weibo text that integrates multiple features and an emoji sentiment dictionary. It extracts character features through BERT, extracts Wubi, Zhengma and Pinyin features through Word2Vec, and learns deep semantic information by combining Bi-GRU network. Finally, it uses an emoji sentiment dictionary for weighted calculation to identify the user's true emotions.

Benefits of technology

It improves the accuracy of sentiment recognition in Weibo comments, fully understands users' true semantics, and enhances the model's performance in implicit sentiment recognition tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116737923B_ABST
    Figure CN116737923B_ABST
Patent Text Reader

Abstract

This invention discloses a method for implicit sentiment recognition of Weibo text that integrates multiple features and an emoji sentiment dictionary. Belonging to the field of sentiment analysis in natural language processing, the method includes the following steps: Step 1: Data collection and processing; Step 2: Assigning corresponding sentiment intensities to default emojis in Weibo posts and establishing an emoji sentiment dictionary; Step 3: Extracting character features and phonetic features from Wubi, Zhengma, and Pinyin input methods, and fusing the extracted features; Step 4: Using a Bi-GRU network to learn deeper semantic information; Step 5: Calculating the sentiment polarity of the text and combining it with the emoji sentiment dictionary to obtain the implicit sentiment classification result. This invention integrates Chinese features to identify online words, improving the accuracy of identifying words with similar shapes and sounds, and, combined with the emoji sentiment dictionary, enhances the effectiveness of identifying implicit sentiment in Weibo text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing, specifically a text implicit sentiment recognition method that integrates multiple features and an expression sentiment dictionary. Background Technology

[0002] With the widespread use of the internet, a vast amount of text data has emerged online, carrying subjective information such as people's attitudes and opinions. Research has found that comments contain a large amount of implicit sentiment, making it difficult for models to identify users' true intentions when commenting, affecting the accuracy of sentiment analysis and leading to significant errors in the analysis results.

[0003] Weibo comments are characterized by their originality and unpredictability. Existing sentiment analysis methods mostly learn only the word features of the text, neglecting the features of character shape and pronunciation. However, Weibo contains a large amount of internet slang, requiring readers to infer the user's true expression through character shape and pronunciation features. Furthermore, Weibo comments contain a significant number of emoticons, most of which differ from their encoded meanings. Each emoticon conveys important emotional information and plays a crucial role in expressing emotions. Directly deleting or using these emoticons would cause semantic confusion. This paper proposes an implicit sentiment recognition method for Weibo text that integrates multiple features and combines them with an emoticon sentiment dictionary to more accurately understand the true emotions expressed by users, demonstrating good performance in implicit sentiment recognition tasks. Summary of the Invention

[0004] The purpose of this invention is to provide a method for implicit sentiment recognition of Weibo text that integrates multiple features and an emoji sentiment dictionary. By integrating multiple features and combining them with an emoji sentiment dictionary, the method can identify the implicit emotions in users' statements and more accurately understand the true emotions expressed by users.

[0005] The present invention achieves its objective using the following technical solution:

[0006] A method for implicit sentiment recognition of Weibo text that integrates multiple features and an emoji sentiment dictionary includes the following steps:

[0007] (1) Collect the comment text under the trending topics on Weibo and preprocess the text data to prevent irrelevant content from interfering with the final judgment result;

[0008] (2) Establish an emoji emotion dictionary corresponding to the default emojis on Weibo, and assign appropriate emotion intensity to each emoji;

[0009] (3) Use BERT to extract character features from the text, and use Word2Vec to extract features from the text in terms of Wubi, Zhengma and Pinyin. Then, fuse the extracted features and use them as input to the Bi-GRU network to learn deeper semantic information.

[0010] (4) Calculate the emotional polarity probability and integrate the facial expression and emotion dictionary to determine the final emotion classification.

[0011] The specific operations for collecting comment texts under trending topics on Weibo and preprocessing the text data in step (1) are as follows:

[0012] (1.1) Use web crawlers to crawl user comments under trending topics.

[0013] (1.2) Remove noise information, including “#topic#”, “@username”, images, video webpage links and irrelevant content, from the crawled text, and convert traditional Chinese characters in the text to simplified Chinese characters.

[0014] (1.3) Label these texts as “positive” and “negative”.

[0015] The method for establishing an emoji emotion dictionary corresponding to the default emojis in Weibo, as described in step (2), is as follows:

[0016] (2.1) Extract the encoding of the default emojis in Weibo.

[0017] (2.2) The emotional intensity of the default emojis on Weibo is labeled manually to construct an emoji emotional dictionary.

[0018] The steps in step (3) include extracting character features from the text using BERT, extracting Wubi, Zhengma, and Pinyin features from the text using Word2Vec, and fusing the extracted feature vectors.

[0019] (3.1) Input sequence vectorization

[0020] BERT uses WordPiece as the tokenizer, and the word embeddings obtained from the original input sequence are: S=[w0,w1,w2,...,w i ,...,w n ,w n+1 ], where S refers to the input sequence, n is the sentence length, w0 is the sentence classification label "[CLS]" (classification) vector, and w n+1 It is a sentence separator / end-of-sentence marker "[SEP]" (separation) vector, which is then encoded using a multi-layer bidirectional Transformer network. The vectorization process can be represented as:

[0021] V i bert =BERT(w i ),i∈Z∩i∈[0,n+1] (1)

[0022] Among them, w i This represents the i-th character in the sequence, where i is an integer between 0 and n+1; BERT() indicates encoding using a BERT pre-trained model; V i bert This represents the vector obtained after encoding the i-th character in the input sequence using BERT.

[0023] (3.2) Extracting Wubi Features

[0024] Using the pywubi library in Python, the input sequence is converted into the corresponding Wubi code. Then, the Word2Vec model is used to train it, obtaining the contextual features of each character's Wubi code, and learning the vector corresponding to each character under the Wubi features. The vectorization process of Wubi features is as follows:

[0025] T = f wb (S) (2)

[0026] W vec =Word2Vec(T) (3)

[0027] V i wb =W vec (T i ),i∈Z∩i∈[0,n+1] (4)

[0028] Among them, f wb This means converting the input sequence into the corresponding Wubi code using the pywubi library; Word2Vec() means vectorizing the sequence using the Word2Vec model based on Wubi features; V i wb Represents the relationship with the input sequence T i The corresponding Wubi feature vector.

[0029] (3.3) Extracting Zheng code features

[0030] The input sequence is converted into its corresponding Zheng code using a correspondence table between Zheng code and Chinese characters. The Zheng code features are then trained using a method similar to that used for training Wubi input methods. The vectorization process of the Zheng code features is as follows:

[0031] T = f zm (S) (5)

[0032] W vec=Word2Vec(T) (6)

[0033] V i zm =W vec (T i ),i∈Z∩i∈[0,n+1] (7)

[0034] Among them, f zm This indicates that the input sequence is converted into the corresponding Zheng code according to the correspondence table between Zheng code and Chinese characters; Word2Vec() indicates that the sequence is vectorized using the Word2Vec model according to the features of Zheng code; V i zm Represents the relationship with the input sequence T i The corresponding Zheng code feature vector.

[0035] (3.4) Extracting Pinyin Features

[0036] Using the pypinyin library in Python, the input sequence is converted into its corresponding pinyin encoding. Then, the Word2Vec model is used to train it, obtaining the contextual features of each character's pinyin encoding. This learns the vector corresponding to each character under the pinyin features. The vectorization process of the pinyin features is as follows:

[0037] T = f py (S) (8)

[0038] W vec =Word2Vec(T) (9)

[0039] V i py =W vec (T i ),i∈Z∩i∈[0,n+1] (10)

[0040] Among them, f py This indicates that the input sequence is converted into its corresponding pinyin encoding using the pypinyin library; Word2Vec() indicates that the sequence is vectorized according to pinyin features using the Word2Vec model; V i py Represents the relationship with the input sequence T i The corresponding pinyin feature vector.

[0041] (3.5) Fuse the extracted features

[0042] The acquired features are concatenated to obtain the final embedding layer vector. The feature concatenation process is shown in Equation 11:

[0043] V i e=Contact(V i bert V i wb V i zm V i py (11)

[0044] (3.6) Use Bi-GRU network to extract deep semantic information

[0045] The fusion result V from step (3.5) i e As input to the Bi-GRU network, it learns deeper semantic information.

[0046] In step (4), the specific operations for calculating the emotional polarity probability and fusing the facial expression emotion dictionary to determine the final category are as follows:

[0047] (4.1) Use a fully connected layer to map the output vector obtained by Bi-GRU in step (3.6) to the sample label space, and then use the SoftMax activation function to calculate the probability corresponding to each polarity. The formula of the SoftMax activation function is as follows:

[0048]

[0049] Where, x i Let J be the output value of the i-th node, and J be the number of output nodes, i.e. the number of categories. In this method, there are 2 categories.

[0050] (4.2) The emojis appearing in the text are weighted using an emoji dictionary and combined with the probabilities calculated using the SoftMax function. The tendency with the highest probability is taken as the final classification result, as shown in formula (13):

[0051] C = Max(λ*E+P) pos ,P neg (13)

[0052] Among them, P pos and P neg λ represents the probabilities of positive and negative sentiment polarities calculated using a fully connected layer and SoftMax, respectively; E represents the sentiment intensity of the facial expressions appearing in the text in the dictionary; λ represents the weight of facial expressions in the implicit sentiment recognition model obtained through experiments, which is set to 0.17 in this method; and C represents the final classification result of the model.

[0053] The implicit sentiment recognition method for Weibo text that integrates multiple features and an emoji sentiment dictionary provided by this invention has the following advantages:

[0054] (1) This invention utilizes the learning of the features of Chinese characters in terms of shape and pronunciation to enable the model to learn and understand the true semantics of users when posting comments more comprehensively, thereby improving the accuracy of the model in recognizing online language in Weibo comments.

[0055] (2) By establishing and combining an expression and emotion dictionary, this invention enables the model to learn the semantics of text while supplementing it with the semantics of facial expressions, resulting in more complete and accurate learning of user emotions. Attached Figure Description

[0056] Figure 1 A flowchart of a method for implicit sentiment recognition of Weibo text that integrates multiple features and an emoji sentiment dictionary provided by this invention;

[0057] Figure 2 A screenshot of the default emojis in Weibo provided by this invention;

[0058] Figure 3 This invention provides a partial dictionary of facial expressions and emotions.

[0059] Figure 4 An example diagram illustrating the model discrimination process provided by this invention. Detailed Implementation

[0060] The present invention will be further explained and illustrated below through specific embodiments.

[0061] Example 1: This invention provides a method for implicit sentiment recognition of Weibo text that integrates multiple features and an emoji sentiment dictionary, such as... Figure 1 As shown. The specific steps are as follows.

[0062] S1. Collect relevant Weibo comments and preprocess the data.

[0063] S1.1 Use web crawler tools to crawl user comments under trending topics on Weibo.

[0064] S1.2 Remove noise information, including "#topic#", "@username", images, video webpage links, and irrelevant content, from the crawled text, and convert traditional Chinese characters in the text to simplified Chinese characters.

[0065] S1.3. Label the cleaned text with either "positive" or "negative" tags, where "positive" indicates positive sentiment comments and "negative" indicates negative sentiment comments.

[0066] S2. Establish an emoji emotion dictionary corresponding to Weibo's default emojis and assign appropriate emotion intensity to each emoji;

[0067] S2.1 Extract the codes corresponding to the default emojis in Weibo to construct an emoji sentiment dictionary, and manually label the emojis with their corresponding sentiment intensities. Among them, the default emojis in Weibo are as follows: Figure 2 As shown, some facial expression and emotion dictionaries are as follows: Figure 3 As shown.

[0068] S3. Use BERT to extract character features from the text, and use Word2Vec to extract features from the text in terms of Wubi, Zhengma, and Pinyin. Then, fuse the extracted features and use them as input to the Bi-GRU network to extract deep semantic information. The specific steps include the following steps.

[0069] S3.1 Input Sequence Vectorization

[0070] BERT uses WordPiece as the tokenizer, and the word embeddings obtained from the original input sequence are: S=[w0,w1,w2,...,w i ,...,w n ,w n+1 ], where S refers to the input sequence, n is the sentence length, w0 is the sentence classification label "[CLS]" (classification) vector, and w n+1 It is a sentence separator / end-of-sentence marker "[SEP]" (separation) vector, which is then encoded using a multi-layer bidirectional Transformer network. The vectorization process can be represented as follows:

[0071] V i bert =BERT(w i ),i∈Z∩i∈[0,n+1] (14)

[0072] Among them, w i This represents the i-th character in the sequence, where i is an integer between 0 and n+1; BERT() indicates encoding using a BERT pre-trained model; V i bert This represents the vector obtained after encoding the i-th character in the input sequence using BERT.

[0073] S3.2, Wubi Characteristics

[0074] Using the pywubi library in Python, the input sequence is converted into the corresponding Wubi code. Then, the Word2Vec model is used to train it, obtaining the contextual features of each character's Wubi code, and learning the vector corresponding to each character under the Wubi features. The vectorization process of Wubi features is as follows:

[0075] T = f wb (S) (15)

[0076] W vec =Word2Vec(T) (16)

[0077] V i wb =W vec (T i ),i∈Z∩i∈[0,n+1] (17)

[0078] Among them, f wb This means converting the input sequence into the corresponding Wubi code using the pywubi library; Word2Vec() means vectorizing the sequence using the Word2Vec model based on Wubi features; V i wb Represents the relationship with the input sequence T i The corresponding Wubi feature vector.

[0079] S3.3, Zheng code characteristics

[0080] The input sequence is converted into its corresponding Zheng code using a correspondence table between Zheng code and Chinese characters. The Zheng code features are then trained using a method similar to that used for training Wubi input methods. The vectorization process of the Zheng code features is as follows:

[0081] T = f zm (S) (18)

[0082] W vec =Word2Vec(T) (19)

[0083] V i zm =W vec (T i ),i∈Z∩i∈[0,n+1] (20)

[0084] Among them, f zm This indicates that the input sequence is converted into the corresponding Zheng code according to the correspondence table between Zheng code and Chinese characters; Word2Vec() indicates that the sequence is vectorized using the Word2Vec model according to the features of Zheng code; V i zm Represents the relationship with the input sequence T i The corresponding Zheng code feature vector.

[0085] S3.4, Pinyin Features

[0086] Using the pypinyin library in Python, the input sequence is converted into its corresponding pinyin encoding. Then, the Word2Vec model is used to train it, obtaining the contextual features of each character's pinyin encoding. This learns the vector corresponding to each character under the pinyin features. The vectorization process of the pinyin features is as follows:

[0087] T = f py (S) (21)

[0088] W vec =Word2Vec(T) (22)

[0089] V i py =W vec (T i ),i∈Z∩i∈[0,n+1] (23)

[0090] Among them, f py This indicates that the input sequence is converted into its corresponding pinyin encoding using the pypinyin library; Word2Vec() indicates that the sequence is vectorized according to pinyin features using the Word2Vec model; V i py Represents the relationship with the input sequence T i The corresponding pinyin feature vector.

[0091] S3.5. Fuse the extracted features.

[0092] The acquired features are concatenated to obtain the final embedding layer vector. The feature concatenation process is shown in Equation 24:

[0093] V i e =Contact(V i bert V i wb V i zm V i py ) (twenty four)

[0094] S3.6. Using a Bi-GRU network to learn deep semantic information.

[0095] The fusion result V from step S3.5 i e As input to the Bi-GRU network, it learns deeper semantic information.

[0096] S4. Calculating the sentiment polarity probability and fusing it with the facial expression sentiment dictionary to determine the final category includes the following steps:

[0097] S4.1. Use a fully connected layer to map the output vector obtained from Bi-GRU in step S3.6 to the sample label space, and then use the SoftMax activation function to calculate the probability corresponding to each polarity. The formula for the SoftMax activation function is as follows:

[0098]

[0099] Where, x i Let J be the output value of the i-th node, and J be the number of output nodes, i.e. the number of categories. In this method, there are 2 categories.

[0100] S4.2. The expressions appearing in the input sequence are weighted using an expression dictionary and combined with the probabilities calculated by the SoftMax function. The expression with the highest probability is taken as the final classification result, as shown in formula (26).

[0101] C = Max(λ*E+P) pos ,P neg (26)

[0102] Among them, P pos and P neg λ represents the probabilities of positive and negative sentiment polarities calculated using a fully connected layer plus SoftMax, respectively; E represents the sentiment intensity of the facial expressions appearing in the text in the dictionary; λ represents the weight of facial expressions in the implicit sentiment recognition model obtained through experiments, which is set to 0.17 in this method; and C represents the final classification result of the model.

[0103] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and not restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

[0104] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A method for implicit sentiment recognition of Weibo text that integrates multiple features and an emoji sentiment dictionary, characterized in that... Includes the following steps: Step 1: Collect and process the data; Step 2: Assign corresponding emotional intensities to the default emoticons in Weibo and establish an emoticon emotional dictionary; Step 3: Extract character features and phonetic features from Wubi, Zhengma, and Pinyin, and fuse the extracted features as input to the Bi-GRU network to learn deeper semantic information; Step 4: Calculate the sentiment polarity of the text and combine it with an expression sentiment dictionary to identify implicit sentiment information in the text; The calculation of the sentiment polarity of the text includes: Step 4.1: Using a fully connected layer, the output vector obtained from Bi-GRU in step 3 is mapped to the sample label space, and then the probability corresponding to each polarity is calculated using the SoftMax activation function. The formula for the SoftMax activation function is as follows: in, This is the output value of the i-th node. The number of output nodes represents the number of categories, which in this method is 2 categories. Step 4.2: Weight the expressions appearing in the input sequence using an expression dictionary, and combine this weighted calculation with the probability calculated using the SoftMax function. The expression with the highest probability is taken as the final classification result. The classification formula is shown below: in, and These are the probabilities of positive and negative sentiment polarities, respectively, calculated in step (4.1) using a fully connected layer and SoftMax. The emotional intensity of the facial expressions appearing in the text, as defined in the dictionary. To obtain the weight of facial expressions in the implicit emotion recognition model through experiments, it is set to 0.17 in this method; This represents the final classification result of the model.

2. The implicit sentiment recognition method for Weibo text integrating multiple features and an expression sentiment dictionary as described in claim 1, characterized in that... Step 1 includes: The program collects text from Weibo posts under a specific topic and performs preprocessing operations on the collection method, including: removing noise information such as "#topic#", "@username", images, videos, web links, and irrelevant content from the text, and converting traditional Chinese characters in the text to simplified Chinese characters.

3. The implicit sentiment recognition method for Weibo text integrating multiple features and an expression sentiment dictionary as described in claim 1, characterized in that... Step 2 includes: We extracted the codes corresponding to the default emojis in Weibo to construct an emoji sentiment dictionary, and manually labeled the emojis with the corresponding sentiment intensities.

4. The implicit sentiment recognition method for Weibo text integrating multiple features and an expression sentiment dictionary as described in claim 1, characterized in that... Step 3 includes: Step 3.1: Vectorize the input sequence; BERT uses WordPiece as the tokenizer, and the word embeddings obtained from the original input sequence are: ,in This refers to the input sequence. It refers to sentence length. It is a sentence classification tag "[CLS]" (classification) vector. It is a sentence separator / end marker "[SEP]" (separation) vector, which is then encoded using a multi-layer bidirectional Transformer network; The vectorization process is represented as: in, This represents the i-th character in the sequence, where i is an integer between 0 and n+1; This indicates that the encoding is performed using a BERT pre-trained model; This represents the vector obtained after encoding the i-th character in the input sequence using BERT. Step 3.2: Extract Wubi features; Using the pywubi library in Python, the input sequence is converted into the corresponding Wubi code. Then, the Word2Vec model is used to train it to obtain the context features of each character corresponding to the Wubi code, and learn the vector corresponding to each character under the Wubi features. The vectorization process of Wubi features is as follows: in, This means converting the input sequence into the corresponding Wubi encoding using the pywubi library; This indicates that the Word2Vec model is used to vectorize the sequence according to the Wubi input method features; Represents the input sequence The corresponding Wubi feature vector; Step 3.3: Extract Zheng code features; The input sequence is converted into the corresponding Zheng code using a correspondence table between Zheng code and Chinese characters. The Zheng code features are then trained using a method similar to that used for training Wubi features. The vectorization process of Zheng code features is as follows: in, This means converting the input sequence into the corresponding Zheng code according to the correspondence table between Zheng code and Chinese characters; This indicates that the Word2Vec model is used to vectorize the sequence according to the Zheng code features; Represents the input sequence The corresponding Zheng code feature vector; Step 3.4: Extract Pinyin Features; Using the pypinyin library in Python, the input sequence is converted into the corresponding pinyin encoding. Then, the Word2Vec model is used to train it to obtain the context features of the pinyin encoding for each character, and learn the vector corresponding to each character under the pinyin features. The vectorization process of Pinyin features is as follows: in, This indicates that the input sequence is converted into the corresponding Pinyin encoding using the pypinyin library; This indicates that the Word2Vec model is used to vectorize the sequence according to its pinyin features; Represents the input sequence The corresponding pinyin feature vector; Step 3.5: Fuse the extracted features; The acquired features are concatenated to obtain the final embedding layer vector; The feature splicing formula is as follows: Step 3.6: Use a Bi-GRU network to learn deep semantic information; The fusion result in step (3.5) As input to the Bi-GRU network, it learns deeper semantic information.