Cross-language sentiment classification method based on sentiment semantic confrontation
Aligning the emotional semantic representations of Vietnamese and Chinese through the emotional semantic adversarial network, combined with the characteristics of emotional words, solves the problem of low accuracy of language emotion classification with low resources, and achieves an improvement in the accuracy of Vietnamese emotion analysis and the effect of cross-language emotion classification. .
Patent Information
- Application Number
- CN202111043204.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-07
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-09-07
AI Technical Summary
Low-resource languages such as Vietnamese have low accuracy in sentiment classification. Existing cross-language sentiment analysis methods rely on the quality and scale of multilingual parallel corpora, and are difficult to effectively utilize sentiment semantic information.
A cross-language emotion classification method based on emotion-semantic confrontation is adopted. By crawling Weibo and Twitter comments, convolutional neural networks and adversarial networks are used to align emotion-semantic representations, and are combined with emotion word features for splicing to achieve Vietnamese emotional tendency analysis. .
It effectively improves the accuracy of Vietnamese emotional tendency analysis, shows obvious advantages among different languages, and solves the problem of bilingual emotional semantic alignment.
Smart Images

Figure CN113901205B
Abstract
Description
Technical Field
[0001] The invention relates to a cross-language sentiment classification method for sentiment semantic confrontation, and belongs to the technical field of natural language processing. Background Art
[0002] With the rapid development of the Internet, people are paying more and more attention to some international events, and often express their opinions on the events involved on social media platforms such as Weibo and Twitter. Since Vietnamese is a minority language and lacks large-scale labeled data, there is a semantic gap between Chinese and Vietnamese, and manual annotation is time-consuming and laborious.
[0003] To complete the sentiment analysis of Vietnamese, we must first solve the problem that Chinese and Vietnamese are not in the same semantic space. Zhou et al. solved the cross-language sentiment analysis by translating the source language into the target language through machine translation. Cross-language representation learning means that word vector representations of different languages can share a vector space, and words with similar sentiment semantics in different languages are close in distance in this space. Mikolov et al. proposed to align bilingual words and train to obtain a linear mapping from the source language word vector space to the target language word vector space. Faruqui et al. proposed to map the word embeddings of the source language and the target language to the same vector space. Sarath et al. proposed to encode the source language through an autoencoder and decode the source language and the target language to obtain bilingual word vectors. Meng et al. used parallel corpora to improve dictionary coverage and used maximum likelihood values to annotate words, thereby improving the accuracy of sentiment classification. Su Yuqing conducted multi-sentiment analysis on Weibo by building a bilingual dictionary. However, these two methods require the construction of multilingual parallel corpora, and the classification accuracy depends on the expected quality and size. Wang et al. used the attribute function of the factor graph model to learn monolingual and bilingual information from each post, used the factor function to explore the relationship between different emotions, and adopted the belief propagation algorithm to learn and predict the model. Although cross-language sentiment analysis on social media has received widespread attention and made a series of progress, there are still great challenges to be further studied and solved. Among them, how to use sentiment semantic information to help improve the accuracy of sentiment classification in low-resource languages is a key issue. Summary of the invention
[0004] The present invention provides a cross-language sentiment classification method based on sentiment semantic confrontation, which is used for sentiment analysis of low-resource languages and solves the problem of bilingual sentiment semantic alignment. The proposed invention method can effectively improve the accuracy of Vietnamese sentiment tendency analysis.
[0005] The technical solution of the present invention is: a cross-language sentiment classification method based on sentiment semantic confrontation, and the specific steps of the method are as follows:
[0006] Step 1: Use crawler technology to crawl relevant Chinese and Vietnamese Weibo and Twitter comments during the 2020 US epidemic, and manually annotate the data set to obtain a Chinese epidemic comment data set and an unannotated Vietnamese epidemic comment data set.
[0007] Step 2: Concatenate the sentences and the sentiment words in the sentences, and use convolutional neural networks to jointly represent the concatenated sentences to obtain the sentiment semantic representations in the monolingual semantic space. Secondly, through the adversarial network, align the sentiment semantic representations of labeled data and unlabeled data in the bilingual sentiment semantic space. Finally, concatenate the most significant representations of the sentences and sentiment words to obtain the sentiment tendency analysis results.
[0008] As a preferred embodiment of the present invention, the specific steps of Step 1 are:
[0009] Step 1.1, use the crawler based on the Scrapy framework to crawl the text and comments of Weibo related to the US epidemic from Sina Weibo and Twitter;
[0010] Step 1.2: Filter and screen the text and comments of Weibo and Twitter. The filtering method is as follows: (1) remove unnecessary symbols, hyperlinks and special characters in the text content; (2) remove the same user comment information in Weibo;
[0011] Step 1.3. Obtain the epidemic microblog and Twitter dataset by manual annotation: Take a microblog comment as a unit for annotation, and annotate the microblog comment sentence with positive emotions as 1, the comment modified by degree adverbs to strengthen positive emotions as 2, the comment sentence with negative emotions as -1, the comment modified by degree adverbs to strengthen negative emotions as -2, and the comment sentence with neutrality and no emotional tendency as 0;
[0012] As a preferred embodiment of the present invention, in the step 2:
[0013] Step 2.1, the acquisition of sentiment words in the sentence is the first step of the cross-language sentiment classification task. Use the matching algorithm to match each word in the corpus sentence with the words in the sentiment dictionary. Splice the sentiment words in the sentence at the end of the sentence;
[0014] X={x i , i = 1, 2, 3, ..., n} (1)
[0015] X′={(x i , l i ), i = 1, 2, 3, ..., n; l i ∈R n×|s|} (2)
[0016] Y={y j , j = 1, 2, 3, ..., m} (3)
[0017] Y′={(y j , z j ), j = 1, 2, 3, ..., m; z j ∈R n×|f|} (4)
[0018] Among them, X represents the source language sentence, Y represents the target language sentence, X′ represents the concatenation of the source language sentence and the sentiment word in the sentence, and x i represents the i-th word in the source language sentence, l i represents the set of sentiment words concatenated after the i-th sentence, n represents the word embedding dimension, |s| represents the length of the concatenated sentiment words, Y′ represents the concatenation of the target language sentence and the sentiment words in the sentence, y j represents the jth word in the target language sentence, z j represents the set of sentiment words concatenated after the j-th target language sentence, and |f| represents the length of the concatenated sentiment words.
[0019] Step 2.2, given a source language sentence input X′={(x i , l i ), j = 1, 2, 3..., n}, target language input Y′ = {(y j , z j ), j = 1, 2, 3..., m}. The method of the present invention uses bilingual word embedding to represent each word of each as an n-dimensional word vector, as shown in formulas (5)-(6);
[0020] E X′ =em b(x i , l i ) (5)
[0021] E Y′ =em b(y j , z j ) (6)
[0022] Among them, E X′ ∈R n×|q| and E Y′ ∈R n×|d| They represent embedding functions, which can transform each word in each input sequence into a corresponding n-dimensional word vector; |q| and |d| represent the length of the sentences in the source language and target language input models. The word embedding used is set to 50 dimensions, that is, n = 50. In the figure, the dotted line represents the unlabeled corpus, and the solid line represents the labeled language.
[0023] Step 2.3, concatenate the sentences and the sentiment words in the sentences, and use the convolutional neural network to jointly represent the concatenated sentences, respectively, and obtain the sentiment semantic representation in the monolingual semantic space, and then align the sentiment semantic representation of the labeled data with that of the unlabeled data in the bilingual sentiment semantic space through the adversarial network. It includes two modules: the shared feature extractor module (G) and the language discriminator (D).
[0024] The output of the embedding layer is sent to the convolution layer for feature extraction. The method of the present invention extracts features from the sentence while also extracting features from the sentiment words in the sentence. Each convolution layer has a sliding window of a fixed size and only processes the information within the window at a time. The size of the window is defined as k, and in the convolution operation, there are k consecutive word vectors to obtain a new feature value c i , i represents the i-th eigenvalue, x i:i+k-1 represents the convolution from the i-th word to the i+k-1th word in the input comment sentence. The operation process can be expressed by formula (7):
[0025] c i =f1(w·x i:i+k-1 +b) (7)
[0026] Among them, the weight matrix of the filter is defined as w∈R k×d , b is the bias term, and f1 is the activation function.
[0027] The extracted feature C can be expressed by formula (8):
[0028] C=[c1,c2,...,c n-k+1 ] (8)
[0029] Where C∈R n-k+1 .
[0030] Similarly, the feature D extracted from sentiment words can be expressed by formula (9):
[0031] D = [d1, d2, ..., d m ] (9)
[0032] Step 2.4, consider the distribution of joint hidden features of source language (S) and target language (T);
[0033]
[0034]
[0035] In order to learn language-invariant features, the SADAN model proposed in the present invention trains F to make the two distributions as close as possible to obtain better cross-language generalization. The present invention minimizes the Kantorovich Rubenstein duality principle proposed by Villani. and The Wasserstein distance W between them. The operation process can be expressed by formula (12) as
[0036]
[0037] where the supremum (maximum) is the set of all 1-Lipschitz functions g. In order to (approximately) compute The method of the present invention uses a language identifier Q as the function g in equation (12), and the goal is to find the supremum in (12). Q attempts to output a higher score for source language examples and a lower score for target language examples. More formally, J q In formula (12), and An approximation of the Wasserstein distance between .
[0038] In order to make Q a Lipschitz function (up to a constant), the parameters of Q are always restricted to a fixed range. Let Q be expressed by θ q Parameterized, then the target J q It becomes formula (13):
[0039]
[0040] Step 2.5, then perform the maximum pooling process; the actual function of the maximum pooling operation is to retain the most significant features extracted by a filter. The maximum pooling layer can reduce the parameter scale of the training model and filter out some unnecessary noise. The feature values generated by multiple filters of different sizes Combine to obtain classification feature v.
[0041] The features can be further quantized through the operation of the fully connected layer, thereby extracting deeper semantic features v′. The quantization process is expressed as follows using formula (14):
[0042] v′=w′·v+b (14)
[0043] Among them, w′ is the weight matrix of the fully connected layer training, and b is the bias term. After v′ passes through the fully connected layer, it obtains the estimated values within the range of multiple feature categories, which need to be normalized. The softmax classification function can be used to determine the category with the maximum probability, which can be expressed as follows:
[0044] p = soft max(v′) (15)
[0045] Among them, soft max is a classifier. p represents the probability of the final sentiment feature of the sentence, which can determine the sentiment category of the sentence.
[0046] The beneficial effects of the present invention are:
[0047] (1) Bilingual sentiment semantic alignment is achieved, and the proposed method can effectively improve the accuracy of Vietnamese sentiment tendency analysis;
[0048] (2) The method of the present invention has obvious advantages in language pairs with different differences. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A schematic diagram of the specific structure of the recognition model in the present invention. DETAILED DESCRIPTION
[0050] Example 1: Figure 1 As shown, a cross-language sentiment classification method based on sentiment semantic confrontation, the specific steps of the method are as follows:
[0051] Step 1.1, use the crawler based on the Scrapy framework to crawl the text and comments of Weibo related to the US epidemic from Sina Weibo and Twitter;
[0052] Step 1.2: Filter and screen the text and comments of Weibo and Twitter. The filtering method is as follows: (1) remove unnecessary symbols, hyperlinks and special characters in the text content; (2) remove the same user comment information in Weibo;
[0053] Step 1.3. Obtain the epidemic microblog and Twitter dataset by manual annotation: Annotation work is performed on a microblog comment basis. Comments with positive emotions in the microblog comment sentences are marked as 1, comments modified by degree adverbs to strengthen positive emotions are marked as 2, comments with negative emotions are marked as -1, comments modified by degree adverbs to strengthen negative emotions are marked as -2, and comments that remain neutral and have no emotional tendency are marked as 0. The size of the experimental corpus is shown in Table 1.
[0054] Table 1 Experimental data statistics
[0055]
[0056] Step2.1, Step2.1, Acquiring sentiment words in a sentence is the first step in the cross-language sentiment classification task. Use a matching algorithm to match each word in the corpus sentence with the words in the sentiment dictionary. Splice the sentiment words in the sentence at the end of the sentence;
[0057] X={x i ,i=1,2,3...,n} (1)
[0058] X′={(x i , l i ), i = 1, 2, 3, ..., n; l i ∈R n×|s|} (2)
[0059] Y={y j , j = 1, 2, 3, ..., m} (3)
[0060] Y′={(y j , z j ), j = 1, 2, 3, ..., m; z j ∈R n×|f|} (4)
[0061] Among them, X represents the source language sentence, Y represents the target language sentence, X′ represents the concatenation of the source language sentence and the sentiment word in the sentence, and x i represents the i-th word in the source language sentence, l i represents the set of sentiment words concatenated after the i-th sentence, n represents the word embedding dimension, |s| represents the length of the concatenated sentiment words, Y′ represents the concatenation of the target language sentence and the sentiment words in the sentence, y j represents the jth word in the target language sentence, z j represents the set of sentiment words concatenated after the j-th target language sentence, and |f| represents the length of the concatenated sentiment words.
[0062] Step 2.2, given a source language sentence input X′={(x i , l i ), j = 1, 2, 3..., n}, target language input Y′ = {(y j , z j ), j = 1, 2, 3..., m}. The method of the present invention uses bilingual word embedding to represent each word of each as an n-dimensional word vector, as shown in formulas (5)-(6);
[0063] E X′ =em b(x i , l i ) (5)
[0064] E Y′ =em b(y j , z j ) (6)
[0065] Among them, E x′ ∈R n×|q|and E Y′ ∈R n×|d| They represent embedding functions, which can transform each word in each input sequence into a corresponding n-dimensional word vector; |q| and |d| represent the length of the sentences in the source language and target language input models. The word embedding used is set to 50 dimensions, that is, n = 50. In the figure, the dotted line represents the unlabeled corpus, and the solid line represents the labeled language.
[0066] Step 2.3, concatenate the sentences and the sentiment words in the sentences, and use the convolutional neural network to jointly represent the concatenated sentences, respectively, and obtain the sentiment semantic representation in the monolingual semantic space, and then align the sentiment semantic representation of the labeled data with that of the unlabeled data in the bilingual sentiment semantic space through the adversarial network. It includes two modules: the shared feature extractor module (G) and the language discriminator (D).
[0067] The output of the embedding layer is sent to the convolution layer for feature extraction. The method of the present invention extracts features from the sentence while also extracting features from the sentiment words in the sentence. Each convolution layer has a sliding window of a fixed size and only processes the information within the window at a time. The size of the window is defined as k, and in the convolution operation, there are k consecutive word vectors to obtain a new feature value c i , i represents the i-th eigenvalue, x i:i+k-1 represents the convolution from the i-th word to the i+k-1th word in the input comment sentence. The operation process can be expressed by formula (7):
[0068] c i =f1(w·x i:i+k-1 +b) (7)
[0069] Among them, the weight matrix of the filter is defined as w∈R k×d , b is the bias term, and f1 is the activation function.
[0070] The extracted feature C can be expressed by formula (8):
[0071] C=[c1,c2,...,c n-k+1 ] (8)
[0072] Where C∈R n-k+1 .
[0073] Similarly, the feature D extracted from sentiment words can be expressed by formula (9):
[0074] D = [d1, d2, ..., d m ] (9)
[0075] Step 2.4, consider the distribution of joint hidden features of source language (S) and target language (T);
[0076]
[0077]
[0078] In order to learn language-invariant features, the SADAN model proposed in the present invention trains F to make the two distributions as close as possible to obtain better cross-language generalization. The present invention minimizes the Kantorovich Rubenstein duality principle proposed by Villani. and The Wasserstein distance W between them. The operation process can be expressed by formula (12) as
[0079]
[0080] where the supremum (maximum) is the set of all 1-Lipschitz functions g. In order to (approximately) compute The method of the present invention uses a language identifier Q as the function g in equation (12), and the goal is to find the supremum in (12). Q attempts to output a higher score for source language examples and a lower score for target language examples. More formally, J q In formula (12), and An approximation of the Wasserstein distance between .
[0081] In order to make Q a Lipschitz function (up to a constant), the parameters of Q are always restricted to a fixed range. Let Q be expressed by θ q Parameterized, then the target J q It becomes formula (13):
[0082]
[0083] Step 2.5, the actual role of the maximum pooling operation is to retain the most significant features extracted by a filter. The maximum pooling layer can reduce the parameter scale of the training model and filter out some unnecessary noise. The feature values generated by multiple filters of different sizes Combine to obtain classification feature v.
[0084] The features can be further quantized through the operation of the fully connected layer, thereby extracting deeper semantic features v′. The quantization process is expressed as follows using formula (14):
[0085] v′=w′·v+b (14)
[0086] Among them, w′ is the weight matrix of the fully connected layer training, and b is the bias term. After v′ passes through the fully connected layer, it obtains the estimated values within the range of multiple feature categories, which need to be normalized. The softmax classification function can be used to determine the category with the maximum probability, which can be expressed as follows:
[0087] p = soft max(v′) (15)
[0088] Among them, soft max is a classifier. p represents the probability of the final sentiment feature of the sentence, which can determine the sentiment category of the sentence.
[0089] In order to illustrate the effect of the present invention, two groups of comparative experiments were set up. The first group of experiments verified the improvement of cross-language performance based on sentiment semantic confrontation, and the other group of experiments verified the generalization of the model.
[0090] (1) Verification of the effectiveness of the dynamic memory mechanism incorporating emotional semantic adversarial information
[0091] The effectiveness of the model is demonstrated on a Vietnamese dataset. First, the sentences and the sentiment words in the sentences are concatenated, and the concatenated sentences are jointly represented using a convolutional neural network to obtain sentiment semantic representations in a monolingual semantic space. Second, the sentiment semantic representations of labeled data and unlabeled data are aligned in a bilingual sentiment semantic space through an adversarial network. Finally, the most significant representations of the sentences and sentiment words are concatenated to obtain the sentiment tendency analysis results. The experimental parameter settings are shown in Table 2.
[0092] Table 2 shows the parameter settings
[0093]
[0094] Table 3 Experimental results of Chinese-Vietnamese dataset
[0095]
[0096]
[0097] (2) Model generalization verification
[0098] The second part verifies the generalization of the model. The experimental results are shown in Table 4.
[0099] Table 4 Comparison of model accuracy between the Yelp dataset and the Chinese hotel dataset
[0100]
[0101] From the analysis of Table 4, we can see that (1) the first variation uses a standard supervised learning algorithm. In addition, the proposed method also evaluates a non-adversarial variant of SADAN, namely the DAN part in row 2, which is one of the modern neural models for sentiment classification. As can be seen from Table 4, the baseline model based only on the source language performs poorly compared to SADAN. This shows that BWE itself is not sufficient to transfer knowledge.
[0102] (2) mSDA does not perform competitively. This is presumably because many domain adaptation models, including mSDA, are designed to use bag-of-words features, which are not suitable for the task of this invention because the vocabularies of the two languages are completely different. This shows that even strong domain adaptation algorithms cannot use off-the-shelf BWE in the CLSC task.
[0103] (3) As shown in Table 4, the SADAN model significantly outperforms the machine translation baseline in both languages, which indicates that the adversarial model of the present invention can successfully perform cross-lingual sentiment classification without any target language annotated data.
[0104] (4) Compared with the CLD-based CLTC method, the method of the present invention concludes the effectiveness of SADAN. The CLD-based CLTC method uses adversarial training to perform domain adaptation in a single language, while the method of the present invention directly uses adversarial training for cross-language generalization comparison and concludes the effectiveness of SADAN.
[0105] (5) The ADAN model only obtains semantic alignment, while the model of the proposed method obtains bilingual sentiment semantic alignment, which proves the effectiveness of SADAN.
[0106] It can be seen that the classification method of the present invention has a higher accuracy rate than other baseline models.
[0107] The specific implementation modes of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. A cross-language sentiment classification method based on sentiment semantic confrontation, characterized by: The specific steps of the method are as follows: Step 1: Obtain Weibo and Twitter comments in Chinese and Vietnamese, and manually annotate the data sets to obtain a Chinese epidemic comment data set and an unannotated Vietnamese epidemic comment data set; Step 2: Concatenate the sentences and the sentiment words in the sentences, and use the convolutional neural network to jointly represent the concatenated sentences, and obtain the sentiment semantic representations in the monolingual semantic space. Secondly, align the sentiment semantic representations of the labeled data and the unlabeled data in the bilingual sentiment semantic space through the adversarial network. Finally, concatenate the most significant representations of the sentences and sentiment words to obtain the sentiment tendency analysis results. The Step 2 includes the following: Step 2.1, the acquisition of sentiment words in the sentence is the first step of the cross-language sentiment classification task. The matching algorithm is used to match each word in the corpus sentence with the words in the sentiment dictionary, and the sentiment words in the sentence are spliced at the end of the sentence; X={x i ,i=1,2,3...,n} (1) X′={(x i ,l i ),i=1,2,3...,n;l i ∈R n×|s| } (2) Y={y j ,j,1,2,3...,m} (3) Y′={(y j ,z j )vj=1,2,3..,m;z j ∈R n×|f| (4) Among them, X represents the source language sentence, Y represents the target language sentence, X′ represents the concatenation of the source language sentence and the sentiment word in the sentence, and x i represents the i-th word in the source language sentence, l i represents the set of sentiment words concatenated after the i-th sentence, n represents the word embedding dimension, |S| represents the length of the concatenated sentiment words, Y′ represents the concatenation of the target language sentence and the sentiment words in the sentence, y j represents the jth word in the target language sentence, z j represents the set of sentiment words concatenated after the j-th target language sentence, and |f| represents the length of the concatenated sentiment words; Step 2.2, given a source language sentence input X′={(x i , l i ), j = 1, 2, 3..., n}, target language input Y′ = {(y j , z j ), j = 1, 2, 3, ..., m}; each word is represented as an n-dimensional word vector using bilingual word embedding, as shown in formulas (5)-(6); AND X’ =emb(x i ,l i ) (5) E Y’ =emb(y j ,z j ) (6) Among them, E X′ ∈R n×|q| and E Y′ ∈R n×|d| They represent embedding functions, which can transform each word in each input sequence into a corresponding n-dimensional word vector; |q| and |d| represent the length of the sentences in the source language and target language input models; Step 2.3, concatenate the sentences and the sentiment words in the sentences, and use the convolutional neural network to jointly represent the concatenated sentences, respectively, to obtain the sentiment semantic representation in the monolingual semantic space, and then align the sentiment semantic representation of the labeled data with that of the unlabeled data in the bilingual sentiment semantic space through the adversarial network; specifically, the following contents are included: The output of the embedding layer is sent to the convolution layer for feature extraction. While extracting features from the sentence, the sentiment words in the sentence are also extracted. Each convolution layer has a sliding window of a fixed size, and only processes the information within the window at a time. The size of the window is defined as k. In the convolution operation, there are k consecutive word vectors to obtain a new feature value c. i , i represents the i-th eigenvalue, x i:i+k-1 represents the convolution from the i-th word to the i+k-1th word in the input comment sentence; the operation process is expressed by formula (7): c i =f1(w.x i:i+k-1 +b) (7) Among them, the weight matrix of the filter is defined as w∈R k×d , b is the bias term, f1 is the activation function; The extracted feature C is expressed by formula (8): C=[c1,c2,…,c n-k+1 (8) Where C∈R n-k+1 ; Similarly, the feature D extracted from sentiment words is expressed by formula (9): D=[d1,d2,…,d m ] (9) Step 2.4, according to the duality principle, minimize the Wasserstein distance between the joint hidden features of the source language and the target language; then find the supremum of the Wasserstein distance; Specifically include: Consider the distribution of the joint hidden features of the source language S and the target language T; Use the SADAN model to train F to make the two distributions as close as possible to obtain better cross-lingual generalization; minimize the joint hidden features of the source language according to the duality principle and the joint hidden features of the target language The Wasserstein distance W between them; the operation process is expressed by formula (12): The supremum is the set of all 1-Lipschitz functions g; in order to calculate The language discriminator Q is used as the function g in equation (12), and the goal is to find the supremum in equation (12); Q tries to output high scores for source language instances and low scores for target language instances; J q is the formula (12) and An approximation of the Wasserstein distance between ; To make Q a Lipschitz function, the parameters of Q are restricted to a fixed range; let Q be expressed by θ q Parameterized, then the target J q It becomes formula (13): Step 2.5, then perform maximum pooling processing; the actual function of the maximum pooling operation is to retain the most significant features extracted by a filter; the feature values generated by multiple filters of different sizes Combine to obtain classification feature v; The features are further quantized through the operation of the fully connected layer, thereby extracting deeper semantic features v′. The quantization process is expressed as follows: v′=w′.v+b (14) Among them, w′ is the weight matrix of the fully connected layer training, and b is the bias term; v′ passes through the fully connected layer and obtains the estimated values within the range of multiple feature categories, which need to be normalized. The softmax classification function is used to decide the category with the maximum probability, which can be expressed as follows: p = softmax(v′) (15) Among them, softmax is a classifier, p represents the probability of the final emotional feature of the sentence, and the emotional category of the sentence is determined.
2. The cross-language sentiment classification method based on sentiment semantic confrontation according to claim 1 is characterized in that: The specific steps of Step 1 are: Step 1.1, use the Scrapy framework to crawl the text and comments of Weibo posts related to the epidemic from Sina Weibo and Twitter; Step 1.2: Filter and screen the text and comments of Weibo and Twitter. The filtering method is as follows: (1) remove unnecessary symbols, hyperlinks and special characters in the text content; (2) remove the same user comment information in Weibo; Step 1.
3. Obtain the epidemic microblog and Twitter dataset by manual labeling: label one microblog comment at a time, label the microblog comment sentence with positive emotions as 1, label the comment sentence with adverbs of degree to strengthen the positive emotions as 2, label the comment sentence with negative emotions as -1, label the comment sentence with adverbs of degree to strengthen the negative emotions as -2, and label the comment sentence with neutral emotions as 0.
