A method for solving aspect opinion pair extraction using semantic segmentation
Through the semantic segmentation method, the dual-channel semantic segmentation module and joint learning loss function are used to solve the problem of limited model complexity and performance improvement in the existing technology, and the efficient aspect-view extraction is achieved, especially the accuracy improvement in one-to-many matching problem.
Patent Information
- Application Number
- CN202211120090.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-15
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-09-15
AI Technical Summary
The existing perspectives fail to make full use of text internal information for the extraction method, resulting in increased model complexity but limited performance improvement, and difficulty in capturing long-range information, especially in the one-to-many type matching problem.
The semantic segmentation method is adopted to calculate the entity and relational feature interaction matrix through the encoding module, and the dual-channel semantic segmentation module captures the task invariant and task-specific features for two subtasks, and combines learning through the marking and classification modules to build a loss function for training.
It effectively solves the error propagation problem, improves model performance, makes full use of sub-task interaction information, captures local and long-range information, and improves the accuracy of aspect perspectives for extraction.
Smart Images

Figure CN115455201B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of aspect-opinion pair extraction, and specifically to a method for solving aspect-opinion pair extraction by using semantic segmentation. Background Art
[0002] The aspect-opinion pair extraction task refers to the paired extraction of aspect words and their corresponding opinion words in a sentence, which is a more fine-grained aspect-level sentiment analysis task. The earliest research was to solve this task using a rule-based pipeline model, first extracting aspect words or opinion words, and then pairing the extracted words. The performance of the extraction model will affect the performance of the pairing model, causing an error propagation effect.
[0003] The current mainstream method is to use joint learning to regard the aspect-opinion pair extraction task as two subtasks of entity recognition and relationship detection. Early research ignored the strong correlation between the two subtasks and regarded them as two completely independent subtasks. However, the current mainstream method does not fully utilize the information inside the text and enhances the representation of the model by injecting external information, which will cause the model to require additional data sets and consume longer training time, resulting in a more complex model but no significant improvement in performance; moreover, the existing joint training models are difficult to capture long-range information and are difficult to solve the one-to-many type matching problem well. Summary of the Invention
[0004] The purpose of the present invention is to provide a method for solving aspect-opinion pair extraction by using semantic segmentation, so as to solve the problems raised in the above background art.
[0005] To achieve the above purpose, the present invention provides the following technical solutions:
[0006] A method for solving aspect-opinion pair extraction by using semantic segmentation, comprising the following steps:
[0007] 1) Encoding module: Input the review sentence into a pre-trained language model to obtain an initial entity feature representation, then obtain a relationship feature representation through correlation calculation, and interact the two feature representations to obtain an interaction matrix;
[0008] 2) Dual-channel semantic segmentation module: Input the interaction matrix into the semantic segmentation module. By using downsampling, task-invariant features can be obtained, and by using upsampling, task-specific features can be obtained for the two subtasks respectively. Then, the entity feature representation and the relationship feature representation are interacted with the information in the downsampling process through the skip-connection mechanism to provide supplementary information for the two subtasks respectively;
[0009] 3) Tagging and Classification Module: Regarding the entity recognition subtask as a sequence tagging task, converting the entity segmentation matrix obtained by the semantic segmentation module into a sequence form, and using CRF for sequence tagging. Regarding the relation detection subtask as a binary classification task, obtaining the matching results of aspect words and relation words from the relation segmentation matrix obtained by the semantic segmentation module through Softmax, and constructing a joint learning loss function to train the two subtasks simultaneously.
[0010] Based on the above technical solutions, the present invention also provides the following alternative technical solutions:
[0011] In an alternative solution: In step 1), given a review sentence with N tokens: S = {w1,..., w N}, the review sentence S obtains an initial entity feature representation through a pre-trained model:
[0012] H e = BERT({w1,…, w N ) (1)
[0013] where the sentence encoding H e = {h1,…, h N}, and d is the hidden state dimension.
[0014] In an alternative solution: Calculate the token-level relation feature representation through the entity feature representation, and add the entity and relation feature representations for interaction:
[0015] F(h m , h n ) = [h m ⊙ h n ; cos(h m , h n ); h m Wh n + H e (2)
[0016] where F(h m , h n ) is the interaction matrix, h m , h n ∈H e , and W is a learnable weight.
[0017] In an alternative solution: In step 2), the dual-channel semantic segmentation module includes a downsampling process and two upsampling processes, which can extract features for two subtasks. The downsampling process consists of two downsampling blocks, each of which contains two convolutional layers and one max-pooling layer. Each upsampling process consists of two upsampling blocks, and each upsampling block contains two convolutional layers and one transposed convolutional layer.
[0018] In an alternative solution: Use CRF for sequence labeling and calculate the probability distribution of sequence E, and find the global optimal solution by calculating the relationship between adjacent labels:
[0019]
[0020]
[0021] where and are the trainable weights of adjacent labels, and Y is the set of all possible labels.
[0022] In an alternative solution: The negative log-likelihood function is used as the loss function for entity recognition:
[0023]
[0024] where y E* is the annotation sequence of the entity feature sequence E.
[0025] In an alternative solution: Using the relation segmentation matrix, by calculating the conditional probability distribution of each token pair obtain the predicted relation distribution obtain the loss function for relation detection:
[0026]
[0027] where is the distribution of the annotated relation segmentation matrix, P is the set of all possible relations, and BCELoss is the binary cross-entropy loss function.
[0028] In an alternative solution: The loss function L entity for entity recognition and the loss function L relation for relation detection can obtain the final loss function:
[0029] L = λL entity + (1 - λ)L relation (7)
[0030] where λ is the balance weight for joint learning.
[0031] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0032] The method of using semantic segmentation to solve the aspect-opinion pair extraction proposes a new framework to solve the aspect-opinion pair extraction task. The encoding module calculates the interaction matrix of entity representation and relationship representation. The dual-channel semantic segmentation module is used to capture task-invariant and task-specific features for two subtasks simultaneously. The tagging and classification module is used for entity recognition and relationship detection; it well solves the deficiencies existing in related work, and fully utilizes the interaction information of the two subtasks to enhance the model without introducing external information. Brief Description of the Drawings
[0033] Figure 1 It is a schematic structural diagram of the algorithm proposed for the method of using semantic segmentation to solve the aspect-opinion pair extraction. Detailed Embodiments
[0034] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0035] The following describes the specific implementation of the present invention in detail with reference to specific embodiments.
[0036] As Figure 1 shown, it is a method of using semantic segmentation to solve the aspect-opinion pair extraction provided by an embodiment of the present invention, and the implementation process of the algorithm:
[0037] 1) Encoder Module (encoding module): This module is located on the Figure 1 left side. An opinion sentence S with N tokens is input into the pre-trained language model BERT to obtain an initial representation with entity features, and then the relationship feature representation is obtained through correlation calculation. Subsequently, the two feature representations are interacted to obtain an interaction matrix.
[0038] 2) Dual-Channel Semantic Segmentation Module (dual-channel semantic segmentation module): This module is located in the Figure 1 middle. We input the interaction matrix into the dual-channel semantic segmentation module; by using downsampling, task-invariant features can be obtained; by using upsampling, task-specific features can be obtained for the two subtasks respectively. Subsequently, the entity feature representation and the relationship feature representation are interacted with the information in the downsampling process through the skip-connection mechanism, which can enhance the representation ability of the model and provide supplementary information for the two subtasks respectively.
[0039] 3) Tagging and Classification Module: This module is located on the right side of Figure 1 . For the entity recognition subtask, we regard this task as a sequence tagging task, convert the entity segmentation matrix obtained by the semantic segmentation module into a sequence form, and use CRF for sequence tagging. For the relation detection subtask, we regard this task as a binary classification task, and obtain the matching results of aspect words and relation words through Softmax on the relation segmentation matrix obtained by the semantic segmentation module.
[0040] As Figure 1 shown, as a preferred embodiment of the present invention, in the aspect-opinion pair extraction task, it is usually divided into two subtasks to solve. First, the entity recognition subtask needs to be carried out to extract aspect and opinion words by using a joint extraction model; then, the relation detection subtask needs to be carried out to identify whether the aspect and opinion words belong to the same category by using a classification model. The traditional pipeline model-based method uses the results of entity recognition for relation detection, and this method will cause the problem of error propagation, resulting in a decline in model performance. To solve this problem, our research adopts a joint learning method to synchronously carry out the entity recognition and relation detection subtasks.
[0041] Implementation solution: Given a comment sentence with N tokens: S = {w1,..., w N}, to implement the relation detection subtask, use semantic segmentation to obtain a relation segmentation matrix R m,n , and assign a label to identify whether a token pair is relevant; to carry out the entity recognition subtask, use semantic segmentation to obtain an entity segmentation matrix and convert it into a sequence E n , and use CRF to assign a label to each token to identify whether each token is an aspect word, an opinion word or others. Finally, construct a joint learning loss function to train the entity recognition and relation detection tasks simultaneously.
[0042] As Figure 1As shown, as a preferred embodiment of the present invention, the current joint learning model is difficult to capture long-range information and cannot well solve the one-to-many matching problem (accounting for 24.42% of the data set). To overcome this problem, dual-channel semantic segmentation is utilized in the Dual-Channel Semantic Segmentation Module to synchronously perform entity recognition and relationship detection, and can well capture local and long-range information. In addition, there is a certain connection between the two subtasks, so the interaction effect of entity and relationship information is fully utilized to enhance the representation ability of the model without introducing external information additionally.
[0043] Implementation solution: In the encoding layer, the model first obtains the initial representation of the given review sentence S through the pre-trained model BERT.
[0044] H e = BERT({w1, …, w N}) (1)
[0045] where the sentence encoding H e = {h1, …, h N}, d is the hidden layer state dimension,
[0046] Use the entity feature representation to calculate the token-level relationship feature representation, and concatenate three similarity calculation methods: element-wise similarity, cosine similarity, and bi-linear similarity. Then, add the entity and relationship feature representations for interaction.
[0047] F(h m , h n ) = [h m ⊙ h n ; cos(h m , h n ); h m Wh n + H e (2)
[0048] where F(h m , h n ) is the interaction matrix, h m , h n ∈H e , and W is the learnable weight.
[0049] Use the dual-channel semantic segmentation module to extract features for the two subtasks. It includes a downsampling process and two upsampling processes, and its structure is as Figure 1As shown in the middle part. Each down-sampling process consists of two down-sampling blocks, and each down-sampling block contains two convolution layers and one max-pooling layer. Each up-sampling process consists of two up-sampling blocks, and each up-sampling block contains two convolution layers and one deconvolution layer.
[0050] Taking the interaction matrix F(h_m, h_n) as the input, the number of channels of the matrix is doubled through the down-sampling process, and the receptive field is expanded to obtain the semantic information of the context. A high-dimensional matrix can be obtained through down-sampling, and rich global information can be obtained to capture task-invariant features for the two subtasks. In addition, we use a two-channel up-sampling process to synchronously perform the entity recognition and relation detection subtasks, and halve the number of channels of the high-dimensional matrix. Through up-sampling, the matrix can be restored to the original size, and local semantic information can be obtained to capture task-specific features for the two subtasks.
[0051] In addition, information loss occurs during the down-sampling process, which will affect the decision-making of the model. Therefore, the skip-connection mechanism is adopted to provide supplementary information, and at the same time, the interaction enhancement model representation is considered. For entity recognition, the interaction between entity features and low-dimensional convolution features is introduced; for relation detection, the cropped low-dimensional feature representation with interaction information is directly concatenated. The feature information shared by entities and relations is used to enhance the performance of entity recognition and relation detection tasks, and the problems of gradient disappearance and network degradation can be well reduced.
[0052] As Figure 1 shown, as a preferred embodiment of the present invention, to solve the error propagation problem, the model constructs a loss function by jointly training and using the negative log-likelihood loss function of entity recognition and the binary loss function of relation detection at the same time. The present invention calculates the joint loss function in the tagging and classification module and uses weight coefficients to balance the loss functions of the two tasks.
[0053] Implementation solution: Regarding entity recognition as a sequence tagging task, after converting the entity segmentation matrix into a sequence form, CRF is used for sequence tagging to calculate the probability distribution of sequence E, and the global optimal solution is found by calculating the relationship between adjacent tags.
[0054]
[0055]
[0056] Where and is an adjacent tag of the trainable weight, and Y is the set of all possible tags.
[0057] The negative log-likelihood function is used as the loss function for entity recognition.
[0058]
[0059] where y E* is the annotation sequence of the entity feature sequence E.
[0060] For relation detection, we regard it as a binary classification task and use BCELoss to identify whether a token pair has a relation. We use the relation segmentation matrix to calculate the conditional probability distribution of each token pair to obtain the predicted relation distribution to obtain the loss function for relation detection:
[0061]
[0062] where is the distribution of the annotated relation segmentation matrix, P is the set of all possible relations, and BCELoss is the binary cross-entropy loss function.
[0063] During training, the minimized loss function consists of two parts: the loss function L entity for entity recognition and the loss function L relation for relation detection. The final loss function can be obtained by adding the two losses together with weights.
[0064] L = λL entity + (1 - λ)L relation (7)
[0065] where λ is the balance weight for joint learning.
[0066] In the above embodiments of the present invention, a method for solving aspect opinion pair extraction by using semantic segmentation is provided. By using the method of joint learning, a dual-channel semantic segmentation module is used to simultaneously perform entity recognition and relation detection subtasks, enabling the model to capture local context information and long-range dependency information for the two subtasks without using external information, and can well solve the error propagation problem, that is Figure 1 the Dual-Channel Semantic Segmentation Module shown makes the model simultaneously fit the loss function of entity recognition and the loss function of the relation detection part through multi-task training.
[0067] As described above, it is only the specific implementation manner of the present disclosure. However, the protection scope of the present disclosure is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present disclosure can easily think of changes or substitutions, which should all be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.
Claims
1. A method for solving aspect opinion pair extraction using semantic segmentation, characterized in that, It includes the following steps: 1) Encoding module: Input the comment sentence into the pre-trained language model to obtain an initial entity feature representation, then obtain a relational feature representation through correlation calculation, and interact the entity feature representation with the relational feature representation to obtain an interaction matrix; 2) Dual-channel semantic segmentation module: Input the interaction matrix into the semantic segmentation module. By using downsampling, task-invariant features can be obtained. By using upsampling, task-specific features can be obtained for the two sub-tasks respectively. Then, the entity feature representation and the relational feature representation interact with the information in the downsampling process through the skip-connection mechanism to provide supplementary information for the two sub-tasks respectively. The dual-channel semantic segmentation module is used to perform the entity recognition and relation detection sub-tasks simultaneously, enabling the model to capture local context information and long-range dependency information for the two sub-tasks without using external information; 3) Tagging and classification module: Regard the entity recognition sub-task as a sequence labeling task, convert the entity segmentation matrix obtained by the semantic segmentation module into a sequence form, and use CRF for sequence labeling. Regard the relation detection sub-task as a binary classification task, and obtain the matching results of the aspect words and relation words through Softmax for the relation segmentation matrix obtained by the semantic segmentation module. Construct a joint learning loss function and train the two sub-tasks simultaneously; In step 2), the dual-channel semantic segmentation module includes a downsampling process and two upsampling processes, which can extract features for the two sub-tasks. The downsampling process consists of two downsampling blocks, and each downsampling block contains two convolutional layers and one max-pooling layer. Each upsampling process consists of two upsampling blocks, and each upsampling block contains two convolutional layers and one transposed convolutional layer.
2. The method for solving aspect view extraction by using semantic segmentation according to claim 1, characterized in that, In step 1), given a review sentence with N tokens: , the review sentence S obtains an initial entity feature representation through a pre-trained model: (1) Among them, the sentence encoding , where d is the dimension of the hidden layer state.
3. The method for solving aspect view extraction by using semantic segmentation according to claim 2, characterized in that, Calculate the token-level relational feature representation through the entity feature representation, and add the entity and relational feature representations for interaction: (2) Among them is the interaction matrix , and W is the learnable weight 4. The method for solving aspect opinion pair extraction using semantic segmentation according to claim 1, characterized in that, Use CRF for sequence labeling and calculate the probability distribution of sequence E, and find the global optimal solution by calculating the relationship between adjacent tags: (3) (4) where and are trainable weights of adjacent tokens, and Y is the set of all possible tokens. 5. The method for solving aspect view extraction by using semantic segmentation according to claim 4, characterized in that, The negative log-likelihood function is used as the loss function for entity recognition: (5) Among them is the annotation sequence of the entity feature sequence E.
6. The method for solving aspect view extraction by using semantic segmentation according to claim 5, characterized in that, Using the relational segmentation matrix, by calculating the conditional probability distribution of each token pair obtain the predicted relational distribution , and obtain the loss function for relation detection: (6) Among them is the distribution of the labeled relational segmentation matrix, P is the set of all possible relationships, and BCELoss is the binary cross-entropy loss function.
7. The method for solving aspect view extraction using semantic segmentation according to claim 6, characterized in that, Loss function for entity recognition and loss function for relation detection can derive the final loss function: (7) where λ is the balance weight for joint learning.
Citation Information
Patent Citations
Case-related news viewpoint sentence sentiment classification method based on CNN-BiLSTM + action model
CN111368086A
Method and system for synchronously tracking aspect-viewpoint pair of entity and relationship
CN115033667A