Aspect emotion triple extraction method based on bidirectional interaction and reasoning strategy combination, computer program product and terminal

By adopting a joint method of two-way interaction and reasoning strategies in the aspect emotion triple extraction task, combining language models and image processing models, and using span generation technology and two-way matching modules, the problem of semantic association between aspects and viewpoints is solved and achieved. More accurate aspect-view pair matching.

CN119312073APending Publication Date: 2025-01-14YIBIN WEITERIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411191172.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

The prior art is difficult to effectively establish semantic correlations between aspects and perspectives in the aspect emotion triple extraction task, resulting in low accuracy of aspect-point matching.

Method used

Using a method based on a combination of two-way interaction and reasoning strategies, the language model extracts context representation and the image processing model obtains dependency information, and combines span generation technology and two-way matching modules to achieve accurate matching of aspects and viewpoints.

Benefits of technology

It improves the accuracy of aspect-view pair matching, enhances the semantic relationship between aspects and views, overcomes the shortcomings of sequential decoding, and solves the problem of difficulty in distinguishing similar spans.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119312073A_ABST
    Figure CN119312073A_ABST
Patent Text Reader

Abstract

The invention discloses an aspect emotion triple extraction method based on bidirectional interaction and reasoning strategy combination, a computer program product and a terminal, and belongs to the field of natural language processing, and the method comprises the following steps: carrying out vector splicing on context representation and word dependence information to obtain new feature representation; extracting candidate spans of aspects and viewpoint sets from the new feature representation; an aspect and viewpoint set is extracted by using a bidirectional interaction module; and a bidirectional matching module is adopted to match the input aspect and viewpoint set to obtain an aspect-viewpoint pair representation, and finally classification processing is carried out. A bidirectional interaction module is introduced, useful information of an aspect span and a viewpoint span is exchanged from two directions of aspects to viewpoints and viewpoints to aspects, and the semantic relationship between the aspects and the viewpoints is enhanced; a bidirectional matching module is introduced, and aspect-viewpoint pairs and viewpoint-aspect pairs are subjected to bidirectional matching by utilizing potential mutual indication relationships among different word pairs, so that the aspect-viewpoint pair matching accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing, and in particular to a method for extracting aspect sentiment triples based on two-way interaction and reasoning strategy combination, a computer program product and a terminal. Background Art

[0002] Aspect-Based Sentiment Analysis (ABSA) is a fine-grained sentiment analysis task for sentences, which aims to identify aspects (a part of the evaluation object or a specific dimension, such as restaurant environment, restaurant service, etc.) and their corresponding sentiment polarity. In order to solve the ABSA task, a variety of subtasks have been developed, such as Aspect Term Extraction (ATE), which is used to extract target entities from sentences. Opinion Term Extraction (OTE), which is used to extract words with sentiment polarity to the target entity. In addition, Aspect Term Sentiment Analysis (ATSA) and Target-oriented Opinion Word Extraction (TOWE) are mainly used to extract sentiment and opinions related to specific aspects from sentences. Recently, Aspect Sentiment Triple Extraction (ASTE) has been proposed, which aims to identify aspect terms and corresponding opinions and sentiments in review sentences. Taking "The ambience was nice, but service wasn't so great" as an example, the goal of the ASTE task is to identify the two triplets (environment, nice, positive) and (service, great, positive). Among them, "environment" and "service" are regarded as aspect terms, "nice" and "great" represent the corresponding opinion terms, and "positive" represents the sentiment polarity. Based on the accurate extraction of triplets, further in-depth exploration can be carried out. For example, if it is already known that "nice" is an opinion term, then in the context of the current example sentence, the aspect term that better matches "nice" is "environment", while "service" does not match "nice".

[0003] Since the ASTE task involves two subtasks, extraction and classification, it is extremely difficult to accurately extract aspects and opinions and use the relationship between them for sentiment prediction. To solve this problem, some researchers first proposed the aspect-sentiment triple extraction (ASTE) task. Specifically, a one- or two-stage model is adopted, including aspect term extraction, opinion term extraction, and sentiment classification. In the first stage, the generation of candidate aspect terms, candidate opinion terms, and sentiment polarity is achieved by considering the mutual influence between aspects and opinions. In the second stage, the aspect and opinion terms are correctly matched and then used for the triple extraction task. However, this tagging scheme may complicate feature learning and model training. In addition, the pipeline method is easily affected by error propagation. To overcome these problems, other researchers have improved the original sequence tagging method and proposed a new tagging scheme to transform the ASTE task form into a unified tagging task. However, these methods cannot effectively establish the relationship between words and ignore the semantic and syntactic relationships between the three elements. Some researchers have proposed a span-based model that can independently predict the sentiment relationship between all possible aspect spans and opinion spans. Although this method shows good performance, it ignores the interaction between potential triplets and the semantic information within the sentence, and has difficulty distinguishing spans with similar distributions. In summary, how to establish semantic associations between aspects and opinions and improve the accuracy of aspect-opinion pair matching is a technical problem that needs to be solved urgently. Summary of the invention

[0004] The purpose of the present invention is to overcome the problems of the prior art and to provide a method for extracting aspect emotion triples based on two-way interaction and reasoning strategy combination, a computer program product and a terminal.

[0005] The object of the present invention is to achieve the following technical solution: a method for extracting aspect emotion triples based on two-way interaction and reasoning strategy combination, the method comprising the following steps:

[0006] The language model is used to extract the contextual representation of the input text, and the image processing model is used to obtain the single dependency information in the input text;

[0007] Vectorize the context representation and word dependency information to obtain a new feature representation;

[0008] Extracting candidate spans of aspect sets and candidate spans of opinion sets from the new feature representation using span generation technology;

[0009] Extract aspect sets and opinion sets using bidirectional interaction modules;

[0010] A bidirectional matching module is used to match the input aspect set and opinion set to obtain the representation of aspect-opinion pairs;

[0011] The aspect-opinion pairs and context representations are processed by information fusion, layer normalization, maximum pooling and classification to obtain the sentiment classification results.

[0012] In one example, a span generation technique is used to extract candidate spans of an aspect set and a candidate span of a viewpoint set from a new feature representation, including:

[0013] Enumerate all possible spans based on the new feature representation, merge the tag-level feature representations through maximum pooling, and obtain a set of candidate spans;

[0014] A non-normalized score represented by each span in the candidate span set is generated through a fully connected layer, and the score is converted into a probability distribution to determine the probability that the candidate span is an aspect or an opinion, thereby obtaining an aspect span set and an opinion span set.

[0015] In one example, a bidirectional interaction module is used to extract an aspect set and a viewpoint set, including:

[0016] Define the semantic relationship between the aspect span representation and the viewpoint span representation, convert the semantic relationship into probability distribution and normalize it, use the attention mechanism to perform weighted summation on the semantic relationship of all aspect spans to obtain the semantic information useful for each aspect span, and concatenate the useful semantic information of each aspect span with the original aspect span representation to obtain the aspect representation set;

[0017] Define the semantic relationship between the span representations of each aspect and the span representations of each opinion, convert the semantic relationship into a probability distribution and normalize it, use the attention mechanism to perform weighted summation on the semantic relationship of all opinion spans to obtain useful semantic information for each opinion span, and concatenate the useful semantic information of each opinion span with the original opinion span representation to obtain a representation set of opinions;

[0018] The fully connected layer is used to generate non-normalized scores for aspect feature representation and opinion feature representation, respectively, and the scores are converted into probability distributions to determine the probability that the span belongs to the aspect category and the probability that the span belongs to the opinion category, thereby obtaining the aspect set and opinion set.

[0019] In one example, before using the bidirectional matching module to match the input aspect set and opinion set, the method further includes:

[0020] The candidate spans are screened based on the binary classification filter, and similar spans are distinguished based on the similar span separation loss of KL divergence.

[0021] In one example, a similar span separation loss based on KL divergence is used to distinguish similar spans, including:

[0022] Calculate similarity scores between aspects and opinions;

[0023] According to the similarity score, the distribution difference between the aspect feature representation and the opinion feature table is measured by KL divergence, and the KL divergence of all feature representations is averaged as the similarity span separation loss.

[0024] In one example, a bidirectional matching module is used to match the input aspect set and opinion set, including:

[0025] Observe the predictions between aspects and other opinions, and between opinions and other aspects, and infer a fit score;

[0026] Construct a feature vector based on the matching scores and aspect-opinion pair representations from the previous round; input the feature vector into the linear layer to obtain a new inference score and convert it into a probability distribution to determine the matching probability;

[0027] For each aspect-opinion pair, the matching scores are compared, and the value with the highest matching degree is selected as the final result to form the final aspect-opinion pair.

[0028] It should be further explained that the technical features corresponding to the various examples of the above method can be combined or replaced with each other to form a new technical solution.

[0029] The present invention also includes a computer program product, including a computer program, which, when executed by a processor, implements the steps of the aspect emotion triple extraction method based on the combination of bidirectional interaction and reasoning strategy formed by any one of the above examples or a combination of multiple examples.

[0030] The present invention also includes a terminal, including a memory and a processor, wherein the memory stores computer instructions that can be executed on the processor, and when the processor executes the computer instructions, the steps of the method for extracting aspect emotion triples based on two-way interaction and reasoning strategy combined formed by any one or more of the above examples are executed.

[0031] Compared with the prior art, the present invention has the following beneficial effects:

[0032] 1. In one example, the semantic representation of spans is enriched by introducing the syntactic dependency information of sentences obtained from GCN and integrating it into the context information; a span-based method is adopted to overcome the shortcomings of sequential decoding, so as to better capture the relationship between spans in a sentence; a bidirectional interaction module is introduced, starting from the two directions of aspect to opinion and opinion to aspect, to exchange useful information of aspect spans and opinion spans, and enhance the semantic relationship between aspects and opinions, so as to achieve more accurate aspect extraction and opinion extraction; a bidirectional matching module is introduced, and a new reasoning strategy is adopted, that is, the potential mutual indicative relationship between different word pairs is utilized to perform bidirectional matching on aspect-opinion pairs and opinion-aspect pairs, so as to generate the final aspect-opinion pair representation, so as to improve the accuracy of aspect-opinion pair matching.

[0033] 2. In one example, a span selection and separation method using binary classification screening and KL divergence is designed to solve the problem of reduced model efficiency due to enumerating all possible spans and the problem of difficulty in distinguishing when dealing with similar spans. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The specific implementation methods of the present invention are further described in detail below in conjunction with the accompanying drawings. The accompanying drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The same reference numerals are used in these drawings to represent the same or similar parts. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.

[0035] Figure 1 A method flow chart provided for an example of the present invention;

[0036] Figure 2 A schematic diagram of bidirectional matching of aspect-viewpoint pairs provided for an example of the present invention;

[0037] Figure 3 A schematic diagram of a model structure for providing a method application for an example of the present invention;

[0038] Figure 4 Different maximum span lengths l provided for an example of the present invention s Schematic diagram of the impact on the F1 score. DETAILED DESCRIPTION

[0039] The technical solution of the present invention is described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0040] In the description of the present invention, it should be noted that the directions or positional relationships indicated by "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside", etc. are directions or positional relationships based on the drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the use of ordinal numbers (e.g., "first and second", "first to fourth", etc.) is to distinguish objects, and is not limited to this order, and cannot be understood as indicating or implying relative importance.

[0041] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, "installation", "connection" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0042] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0043] In one example, if Figure 1 As shown, the aspect sentiment triple extraction method based on the combination of bidirectional interaction and reasoning strategy includes the following steps:

[0044] S1: Use a language model to extract the contextual representation of the input text, and use an image processing model to obtain the single dependency information in the input text; the language model is based on the Transformer architecture or its variants, and learns rich contextual information through pre-training and fine-tuning to adapt to different natural language processing tasks. The language model can be a GPT model, XLNet, etc., and this example is a BERT model. Specifically, the BERT model is used to process the entire input sequence, and the self-attention mechanism is used to capture the dependency relationship and contextual information between words in the input text; after being processed by the BERT model, the contextual representation H of each word is obtained L =[h1,h2,...,h n The image processing model can be a GAE (Graph Auto-Encoder) model, an RNN model, etc. This example uses a GCN (Graph Convolutional Network) module, and the word dependency information H is obtained through the GCN module. G =[h'1,h'2,…,h' n].

[0045] S2: Represent the context H L =[h1,h2,...,h n ] and word dependency information H G =[h'1,h'2,…,h' n ] to obtain a more comprehensive and rich new feature representation

[0046] S3: Extract candidate spans A of aspect sets from the new feature representation using span generation techniques S and the candidate span O of the view set S ;

[0047] S4: Extracting aspect sets using the Bidirectional Interaction Module Viewpoint Collection To further improve the accuracy of aspect sets and opinion sets;

[0048] S5: Use a bidirectional matching module to match the input aspect set Viewpoint Collection Matching is performed to obtain the representation of aspect-viewpoint pairs; specifically, the aspect set and viewpoint collection As the input of the Bidirectional Matching Module, the proposed reasoning strategy is used to correctly match aspect and opinion terms to form the representation of aspect-opinion pairs.

[0049] S6: Perform information fusion processing, layer normalization processing, maximum pooling processing, and classification processing on the aspect-opinion pairs and context representation in turn to obtain the sentiment classification result.

[0050] In one example, extracting the context representation of the input text using a language model in step S1 includes the following steps:

[0051] Process the input text by adding special tags [CLS] and [SEP] at the beginning and end of sentences;

[0052] The entire sequence "[CLS]w1,w2,…,w n [SEP]"Input into BERT encoder;

[0053] Get the contextual embedding representation of each word represents the dimensional space of hidden representation, n represents the total number of nodes, d h represents the dimension of each context embedding vector;

[0054] In one example, in step S1, the image processing model is used to obtain single dependency information in the input text, including the following steps:

[0055] Use the GCN module to obtain word dependency information and consider the hidden representation of node i in the lth layer (l ≥ 2) The calculation formula is: The final hidden representation is obtained by iteratively applying GCN layers Among them, σ represents the activation function; represents the adjacency matrix; W l represents the weight matrix of the lth layer; b l Represents the bias term of the lth layer.

[0056] H L Compared with the representation H generated by GCN G Make connections to build new features

[0057] In one example, a span generation technique is used to extract candidate spans of an aspect set and a candidate span of a viewpoint set from a new feature representation, including:

[0058] S31: Based on H sp Enumerate all possible spans, then merge the tag-level feature representations through maximum pooling to finally obtain a set of candidate spans Where m is the number of candidate spans;

[0059] S32: Take the span representation as input, generate unnormalized scores through a fully connected layer, and then apply the softmax function to convert the scores into probability distributions Right now To determine whether each span is aspect or non-aspect, we finally get the aspect span set A S ;in, represents weight; represents the representation vector of the i-th span; represents the bias term;

[0060] S33: Take the span representation as input and generate unnormalized scores through a fully connected layer. Then apply the softmax function to convert the scores into probability distributions Right now To determine whether each span is an opinion or a non-opinion, we finally get the opinion span set O S .

[0061] In one example, a bidirectional interaction module is used to extract an aspect set and a viewpoint set, including:

[0062] S41: define the semantic relationship between the aspect span representation and the viewpoint span representation, convert the semantic relationship into probability distribution and perform normalization, use the attention mechanism to perform weighted summation on the semantic relationship of all aspect spans, obtain the semantic information useful for each aspect span, concatenate the useful semantic information of each aspect span with the original aspect span representation, and obtain the aspect representation set;

[0063] In this step, the semantic relationship is calculated from the perspective of viewpoint to aspect. First, the i-th aspect span is defined as The j-th view span is represented by The semantic relationship between Then add d i,j Convert it into a probability distribution and normalize it using the softmax function. The normalized score is: Use the attention mechanism to perform weighted summation of the semantic relationships of all view spans, thereby obtaining useful semantic information for each aspect span And transfer it from opinion span to aspect span to obtain a more accurate aspect span representation. Useful clues extracted from opinion span Compared with the original aspect span representation Make a connection, that is Get the final representation set of aspects

[0064] S42: define the semantic relationship between the representation of each aspect span and the representation of each opinion span, convert the semantic relationship into a probability distribution and perform normalization, use the attention mechanism to perform weighted summation on the semantic relationship of all opinion spans, obtain useful semantic information for each opinion span, concatenate the useful semantic information of each opinion span with the original opinion span representation, and obtain a representation set of opinions;

[0065] In this step, the semantic relationship is calculated from the perspective of aspect to viewpoint. First, the j-th viewpoint span is defined as The i-th aspect span is represented by The semantic relationship between Then in order to i,j Converted into probability distribution, normalized using softmax function, the normalized score is: Since the direction is ignored when calculating the semantic relationship between aspect span and view span, the same calculation method from view to aspect is used to obtain the relevant aspect span representation Useful information Then, the useful information extracted from the aspect span The original view span Make a connection, that is Get the final view feature representation set

[0066] S43: Represent the final aspect feature The score is then converted into a probability distribution using the softmax function to determine the predicted probability that the i-th span belongs to the aspect category. Then we get the aspect set;

[0067] S44: The final view feature representation The input is fed into the fully connected layer to generate a non-normalized score. Then, the softmax function is applied to convert the score into a probability distribution, which is used to determine the predicted probability that the jth span belongs to the opinion category. Then we get a collection of opinions.

[0068] In one example, before using the bidirectional matching module to match the input aspect set and opinion set, the method further includes:

[0069] The candidate spans are screened based on a binary classification filter, and similar spans are separated based on a KL divergence loss to distinguish similar spans. Optionally, the span selection and separation method using binary classification screening and KL divergence includes the following steps:

[0070] S051: Use a binary filter to filter spans to filter out misjudged feature representations. Specifically, spans are retained or filtered by minimizing the difference between the predicted probability and the true label. Therefore, the cross entropy loss function is used to measure the difference between the model prediction value and the true label. The cross entropy loss functions for aspect feature representation and opinion feature representation are defined as follows:

[0071]

[0072] in, The cross entropy loss function representing the aspect feature representation; The cross entropy loss function representing the opinion feature representation; represents the total loss function; η a Represents a collection of aspect spans The size of η o Represents a collection of view spans size; Represents the true label distribution of the i-th aspect sample; represents the true label distribution of the i-th opinion sample.

[0073] S052: Calculate similarity scores between aspects and opinions

[0074] S053: Based on the similarity score, the KL divergence is used to measure the distribution difference between the aspect feature representation and the opinion feature table, and the KL divergence of all feature representations is averaged as the similarity span separation loss. Similarity span separation loss The calculation expression is:

[0075]

[0076] in, Representation of aspect features With all viewpoint features expressed The sum of the similarities between .

[0077] In one example, a bidirectional matching module is used to match the input aspect set and opinion set, including:

[0078] S51: observe the prediction results between the aspect and other opinions and between the opinion and other aspects, and infer the matching scores;

[0079] In this step, in order to improve the matching accuracy between aspects and opinions, a new reasoning strategy is introduced. Through reasoning and iterative prediction, the calculation steps of the matching score in the kth round are as follows:

[0080] First use represents all aspect-viewpoint pairs, where i∈[0,η a -1]∧j∈[η a ,η a +η o -1]. represents all viewpoint-aspect pairs, where i∈[η a ,η a +η o -1]∧j∈[0,η a -1], and then regard the representations of all aspect-viewpoint pairs and viewpoint-aspect pairs as cells in the grid, and only focus on the upper right and lower left corners of the matrix to obtain the representations of aspect to viewpoint and viewpoint to aspect, respectively. The use of this bidirectional representation can improve the matching accuracy. Then the initial matching degree in the cell is calculated as follows and the initial representation

[0081]

[0082] Among them, W g and b g are the trainable weights and biases, respectively.

[0083] By observing Predictions and opinions compared with other opinions The prediction results between other aspects are inferred and Matching score and Among them, i ranges from 0 to η a -1, the range of j is η a to η a +η o -1, represents the maximum matching score between the i-th aspect and all other viewpoints, represents the maximum matching score between the jth viewpoint and all other aspects;

[0084] S52: construct a feature vector based on the matching scores and aspect-opinion pair representations of the previous round; input the feature vector into the linear layer to obtain a new inference score, and convert it into a probability distribution to determine the matching probability;

[0085] In this step, in order to obtain richer feature representation, the feature vector is constructed in the following way: Represents the inference score; the feature vector is input into the linear layer to obtain Finally Send to a linear layer with softmax activation function for classification

[0086] S53: For each aspect-viewpoint pair, compare the matching scores, and select the value with the highest matching degree as the final result to form a final aspect-viewpoint pair.

[0087] In this step, in order to merge these two parts and form the final aspect-opinion pair, for each aspect-opinion pair (a, o) i , by comparison Figure 2 The matching degree of the corresponding position in the upper right corner and the lower left corner of the matrix is ​​then selected, and the value with higher matching degree in the corresponding position in the upper right corner and the lower left corner is taken as the final result to obtain the merged aspect-viewpoint pair representation Where η = max(η a ,η o ).

[0088] Furthermore, since the number of inference iterations is uncertain, in order to prevent the increase of time complexity, Bayesian optimization is used to automatically adjust the hyperparameters to select the optimal number of inferences k. Then, the true distribution and predicted label distribution are calculated. The cross entropy loss between is used to measure the performance of the model, where the cross loss function for:

[0089]

[0090] Among them, η represents the number of samples; G ij Indicates the true matching probability between the i-th word and the j-th word, that is, whether they match; represents the predicted matching probability between the i-th word and the j-th word;

[0091] In one example, information fusion processing, layer normalization processing, maximum pooling processing, and classification processing are performed on aspect-viewpoint pairs and context representations in sequence, including the following steps:

[0092] S61: New feature representation H obtained by combining context representation and word dependency information sp , aspects and viewpoint information are fused into a representation vector f, and the calculation expression of vector f is:

[0093]

[0094] in, represents the span of the i-th aspect; represents the representation of the i-th view span;

[0095] S62: performing layer normalization and maximum pooling operation on the fused vector f to obtain a vector r=MaxPooling(f), where MaxPooling represents maximum pooling processing;

[0096] S63: Perform linear transformation and softmax operation on the pooled vector r to obtain the prediction result y of the sentiment polarity, that is, y = softmax (Wr + b);

[0097] S64: Use the cross entropy loss function to calculate the difference between the predicted probability distribution and the true label, by minimizing the loss function Make the model more accurate in predicting the sentiment polarity of the input text; comprehensive cross entropy loss and similar span separation loss Define the total loss function in represents the true label distribution, represents the predicted probability distribution; Binary cross loss function for aspect representation and opinion representation; represents the cross entropy loss function for aspect-opinion pair matching, λ is used to control the similarity span separation loss; by training and minimizing the total loss function The model of the application method of the present invention can better understand and represent the contextual information, aspect terms and opinion terms in the text, thereby enhancing the performance of sentiment classification and improving the accuracy of aspect sentiment triple extraction.

[0098] In one example, the above methods are combined to obtain a preferred method of the present invention, in which the scheme includes the following steps:

[0099] S10: extracting context representation of the input text using a language model, and obtaining single dependency information in the input text using an image processing model;

[0100] S20: Connect the context representation with the word dependency information to obtain a more comprehensive and rich new feature representation;

[0101] S30: extracting candidate spans of aspect sets and candidate spans of opinion sets from the new feature representation using span generation technology;

[0102] S40: extracting aspect sets and opinion sets by using a two-way interaction module to further improve the accuracy of the aspect sets and opinion sets;

[0103] S50: Screen candidate spans based on binary classification filters and distinguish similar spans based on similar span separation loss of KL divergence

[0104] S60: using a bidirectional matching module to match the input aspect set and opinion set to obtain a representation of an aspect-opinion pair;

[0105] S70: performing information fusion processing, layer normalization processing, maximum pooling processing, and classification processing on the aspect-viewpoint pairs and context representation in turn to obtain a sentiment classification result.

[0106] The model used in the method corresponding to steps S10-S70 of the present invention is defined as the BIISJ model (bidirectional interaction and inference strategy joint, BIISJ), such as Figure 3 As shown, the BIISJ model includes a BERT model, a GCN module, a connection layer, a span generation module, an aspect-viewpoint decoder, a bidirectional interaction module, a bidirectional matching module, a multi-head self-attention layer, a layer normalization and a maximum pooling layer, wherein the output ends of the BERT model and the GCN module are connected to the connection layer, the connection layer is connected to the span generation module, the span generation module is connected to the aspect-viewpoint decoder, the aspect-viewpoint decoder is connected to the bidirectional interaction module, the bidirectional matching module, and the multi-head self-attention layer, the multi-head self-attention layer, the layer normalization and the maximum pooling layer are connected in sequence, and the output end of the connection layer is connected to the layer normalization and the maximum pooling layer.

[0107] Specifically, the present invention uses the BERT model to process the input text (InputSentence) to obtain the contextual representation of each word. In order to comprehensively utilize the semantic information and syntactic dependency information of the context, the contextual representation is connected with the word dependency information obtained by the GCN module (GCNModule) through the connection layer to obtain a more comprehensive and rich feature representation for achieving the following tasks. The span generation module is then used to extract the candidate spans of the aspect set and the candidate spans of the opinion set from the representation to achieve span generation (Span Generation), and the span-based method overcomes the shortcomings of sequential decoding, thereby better capturing the relationship between the spans in the sentence. The candidate spans of the aspect set and the candidate spans of the opinion set are decoded by the aspect-opinion decoder, and the bidirectional interaction module and the bidirectional matching module are introduced to improve the matching correctness of the aspect-opinion pair. The bidirectional interaction module starts from the two directions of aspect to opinion and opinion to aspect, exchanges useful information of aspect span and opinion span, enhances the semantic relationship between aspect and opinion, so as to improve the accuracy of aspect set and opinion set. Then, the aspect set and opinion set are used as the input of the bidirectional matching module, and the aspect and opinion terms are correctly matched through the proposed reasoning strategy to form the aspect-opinion pair representation, so as to improve the accuracy of aspect-opinion pair matching. Finally, the aspect-opinion pair and the context representation are input into the multi-head self-attention layer, layer normalization and maximum pooling layer to achieve sentiment classification.

[0108] In order to evaluate the performance of the proposed BIISJ model and the baseline model in the sentiment triple extraction (ASTE) task, precision (P), recall (R) and F1-score (F1) were used as evaluation indicators. Only when the aspects, opinions and sentiment polarities extracted by the model completely matched the true values, they were regarded as correct extraction results. Finally, the data with the best performance were selected as the test results.

[0109] In order to verify the efficiency of the BIISJ model, experiments are conducted on four benchmark datasets, namely REST14, REST15, REST16 and LAPTOP14, covering the restaurant and laptop domains, which are from SemEval2014, SemEval 2015 and SemEval 2016 respectively. However, since these original datasets only annotate aspect terms and sentiment polarity, the experiment is conducted on the ASTE-Data-V2 dataset, which contains one-to-many or many-to-one associations between aspect terms and opinion terms. And each dataset is further divided into three subsets: training set, validation set and test set.

[0110] The proposed BIISJ model is compared with some other baseline models, including RINANTE+, CMLA+, Peng-two-stage, Li-unified-R, OTE-MTL, GTS and EMC-GCN. Extensive experiments were conducted and the experimental results were analyzed. Among them, the Precision (%), Recall (%) and F1-score (%) of the ASTE task on the ASTE-DATA-V2 dataset are shown in Table 1:

[0111] Table 1 Performance results of different models performing ASTE tasks on the ASTE-DATA-V2 dataset

[0112]

[0113] It can be seen that the precision P, recall R, and F1 score of the BIISJ model of the present invention exceed all other baseline models. On the 14LAP, 14RES, 15RES, and 16RES datasets, the F1 score of the BIISJ model of the present invention is improved by 3.55%, 1.53%, 2.61%, and 3.95% respectively compared with the best baseline (EMC-GCN). The method of the present invention extracts aspect and opinion representations from aspect to opinion and opinion to aspect directions, and adopts a new reasoning strategy to match aspect-opinion pairs, thereby achieving accurate triple prediction. In addition, in most cases, the model of the present invention shows better precision and recall than the existing methods. The main reason is that BIISJ successfully alleviates the difficulty of error propagation and distinguishing similar spans through a bidirectional interaction module, a bidirectional matching module, and a span selection and separation method. Although the recall rate on the 14RES and 15RES datasets is slightly lower than that of EMC-GCN, the accuracy of the model of the present invention exceeds other baselines on most datasets, further confirming the effectiveness of the method of the present invention.

[0114] Furthermore, in order to explore the impact of various modules on the BIISJ model, an ablation study was conducted. The ablation experiment results are shown in Table 2:

[0115] Table 2 Ablation experiment results

[0116]

[0117] Among them, "w / o GCN" means removing the GCN module from BIISJ. The performance of the model will be reduced after removing this module, because GCN can enhance span representation by integrating dependency information into the model. "w / o Span length embedding" means removing span length embedding from BIISJ. After removing it, it can be observed that the performance of the proposed model has a certain degree of performance degradation on all datasets. This is because most aspect and opinion terms in sentences are short in length, and the span length feature helps the model filter out incorrect terms. "w / o BiMatching" means canceling the bidirectional interaction module. A significant F1 score drop is observed on all four datasets because this module achieves more accurate aspect extraction and opinion extraction by exchanging useful information about aspect span and opinion span, starting from the direction of aspect to opinion and opinion to aspect. "w / o BiMatching" means removing the bidirectional matching module from BIISJ. The performance of the model will also be significantly reduced after removing it. This module adopts a novel reasoning strategy to match aspect-opinion pairs and opinion pairs in both directions to generate the final representation of aspect-opinion pairs to improve matching accuracy. “w / o Span-selection-separation” means removing the span selection and separation method from BIISJ. Experimental results show that this span selection and separation method combining span screening and KL divergence effectively solves the problem of indistinguishable similar spans.

[0118] Furthermore, during the experiment, the maximum span length l s From 2 to 8, the step size is 1, the experimental results are as follows Figure 4 As shown in the figure, it can be observed that the F1 score of the ASTE task on the four benchmark datasets increases with l s However, when l s When it reaches 6, the F1 score tends to stabilize. This result shows that even with a relatively small l s It is possible to generate spans with precise boundaries, increasing l s It will not significantly improve the performance. Considering that the model training time increases with l s The present invention will increase with the increase of s Set to 2.

[0119] In order to more vividly illustrate the effectiveness of the proposed BIISJ model, three samples are selected from the 14RES test set, and the corresponding prediction triples are shown in Figure 3:

[0120] Table 3 Case study table of ASTE

[0121]

[0122] In Table 3, X represents an incorrect prediction. For sample E1, the model provides correct results in both directions (i.e., aspect to opinion and opinion to aspect), showing a clear advantage. For sample E2, partial triple information is captured in each direction, resulting in incomplete prediction. However, the bidirectional matching module of the present invention enables the model to obtain all correct triple information. For sample E3, involving a one-to-many relationship between aspect and opinion terms, it can be observed that the predictions in both directions are only partially correct. However, since the bidirectional matching module of the present invention can select a representation with a higher matching degree as the matching result, the performance of the ASTE task is improved.

[0123] In summary, the proposed method has been extensively experimented on benchmark datasets, and the experimental results show that the proposed method performs well in processing the complex relationship between aspect terms and opinion terms in sentences, and outperforms the most advanced pipeline methods and joint methods in the ASTE task.

[0124] An example of the present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method for extracting aspect emotion triples based on two-way interaction and reasoning strategy combined with any one of the above examples or a combination of multiple examples. The processor may be a single-core or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the present invention.

[0125] An example of the present invention also provides a storage medium, which has the same inventive concept as the method for extracting aspect emotion triples based on two-way interaction and reasoning strategies formed by any one of the above examples or a combination of multiple examples, and stores computer instructions thereon, which, when executed, execute the steps of the method for extracting aspect emotion triples based on two-way interaction and reasoning strategies formed by any one of the above examples or a combination of multiple examples.

[0126] Based on this understanding, the technical solution of this embodiment, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0127] An example of the present invention also provides a terminal, which has the same inventive concept as any example or a combination of multiple examples corresponding to the above-mentioned method for extracting aspect emotion triples based on two-way interaction and reasoning strategy, including a memory and a processor, the memory stores computer instructions that can be run on the processor, and the processor executes the steps of the above-mentioned method for extracting aspect emotion triples based on two-way interaction and reasoning strategy when running the computer instructions. The processor can be a single-core or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the present invention.

[0128] In one example, the terminal, i.e., the electronic device, is presented in the form of a general-purpose computing device, and the components of the electronic device may include but are not limited to: at least one processing unit (processor) mentioned above, at least one storage unit mentioned above, and a bus connecting different system components (including storage units and processing units).

[0129] The storage unit stores a program code, which can be executed by the processing unit, so that the processing unit performs the steps of various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification. For example, the processing unit can execute the above-mentioned aspect sentiment triple extraction method based on two-way interaction and reasoning strategy combination.

[0130] The storage unit may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 3201 and / or a cache memory unit, and may further include a read-only memory unit (ROM).

[0131] The storage unit may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0132] The bus may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0133] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may communicate with one or more devices that enable a user to interact with the electronic device, and / or may communicate with any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter. The network adapter communicates with other modules of the electronic device through a bus. It should be understood that other hardware and / or software modules may be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0134] Through the above description, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to this exemplary embodiment can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method of the exemplary embodiment of the present application.

[0135] The above specific implementation methods are detailed descriptions of the present invention. It cannot be determined that the specific implementation methods of the present invention are limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions and substitutions can be made without departing from the concept of the present invention, which should be regarded as belonging to the protection scope of the present invention.

Claims

1. A method for extracting aspect sentiment triples based on two-way interaction and reasoning strategy, characterized in that: The following steps are involved: The language model is used to extract the contextual representation of the input text, and the image processing model is used to obtain the single dependency information in the input text; Vectorize the context representation and word dependency information to obtain a new feature representation; Extracting candidate spans of aspect sets and candidate spans of opinion sets from the new feature representation using span generation technology; Extract aspect sets and opinion sets using bidirectional interaction modules; A bidirectional matching module is used to match the input aspect set and opinion set to obtain the representation of aspect-opinion pairs; The aspect-opinion pairs and context representations are processed by information fusion, layer normalization, maximum pooling and classification to obtain the sentiment classification results.

2. The aspect sentiment triple extraction method based on two-way interaction and reasoning strategy combination according to claim 1 is characterized in that: The span generation technology is used to extract candidate spans of aspect sets and candidate spans of opinion sets from the new feature representation, including: Enumerate all possible spans based on the new feature representation, merge the tag-level feature representations through maximum pooling, and obtain a set of candidate spans; A non-normalized score represented by each span in the candidate span set is generated through a fully connected layer, and the score is converted into a probability distribution to determine the probability that the candidate span is an aspect or an opinion, thereby obtaining an aspect span set and an opinion span set.

3. The aspect sentiment triple extraction method based on two-way interaction and reasoning strategy combination according to claim 1 is characterized in that: The bidirectional interaction module is used to extract aspect sets and opinion sets, including: Define the semantic relationship between the aspect span representation and the viewpoint span representation, convert the semantic relationship into probability distribution and normalize it, use the attention mechanism to perform weighted summation on the semantic relationship of all aspect spans to obtain the semantic information useful for each aspect span, and concatenate the useful semantic information of each aspect span with the original aspect span representation to obtain the aspect representation set; Define the semantic relationship between the span representations of each aspect and the span representations of each opinion, convert the semantic relationship into a probability distribution and normalize it, use the attention mechanism to perform weighted summation on the semantic relationship of all opinion spans to obtain useful semantic information for each opinion span, and concatenate the useful semantic information of each opinion span with the original opinion span representation to obtain a representation set of opinions; The fully connected layer is used to generate non-normalized scores for aspect feature representation and opinion feature representation, respectively, and the scores are converted into probability distributions to determine the probability that the span belongs to the aspect category and the probability that the span belongs to the opinion category, thereby obtaining the aspect set and opinion set.

4. The aspect sentiment triple extraction method based on two-way interaction and reasoning strategy combination according to claim 1 is characterized in that: Before using the two-way matching module to match the input aspect set and opinion set, it also includes: The candidate spans are screened based on the binary classification filter, and similar spans are distinguished based on the similar span separation loss of KL divergence.

5. The aspect sentiment triple extraction method based on two-way interaction and reasoning strategy combination according to claim 4 is characterized in that: The similar span separation loss based on KL divergence is used to distinguish similar spans, including: Calculate similarity scores between aspects and opinions; According to the similarity score, the distribution difference between the aspect feature representation and the opinion feature table is measured by KL divergence, and the KL divergence of all feature representations is averaged as the similarity span separation loss.

6. The aspect sentiment triple extraction method based on two-way interaction and reasoning strategy combination according to claim 1 is characterized in that: A two-way matching module is used to match the input aspect set and opinion set, including: Observe the predictions between aspects and other opinions, and between opinions and other aspects, and infer a fit score; Construct a feature vector based on the matching scores and aspect-opinion pair representations from the previous round; input the feature vector into the linear layer to obtain a new inference score and convert it into a probability distribution to determine the matching probability; For each aspect-opinion pair, the matching scores are compared, and the value with the highest matching degree is selected as the final result to form the final aspect-opinion pair.

7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for extracting aspect emotion triples based on the combination of bidirectional interaction and reasoning strategy described in any one of claims 1 to 6 are implemented.

8. A terminal comprising a memory and a processor, wherein the memory stores computer instructions that can be executed on the processor, characterized in that: When the processor runs the computer instructions, it executes the steps of the method for extracting aspect emotion triples based on the combination of bidirectional interaction and reasoning strategy as described in any one of claims 1-6.