CN112100376B - Mutual enhancement conversion method for fine-grained emotion analysis - Google Patents

Mutual enhancement conversion method for fine-grained emotion analysis Download PDF

Info

Publication number
CN112100376B
CN112100376B CN202010951154.4A CN202010951154A CN112100376B CN 112100376 B CN112100376 B CN 112100376B CN 202010951154 A CN202010951154 A CN 202010951154A CN 112100376 B CN112100376 B CN 112100376B
Authority
CN
China
Prior art keywords
attribute
word
representation
layer
bidirectional
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.)
Active
Application number
CN202010951154.4A
Other languages
Chinese (zh)
Other versions
CN112100376A (en
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.)
Hunan University
Original Assignee
Hunan University
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 Hunan University filed Critical Hunan University
Priority to CN202010951154.4A priority Critical patent/CN112100376B/en
Publication of CN112100376A publication Critical patent/CN112100376A/en
Application granted granted Critical
Publication of CN112100376B publication Critical patent/CN112100376B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/044Recurrent networks, e.g. Hopfield 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/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs

Abstract

The invention relates to a mutual enhancement conversion network for fine-grained emotion analysis, belonging to a fine-grained emotion analysis task aiming at determining the emotion polarity of each specific attribute in a given sentence. The invention provides a mutual enhancement conversion network for fine-grained emotion analysis. First, the attribute enhancement module in the network refines the attribute characterization learning by semantic features extracted from sentences to give richer information to the attributes. Second, the network iteratively enhances the representation of attributes and contexts using a hierarchy to achieve more accurate emotion prediction. The invention is effective for fine-grained emotion analysis tasks and performs well in both single-attribute sentences and multi-attribute sentences.

Description

Mutual enhancement conversion method for fine-grained emotion analysis
Technical Field
The invention relates to a mutual enhancement conversion method for fine-grained emotion analysis, and belongs to the technical field of fine-grained emotion analysis tasks.
Background
The fine-grained sentiment analysis task comprises two subtasks, namely attribute extraction and attribute sentiment classification. The invention assumes that the attributes are known and focuses only on the attribute emotion classification task. In the fine-grained emotion analysis task, multiple attributes may appear in one sentence. Other attributes and related words become noisy when predicting the emotion of the current attribute. Therefore, how to efficiently model semantic relationships between a given attribute and words in a sentence is an important challenge.
The traditional method mainly depends on the characteristics of manual design, and the characterization mode almost reaches the performance bottleneck. With the development of deep learning technology, especially the proposal of attention mechanism, the above problems are well solved, and many neural attention models are proposed. In these works, the model typically first takes a representation of the attributes, and then applies an attention mechanism to extract contextual features that are relevant to the given attributes for emotion prediction. Attention machines, however, have some drawbacks. When a sentence contains multiple attributes and they have different emotional tendencies, the viewpoint modifiers of the other attributes are noise information for the current attribute. However, attention mechanisms have difficulty learning different perspective modifiers that distinguish multiple attributes, and this directly affects the final prediction result. For example, in the sentence "I like coming back to Mac OS but this is a stitch is lacking in the spoke quality compensated to my $400old HP lap", the attention force mechanism should pay more attention to the opinion word "like" with positive emotional tendency for the attribute "Mac OS". However, attention mechanisms typically involve unrelated opinion words, such as the opinion word "lacing" with negative emotional tendencies, which can interfere with emotion prediction for the attribute "Mac OS". To this end, researchers have proposed some work to ameliorate the drawbacks of the attention mechanism. However, most work has been directed to designing complex neural networks to improve the characterization learning of context. Little work has been focused on improving the characterization learning of attributes.
Disclosure of Invention
The invention provides a mutual enhancement conversion method for fine-grained emotion analysis, which aims to determine the emotion polarity of each specific attribute in a given sentence.
The invention comprises a BERT layer, a bidirectional enhanced conversion layer and a convolution characteristic extractor which are connected in sequence;
the BERT layer generates a word representation of the sequence using pre-trained BERT;
the bidirectional enhancement conversion layer comprises a bidirectional LSTM layer, an attribute enhancement module and a group of word conversion units, wherein the bidirectional LSTM layer is respectively connected with the attribute enhancement module and the word conversion units;
the bidirectional LSTM layer is used for capturing long dependency relationship and position information between texts, and the encoding result has two directions, one is an attribute enhancement module, and the other is a word conversion unit;
the attribute enhancement module receives the attribute representation and the average of the bidirectional LSTM layer coding result, and finally outputs an enhanced attribute representation which is input into the word conversion unit;
the attribute enhancement module utilizes the extracted context characteristics to enhance the attributes;
the word conversion unit receives the encoding result from the bidirectional LSTM layer and the enhanced attribute representation from the attribute enhancement module; the convolutional feature extractor receives attribute information using a GCAE network to control the transfer of the emotional features of the sentence, which further enhances the link between the attributes and the context, and furthermore, introduces relative position information to better extract the emotional features.
The process of reasoning and training by the mutual enhancement conversion method for the fine-grained emotion analysis is as follows:
step 1, a BERT layer, which uses pre-trained BERT to generate word representation of a sequence, supposing that a sentence contains m words and an attribute contains n words, vector representation of the sentence can be obtained through the BERT layer
Figure GDA0003362787100000021
Vector representation of sum attribute a ═ a1,a2,...,an}∈Rn×dWhere d represents the dimension of the BERT output layer.
And 2, bidirectional enhancement conversion layers, wherein each bidirectional enhancement conversion layer comprises three parts, namely a bidirectional LSTM layer, an attribute enhancement module and a group of character conversion units. The bi-directional LSTM layer first generates a contextualized word representation from the input. The attribute enhancement module then uses the word representations to enhance the attribute representations. Finally, the word conversion unit generates an attribute-specific word representation based on the contextualized word representation and the enhanced attribute representation.
And S21, learning the context dependence relationship of the text through the bidirectional LSTM layer. As shown in fig. 1, the bidirectional enhancement translation layer is repeated a plurality of times through the hierarchical structure. The input of the bi-directional LSTM in the lowest bi-directional enhancement conversion layer is a contextual representation of the BERT layer output. The input to the bi-directional LSTM in the next bi-directional enhancement conversion layer is from the output of the word conversion unit in the previous bi-directional enhancement conversion layer.
The word representation of the bidirectional LSTM output may be represented as
Figure GDA0003362787100000022
Forward LSTM outputs a set of hidden state vectors
Figure GDA0003362787100000023
Wherein d ishIndicating the number of hidden units. Similarly, backward LSTM also outputs a set of hidden state vectors
Figure GDA0003362787100000024
Finally, the word representation of the bidirectional LSTM output is obtained by connecting the two hidden state lists
Figure GDA0003362787100000025
Wherein
Figure GDA0003362787100000026
S22, attribute enhancing module, before the first attribute enhancing operation, obtaining the initial attribute representation. Specifically, the attribute vector a output by BERT is first set to { a ═ a }1,a2,...,an}∈Rn×dInput into another bi-directional LSTM, and then apply to the obtained hidden state vector
Figure GDA0003362787100000027
Applying an average pooling method to obtain an initial attribute representation
Figure GDA0003362787100000028
Taking the lowest bi-directional enhancement translation layer as an example, after obtaining the initial attribute representation, the contextualized word vector h is output based on the bi-directional LSTM(1)We obtain a vector by averaging the pooling layers
Figure GDA0003362787100000029
This is referred to as a context vector. The context vectors are then fused into the initial attribute representation using a basic feature fusion method (point-by-bit addition), which can be expressed as
Figure GDA0003362787100000031
This is an enhancement operation that acts on the attribute. And so on, the final attribute representation is
Figure GDA0003362787100000032
This formula expands as follows:
Figure GDA0003362787100000033
wherein
Figure GDA0003362787100000034
i∈[1,L]Representing the context vector in the ith dyad conversion layer. According to equation (1), the attributes are enhanced by different context vectors in multiple dyads. Attribute vector
Figure GDA0003362787100000035
l∈[1,L-1]There are two destinations, one destination being a word conversion unit in the same dyad and the other destination being a property enhancement module in the next dyad.
S23, a word conversion unit, which uses the same structure as the CPT module in the TNet model. The unit will attribute the vector
Figure GDA0003362787100000036
And the word represents
Figure GDA0003362787100000037
As an input, wherein
Figure GDA0003362787100000038
Is represented by the ith word level of the bi-directional LSTM layer output,
Figure GDA0003362787100000039
is the enhanced attribute vector. Specifically, firstly, the
Figure GDA00033627871000000310
And
Figure GDA00033627871000000311
is input to a full connection layer to obtain an ith attribute-specific word representation
Figure GDA00033627871000000312
Figure GDA00033627871000000313
Where g (—) is a non-linear activation function and ": means a vector join operation.
Figure GDA00033627871000000314
And
Figure GDA00033627871000000315
respectively weight matrix and bias. There is an information protection mechanism to ensure that context dependent information captured from the bi-directional LSTM layer is not lost. This information protection mechanism enhances the delivery and use of features, which can be expressed as:
Figure GDA00033627871000000316
wherein
Figure GDA00033627871000000317
Is the output of the word conversion unit.
Step 3, a convolution feature extractor is introduced to a variable piTo measure the relative position information between the ith word and the current attribute word in the context, piIs calculated as follows:
Figure GDA00033627871000000318
where k is the index of the first word in the attribute, C is a pre-specified constant, and n is the length of the attribute phrase. When a sentence is filled, the index i may be larger than the actual length m of the sentence. Then, p is addediThe word output by the ith word conversion unit in the Lth bidirectional enhanced conversion layer is multiplied by the weight to represent that:
Figure GDA00033627871000000319
x at this timeiIs a word representation that incorporates location information.
Then, the sentence with the position information is expressed with X ═ X1,x2,...,xmAnd the final attribute vector
Figure GDA0003362787100000041
Inputting into a gated convolution network to generate a feature map c:
Figure GDA0003362787100000042
si=tanh(WsXi:i+k-1+bs) (7)
ci=si×ai (8)
where k is the convolution kernel size, Wa,Va,ba,WsAnd bsAre all learnable parameters, ciIs one item in the feature map c, siIs a calculated emotional feature, aiIs the calculated attribute feature; x denotes element-by-element multiplication. Then, the sentence representation z is obtained by s convolution kernels and applying the maximum pooling method:
z={max(c1),...,max(cs)} (9)
where max is a function of the maximum. Finally, z is input to a fully connected layer for final emotion prediction:
Figure GDA0003362787100000043
wherein softmax is a normalized exponential function, WfAnd bfAre learnable parameters.
Step 4, fine particles as referred to hereinThe mutual enhancement conversion method of the emotion analysis can be trained in an end-to-end manner in a supervised learning framework, so that all parameters theta are optimized. With L2The cross entropy of the regularization term is used as a loss function, defined as:
Figure GDA0003362787100000044
wherein y isiRepresenting the true probability that a given sentence is labeled as each emotion,
Figure GDA0003362787100000045
representing the estimated probability that a given sentence is labeled as each emotion, O representing the number of classes of emotion polarity, and λ being L2Parameters of the regularization term.
The method has the advantages of improving the attribute characterization learning and realizing the iterative interactive learning between the attribute and the context. The attribute enhancement module in the network improves the attribute characterization learning through semantic features extracted from sentences so as to endow the attributes with richer information. Second, the network iteratively enhances the representation of attributes and contexts using a hierarchy to achieve more accurate emotion prediction.
Drawings
FIG. 1 is an overall architecture of a mutual enhancement conversion method for fine-grained sentiment analysis.
Fig. 2 is a structural diagram of the first bidirectional enhanced conversion module.
Fig. 3 is a block diagram of a word conversion unit.
Detailed Description
In the following, preferred embodiments of the present invention will be further explained with reference to fig. 1 to 3, wherein the dashed arrows in fig. 1 represent the conversion of attributes, and the solid arrows represent the conversion of sentences.
The invention comprises a BERT layer, a bidirectional enhanced conversion layer and a convolution characteristic extractor which are connected in sequence;
the BERT layer generates a word representation of the sequence using pre-trained BERT; BERT is an english abbreviation expressed by the bidirectional coder of the transform model, which is a common abbreviation of those skilled in the art.
The bidirectional enhancement conversion layer comprises a bidirectional LSTM layer, an attribute enhancement module and a group of word conversion units, wherein the bidirectional LSTM layer is respectively connected with the attribute enhancement module and the word conversion units; iterative interactive learning of attributes and contexts is realized by adopting a hierarchical structure, and each computing layer is a bidirectional enhancement conversion component; attribute information is added in the process of extracting emotional characteristics through GCAE, wherein the GCAE is an English abbreviation of a gated convolution network with embedded attributes and is a common abbreviation for a person skilled in the art; the relation between the attribute and the context is further enhanced, and relative position information is introduced to better provide emotional characteristics; compared with the prior art, the feature extractor is replaced by GCAE from CNN; CNN is an english abbreviation of convolutional neural network, which is commonly abbreviated by those skilled in the art.
The bidirectional LSTM layer is used for capturing long dependency relationship and position information between texts, and the encoding result has two directions, one is an attribute enhancement module, and the other is a word conversion unit;
the attribute enhancement module receives the attribute representation and the average of the bidirectional LSTM layer coding result, and finally outputs an enhanced attribute representation which is input into the word conversion unit;
the attribute enhancement module utilizes the extracted context characteristics to enhance the attributes;
the word conversion unit receives the encoding result from the bi-directional LSTM layer and the enhanced attribute representation from the attribute enhancement module.
The convolutional feature extractor receives attribute information using a GCAE network to control the transfer of emotional features of the sentence, which further enhances the link between the attribute and the context, and furthermore, introduces relative position information to better extract the emotional features, and GCAE is an english abbreviation of gated convolutional network with embedded attribute, which is commonly abbreviated by those skilled in the art.
The process of reasoning and training of the invention is as follows:
step 1, BERT layer, using pre-trainedBERT generates a word representation of a sequence, assuming that a sentence contains m words and an attribute contains n words, a vector representation of the sentence is obtained by the BERT layer
Figure GDA0003362787100000051
Vector representation of sum attribute a ═ a1,a2,...,an}∈Rn×dWhere d represents the dimension of the BERT output layer.
And 2, bidirectional enhancement conversion layers, wherein each bidirectional enhancement conversion layer comprises three parts, namely a bidirectional LSTM layer, an attribute enhancement module and a group of character conversion units. The bi-directional LSTM layer first generates a contextualized word representation from the input. The attribute enhancement module then uses the word representations to enhance the attribute representations. Finally, the word conversion unit generates an attribute-specific word representation based on the contextualized word representation and the enhanced attribute representation.
And S21, learning the context dependence relationship of the text through the bidirectional LSTM layer. As shown in fig. 1, the bidirectional enhancement translation layer is repeated a plurality of times through the hierarchical structure. The input of the bi-directional LSTM in the lowest bi-directional enhancement conversion layer is a contextual representation of the BERT layer output. The input to the bi-directional LSTM in the next bi-directional enhancement conversion layer is from the output of the word conversion unit in the previous bi-directional enhancement conversion layer.
The word representation of the bidirectional LSTM output may be represented as
Figure GDA0003362787100000061
Forward LSTM outputs a set of hidden state vectors
Figure GDA0003362787100000062
Wherein d ishIndicating the number of hidden units. Similarly, backward LSTM also outputs a set of hidden state vectors
Figure GDA0003362787100000063
Finally, the word representation of the bidirectional LSTM output is obtained by connecting the two hidden state lists
Figure GDA0003362787100000064
Wherein
Figure GDA0003362787100000065
S22, attribute enhancing module, before the first attribute enhancing operation, obtaining the initial attribute representation. Specifically, the attribute vector a output by BERT is first set to { a ═ a }1,a2,...,an}∈Rn×dInput into another bi-directional LSTM, and then apply to the obtained hidden state vector
Figure GDA0003362787100000066
Applying an average pooling method to obtain an initial attribute representation
Figure GDA0003362787100000067
Taking the lowest bi-directional enhancement translation layer as an example, after obtaining the initial attribute representation, the contextualized word vector h is output based on the bi-directional LSTM(1)Obtaining a vector by averaging the pooling layers
Figure GDA0003362787100000068
This is referred to as a context vector. The context vectors are then fused into the initial attribute representation using a basic feature fusion method (point-by-bit addition), which can be expressed as
Figure GDA0003362787100000069
This is an enhancement operation that acts on the attribute. And so on, the final attribute representation is
Figure GDA00033627871000000610
This formula expands as follows:
Figure GDA00033627871000000611
wherein
Figure GDA00033627871000000612
i∈[1,L]Representing a context vector in an ith bi-directional enhancement conversion layer; according to equation (1), the attributes are enhanced by different context vectors in multiple dyads. Attribute vector
Figure GDA00033627871000000613
l∈[1,L-1]There are two destinations, one destination being a word conversion unit in the same dyad and the other destination being a property enhancement module in the next dyad.
S23, a word conversion unit, which uses the same structure as the CPT module in the TNet model. TNet is an english abbreviation for attribute-oriented transition network, which is commonly abbreviated by those skilled in the art; CPT is an english abbreviation of context protection mechanism, which is a common shorthand for those skilled in the art; the unit will attribute the vector
Figure GDA0003362787100000071
And the word represents
Figure GDA0003362787100000072
As an input, wherein
Figure GDA0003362787100000073
Is represented by the ith word level output by the bidirectional LSTM layer, LSTM is an english abbreviation of long-short term memory network, which is commonly abbreviated by those skilled in the art,
Figure GDA0003362787100000074
is the enhanced attribute vector. Specifically, firstly, the
Figure GDA0003362787100000075
And
Figure GDA0003362787100000076
is input to a full connection layer to obtain an ith attribute-specific word representation
Figure GDA0003362787100000077
Figure GDA0003362787100000078
Where g (—) is a non-linear activation function and ": means a vector join operation.
Figure GDA0003362787100000079
And
Figure GDA00033627871000000710
respectively weight matrix and bias. There is an information protection mechanism to ensure that context dependent information captured from the bi-directional LSTM layer is not lost. This information protection mechanism enhances the delivery and use of features, which can be expressed as:
Figure GDA00033627871000000711
wherein
Figure GDA00033627871000000712
Is the output of the word conversion unit.
Step 3, a convolution feature extractor is introduced to a variable piTo measure the relative position information between the ith word and the current attribute word in the context, piIs calculated as follows:
Figure GDA00033627871000000713
where k is the index of the first word in the attribute, C is a pre-specified constant, and n is the length of the attribute phrase. When a sentence is filled, the index i may be larger than the actual length m of the sentence. Then, p is addediThe word output by the ith word conversion unit in the Lth bidirectional enhanced conversion layer is multiplied by the weight to represent that:
Figure GDA00033627871000000714
x at this timeiIs a word representation that incorporates location information.
Expressing the sentence integrated with the position information as X ═ X1,x2,...,xmAnd the final attribute vector
Figure GDA00033627871000000715
Inputting into a gated convolution network to generate a feature map c:
Figure GDA00033627871000000716
si=tanh(WsXi:i+k-1+bs) (7)
ci=si×ai (8)
where k is the convolution kernel size, Wa,Va,ba,WsAnd bsAre all learnable parameters, ciIs one item in the feature map c, siIs a calculated emotional feature, aiIs the calculated attribute feature; x denotes element-by-element multiplication. Then, the sentence representation z is obtained by s convolution kernels and applying the maximum pooling method:
z={max(c1),...,max(cs)} (9)
where max is a function of the maximum. Finally, z is input to a fully connected layer for final emotion prediction:
Figure GDA0003362787100000081
wherein softmax is a normalized exponential function, WfAnd bfAre learnable parameters.
Step 4, interaction for fine-grained sentiment analysis referred to hereinThe enhanced conversion method can be trained in an end-to-end fashion within a supervised learning framework to optimize all parameters Θ. With L2The cross entropy of the regularization term is used as a loss function, defined as:
Figure GDA0003362787100000082
wherein y isiRepresenting the true probability that a given sentence is labeled as each emotion,
Figure GDA0003362787100000083
representing the estimated probability that a given sentence is labeled as each emotion, O representing the number of classes of emotion polarity, and λ being L2Parameters of the regularization term.

Claims (2)

1. The mutual enhancement conversion method for fine-grained emotion analysis is characterized by comprising the following steps of:
the device comprises a BERT layer, a bidirectional enhanced conversion layer and a convolution feature extractor which are connected in sequence;
the BERT layer generates a word representation of the sequence using pre-trained BERT;
the bidirectional enhancement conversion layer comprises a bidirectional LSTM layer, an attribute enhancement module and a group of word conversion units, wherein the bidirectional LSTM layer is respectively connected with the attribute enhancement module and the word conversion units;
the bidirectional LSTM layer is used for capturing long dependency relationship and position information between texts, and the encoding result has two directions, one is an attribute enhancement module, and the other is a word conversion unit;
the attribute enhancement module receives the attribute representation and the average of the bidirectional LSTM layer coding result, and finally outputs an enhanced attribute representation which is input into the word conversion unit;
the attribute enhancement module utilizes the extracted context characteristics to enhance the attributes; firstly, inputting an attribute vector output by the BERT into another bidirectional LSTM, then applying an average pooling method to the obtained hidden state vector, and finally obtaining an initial attribute representation; after the initial attribute representation is obtained, an average pooling method is applied to contextualized word vectors output based on the bidirectional LSTM to obtain context vectors, and then the context vectors are fused into the initial attribute representation by using a point-by-point and bit-by-bit addition feature fusion method to form an enhancement operation acting on the attributes;
the word conversion unit receives the encoding result from the bidirectional LSTM layer and the enhanced attribute representation from the attribute enhancement module; the convolutional feature extractor receives attribute information using a GCAE network to control the transfer of the emotional features of the sentence, which further enhances the link between the attributes and the context, and furthermore, introduces relative position information to better extract the emotional features.
2. The mutual enhancement conversion method for the fine-grained emotion analysis is characterized in that the reasoning and training process comprises the following steps:
step 1, a BERT layer, which uses pre-trained BERT to generate word representation of a sequence, supposing that a sentence contains m words and an attribute contains n words, vector representation of the sentence can be obtained through the BERT layer
Figure FDA0003362787090000011
Vector representation of sum attribute a ═ a1,a2,...,an}∈Rn×dWherein d represents the dimension of the BERT output layer;
step 2, a bidirectional enhanced conversion layer, wherein a bidirectional LSTM layer generates contextualized word representation according to input; the attribute enhancement module then further enhances the attribute representation with these word representations; finally, the word conversion unit generates an attribute-specific word representation based on the contextualized word representation and the enhanced attribute representation;
s21, learning the context dependency relationship of the text through the bidirectional LSTM layer; the bidirectional enhancement conversion layer is repeated a plurality of times through the hierarchical structure, and the input of the bidirectional LSTM in the bottommost bidirectional enhancement conversion layer is the context representation of the output of the BERT layer;
the input of the bidirectional LSTM in the next bidirectional enhancement conversion layer is from the output of the word conversion unit in the previous bidirectional enhancement conversion layer;
the word representation of the bidirectional LSTM output may be represented as
Figure FDA0003362787090000021
Forward LSTM outputs a set of hidden state vectors
Figure FDA0003362787090000022
Wherein d ishIndicating the number of hidden units; backward LSTM also outputs a set of hidden state vectors
Figure FDA0003362787090000023
Connecting the two hidden state lists results in a word representation of the bi-directional LSTM output
Figure FDA0003362787090000024
Wherein
Figure FDA0003362787090000025
S22, an attribute enhancement module, before the first attribute enhancement operation, obtaining the initial attribute representation; first, the attribute vector a output by BERT is ═ a1,a2,...,an}∈Rn×dInput into another bi-directional LSTM, and then apply to the obtained hidden state vector
Figure FDA0003362787090000026
Applying an average pooling method to obtain an initial attribute representation
Figure FDA0003362787090000027
Contextualized word vector h based on bi-directional LSTM output after initial attribute representation is obtained(1)Obtaining a vector by averaging the pooling layers
Figure FDA0003362787090000028
It is referred to as a context vector; the context vectors are then fused into the initial attribute representation using a point-by-point bitwise additive feature fusion method, resulting in an enhanced operation on the attributes, represented as
Figure FDA0003362787090000029
The final attribute representation is obtained
Figure FDA00033627870900000210
The formula expands as follows:
Figure FDA00033627870900000211
wherein
Figure FDA00033627870900000212
Representing a context vector in an ith bi-directional enhancement conversion layer;
according to formula (1), the attributes are reinforced by different context vectors in a plurality of bidirectional enhancement conversion layers;
attribute vector
Figure FDA00033627870900000213
There are two directions, one is the word conversion unit in the same bidirectional enhanced conversion layer, the other is the attribute enhancement module in the next bidirectional enhanced conversion layer;
s23, word conversion unit, converting attribute vector
Figure FDA00033627870900000214
And the word represents
Figure FDA00033627870900000215
As an input, wherein
Figure FDA00033627870900000216
Is represented by the ith word level of the bi-directional LSTM layer output,
Figure FDA00033627870900000217
is the enhanced attribute vector;
firstly, the method is carried out
Figure FDA00033627870900000218
And
Figure FDA00033627870900000219
is input to a full connection layer to obtain an ith attribute-specific word representation
Figure FDA00033627870900000220
Figure FDA00033627870900000221
Wherein g () is a non-linear activation function, ": indicates a vector join operation;
Figure FDA00033627870900000222
and
Figure FDA00033627870900000223
respectively, weight matrix and bias;
an information protection mechanism is employed to ensure that the context dependent information captured from the bi-directional LSTM layer is not lost, the information protection mechanism enhances the delivery and use of features, expressed as:
Figure FDA0003362787090000031
wherein
Figure FDA0003362787090000032
Is the output of the word conversion unit;
step 3, a convolution feature extractor is introduced to a variable piTo measure the relative position information between the ith word and the current attribute word in the context, piIs calculated as follows:
Figure FDA0003362787090000033
wherein k is the index of the first word in the attribute, C is a pre-specified constant, and n is the length of the attribute phrase; when a sentence is filled, the index i may be larger than the actual length m of the sentence;
p is to beiThe word output by the ith word conversion unit in the Lth bidirectional enhanced conversion layer is multiplied by the weight to represent that:
Figure FDA0003362787090000034
x at this timeiIs a word representation of the merged position information;
then, the sentence with the position information is expressed with X ═ X1,x2,...,xmAnd the final attribute vector
Figure FDA0003362787090000035
Inputting into a gated convolution network to generate a feature map c:
Figure FDA0003362787090000036
si=tanh(WsXi:i+k-1+bs) (7)
ci=si×ai (8)
where k is the convolution kernel size, Wa,Va,ba,WsAnd bsAre all learned parameters, x represents element-by-element multiplication; c. CiIs one item in the feature map c, siIs a calculated emotional feature, aiIs the calculated attribute feature;
the sentence representation z is obtained by s convolution kernels and applying the maximum pooling method:
z={max(c1),...,max(cs)} (9)
where max (×) is a function of the maximum; finally, z is input to a fully connected layer for final emotion prediction:
Figure FDA0003362787090000037
wherein softmax is a normalized exponential function, WfAnd bfAre learnable parameters;
step 4, the mutual enhancement conversion method for fine-grained emotion analysis referred to herein can be trained in an end-to-end manner within a supervised learning framework, so as to optimize all parameters Θ, with L2The cross entropy of the regularization term is used as a loss function, defined as:
Figure FDA0003362787090000041
wherein y isiRepresenting the true probability that a given sentence is labeled as each emotion,
Figure FDA0003362787090000042
representing the estimated probability that a given sentence is labeled as each emotion, O representing the number of classes of emotion polarity, and λ being L2Parameters of the regularization term.
CN202010951154.4A 2020-09-11 2020-09-11 Mutual enhancement conversion method for fine-grained emotion analysis Active CN112100376B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010951154.4A CN112100376B (en) 2020-09-11 2020-09-11 Mutual enhancement conversion method for fine-grained emotion analysis

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010951154.4A CN112100376B (en) 2020-09-11 2020-09-11 Mutual enhancement conversion method for fine-grained emotion analysis

Publications (2)

Publication Number Publication Date
CN112100376A CN112100376A (en) 2020-12-18
CN112100376B true CN112100376B (en) 2022-02-08

Family

ID=73752087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010951154.4A Active CN112100376B (en) 2020-09-11 2020-09-11 Mutual enhancement conversion method for fine-grained emotion analysis

Country Status (1)

Country Link
CN (1) CN112100376B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113705197B (en) * 2021-08-30 2024-04-02 北京工业大学 Fine granularity emotion analysis method based on position enhancement

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2521607A1 (en) * 2003-04-07 2004-10-28 Sevenecho, Llc Method, system and software for digital media narrative personalization
CN110489554B (en) * 2019-08-15 2021-06-18 昆明理工大学 Attribute-level emotion classification method based on location-aware mutual attention network model
CN111414476A (en) * 2020-03-06 2020-07-14 哈尔滨工业大学 Attribute-level emotion analysis method based on multi-task learning

Also Published As

Publication number Publication date
CN112100376A (en) 2020-12-18

Similar Documents

Publication Publication Date Title
CN109902293B (en) Text classification method based on local and global mutual attention mechanism
CN110119467B (en) Project recommendation method, device, equipment and storage medium based on session
CN110598779B (en) Abstract description generation method and device, computer equipment and storage medium
CN110163299B (en) Visual question-answering method based on bottom-up attention mechanism and memory network
CN109934261B (en) Knowledge-driven parameter propagation model and few-sample learning method thereof
CN109582956B (en) Text representation method and device applied to sentence embedding
CN110046248B (en) Model training method for text analysis, text classification method and device
GB2547068A (en) Semantic natural language vector space
CN109919221B (en) Image description method based on bidirectional double-attention machine
CN109902750A (en) Method is described based on two-way single attention mechanism image
CN111897957B (en) Capsule neural network integrating multi-scale feature attention and text classification method
CN113240683B (en) Attention mechanism-based lightweight semantic segmentation model construction method
CN113673535B (en) Image description generation method of multi-modal feature fusion network
CN112527966B (en) Network text emotion analysis method based on Bi-GRU neural network and self-attention mechanism
CN115145551A (en) Intelligent auxiliary system for machine learning application low-code development
CN113626589A (en) Multi-label text classification method based on mixed attention mechanism
CN112651940A (en) Collaborative visual saliency detection method based on dual-encoder generation type countermeasure network
CN112100376B (en) Mutual enhancement conversion method for fine-grained emotion analysis
CN114510576A (en) Entity relationship extraction method based on BERT and BiGRU fusion attention mechanism
CN112560440A (en) Deep learning-based syntax dependence method for aspect-level emotion analysis
CN113269277A (en) Continuous dimension emotion recognition method based on Transformer encoder and multi-head multi-modal attention
CN113326374A (en) Short text emotion classification method and system based on feature enhancement
CN110321565B (en) Real-time text emotion analysis method, device and equipment based on deep learning
CN116467452A (en) Chinese complaint classification method based on multi-task learning hybrid neural network
CN116150334A (en) Chinese co-emotion sentence training method and system based on UniLM model and Copy 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
GR01 Patent grant
GR01 Patent grant