CN113435192A - Chinese text emotion analysis method based on changing neural network channel cardinality - Google Patents

Chinese text emotion analysis method based on changing neural network channel cardinality Download PDF

Info

Publication number
CN113435192A
CN113435192A CN202110658901.XA CN202110658901A CN113435192A CN 113435192 A CN113435192 A CN 113435192A CN 202110658901 A CN202110658901 A CN 202110658901A CN 113435192 A CN113435192 A CN 113435192A
Authority
CN
China
Prior art keywords
vector
feature
word
chinese text
neural network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110658901.XA
Other languages
Chinese (zh)
Inventor
王丽亚
陈哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN202110658901.XA priority Critical patent/CN113435192A/en
Publication of CN113435192A publication Critical patent/CN113435192A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Abstract

The invention provides a Chinese text sentiment analysis method based on changing of a neural network channel base number, which comprises the following steps: step1, preprocessing the Chinese text data set through a word embedding system to obtain a word sequence corresponding to Chinese text information and a word vector matrix corresponding to the word sequence; step2, constructing a multi-channel model, wherein the multi-channel model consists of n groups of parallel CNN-BiGRU-Attention networks, and performing feature extraction by using the multi-channel model to obtain n corresponding local feature vectors; step3, splicing the n local feature vectors together by using a full-join function to generate a global feature vector; and Step4, inputting the generated global feature vector into a sigmoid classifier for classification to obtain a final emotion analysis result.

Description

Chinese text emotion analysis method based on changing neural network channel cardinality
Technical Field
The invention relates to the technical field of natural language processing, in particular to a Chinese text emotion analysis method based on changing of a neural network channel base number.
Background
Text emotion Analysis (Sentiment Analysis) refers to a process of analyzing, processing and extracting subjective text with emotional colors by using natural language processing and text mining technologies. The fields of the method include natural language processing, text mining, information retrieval, information extraction, machine learning and the like. With the development of social multimedia, a large amount of comment data with emotional tendency and the like are provided, so that the emotion analysis technology plays an increasingly important role in understanding the attitude and the opinion of people to certain events, a neural deep learning model is widely applied to the emotion analysis aspect, at present, the technology of deep learning applied to the emotion analysis field mainly comprises word embedding, CNN, RNN, attention mechanism and the like, but networks such as RNN and the like have the defect of high complexity, in addition, most of the existing emotion analysis methods extract text features by constructing a single-channel or double-channel neural network model, and as the number of network layers is increased, the performance of the channel model is influenced, and the characteristics of the text cannot be fully extracted.
In summary, it is an urgent need to solve the problem of the skilled in the art to provide a method for analyzing Chinese text emotion based on changing the channel cardinality of the neural network, which can determine the emotional tendency of the Chinese text by changing the channel cardinality of the neural network and effectively improve the emotion analysis accuracy of the Chinese text.
Disclosure of Invention
Aiming at the problems and the requirements mentioned above, the scheme provides a Chinese text sentiment analysis method based on changing the neural network channel base number, and the technical problems can be solved by adopting the following technical scheme.
In order to achieve the purpose, the invention provides the following technical scheme: a Chinese text emotion analysis method based on changing of neural network channel cardinality comprises the following steps: step1, preprocessing a Chinese text data set through a word embedding system to obtain a word sequence corresponding to Chinese text information and a word vector matrix corresponding to the word sequence, wherein the word vector is used for representing the positions of words and words in the word sequence;
step2, constructing a multi-channel model, wherein the multi-channel model consists of n groups of parallel CNN-BiGRU-Attention networks, and performing feature extraction by using the multi-channel model to obtain n corresponding local feature vectors;
step3, splicing the n local feature vectors together by using a full-join function to generate a global feature vector;
and Step4, inputting the generated global feature vector into a sigmoid classifier for classification to obtain a final emotion analysis result.
Further, the pre-processing comprises: obtaining a Chinese text data set, carrying out word segmentation on original text data in the Chinese text data set to obtain a sentence sequence consisting of single words, inputting the sentence sequence into a Skip-gram model training word vector in word2vec, and further obtaining a word vector matrix S ═ { x ═ corresponding to the sentence sequence1,x2,…,xnWhere the word vector for each word in the sentence sequence is xi,xi∈Rn×dN is the number of words and d is the vector dimension.
Furthermore, the feature extraction process of each group of CNN-BiGRU-Attention network comprises the following steps:
A. inputting the word vector matrix into a CNN network to extract local characteristic information of input text data, dividing and combining word vectors corresponding to the word vector matrix according to different word quantities by using convolution kernels with 3 sizes of a convolution neural network CNN to extract characteristics, and obtaining 3 corresponding different characteristic values;
B. connecting the 3 corresponding different feature values to obtain a serialized phrase feature U, inputting the serialized phrase feature U into a BiGRU network for learning, and acquiring the forward and backward contact information of the phrase feature of the level;
C. and B, highlighting important information in the local features by using a feedforward Attention mechanism Attention network, distributing corresponding weights to the feature information extracted in the step B, and screening to obtain the most important emotional information features.
Furthermore, the CNN network includes a convolutional layer, a pooling layer, and a full-link layer, and the word vector matrix S is input into 3 filters set in the convolutional layer to extract local features of the input text data, so as to obtain a feature vector C ═ C1,c2,…,cm]Wherein c isjFeature vectors obtained for a filter, cj=[c1,c2,...,cn-h+1]H is the size of the convolution kernel, ciIs a local feature vector; the pooling layer is used for matching the feature vector c by adopting a Max scaling technologyjDown-sampling to obtain optimal solution M of local valuejObtaining a feature vector M with the length M, wherein M is [ M ═ M1,M2,…,Mm]Wherein M isj=max(c1,c2,...,cn-h+1)=max{cj}; and inputting the characteristic vector M into a full-connection layer to obtain a vector U.
Furthermore, the outputs of the 3 filters after the features are pooled are respectively marked as M3、M4、M5Using full-join function to process the vector M after the pooling layer processing3、M4、M5Connected as a vector U, where U ═ M3,M4,M5}。
Furthermore, the vector U is input into a BiGRU network for learning, and the forward and backward contact information of the sequence phrase characteristics is extracted to obtain the latent state semantic code ht
Further, the step of assigning corresponding weights to the feature information extracted in the step B and performing screening to obtain the most important emotion information includes: generating a target attention weight vt,vt=tanh(ht) Tanh is a function for attention mechanics; the attention weight is then probabilistic, according to the formula:
Figure BDA0003114353630000031
generation of probability vectors p by softmax functiont(ii) a And finally, according to a formula:
Figure BDA0003114353630000032
the generated attention weight is configured to the corresponding hidden layer state semantic code htWherein a istIs htWeighted average of ptIs a weight value, a new vector a processed by a feedforward attention mechanismtProcessing by a dropout layer to obtain a characteristic vector at r,at rIs the feature vector at time t.
Furthermore, n corresponding feature vectors are obtained and are marked as at nAnd splicing the n feature vectors together by using a full-concatenation function, and recording the spliced n feature vectors as feature vectors:
A={at 1:at 2:at 3:at 4:at 5:at 6:at 7:at 8:at 9:at 10},
wherein: a splice symbol is represented.
Further, the inputting the generated global feature vector into a sigmoid classifier for classification includes: adding a Dense layer, inputting a feature vector A serving as an input element into the Dense layer, wherein the parameter of the Dense layer is 1, an activation function is a sigmoid function, and according to a formula:
p(y=1|x,ω)=hω(x)=g(ωTx)=1/(1+exp(-ωTx)) are classified with a sigmoid function,
wherein, the sample is x, y is 0 or 1, which represents positive class or negative class, x is sample feature vector, omega is training model parameter,
by using
Figure BDA0003114353630000041
The model parameters omega are trained as a loss function,
wherein, yiIs input xiTrue class of hω(xi) For predicting input xiProbability of belonging to class 1.
According to the technical scheme, the invention has the beneficial effects that: the emotional tendency of the Chinese text can be judged by changing the channel base number of the neural network, and the accuracy of the emotional analysis of the Chinese text can be effectively improved.
In addition to the above objects, features and advantages, preferred embodiments of the present invention will be described in more detail below with reference to the accompanying drawings so that the features and advantages of the present invention can be easily understood.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments of the present invention or the prior art will be briefly described, wherein the drawings are only used for illustrating some embodiments of the present invention and do not limit all embodiments of the present invention thereto.
FIG. 1 is a schematic diagram illustrating specific steps of a Chinese text sentiment analysis method based on changing a neural network channel cardinality according to the present invention.
Fig. 2 is a schematic diagram of the specific steps of the feature extraction process of each group of CNN-BiGRU-Attention networks in this embodiment.
Fig. 3 is a schematic structural diagram of the multi-channel model in this embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of specific embodiments of the present invention. Like reference symbols in the various drawings indicate like elements. It should be noted that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the invention without any inventive step, are within the scope of protection of the invention.
The channel cardinality (channel cardinality) refers to the number of channels in the model in this embodiment, and it can be understood that when the neural network model is established, after the embedding layer (embedding _ layer), n sets of parallel CNN-BiGRU-orientation networks are used for performing the feature extractionAnd (4) feature extraction, namely performing feature splicing before a classifier layer. For example, the 1-CBGA model is composed of 1 group of CNN-BiGRU-Attention networks, and the number of the channel bases is 1. The 2-CBGA model is formed by 2 groups of CNN-BiGRU-Attention networks in parallel, and the base number of the channel is recorded as 2. As shown in fig. 1 to 3, the method specifically includes: step1, preprocessing a Chinese text data set through a word embedding system to obtain a word sequence corresponding to Chinese text information and a word vector matrix corresponding to the word sequence, wherein the word vector is used for representing the position of a word and a word in the word sequence, and the preprocessing comprises the following steps: obtaining a Chinese text data set, carrying out word segmentation on original text data in the Chinese text data set to obtain a sentence sequence consisting of single words, inputting the sentence sequence into a Skip-gram model training word vector in word2vec, and further obtaining a word vector matrix S ═ { x ═ corresponding to the sentence sequence1,x2,…,xnWhere the word vector for each word in the sentence sequence is xi,xi∈Rn×dN is the number of words and d is the vector dimension.
Because the influence of the channel base number on the model effect exists, and meanwhile, the model network is more complex and the model requires more parameters with the increase of the channel base number, and the time cost is increased. Due to the limitation of experimental conditions, in the embodiment, only the model analysis of the channel base numbers of 1-10 is given, but the method is not limited to the channel base numbers of 1-10. FIG. 3 shows a model diagram with channel cardinality of 1-10, where n is the model channel cardinality, and n is ∈ {1,2,3,4,5,6,7,8,9,10 }. When preprocessing Chinese text data, a sentence needs to be split into words to obtain a sentence list composed of single words, for example: [ …, [ ' disperse ', ' hot ', ' non ', ' normal ', ' rod ', ' | for! ' ], … ]. And then, constructing a word vector by using a Skip-gram model in word2vec, wherein if the size of a context window is 5, and the vector form corresponding to the current word W (t) is V (W (t)), and the vector forms corresponding to the 4 surrounding words are V (W (t +2)), V (W (t +1)), V (W (t-1) and V (W (t-2)), the Skip-gram model predicts the surrounding words through the central word, and is solved by using the conditional probability value of the central word vector V (W (i)) V (W (t)), as shown in a formula P (V (W (i)) | V (W (t)). After preprocessing is completed, the word vector matrix is input into a multi-channel model for feature extraction.
And Step2, constructing a multi-channel model, wherein the multi-channel model consists of n groups of parallel CNN-BiGRU-Attention networks, and performing feature extraction by using the multi-channel model to obtain corresponding n local feature vectors.
As shown in fig. 2, in the method, the feature extraction process of each group of CNN-BiGRU-Attention network includes:
A. inputting the word vector matrix into a CNN network to extract local characteristic information of input text data, dividing and combining word vectors corresponding to the word vector matrix according to different word quantities by using convolution kernels with 3 sizes of a convolution neural network CNN to extract characteristics, and obtaining 3 corresponding different characteristic values;
B. connecting the 3 corresponding different feature values to obtain a serialized phrase feature U, inputting the serialized phrase feature U into a BiGRU network for learning, and acquiring the forward and backward contact information of the phrase feature of the level;
C. and B, highlighting important information in the local features by using a feedforward Attention mechanism Attention network, distributing corresponding weights to the feature information extracted in the step B, and screening to obtain the most important emotional information features.
Specifically, the CNN network includes a convolutional layer, a pooling layer, and a full-link layer, and the word vector matrix S is input to the convolutional layer and the 3 filters having the set size are used to extract local features of input text data, so as to obtain a feature vector C ═ C1,c2,…,cm]Wherein c isjFeature vectors obtained for a filter, cj=[c1,c2,...,cn-h+1]M is the number of convolution kernels, h is the size of the convolution kernels, ciIs a local feature vector, and ci=f(ω×xi:i+h-1+ b) wherein ciIs the local feature extracted by the convolution operation; f represents a non-linear function; ω is a filter of size h × d; h is the size of the convolution kernel, representing h words; x is the number ofi:i+h-1Is a phrase vector consisting of h words from i to i + h-1; b is an offsetAn item. For example, after passing through the convolutional layer, a filter obtains the eigenvector c1,c1=[c1,c2,...,cn-h+1]. Obtaining a characteristic vector C ═ C by m convolution kernels1,c2,…,cm](ii) a The pooling layer is used for matching the feature vector c by adopting a Max scaling technologyjDown-sampling to obtain optimal solution M of local valuejObtaining a feature vector M with the length M, wherein M is [ M ═ M1,M2,…,Mm]Wherein M isj=max(c1,c2,...,cn-h+1)=max{cj}, e.g. by applying Max boosting techniques to the local feature vector c1Down-sampling to obtain optimal solution M of local value1And M is1=max(c1,c2,...,cn-h+1)=max{c1}; and inputting the feature vector M into a full-connection layer to obtain a vector U, wherein the outputs of the pooled features extracted by the 3 filters are respectively recorded as M3、M4、M5Using full-join function to process the vector M after the pooling layer processing3、M4、M5Connected as a vector U, where U ═ M3,M4,M5}. Inputting the vector U into a BiGRU network for learning, and extracting the forward and backward contact information of the sequence phrase characteristics to obtain a latent state semantic code ht. In this embodiment, the implemented CNN network is different from the ordinary CNN network in that 3 filters with convolution kernels of 3,4, and 5 are provided, because the sizes of the convolution kernels are different, different phrases can be formed for different partitions of sentences, that is, different feature values can be extracted through convolution windows of different sizes, so that relatively comprehensive features can be extracted. And since the input of BiGRU must be a serialized structure, the vector M after the pooling layer needs to be connected using a full-join function (Concatenate)3、M4、M5And connecting the two continuous high-order windows into a vector U, taking a new continuous high-order window U as the input of the BiGRU, and learning the obtained serialized phrase features U to obtain the forward and backward contact information of the phrase features of the level, namely the features of a sentence system.
The BiGRU consists of a forward GRU,And the output state connecting layers of the reverse GRU and the forward GRU form a neural network. If the hidden state of the forward GRU output at the moment of t is recorded as
Figure BDA0003114353630000081
The hidden state of the reverse GRU output is
Figure BDA0003114353630000082
Then the hidden state h of the BiGRU outputtThe specific calculation process is as follows:
Figure BDA0003114353630000083
Figure BDA0003114353630000084
Figure BDA0003114353630000085
wherein, wt,vtIs the weight matrix, GRU: GRU function, Ut: GRU input at time t, bt: a bias vector.
Then, a feedforward attention mechanism is introduced to obtain a sentence hiding state htNew vector a after weight assignmenttAnd B, distributing corresponding weight to the characteristic information extracted in the step B and screening, wherein the step B of obtaining the most important emotion information comprises the following steps: generating a target attention weight vt,vt=tanh(ht) Tanh is a function for attention mechanics; the attention weight is then probabilistic, according to the formula:
Figure BDA0003114353630000086
generation of probability vectors p by softmax functiont(ii) a And finally, according to a formula:
Figure BDA0003114353630000087
configuring the generated attention weight to the pairLatent state semantic coding of contenttWherein a istIs htWeighted average of ptIs a weight value, a new vector a processed by a feedforward attention mechanismtProcessing by a dropout layer to obtain a characteristic vector at r,at rIs the feature vector at time t.
Step3, the n local feature vectors are spliced together using a full join function to generate a global feature vector.
Specifically, the corresponding n feature vectors obtained above are denoted as at nAnd splicing the n feature vectors together by using a full-concatenation function, and recording the spliced n feature vectors as feature vectors:
A={at 1:at 2:at 3:at 4:at 5:at 6:at 7:at 8:at 9:at 10},
wherein: a splice symbol is represented.
Step4, inputting the generated global feature vector into a sigmoid classifier for classification to obtain a final emotion analysis result, wherein the Step of inputting the generated global feature vector into the sigmoid classifier for classification specifically comprises the following steps: adding a Dense layer, inputting a feature vector A serving as an input element into the Dense layer, wherein the parameter of the Dense layer is 1, an activation function is a sigmoid function, and according to a formula: p (y ═ 1| x, ω) ═ hω(x)=g(ωTx)=1/(1+exp(-ωTx)) is classified by a sigmoid function, wherein the sample is { x, y }, y is 0 or 1 and represents a positive class or a negative class, x is a sample feature vector, and omega is a training model parameter and is adopted
Figure BDA0003114353630000091
Figure BDA0003114353630000092
Training model parameters ω as a loss function, where yi is the input xiTrue class of hω(xi) For predicting input xiProbability of belonging to class 1.
In the embodiment, the data set experiment data used for the channel base experiment is from Chinese web shopping comment text provided by BUPTLdy personal github website, and the data set setting is shown in Table 1.
Table 1 experimental data set-up
Data set Training set Verification set Test set Total number of
Data 16884 2000 2221 21105
Considering time cost, experimental software and hardware environment configuration and the like, only the network model with the channel base number of 1-10 is researched and realized, and the comparative experimental setup is shown in table 2.
Table 2 comparative experimental setup
ChannelRadix Name of model
1 1-CBGA
2 2-CBGA
3 3-CBGA
n∈{4,5,6,7,8,9,10} n-CBGA
The experiment calculates 4 model evaluation indexes Accuracy, Precision, Recall and F1 values commonly used in the NLP field on a test set to evaluate the model. The results of the comparison of the 10 models are shown in Table 3.
TABLE 3 comparison of models
Model Accuracy Precision Recall F1
1-CBGA 0.9217 0.9059 0.9376 0.9215
2-CBGA 0.9289 0.9298 0.9247 0.9273
3-CBGA 0.9194 0.8950 0.9467 0.9201
4-CBGA 0.9145 0.9610 0.8604 0.9079
5-CBGA 0.9185 0.9416 0.8889 0.9145
6-CBGA 0.9167 0.8944 0.9412 0.9172
7-CBGA 0.9212 0.8981 0.9467 0.9218
8-CBGA 0.9239 0.9220 0.9229 0.9224
9-CBGA 0.9163 0.9035 0.9284 0.9158
10-CBGA 0.9158 0.8881 0.9477 0.9169
The above results illustrate the feasibility and effectiveness of the Chinese text sentiment analysis method based on changing the neural network channel cardinality proposed in the present application.
It should be noted that the described embodiments of the invention are only preferred ways of implementing the invention, and that all obvious modifications, which are within the scope of the invention, are all included in the present general inventive concept.

Claims (9)

1. A Chinese text emotion analysis method based on changing of a neural network channel base number is characterized by comprising the following steps:
step1, preprocessing a Chinese text data set through a word embedding system to obtain a word sequence corresponding to Chinese text information and a word vector matrix corresponding to the word sequence, wherein the word vector is used for representing the positions of words and words in the word sequence;
step2, constructing a multi-channel model, wherein the multi-channel model consists of n groups of parallel CNN-BiGRU-Attention networks, and performing feature extraction by using the multi-channel model to obtain n corresponding local feature vectors;
step3, splicing the n local feature vectors together by using a full-join function to generate a global feature vector;
and Step4, inputting the generated global feature vector into a sigmoid classifier for classification to obtain a final emotion analysis result.
2. The method for sentiment analysis of chinese text based on changing neural network channel cardinality of claim 1, wherein the preprocessing comprises: obtaining a Chinese text data set, carrying out word segmentation on original text data in the Chinese text data set to obtain a sentence sequence consisting of single words, inputting the sentence sequence into a Skip-gram model training word vector in word2vec, and further obtaining a word vector matrix S ═ { x ═ corresponding to the sentence sequence1,x2,…,xnWhere the word vector for each word in the sentence sequence is xi,xi∈Rn×dN is the number of words and d is the vector dimension.
3. The method for emotion analysis of Chinese text based on changing channel cardinality of neural network as claimed in claim 2, wherein the feature extraction process of each group of CNN-BiGRU-Attention network includes:
A. inputting the word vector matrix into a CNN network to extract local characteristic information of input text data, dividing and combining word vectors corresponding to the word vector matrix according to different word quantities by using convolution kernels with 3 sizes of a convolution neural network CNN to extract characteristics, and obtaining 3 corresponding different characteristic values;
B. connecting the 3 corresponding different feature values to obtain a serialized phrase feature U, inputting the serialized phrase feature U into a BiGRU network for learning, and acquiring the forward and backward contact information of the phrase feature of the level;
C. and B, highlighting important information in the local features by using a feedforward Attention mechanism Attention network, distributing corresponding weights to the feature information extracted in the step B, and screening to obtain the most important emotional information features.
4. The method as claimed in claim 3, wherein the CNN network includes a convolutional layer, a pooling layer and a full link layer, and the 3 filters configured for inputting the word vector matrix S into the convolutional layer extract local features of the input text data to obtain a feature vector C ═ C1,c2,…,cm]Wherein c isjFeature vectors obtained for a filter, cj=[c1,c2,...,cn-h+1]M is the number of convolution kernels, h is the size of the convolution kernels, ciIs a local feature vector; the pooling layer is used for matching the feature vector c by adopting a Max scaling technologyjDown-sampling to obtain optimal solution M of local valuejObtaining a feature vector M with the length M, wherein M is [ M ═ M1,M2,…,Mm]Wherein M isj=max(c1,c2,...,cn-h+1)=max{cj}; and inputting the characteristic vector M into a full-connection layer to obtain a vector U.
5. The method as claimed in claim 4, wherein the outputs of the 3 kinds of filter extracted features after pooling are respectively marked as M3、M4、M5Using full-join function to process the vector M after the pooling layer processing3、M4、M5Connected as a vector U, where U ═ M3,M4,M5}。
6. The method of emotion analysis for Chinese text based on changing the channel cardinality of neural network as claimed in claim 5, wherein said vector U is inputted into BiGRU network for learning before and after feature of sequence phraseExtracting the contact information to obtain a latent state semantic code ht
7. The method for analyzing Chinese text sentiment based on changing neural network channel cardinality according to claim 6, wherein the step of assigning corresponding weights to the feature information extracted in the step B and performing screening, and the step of obtaining the most important sentiment information comprises the steps of: generating a target attention weight vt,vt=tanh(ht) Tanh is a function for attention mechanics; the attention weight is then probabilistic, according to the formula:
Figure FDA0003114353620000031
generation of probability vectors p by softmax functiont(ii) a And finally, according to a formula:
Figure FDA0003114353620000032
the generated attention weight is configured to the corresponding hidden layer state semantic code htWherein a istIs htWeighted average of ptIs a weight value, a new vector a processed by a feedforward attention mechanismtProcessing by a dropout layer to obtain a characteristic vector at r,at rIs the feature vector at time t.
8. The method of emotion analysis of Chinese text based on changing the cardinality of neural network channels as claimed in claim 7, wherein corresponding n eigenvectors, denoted as a, are obtainedt nAnd splicing the n feature vectors together by using a full-concatenation function, and recording the spliced n feature vectors as feature vectors:
A={at 1:at 2:at 3:at 4:at 5:at 6:at 7:at 8:at 9:at 10},
wherein: a splice symbol is represented.
9. The method for emotion analysis of Chinese text based on changing channel cardinality of neural network as claimed in claim 8, wherein said inputting the generated global feature vector into sigmoid classifier for classification comprises: adding a Dense layer, inputting a feature vector A serving as an input element into the Dense layer, wherein the parameter of the Dense layer is 1, an activation function is a sigmoid function, and according to a formula:
p(y=1|x,ω)=hω(x)=g(ωTx)=1/(1+exp(-ωTx)) are classified with a sigmoid function,
wherein, the sample is x, y is 0 or 1, which represents positive class or negative class, x is sample feature vector, omega is training model parameter,
by using
Figure FDA0003114353620000033
The model parameters omega are trained as a loss function,
wherein, yiIs input xiTrue class of hω(xi) For predicting input xiProbability of belonging to class 1.
CN202110658901.XA 2021-06-15 2021-06-15 Chinese text emotion analysis method based on changing neural network channel cardinality Pending CN113435192A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110658901.XA CN113435192A (en) 2021-06-15 2021-06-15 Chinese text emotion analysis method based on changing neural network channel cardinality

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110658901.XA CN113435192A (en) 2021-06-15 2021-06-15 Chinese text emotion analysis method based on changing neural network channel cardinality

Publications (1)

Publication Number Publication Date
CN113435192A true CN113435192A (en) 2021-09-24

Family

ID=77755896

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110658901.XA Pending CN113435192A (en) 2021-06-15 2021-06-15 Chinese text emotion analysis method based on changing neural network channel cardinality

Country Status (1)

Country Link
CN (1) CN113435192A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115935075A (en) * 2023-01-30 2023-04-07 杭州师范大学钱江学院 Social network user depression detection method integrating tweet information and behavior characteristics

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200159778A1 (en) * 2018-06-19 2020-05-21 Priyadarshini Mohanty Methods and systems of operating computerized neural networks for modelling csr-customer relationships
CN111651593A (en) * 2020-05-08 2020-09-11 河南理工大学 Text emotion analysis method based on word vector and word vector mixed model
CN112818123A (en) * 2021-02-08 2021-05-18 河北工程大学 Emotion classification method for text

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200159778A1 (en) * 2018-06-19 2020-05-21 Priyadarshini Mohanty Methods and systems of operating computerized neural networks for modelling csr-customer relationships
CN111651593A (en) * 2020-05-08 2020-09-11 河南理工大学 Text emotion analysis method based on word vector and word vector mixed model
CN112818123A (en) * 2021-02-08 2021-05-18 河北工程大学 Emotion classification method for text

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王丽亚 等: "基于字符级双通道复合网络的中文文本情感分析", 计算机应用研究, vol. 37, no. 9, pages 2674 - 2678 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115935075A (en) * 2023-01-30 2023-04-07 杭州师范大学钱江学院 Social network user depression detection method integrating tweet information and behavior characteristics
CN115935075B (en) * 2023-01-30 2023-08-18 杭州师范大学钱江学院 Social network user depression detection method integrating text information and behavior characteristics

Similar Documents

Publication Publication Date Title
CN111368996B (en) Retraining projection network capable of transmitting natural language representation
CN108446271B (en) Text emotion analysis method of convolutional neural network based on Chinese character component characteristics
CN110245229B (en) Deep learning theme emotion classification method based on data enhancement
Che et al. Punctuation prediction for unsegmented transcript based on word vector
CN111160037B (en) Fine-grained emotion analysis method supporting cross-language migration
CN108829662A (en) A kind of conversation activity recognition methods and system based on condition random field structuring attention network
CN108038205B (en) Viewpoint analysis prototype system for Chinese microblogs
CN109885670A (en) A kind of interaction attention coding sentiment analysis method towards topic text
CN110390017B (en) Target emotion analysis method and system based on attention gating convolutional network
CN107729309A (en) A kind of method and device of the Chinese semantic analysis based on deep learning
CN112364638B (en) Personality identification method based on social text
CN110619044B (en) Emotion analysis method, system, storage medium and equipment
CN110929034A (en) Commodity comment fine-grained emotion classification method based on improved LSTM
CN113435211B (en) Text implicit emotion analysis method combined with external knowledge
CN110472245B (en) Multi-label emotion intensity prediction method based on hierarchical convolutional neural network
CN109446423B (en) System and method for judging sentiment of news and texts
CN111581966A (en) Context feature fusion aspect level emotion classification method and device
CN112434164B (en) Network public opinion analysis method and system taking topic discovery and emotion analysis into consideration
CN112925904B (en) Lightweight text classification method based on Tucker decomposition
CN109614611B (en) Emotion analysis method for fusion generation of non-antagonistic network and convolutional neural network
CN111400494A (en) Sentiment analysis method based on GCN-Attention
CN113761868A (en) Text processing method and device, electronic equipment and readable storage medium
CN113094502A (en) Multi-granularity takeaway user comment sentiment analysis method
CN115687609A (en) Zero sample relation extraction method based on Prompt multi-template fusion
CN110874392A (en) Text network information fusion embedding method based on deep bidirectional attention mechanism

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination