Aspect-level sentiment triple extraction method integrating part-of-speech information
Through the fusion of multi-task learning framework and part-of-speech information, part-of-speech information is explicitly embedded, which solves the problem of not utilizing part-of-speech information in the existing technology, realizes the extraction of in-depth understanding of aspect-level emotional triples, and improves model performance and semantic connections. Modeling capabilities.
Patent Information
- Application Number
- CN202210633972.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-07
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-06-07
AI Technical Summary
Existing aspect-level emotional triple extraction methods fail to effectively utilize part-of-speech information, resulting in the model being unable to deeply understand the semantic connections between the three, and only staying in shallow learning.
Using a multi-task learning framework, by fusing the feature representation of part-of-speech information, explicitly embedding word vectors, using the NLTK part-of-speech tagger to obtain the part-of-speech vectors, and combining Bi-LSTM network and biaffine scorer to achieve the integration of aspect words, opinion words and emotional polarity. modeling of interactions.
It improves the performance of emotional triple extraction, enhances the model's understanding of text semantics, independently extracts aspect words and opinion words, and analyzes emotional dependencies at the same time to meet the interaction modeling needs between triple elements. The experimental results are in SemEval Excellent performance on benchmark data.
Smart Images

Figure CN115048936B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an aspect-level sentiment triple extraction method integrating part-of-speech information, and belongs to the technical field of sentiment analysis. Background Art
[0002] Aspect sentiment triplet extraction (ASTE) is a recently proposed ABSA subtask that aims to extract sentiment triplets (aspect words, opinion words, sentiment polarity) from input sentences. For this task, Peng et al. proposed a two-stage pipeline approach. In the first stage, two sequence taggers are used, one for jointly extracting aspect words-sentiment polarity and the other for extracting opinion words. Then, in the second stage, the positional information between aspect words and opinion words is used to link the two to determine their sentiment polarity pairing relationship and realize sentiment triple extraction. Xu et al. adopted a novel position-aware tagging scheme that can specify the structural information of the triples and realize the connection between the three elements through label semantics. Considering that aspect words and opinion words may be composed of multiple words, Xu et al. proposed a span-based ASTE model (Span ASTE), which directly captures span-to-span interactions when predicting the sentiment relationship between aspect word and opinion word pairs for the first time. These methods have achieved considerable results on the ASTE task, but still have the following shortcomings: the feature representation does not contain part-of-speech information, and does not consider using part-of-speech information to guide the interactive modeling of aspect words, opinion words, and sentiment polarity, resulting in the model being unable to deeply understand the semantic connection between the three and only remaining at a shallow level of learning.
[0003] To solve the above problems, the present invention proposes a multi-task learning framework OTE-MTL-POS for sentiment triple extraction that integrates part-of-speech information. The proposed method is compared with a series of baseline methods on four ABSA benchmark data published by SemEval. The experimental results prove the effectiveness of the proposed method in sentiment triple extraction tasks. Summary of the invention
[0004] The present invention provides an aspect-level sentiment triple extraction method integrating part-of-speech information, which is used for the problem that the feature representation stage in previous related research work did not include part-of-speech information, and did not consider using part-of-speech information to guide the interactive modeling of aspect words, opinion words, and sentiment polarity. The present invention uses part-of-speech information to guide the extraction of aspect-level sentiment triplets, thereby improving the extraction performance.
[0005] The technical solution of the present invention is: an aspect-level sentiment triple extraction method integrating part-of-speech information, and the specific steps of the aspect-level sentiment triple extraction method integrating part-of-speech information are as follows:
[0006] Step 1: Combine the word vector representation based on the text and its corresponding part-of-speech vector representation;
[0007] Step 2, obtain the fusion feature representation containing part-of-speech information;
[0008] Step 3: Input the fused feature representation into the multi-task learning network to predict triples, that is, guided by the part-of-speech information, complete aspect word extraction, opinion word extraction, and sentiment polarity analysis in parallel;
[0009] Step 4: Triplet decoding, generate triplet span representation according to heuristic rules.
[0010] As a further solution of the present invention, in Step 1, the pre-trained model GloVe is used to map each word in the input sentence to a low-dimensional vector space to obtain the corresponding word vector representation Where d is the dimension of the word vector; at the same time, in the input stage of the model, the part-of-speech information is explicitly embedded in the word vector to generate a text representation that combines syntax and semantics, so that the triple extraction task can benefit from it. Specifically, for the input sequence First, use the NLTK part-of-speech tagger pos_tag to tag each word with a part-of-speech tag. Examples of part-of-speech tagging are shown in Table 1. Then, a part-of-speech vector is assigned to each part-of-speech tag. d is the dimension of the part-of-speech vector, which is consistent with the word vector dimension; finally, the part-of-speech vector of each word is With word vector Concatenate to get the vector representation f of the fusion feature i , the calculation process is shown in formula (1).
[0011]
[0012] in, Represents a vector concatenation operation.
[0013] Table 1 Part-of-speech tagging examples
[0014]
[0015] Syntax is a basic feature of a sentence, and part of speech is a basic syntax. Part of speech specifies the word order in a sentence. For example, a noun is followed by a verb to indicate an action, and a noun is followed by an adjective to modify it. In order to solve the problem that part of speech information was not introduced in previous sentiment triple extraction work, resulting in a lack of deep semantics that limits the performance of the model, the present invention explicitly embeds part of speech information into word vectors, generates a fused feature vector representation, and deepens the model's understanding of the semantics of the text itself. The operation of fusing part of speech information not only gives full play to the data advantage that most aspect words in the comment text belong to nouns and most opinion words belong to adjectives, but is directly beneficial to the extraction of aspect-level sentiment triplets. This operation also guides modeling with part of speech information, fully considers the semantic information and part of speech information of the feature itself, and indirectly assists in the completion of the sentiment triple task.
[0016] The part-of-speech tagger pos_tag in the NLTK toolkit is essentially a part-of-speech classification neural network model trained based on a rich training corpus. Its advantages are: (1) The input is consistent with the sentiment triple task of this article, in units of sentences; (2) The tagging method is better, and includes multiple taggers such as maximum entropy tagger, regular expression tagger, unigram tagger, n-gram tagger, etc. These taggers can be used in combination using backoff technology; (3) A universal part-of-speech tag set includes 36 commonly used part-of-speech tags such as nouns, verbs, adjectives and adverbs; (4) Based on an object-oriented scripting language, it supports rapid prototyping and text programming, and is easy to learn and use. In view of this, the present invention uses the pos_tag part-of-speech tagger to automatically annotate text and obtain the part-of-speech tag corresponding to each word.
[0017] As a further solution of the present invention, in Step 2, the vector representation f of the fusion feature is obtained. i Afterwards, a Bi-LSTM network is used to obtain a representation containing contextual information as follows:
[0018]
[0019] Among them, d h is the dimension of the hidden layer vector of the unidirectional LSTM network, They represent forward LSTM and reverse LSTM respectively. Represents the concatenation operation of vectors;
[0020] Subsequently, through a linear layer and a nonlinear transformation, the dimension reduction is achieved while obtaining the feature representation of aspect words and opinion words. Here, the hidden layer vector is not directly input into the next stage of the model for two reasons: first, the features of the hidden layer state contain computationally redundant information, which has the risk of overfitting; second, this operation can eliminate features that are not related to aspect words and opinion words. The specific calculation process is as follows:
[0021]
[0022]
[0023] Among them, r i ap , are the feature vector representations of aspect words and opinion words respectively, d r is the vector dimension. and are learnable weights and biases, respectively. In addition, g(·) is the nonlinear function ReLU(·), i.e. max(·,0).
[0024] It should be noted that the above vector representations are all in preparation for the extraction of triples. Similar to equations (3) and (4), a set of feature representations r for sentiment polarity analysis can be obtained. i ap′ , The calculation process is consistent with equations (3) and (4), except that the learning parameters are different.
[0025] As a further solution of the present invention, in Step 3, the multi-task learning network architecture includes two parts: extraction of aspect words and opinion words, and word-level sentiment dependency analysis;
[0026] When extracting aspect words and opinion words, the network model adopts the {B, I, O} tagging scheme, where B represents the starting position of the aspect word or opinion word, I represents the middle position, and O represents the others. The feature vector representations of aspect words and opinion words are input into the multi-task learning network model. The model predicts the probability distribution of each word in the sentence being an aspect word as shown in formula (5), and the probability distribution of opinion words as shown in formula (6).
[0027]
[0028]
[0029] Among them, W t ap , is the weight matrix, is the bias, both are training parameters.
[0030] When extracting aspect words and opinion words, the cross entropy loss is used to jointly train the model. The loss function includes two parts: aspect word extraction loss and opinion word extraction loss, as follows:
[0031]
[0032] Among them, S is the total number of samples and k is the number of category iterations. Respectively represent the true label probability distribution of aspect words and opinion words, Represent the predicted label probability distribution of aspect words and opinion words respectively.
[0033] For a sentence of length N, there are N 2 freely combined word pairs (including self-pairing), the model of the present invention will perform sentiment dependency analysis on each word pair. The sentiment dependency category set is defined as {NEU, NEG, POS, NO-DEP}, where NEU, NEG, POS represent neutral, negative, and positive, respectively, and NO-DEP represents no sentiment dependency. Here, we only consider the sentiment dependency relationship of one word pair, that is, the last word of the aspect word and the last word of the opinion word. For example, in the sentence "Great battery, start up speed.", a triple is involved (start up speed, Great, POS). During the sentiment dependency analysis process, the triple is simplified to (speed, Great, POS), and the analysis result is as follows: Figure 2 In this way, the learning redundancy of the parser will be greatly reduced, and the word-level sentiment dependency is still available when combined with the extracted aspect word span and opinion word span.
[0034] During word-level sentiment dependency parsing, the biaffine scorer, which has better performance in syntactic dependency parsing, is used to capture the interaction between the two words in each word pair; the sentiment dependency score of each word pair is as follows:
[0035]
[0036] in, Represents word pair (w i ,w j ) belongs to the score of the k-th emotional dependency relationship, W k and b k are the training parameter matrix and bias, r i ap′ , is the feature representation of the aspect words and opinion words calculated in step 2. In addition, S i,j,k To express the fraction Normalized score after softmax.
[0037]
[0038] From the factorization of formula (8), we can see that conceptually, the biaffine scorer can not only calculate w i Receive jThe probability of belonging to a specific dependent category (the first term), and w j The probability of belonging to the dependent category is used as the prior probability (the second term). In fact, the biaffine scorer is an operation of a biaffine transformation and a matrix multiplication.
[0039] Subsequently, the word-level sentiment dependency parser is trained. This stage uses the cross entropy function as the loss function, as shown below:
[0040]
[0041] Where |N| 2 is the total number of word pairs, For each word pair (w i ,w j )’s true dependency category, S i,j,k Score for biaffine.
[0042] Then conduct model training;
[0043] Finally, the joint training loss function of the multi-task learning framework is as follows:
[0044]
[0045] Among them, α is a balance coefficient used to balance the learning between the model's extraction task and sentiment dependency parsing. θ is a training parameter, and ||θ||2 and γ are the L2 regularization and control coefficients of parameter θ, respectively.
[0046] As a further solution of the present invention, in Step 4, after obtaining the aspect words, opinion words and word-level sentiment dependency relationships extracted in Step 3, the present invention uses heuristic rules to decode sentiment triples to obtain span-represented triples. Specifically, the sentiment dependency relationship generated by the biaffine scorer is used as a pivot to traverse the labels generated by the aspect word and opinion word tagger in reverse order.
[0047] For example, from the input sequence "Great battery, start up speed.", we can get the aspect word labels {O, B, O, B, I, I, O}, the opinion word labels {B, O, O, O, O, O, O}, and the word-level sentiment dependency is POS. The sentiment triple in index form can be represented as (6, 1, POS), where 6 is the index of the last word of the aspect word (speed), and 1 is the index of the last word of the opinion word (Great). The sentiment polarity obtained by parsing the two is positive (POS). The reverse traversal uses the aspect word and opinion word index as the pivot, and the mark of the traversed word sequence is label I. The final output sentiment triple is [(4, 6), (1, 1), POS].
[0048] The beneficial effects of the present invention are:
[0049] 1. The method of the present invention explicitly embeds part-of-speech information into word vectors to generate fused feature vector representations, taking advantage of the data characteristics that most aspect words belong to nouns and most opinion words belong to adjectives or adverbs, thus deepening the model's understanding of the text's own semantics;
[0050] 2. The present invention uses a multi-task learning approach to process the target task. While independently extracting aspect words and opinion words, a parser is used to parse the emotional dependency between the two, meeting the need for interactive modeling between the three elements in the triplet;
[0051] 3. The present invention first uses the part-of-speech tagging tool pos_tag in the NLTK toolkit to tag the part-of-speech of the input sequence, obtains the corresponding part-of-speech vector representation, and fuses the part-of-speech vector with the word vector to obtain a fused feature vector representation; then, an LSTM network is used to encode the sentence, and the sentence context information is integrated into the feature representation; further, two independent taggers are used to respectively complete the extraction of aspect words and opinion words, and the biaffine sentiment dependency parser is used to predict word-level sentiment dependency to complete the extraction of sentiment triples; finally, the sentiment triples are decoded to obtain the span representation of the sentiment triples.
[0052] 4. The method of the present invention is compared with a series of baseline methods on the four ABSA benchmark data disclosed by SemEval. The experimental results prove the effectiveness of the method of the present invention in the task of sentiment triple extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is the aspect-level sentiment triple extraction model framework integrating part-of-speech information of the present invention;
[0054] Figure 2 This is an example of the word-level sentiment dependency parsing result of the present invention;
[0055] Figure 3 The triples of the present invention are classified as follows; the light spans represent aspect words, and the dark spans represent opinion words. The arrows represent sentiment polarity dependencies, which always point from aspect words to opinion words.
[0056] Figure 4 This is the experimental result (F1 value) of the influence of part-of-speech information on aspect word extraction in the present invention.
[0057] Figure 5 This is the experimental result (F1 value) of the influence of part-of-speech information on opinion word extraction in the present invention.
[0058] Figure 6 This is a graph showing the composition of false negative and false positive data on the Rest14 dataset of the present invention. DETAILED DESCRIPTION
[0059] Example 1: Figure 1-Figure 6 As shown, the aspect-level sentiment triple extraction method integrating part-of-speech information, the specific steps of the aspect-level sentiment triple extraction method integrating part-of-speech information are as follows:
[0060] Step 1: Combine the word vector representation based on the text and its corresponding part-of-speech vector representation;
[0061] Step 2, obtain the fusion feature representation containing part-of-speech information;
[0062] Step 3: Input the fused feature representation into the multi-task learning network to predict triples, that is, guided by the part-of-speech information, complete aspect word extraction, opinion word extraction, and sentiment polarity analysis in parallel;
[0063] Step 4: Triplet decoding, generate triplet span representation according to heuristic rules.
[0064] As a further solution of the present invention, in Step 1, the pre-trained model GloVe is used to map each word in the input sentence to a low-dimensional vector space to obtain the corresponding word vector representation Where d is the dimension of the word vector; at the same time, in the input stage of the model, the part-of-speech information is explicitly embedded in the word vector to generate a text representation that combines syntax and semantics, so that the triple extraction task can benefit from it. Specifically, for the input sequence First, use the NLTK part-of-speech tagger pos_tag to tag each word with a part-of-speech tag. Examples of part-of-speech tagging are shown in Table 1. Then, a part-of-speech vector is assigned to each part-of-speech tag. d is the dimension of the part-of-speech vector, which is consistent with the word vector dimension; finally, the part-of-speech vector of each word is With word vector Concatenate to get the vector representation f of the fusion feature i , the calculation process is shown in formula (1).
[0065]
[0066] in, Represents a vector concatenation operation.
[0067] Table 1 Part-of-speech tagging examples
[0068]
[0069] Syntax is a basic feature of a sentence, and part of speech is a basic syntax. Part of speech specifies the word order in a sentence. For example, a noun is followed by a verb to indicate an action, and a noun is followed by an adjective to modify it. In order to solve the problem that part of speech information was not introduced in previous sentiment triple extraction work, resulting in a lack of deep semantics that limits the performance of the model, the present invention explicitly embeds part of speech information into word vectors, generates a fused feature vector representation, and deepens the model's understanding of the semantics of the text itself. The operation of fusing part of speech information not only gives full play to the data advantage that most aspect words in the comment text belong to nouns and most opinion words belong to adjectives, but is directly beneficial to the extraction of aspect-level sentiment triplets. This operation also guides modeling with part of speech information, fully considers the semantic information and part of speech information of the feature itself, and indirectly assists in the completion of the sentiment triple task.
[0070] The part-of-speech tagger pos_tag in the NLTK toolkit is essentially a part-of-speech classification neural network model trained based on a rich training corpus. Its advantages are: (1) The input is consistent with the sentiment triple task of this article, in units of sentences; (2) The tagging method is better, and includes multiple taggers such as maximum entropy tagger, regular expression tagger, unigram tagger, n-gram tagger, etc. These taggers can be used in combination using backoff technology; (3) A universal part-of-speech tag set includes 36 commonly used part-of-speech tags such as nouns, verbs, adjectives and adverbs; (4) Based on an object-oriented scripting language, it supports rapid prototyping and text programming, and is easy to learn and use. In view of this, the present invention uses the pos_tag part-of-speech tagger to automatically annotate text and obtain the part-of-speech tag corresponding to each word.
[0071] As a further solution of the present invention, in Step 2, the vector representation f of the fusion feature is obtained. i Afterwards, a Bi-LSTM network is used to obtain a representation containing contextual information as follows:
[0072]
[0073] Among them, d h is the dimension of the hidden layer vector of the unidirectional LSTM network, They represent forward LSTM and reverse LSTM respectively. Represents the concatenation operation of vectors;
[0074] Subsequently, through a linear layer and a nonlinear transformation, the dimension reduction is achieved while obtaining the feature representation of aspect words and opinion words. Here, the hidden layer vector is not directly input into the next stage of the model for two reasons: first, the features of the hidden layer state contain computationally redundant information, which has the risk of overfitting; second, this operation can eliminate features that are not related to aspect words and opinion words. The specific calculation process is as follows:
[0075]
[0076]
[0077] Among them, r i ap , are the feature vector representations of aspect words and opinion words respectively, d r is the vector dimension. and are learnable weights and biases, respectively. In addition, g(·) is the nonlinear function ReLU(·), i.e. max(·,0).
[0078] It should be noted that the above vector representations are all in preparation for the extraction of triples. Similar to equations (3) and (4), a set of feature representations r for sentiment polarity analysis can be obtained. i ap′ , The calculation process is consistent with equations (3) and (4), except that the learning parameters are different.
[0079] As a further solution of the present invention, in Step 3, the multi-task learning network architecture includes two parts: extraction of aspect words and opinion words, and word-level sentiment dependency analysis;
[0080] When extracting aspect words and opinion words, the network model adopts the {B, I, O} tagging scheme, where B represents the starting position of the aspect word or opinion word, I represents the middle position, and O represents the others. The feature vector representations of aspect words and opinion words are input into the multi-task learning network model. The model predicts the probability distribution of each word in the sentence being an aspect word as shown in formula (5), and the probability distribution of opinion words as shown in formula (6).
[0081]
[0082]
[0083] Among them, W t ap , is the weight matrix, is the bias, both are training parameters.
[0084] When extracting aspect words and opinion words, the cross entropy loss is used to jointly train the model. The loss function includes two parts: aspect word extraction loss and opinion word extraction loss, as follows:
[0085]
[0086] Among them, S is the total number of samples and k is the number of category iterations. Respectively represent the true label probability distribution of aspect words and opinion words, Represent the predicted label probability distribution of aspect words and opinion words respectively.
[0087] For a sentence of length N, there are N 2 freely combined word pairs (including self-pairing), the model of the present invention will perform sentiment dependency analysis on each word pair. The sentiment dependency category set is defined as {NEU, NEG, POS, NO-DEP}, where NEU, NEG, POS represent neutral, negative, and positive, respectively, and NO-DEP represents no sentiment dependency. Here, we only consider the sentiment dependency relationship of one word pair, that is, the last word of the aspect word and the last word of the opinion word. For example, in the sentence "Great battery, start up speed.", a triple is involved (start up speed, Great, POS). During the sentiment dependency analysis process, the triple is simplified to (speed, Great, POS), and the analysis result is as follows: Figure 2 In this way, the learning redundancy of the parser will be greatly reduced, and the word-level sentiment dependency is still available when combined with the extracted aspect word span and opinion word span.
[0088] During word-level sentiment dependency parsing, the biaffine scorer, which has better performance in syntactic dependency parsing, is used to capture the interaction between the two words in each word pair; the sentiment dependency score of each word pair is as follows:
[0089]
[0090] in, Represents word pair (w i ,w j ) belongs to the score of the k-th emotional dependency relationship, W k and b k are the training parameter matrix and bias, r i ap′ , is the feature representation of the aspect words and opinion words calculated in step 2. In addition, S i,j,k To express the fraction Normalized score after softmnax.
[0091]
[0092] From the factorization of formula (8), we can see that conceptually, the biaffine scorer can not only calculate w i Receive jThe probability of belonging to a specific dependent category (the first term), and w j The probability of belonging to the dependent category is used as the prior probability (the second term). In fact, the biaffine scorer is an operation of a biaffine transformation and a matrix multiplication.
[0093] Subsequently, the word-level sentiment dependency parser is trained. This stage uses the cross entropy function as the loss function, as shown below:
[0094]
[0095] Where |N| 2 is the total number of word pairs, For each word pair (w i ,w j )’s true dependency category, S i,j,k Score for biaffine.
[0096] Then conduct model training;
[0097] Finally, the joint training loss function of the multi-task learning framework is as follows:
[0098]
[0099] Among them, α is a balance coefficient used to balance the learning between the model's extraction task and sentiment dependency parsing. θ is a training parameter, and ||θ||2 and γ are the L2 regularization and control coefficients of parameter θ, respectively.
[0100] As a further solution of the present invention, in Step 4, after obtaining the aspect words, opinion words and word-level sentiment dependency relationships extracted in Step 3, the present invention uses heuristic rules to decode sentiment triples to obtain span-represented triples. Specifically, the sentiment dependency relationship generated by the biaffine scorer is used as a pivot to traverse the labels generated by the aspect word and opinion word tagger in reverse order.
[0101] For example, from the input sequence "Great battery, start up speed.", we can get the aspect word labels {O, B, O, B, I, I, O}, the opinion word labels {B, O, O, O, O, O, O}, and the word-level sentiment dependency is POS. The sentiment triple in index form can be represented as (6, 1, POS), where 6 is the index of the last word of the aspect word (speed), and 1 is the index of the last word of the opinion word (Great). The sentiment polarity obtained by parsing the two is positive (POS). The reverse traversal uses the aspect word and opinion word index as the pivot, and the mark of the traversed word sequence is label I. The final output sentiment triple is [(4, 6), (1, 1), POS]. The detailed process of the algorithm is shown below.
[0102] Table 2 shows the detailed process of the algorithm
[0103]
[0104]
[0105] The sentiment triple extraction method integrating part-of-speech information proposed in the present invention was verified on four public datasets, including the following:
[0106] (1): The experimental data sets of the present invention use Laptop14, Rest14, Rest15, and Rest16. Among them, the Laptop14 data set is the Laptop data set published by SemEval challenge 2014Task4, and the Rest14, Rest15, and Rest16 data sets are the Restaurant data sets published by SemEval challenge 2014Task4, SemEval Challenge 2015task 12, and SemEvalChallenge 2016task 5, respectively. Each data set is divided into three subsets: training set, validation set, and test set, and the division ratio is 3:1:1. In addition, Sentence overlap represents the number of sentences containing overlapping triplets of opinion words, and Triplet overlap represents the number of triplets with overlapping opinion words in all triplets. The opinion word overlap phenomenon refers to that multiple aspect words correspond to the same opinion word, such as Figure 3 As shown in Figure 2, the proportion of triples with overlapping opinion words in the triples is 24%, which has a certain impact on the experimental results. Therefore, the data used in this experiment includes triples with overlapping opinion words.
[0107] (2): The experimental environment of the present invention is the deep learning framework Pytoch1.2.0 based on Python 3.7.3. The experiment of the present invention uses the GloVe pre-trained model to initialize the word vector of the data set, and the word vector dimension is set to d = 300. The present invention uses the part-of-speech tagger pos_tag provided in the NLTK package to mark the part of speech, and the part-of-speech vector dimension is d = 300. The LSTM hidden layer vector dimension is set to d h =600. The feature dimension after dimensionality reduction is d r = 100. In the objective function, α = 1, and L2 regularization coefficient γ = 10 -5 During model training, the learning rate is 10 -3, batch_size is 32, dropout strategy is used to prevent overfitting, and dropout = 0.5. All parameters are initialized with uniform distribution, and Adam optimizer is used to optimize parameters. In the experiment, 10 models are initialized and trained respectively, and the final experimental results are the average of the test results of the 10 models. In addition, when the model performance on the validation set does not improve further for 5 consecutive times, the model training stops.
[0108] (3): The baseline models used in this invention include two categories: one is the classic model for aspect-level triple extraction, and the second is the model based on multi-task learning. The details are as follows:
[0109] RINANTE+: This model mines the extraction rules of aspect words and opinion words based on the dependency relationship of words in a sentence, thereby jointly extracting aspect words and opinion words.
[0110] CMLA+: This model uses the attention mechanism to interactively learn the connection between aspect words and opinion words to achieve joint extraction of aspect words and opinion words.
[0111] Unified+: This model is a classic aspect word-sentiment polarity joint extraction model, involving two stacked RNNs: one is used to predict the joint label to complete the joint extraction task; the other is used to predict the boundary of the aspect word to assist in the joint extraction.
[0112] Pipeline: The model decomposes triple extraction into two stages: the first stage is used to predict the joint label of aspect word-sentiment polarity and the label of opinion word, and the second stage pairs the two results of the first stage.
[0113] CMLA-MTL: This model is a multi-task learning model, which is obtained by extending CMLA by Zhang et al. and applied to the aspect-level sentiment triple extraction task.
[0114] HAST-MTL: This model is obtained by Zhang et al. by extending HAST and applying it to the aspect-level sentiment triple extraction task.
[0115] OTE-MTL: This model uses a multi-task learning approach to jointly extract aspect words and opinion words, and uses a biaffine scorer to parse the sentiment dependencies between them, thereby achieving the extraction of aspect-level sentiment triplets.
[0116] The aspect-level sentiment triple extraction model POS-OTE-MTL that integrates part-of-speech information proposed in the present invention is compared with the baseline model. The experimental results are shown in Table 3.
[0117] Table 3 Comparative experimental results (%). * indicates the experimental results obtained on the data set without overlapping sentences of opinion words, and the best experimental results are bolded.
[0118]
[0119]
[0120] As shown in Table 3, except for the Laptop14 dataset, the performance of OTE-MTL* is better than that of OTE-MTL. This shows that the existence of overlapping opinion word data does hinder the further improvement of model performance and brings challenges to the aspect-level sentiment triple extraction task. In addition, compared with the CMLA-MTL model, the performance of the CMLA+* model is poor. This shows that by decoupling the two tasks of aspect word extraction and sentiment polarity prediction and using multi-task learning to handle both, the adverse effects of opinion word overlapping data on the model can be reduced to a certain extent. Whether it is CMLA+*, Unified+*, or Pipeline*, joint labels are used to couple the aspect word extraction task and the sentiment polarity classification task and process them simultaneously. This processing method is simple and efficient, but there is a problem that the aspect word extraction task and the sentiment polarity classification task are rigidly associated through labels, and the semantic dependency between aspect words and opinion words is not obtained, that is, the phenomenon of opinion word overlap is ignored. The above problems can be avoided by using a multi-task processing method. The aspect word extraction task and the sentiment polarity classification task can be processed in parallel. When the aspect words are paired with the sentiment polarity, the semantic connection between the aspect words and the opinion words can be obtained, thereby improving the accuracy of sentiment polarity classification, thereby achieving better results. Furthermore, compared with the CMLA-MTL model, the POS-OTE-MTL model proposed in the present invention has achieved higher F1 values on all data sets, which are increased by 14.88%, 12.16%, 12.60%, and 11.25% respectively. The rationality and superiority of using the model of the present invention to process opinion word overlapping data have been verified.
[0121] Overall, it can be seen from Table 3 that compared with all baseline models, the model POS-OTE-MTL proposed in this invention has achieved the highest F1 value on the three data sets of Rest15, Rest16, and Laptop14, verifying the effectiveness of the method in this paper. Compared with the OTE-MTL model, the F1 value of the model in this paper on the three data sets of Rest15, Rest16, and Laptop14 has increased by 0.74%, 1.78%, and 0.88%, respectively, verifying that the incorporation of part-of-speech information is indeed helpful for the extraction of aspect-level sentiment triples. The model of the present invention combines part-of-speech vectors and part-of-speech vectors as feature representations, fully considering the part-of-speech information of the features and the semantic information of the features. Semantic information can assist the model in learning the association between different features, which is beneficial for the model to understand the context of the sentence. Part-of-speech information not only utilizes the data features that most aspect words are nouns and most opinion words are adjectives and adverbs, but also follows the grammatical rule that adjectives follow nouns, thereby deepening the model's understanding of the text content. As a result, the model of the present invention is able to achieve better performance. In addition, compared with models such as CMLA-MTL and HAST-MTL that focus on the joint extraction of aspect words and opinion words, when such models are used for sentiment triple tasks, the model of the present invention shows obvious advantages. Specifically, the average performance is 12.72% higher than CMLA-MTL and 9.40% higher than HAST-MTL. The reason may be that when migrating the joint extraction model to the sentiment triple extraction task, the loss of sentiment polarity parsing must also be considered, which reduces the model performance to a certain extent.
[0122] (4): In order to verify the influence of the part-of-speech information introduced by the model of the present invention on each element in the triple (aspect word, opinion word, sentiment polarity), and further analyze the reasons behind the higher F1 value of the model, the present invention evaluates the performance of the POS-OTE-MTL model in the aspect word extraction task and the opinion word extraction task on four datasets. The experimental results are as follows: Figure 4 , Figure 5 shown.
[0123] from Figure 4 It can be seen that compared with the previous method OTE-MTL, the method of the present invention performs better on the Rest15 and Laptop14 datasets, with the F1 values increased by 0.05% and 0.34% respectively. It is verified that the introduction of part-of-speech information is helpful for the extraction of aspect words to a certain extent. In the product review corpus, most aspect words are nouns. The introduction of part-of-speech information can enhance the sensitivity of the model to identify aspect words. Secondly, for the extraction of opinion words, Figure 5It can be seen that the method proposed in the present invention also performs better than OTE-MTL on the Rest15 and Laptop14 datasets, with the F1 values increased by 0.09% and 0.65% respectively. This shows that part-of-speech information can assist in the extraction of opinion words. In product review sentences, most opinion words are adjectives and adverbs, and nouns are generally followed by adjectives, and adjectives are followed by adverbs. Therefore, giving sentences part-of-speech information can assist the model in quickly locating adjectives and adverbs in the sentence, which not only helps in the recognition of opinion words, but also enhances the semantic connection between aspect words and opinion words.
[0124] In addition, by Figure 4 and Figure 5 It can be seen that on the Rest16 dataset, the performance of the method of the present invention is poor, whether it is aspect word extraction or opinion word extraction. However, in Table 3, the method of this paper is better than OTE-MTL in triple extraction, which verifies that the method of the present invention is more beneficial to the prediction of sentiment polarity on the Rest16 dataset. Different from the previous work of directly using classifiers to predict sentiment polarity, the method of the present invention adopts sentence dependency parsing to input the feature vector representation of aspect words and opinion words into the sentiment polarity parser to fully obtain the connection between the two. In addition, the present invention introduces part-of-speech information to guide the model to predict sentiment polarity, thereby improving the model performance.
[0125] (5): In order to further explore the advantages and limitations of the POS-OTE-MTL model of the present invention, we analyzed the source of model errors. Specifically, we conducted a detailed analysis of the data composition of false positives (the model predicted the label to be positive, but the true label was negative) and false negatives (the model predicted the label to be negative, but the true label was positive) on the Rest14 dataset. Figure 6 As shown in the figure, we divide the sources of false positives into four categories: aspect word errors, opinion word errors, sentiment polarity errors, and others. For false negatives, we divide their sources into three categories: opinion word overlap, aspect word overlap, and normal sources.
[0126] The error analysis results are as follows Figure 6 As shown. Figure 6As can be seen on the right, more than 50% of false positive errors come from aspect word errors, opinion word errors, and sentiment polarity errors. This shows that false positives are largely triggered by only one wrong element of the extracted triples (especially aspect words or opinion words). This also shows to a certain extent that there is still room for improvement in our triple span decoding algorithm. In future work, there is great potential for research on the development of more powerful span detection algorithms. In addition, this also indirectly reflects that the calculation method of the loss function of the model of the present invention may be insufficient. The exact matching of aspect words, opinion words, and sentiment polarity in triples is not an ideal metric. Because slight differences in the span representation of aspect words and opinion words may have no effect on the sentiment polarity in the experiment. By Figure 6 As can be seen from the left side, more than 40% of the false negative errors of the model of the present invention come from the overlapping data of aspect words and opinion words. This shows that although the model of the present invention POS-OTE-MTL can alleviate the negative impact caused by overlapping samples to a certain extent, the problem still cannot be cured, and the solution to this problem still needs further research.
[0127] The specific implementation modes of the present invention have been described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. A method for extracting aspect-level sentiment triples by integrating part-of-speech information, characterized by: The specific steps of the aspect-level sentiment triple extraction method integrating part-of-speech information are as follows: Step 1: Combine the word vector representation based on the text and its corresponding part-of-speech vector representation; Step 2, obtain the fusion feature representation containing part-of-speech information; Step 3: Input the fused feature representation into the multi-task learning network to predict triples, that is, guided by the part-of-speech information, complete aspect word extraction, opinion word extraction, and sentiment polarity analysis in parallel; Step 4, triple decoding, generating triple span representation according to heuristic rules; In Step 1, the pre-trained model GloVe is used to map each word in the input sentence to a low-dimensional vector space to obtain the corresponding word vector representation. Where d is the dimension of the word vector; for the input sequence First, use the NLTK part-of-speech tagger pos_tag to tag each word with a part-of-speech tag, and then assign a part-of-speech vector to each part-of-speech tag. d is the dimension of the part-of-speech vector, which is consistent with the word vector dimension; finally, the part-of-speech vector of each word is With word vector Concatenate to get the vector representation f of the fusion feature i ; In the Step 2, the vector representation f of the fusion feature is obtained i Afterwards, a Bi-LSTM network is used to obtain a representation containing contextual information Subsequently, through a linear layer and a nonlinear transformation, the dimension reduction is achieved while obtaining the feature representation of aspect words and opinion words. There are two reasons why the hidden layer vector is not directly input into the next stage of the model: first, the features of the hidden layer state contain computationally redundant information, which has the risk of overfitting; second, this operation can eliminate features that are not related to aspect words and opinion words. In the Step 3, the multi-task learning network architecture includes two parts: extraction of aspect words and opinion words, and word-level sentiment dependency parsing; when extracting aspect words and opinion words, the network model adopts a {B, I, O} tagging scheme, where B represents the starting position of the aspect word or opinion word, I represents the middle position, and O represents others; the feature vector representation of the aspect word and opinion word is input into the multi-task learning network model, and in the process of word-level sentiment dependency parsing, a biaffine scorer with better performance in syntactic dependency parsing is used to capture the interactive relationship between the two words in each word pair, and then a word-level sentiment dependency parser is trained; In the Step 4, the sentiment triples are decoded using heuristic rules to obtain the triples represented by the span; specifically, the sentiment dependency relationship generated by the biaffine scorer is used as the pivot to traverse the labels generated by the aspect word and opinion word tagger in reverse order; In the Step 2, the specific calculation process of achieving dimensionality reduction and obtaining feature representations of aspect words and opinion words through a linear layer and a nonlinear transformation is as follows: in, are the feature vector representations of aspect words and opinion words respectively, d r is the vector dimension, and are learnable weights and biases, respectively. In addition, g(·) is the nonlinear function ReLU(·), i.e., max(·,0); In Step 3, the feature vector representations of aspect words and opinion words are input into the multi-task learning network model. The model predicts that the probability distribution of each word in the sentence being an aspect word is shown in Formula (3), and the probability distribution of opinion words is shown in Formula (4); in, is the weight matrix, is the bias, both are training parameters, are the feature vector representations of aspect words and opinion words respectively, d r is the vector dimension.
Citation Information
Patent Citations
Multi-level text emotion feature extraction method and model
CN108763204A
Text sentiment analysis method based on convolutional neural network
CN110362819A
Attribute-level sentiment analysis method of complete attention mechanism
CN111259153A
Aspect-level sentiment analysis method and system based on deep learning
CN112667816A
Emotion triple extraction method based on span sharing and grammar dependency relationship enhancement
CN113743097A
