Cross-Domain Sentiment Analysis Method and Device Based on Aspect-Opinion Word Sentiment Alignment

By adopting the method of emotional alignment based on aspect viewpoint words in cross-domain sentiment analysis, and using self-supervised tasks to extract emotional feature vectors, the problem of emotional transmission errors in cross-domain sentiment analysis is solved, and the performance of emotion analysis is improved.

CN115269770BActive Publication Date: 2025-05-30SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210661002.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-13
Publication Date
2025-05-30
Estimated Expiration
2042-06-13

AI Technical Summary

Technical Problem

The existing cross-domain sentiment analysis methods are difficult to effectively convey emotions when the source and target domains are different, resulting in a decline in sentiment analysis performance.

Method used

A cross-domain emotion analysis method based on emotional alignment of aspect view words is adopted. By constructing a cross-domain emotion analysis model, including pre-training BERT encoder, GCN autoencoder and emotion classifier, the GCN autoencoder is trained using self-supervised tasks to extract feature vectors containing background common sense and emotional alignment of aspect view words, and then perform sentiment analysis.

Benefits of technology

The emotion analysis prediction effect of the model migrating from the source field to the target field is improved, the emotion transmission errors are reduced, and the performance of cross-domain emotion analysis is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269770B_ABST
    Figure CN115269770B_ABST
Patent Text Reader

Abstract

The present invention discloses a cross-domain sentiment analysis method and device based on aspect-opinion word sentiment alignment. The method includes: constructing a cross-domain sentiment analysis model, which includes a pre-trained BERT encoder, a GCN autoencoder, and a sentiment classifier; obtaining a first feature vector through the pre-trained BERT encoder, and obtaining a second feature vector containing background common sense and aspect-opinion word sentiment alignment through the GCN autoencoder; splicing the feature vectors generated by the two encoders as the vector of the sentence to be input into the sentiment classifier, calculating the probabilities of all possible polarities of the input text, and selecting the sentiment label with the highest probability as the final predicted sentiment label to complete the sentiment analysis task. The present invention uses adversarial training to map the source domain and target domain data to the same distribution space, thereby improving the entity prediction effect of the model migrating from the source domain to the target domain, and can be widely applied to the field of natural language processing technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular, to a cross-domain sentiment analysis method and device based on aspect-opinion word sentiment alignment. Background Art

[0002] Sentiment analysis is a task of automatically identifying the sentiment polarity of text data (such as movie reviews, etc.). At present, sentiment analysis models based on deep neural networks have achieved remarkable performance, but training a neural network requires training the model based on a large number of labeled samples to achieve a better prediction effect. And the training samples require a large amount of labeled data, and the process of annotating data requires a lot of manpower and a lot of time.

[0003] To alleviate the problem of dependence on a large amount of labeled data, cross-domain sentiment analysis tasks have attracted great attention, which transfer knowledge from the source domain with rich labels to the target domain with scarce labels. Its main challenge is to overcome the differences between the source domain and the target domain, especially when the source domain and the target domain are quite different. Facing this challenge, many studies have proposed to extract domain-invariant features. When mapping to the same feature space, domain-invariant features are used to reduce the inter-domain differences between domains. It is usually based on the assumption that a domain-invariant feature also shares the same sentiment polarity in the source domain and the target domain. However, it does not comply with this assumption in many real-world scenarios, resulting in incorrect sentiment transfer. The reason is that the sentiment of domain-invariant opinion features depends not only on the domain they are in but also on the aspects they describe. Recently, an effective unsupervised domain adaptation method is adversarial training, which automatically obtains domain-invariant features with a large amount of unlabeled data. However, they only focus on domain-invariant features and ignore the extraction of domain-specific features. As the domain differences become larger, domain-invariant features will be restricted, thereby reducing the performance of cross-domain sentiment analysis. Summary of the Invention

[0004] To at least to some extent solve one of the technical problems existing in the prior art, an object of the present invention is to provide a cross-domain sentiment analysis method and device based on aspect-opinion word sentiment alignment.

[0005] The technical solution adopted by the present invention is as follows:

[0006] A cross-domain sentiment analysis method based on aspect-opinion word sentiment alignment, comprising the following steps:

[0007] Construct a cross-domain sentiment analysis model, where the cross-domain sentiment analysis model includes a pre-trained BERT encoder, a GCN autoencoder, and a sentiment classifier;

[0008] Input the sentences of the source domain and the target domain into the pre-trained BERT encoder for encoding to obtain a first feature vector;

[0009] Taking sentences as units, using the words of the specified part of speech in the sentences as seeds, expanding the specified words by filtering the ConceptNet common sense knowledge base, and constructing a domain common sense graph of aspect opinion words by using the dependency relationships in the sentences;

[0010] Designing two self-supervised tasks, namely relation classification task and sentiment alignment classification task, training a GCN autoencoder, and obtaining a second feature vector containing background common sense and sentiment alignment of aspect opinion words;

[0011] Inputting the second feature vector generated by the GCN autoencoder into a graph feature reconstructor, and through the graph feature reconstructor, the graph node-level feature vector is adapted to the word-level vector;

[0012] Concatenating the feature vectors generated by the two encoders as the sentence vector and inputting it into a sentiment classifier, calculating the probabilities of all possible polarities of the input text, and selecting the sentiment label with the highest probability as the final predicted sentiment label to complete the sentiment analysis task;

[0013] Jointly training the relation classification task and the sentiment alignment classification task, optimizing the cross-domain sentiment analysis model, and obtaining the best model parameters;

[0014] Obtaining the target domain data that needs sentiment analysis, inputting the target domain data into the optimized cross-domain sentiment analysis model, and outputting the predicted label of the sentence sentiment.

[0015] Furthermore, the pre-trained BERT encoder is trained in the following way:

[0016] Obtaining the text of the source domain or the target domain, training the BERT encoder to obtain rich domain feature knowledge; where the feature vector of each sentence in the text is represented as:

[0017] x w = h [cls] = BERT(x)

[0018] In the formula, x represents the input sentence, and h [cls] represents the hidden vector representation of the special character before the sentence of the BERT encoder, and BERT is the sentence encoder.

[0019] Furthermore, in the domain common sense graph of aspect opinion words, the subgraphs of all sentences are merged into the representation of the domain common sense graph as follows:

[0020]

[0021] Among them, the nodes vi ∈ V in the constructed graph, and the relation triple (vi, ri, j, vj) ∈ φ, where Denoted as the relationship between two nodes vi and vj, φ represents the set of all triples contained in the graph spectrum G.

[0022] Furthermore, for the two self-supervised tasks of the design relationship classification task and the sentiment alignment classification task, training the GCN autoencoder to obtain a second feature vector containing background common sense and sentiment alignment of aspect opinion words includes:

[0023] Predicting the relationship between nodes to obtain a common sense knowledge feature vector, and using the sentiment alignment binary classification task to learn the sentiment alignment feature between aspect opinion pairs, so as to obtain a feature vector containing background common sense and sentiment alignment of aspect opinion words;

[0024] Among them, the conversion process of the feature vector can be expressed as:

[0025]

[0026]

[0027] Among them, represents all neighbor nodes of node i under relationship r; c i,r is a normalization constant that can be preset; g i is an initial node feature vector randomly initialized, which is converted to h after using a two-step graph convolution process i , that is is the domain aggregation feature vector, and refer to the weight matrix of the l-th layer; x i is the feature vector representation of node i, and x j is the feature vector representation of node j.

[0028] Furthermore, inputting the second feature vector generated by the GCN autoencoder into the graph feature reconstructor, in the process of adapting the graph node-level feature vector to the word-level vector by the graph feature reconstructor, taking sentences as units, the feature mapping layer and the graph feature reconstructor are designed as follows:

[0029] x c = W c x' c + b c

[0030] x' recon = W recon x c + b recon

[0031] Among them, x represents the vector representation of the sentence, W c and b c , W recon and brecon All are weight matrices; x' c is the sentence feature vector obtained by averaging the representations of all nodes in the graph after the sub-graph of x is constructed and passed through the GCN autoencoder; x' recon is the sentence feature vector representation adapted to the word-level distribution space obtained after passing through the graph feature reconstructor; x c The vector representation of is used as the final vector representation of the sentence x by the GCN autoencoder; b c is the constant vector of the fully connected layer.

[0032] Furthermore, the expression of the loss function of the graph feature reconstructor is as follows:

[0033]

[0034] Among them, x' c , x' recon are respectively the sentence feature vector representations obtained after the sub-graph of sentence x is constructed and the graph is input into the GCN autoencoder, and the sentence feature vector representation obtained after passing through the reconstruction function.

[0035] Furthermore, in the step of splicing the feature vectors generated by the two encoders as the vector of the sentence to input into the sentiment classifier, calculating the probabilities of all possible polarities of the input text, and selecting the sentiment label with the highest probability as the final predicted sentiment label to complete the sentiment analysis task, the feature vector representation of the sentence is:

[0036] x = [x c ; x w

[0037] Among them, x c is the common sense knowledge vector with aspect-opinion word sentiment alignment, and x w is the sentence vector with context information generated by the BERT encoder; [;] represents vector splicing.

[0038] Furthermore, in the step of completing the sentiment analysis task, the sentiment probability of the given sentence x is output, and the calculation formula of the sentiment probability is as follows:

[0039]

[0040] Among them, c i ∈C is the possible sentiment polarity, and x i is the vector representation of the i-th node.

[0041] Furthermore, optimizing the cross-domain sentiment analysis model includes:

[0042] ​The Adam optimizer is used to optimize the cross - domain sentiment analysis model. Among them, the loss function used in the optimization process is expressed as follows:

[0043]

[0044] Among them, represents the loss of sentence vector representation reconstruction; represents the cross - entropy loss function of the sentiment classification task.

[0045] Another technical solution adopted by the present invention is:

[0046] A cross - domain sentiment analysis device based on aspect - opinion word sentiment alignment, comprising:

[0047] At least one processor;

[0048] At least one memory for storing at least one program;

[0049] When the at least one program is executed by the at least one processor, the at least one processor implements the above - mentioned method.

[0050] The beneficial effects of the present invention are as follows: The present invention uses adversarial training to map the source - domain and target - domain data into the same distribution space, thereby improving the entity prediction effect of the model migrating from the source domain to the target domain. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following introduces the relevant technical solution drawings in the embodiments of the present invention or the prior art. It should be understood that the drawings introduced below only conveniently and clearly illustrate some embodiments of the technical solutions in the present invention. For those skilled in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0052] Figure 1 is a flowchart of a cross - domain sentiment analysis method based on aspect - opinion word sentiment alignment in an embodiment of the present invention;

[0053] Figure 2 is a schematic structural diagram of a cross - domain sentiment analysis model based on aspect - opinion word sentiment alignment in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0054] Embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where like or similar reference numerals denote like or similar elements or elements having like or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary only for explaining the present invention and should not be construed as limiting the present invention. For the step numbers in the following embodiments, they are only set for the convenience of elaboration and explanation, and no limitation is imposed on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0055] In the description of the present invention, it should be understood that for the orientation description, such as up, down, front, back, left, right, etc., the orientation or positional relationship indicated is based on the orientation or positional relationship shown in the accompanying drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present invention.

[0056] In the description of the present invention, the meaning of several is one or more, the meaning of multiple is two or more, greater than, less than, exceeding, etc. are understood not to include the present number, and above, below, within, etc. are understood to include the present number. If there is a description of first and second, it is only for the purpose of distinguishing technical features and should not be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or implicitly indicating the sequence relationship of the indicated technical features.

[0057] In the description of the present invention, unless otherwise clearly defined, words such as set, install, connect, etc. should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meaning of the above words in the present invention in combination with the specific content of the technical solution.

[0058] As Figure 1 shown, this embodiment provides a flowchart of a cross-domain sentiment analysis method based on aspect-opinion word sentiment alignment. This method constructs an unlabeled sentiment analysis model, and the model structure is as Figure 2 shown, including a BERT encoder, a GCN autoencoder, an aspect-opinion word sentiment alignment discriminator, and a vector splicing module. The method includes the following steps:

[0059] Step 1: Input the sentences in the source domain and the target domain into the pre-trained BERT encoder for encoding to obtain a first feature vector.

[0060] The pre-trained BERT encoder refers to obtaining rich domain knowledge by pre-training the BERT encoder with a large amount of unlabeled data. The feature vector of each sentence in the text is represented as:

[0061] x w = h [cls]= BERT(x)

[0062] Among them, x represents the input sentence, and BERT is the sentence encoder.

[0063] Step 2: Taking sentences as units, use the words of specified parts of speech (nouns, verbs, adjectives, etc.) in the sentences as seeds, expand the specified words by filtering the ConceptNet common sense knowledge base, and construct a domain common sense graph of aspect-opinion words using the dependency relationships in the sentences.

[0064] The so-called dependency relationship means that if the dependency syntactic relationship between the specified words in the sentence is "nsubj", "amod", or "xcomp", then they are connected as a "description" relationship. Finally, the seeds filter ConceptNet to create subgraphs, and the subgraphs of all sentences are merged into a domain common sense graph, which can be expressed as:

[0065]

[0066] Among them, the node v in the constructed graph i ∈V, and the relationship triple (v i , r i,j , v j ) ∈ φ, where r i,j refers to the relationship between two nodes in ConceptNet. To consider the sentiment symmetry relationship between aspects and opinion word pairs, when there is a direct relationship in the dependency tree, a "description" relationship is added to the graph.

[0067] Step 3: Design two self-supervised tasks, a relationship classification task and a sentiment alignment classification task, to train the GCN autoencoder, that is, predict the relationship between nodes to obtain common sense knowledge feature vectors, and use the sentiment alignment binary classification task to learn the sentiment alignment features between aspect-opinion pairs, so as to obtain feature vectors containing background common sense and aspect-opinion word sentiment alignment.

[0068] The conversion process of the feature vector can be expressed as:

[0069]

[0070]

[0071] Among them,[[]] represents all the neighbor nodes of node i under relationship r; c i,r is a normalization constant that can be preset; g i is the initial node feature vector randomly initialized, and after using a two-step graph convolution process on it, it is converted to h i , that is is the domain aggregation feature vector; W r(l) and W 0 (l) refers to the weight matrix of the l-th layer.

[0072] Step 4: Input the feature vectors generated by the GCN autoencoder into the graph feature reconstructor. Through the graph feature reconstructor, the graph node-level feature vectors are adapted to word-level vectors.

[0073] The feature mapping layer and the graph feature reconstructor are designed as follows in units of sentences:

[0074] x c = W c x' c + b c

[0075] x' recon = W recon x c + b recon

[0076] where x represents the vector representation of the sentence, W c and b c , W recon and b recon are both weight matrices, x' c is the sentence feature vector obtained by averaging the representations of all nodes in the graph after x constructs the sub-graph and passes through the GCN autoencoder, x' recon is the sentence feature vector representation adapted to the word-level distribution space after passing through the feature reconstructor, and the vector representation of x c is used as the final vector representation of the sentence x by the GCN autoencoder.

[0077] Therefore, the loss function of the reconstruction function uses the cosine similarity function and is represented by the following formula:

[0078]

[0079] where x' c , x' recon are respectively the sentence feature vector representations obtained after x constructs the sub-graph and inputs the graph into the GCN autoencoder, and the sentence feature vector representation obtained after passing through the reconstruction function.

[0080] Step 5: Concatenate the vectors generated by the two encoders as the vector of the sentence and input it into the classifier, calculate the probabilities of all possible polarities of the input text, and select the sentiment label with the highest probability as the final predicted sentiment label to complete the sentiment analysis task.

[0081] The feature vector of the sentence can be represented as:

[0082] x = [xc ; x w

[0083] Among them, x c is a common sense knowledge vector with sentiment alignment of aspect opinion words, and x w is a sentence vector with context information generated by the BERT encoder; [;] represents concatenating vectors.

[0084] Therefore, in the steps of completing the sentiment analysis task, the calculation formula of the sentiment probability is as follows:

[0085]

[0086] Among them, c i ∈C is a possible sentiment polarity.

[0087] Step 6, In the process of jointly training the aspect opinion word sentiment alignment task and the sentiment analysis task and using the Adam optimizer to train the model to obtain the best parameters, the loss function can be expressed as:

[0088]

[0089] Among them, represents the loss of sentence vector representation reconstruction; represents the cross-entropy loss function of the sentiment classification task.

[0090] Step 7, After obtaining the final model, input the target domain data, and output the prediction label of the sentence sentiment through the classification task of the sentence vector finally.

[0091] As can be seen from the above, this embodiment provides a cross-domain sentiment analysis method based on aspect opinion word sentiment alignment. This method can mine the sentiment alignment relationship of opinion words through self-supervised learning, and can well solve the problem of sentiment transfer errors caused by the fact that the same opinion word may contain different sentiment polarities when describing different aspect words, thereby improving the sentiment analysis prediction effect of the model transferred from the source domain to the target domain.

[0092] This embodiment also provides a cross-domain sentiment analysis device based on aspect opinion word sentiment alignment, including:

[0093] At least one processor;

[0094] At least one memory for storing at least one program;

[0095] When the at least one program is executed by the at least one processor, the at least one processor implements Figure 1 the method shown.

[0096] ​A cross-domain sentiment analysis device based on aspect-opinion word sentiment alignment according to this embodiment can execute a cross-domain sentiment analysis method based on aspect-opinion word sentiment alignment provided by the method embodiment of the present invention, can execute any combination of implementation steps of the method embodiment, and has the corresponding functions and beneficial effects of the method.

[0097] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order mentioned in the operation diagrams. For example, depending on the functions / operations involved, two consecutive blocks shown may actually be executed substantially simultaneously or the blocks can sometimes be executed in the reverse order. In addition, the embodiments presented and described in the flowcharts of the present invention are provided by way of example for the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated where the order of various operations is changed and where sub-operations described as part of a larger operation are executed independently.

[0098] Furthermore, although the present invention has been described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and / or features described may be integrated in a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It can also be understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present invention. Rather, considering the attributes, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of the modules will be understood within the ordinary skill of an engineer. Thus, those skilled in the art can implement the present invention as set forth in the claims without undue experimentation. It can also be understood that the specific concepts disclosed are illustrative only and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0099] If the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.

[0100] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a predefined sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch instructions from the instruction execution system, apparatus, or device and execute the instructions), or in conjunction with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0101] More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or, if necessary, other suitable processing, and then storing it in a computer memory.

[0102] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

[0103] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example", or "certain embodiments / examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0104] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the claims and their equivalents.

[0105] The above has specifically described the preferred embodiments of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included within the scope defined by the claims of this application.

Claims

1. A cross - domain sentiment analysis method based on aspect - opinion word sentiment alignment, characterized in that, it includes the following steps: Construct a cross - domain sentiment analysis model, which includes a pre - trained BERT encoder, a GCN auto - encoder, and a sentiment classifier; Input the sentences of the source domain and the target domain into the pre - trained BERT encoder for encoding to obtain the first feature vector; taking the sentence as a unit, use the words of the specified part of speech in the sentence as seeds, expand the specified words by filtering the ConceptNet commonsense knowledge base, and construct an aspect - opinion word domain commonsense graph using the dependency relationships in the sentence; Design two self - supervised tasks, namely a relationship classification task and a sentiment alignment classification task, to train the GCN auto - encoder to obtain a second feature vector containing background commonsense and aspect - opinion word sentiment alignment; Input the second feature vector generated by the GCN auto - encoder into a graph feature reconstructor, and the graph feature reconstructor adapts the node - level feature vector to the word - level vector space; Concatenate the feature vectors generated by the two encoders as the sentence vector and input it into the sentiment classifier, calculate the probabilities of all possible polarities of the input text, and select the sentiment label with the highest probability as the final predicted sentiment label to complete the sentiment analysis task; jointly train the relationship classification task and the sentiment alignment classification task to optimize the cross - domain sentiment analysis model and obtain the best model parameters; Obtain the target domain data that needs sentiment analysis, and input the target domain data into the optimized cross - domain sentiment analysis model, Output the predicted label of the sentence sentiment; During the process of inputting the second feature vector generated by the GCN auto - encoder into the graph feature reconstructor, and the graph feature reconstructor adapts the node - level feature vector to the word - level vector space, taking the sentence as a unit, the feature mapping layer and the graph feature reconstructor are designed as follows: x c = W c x' c + b c x’ recon = W recon x c + b recon Among them, x represents the vector representation of the sentence, W c and b c , W recon and b recon are both weight matrices; x’ c is the sentence feature vector obtained by averaging the representations of all nodes in the graph after x constructs the sub-graph and passes through the GCN auto-encoder; x’ recon is the sentence feature vector representation adapted to the word-level distribution space after passing through the graph feature reconstructor; the vector representation of x c serves as the final vector representation of the sentence x by the GCN auto-encoder; b c is the constant vector of the fully connected layer.

2. The cross - domain sentiment analysis method based on aspect - opinion word sentiment alignment according to claim 1, characterized in that, the pre - trained BERT encoder is trained in the following way: Obtain the text of the source domain or the target domain, and train the BERT encoder to obtain rich domain - specific feature knowledge; where the feature vector of each sentence in the text is represented as: x w = h cls] = BERT(x) where x represents the input sentence, and h [cls] represents the hidden vector representation of the special character before the sentence in the BERT encoder, and BERT is the sentence encoder.

3. The cross - domain sentiment analysis method based on aspect - opinion word sentiment alignment according to claim 1, characterized in that, In the aspect - opinion word domain commonsense graph, the sub - graphs of all sentences are merged into the representation of the domain commonsense graph as follows: Among them, the node v in the constructed graph i ∈V, and the relational triple (v i , r i,j , v j ) ∈ φ, where represents the relationship between two nodes v i and v j , and φ represents the set of all triples contained in the graph G.

4. The cross - domain sentiment analysis method based on aspect - opinion word sentiment alignment according to claim 1, characterized in that, The design of two self - supervised tasks, namely a relationship classification task and a sentiment alignment classification task, to train the GCN auto - encoder to obtain a second feature vector containing background commonsense and aspect - opinion word sentiment alignment includes: Predict the relationship between nodes to obtain the commonsense knowledge feature vector, and use the sentiment alignment binary classification task to learn the sentiment alignment feature between aspect - opinion pairs, so as to obtain a feature vector containing background commonsense and aspect - opinion word sentiment alignment; Among them, the conversion process of the feature vector is represented as: Among them, represents all neighbor nodes of node i under relationship r; c i,r is a preset normalization constant; g i is an initially randomly initialized node feature vector, which is converted to h after using a two-step graph convolution process i , that is is the domain aggregation feature vector, and refer to the weight matrix of the l-th layer; x i is the feature vector representation of node i, and x j is the feature vector representation of node j.

5. A cross-domain sentiment analysis method based on aspect-opinion word sentiment alignment according to claim 1, characterized in that, the expression of the loss function of the graph feature reconstructor is as follows: Among them, x' c , x' recon are respectively the sentence feature vector representation obtained after inputting the constructed sub-graph of sentence x into the GCN auto-encoder, and the sentence feature vector representation obtained through the reconstruction function.

6. A cross-domain sentiment analysis method based on aspect-opinion word sentiment alignment according to claim 1, characterized in that, in the step of splicing the feature vectors generated by the two encoders as the vector of the sentence to input into the sentiment classifier, calculating the probabilities of all possible polarities of the input text, and selecting the sentiment label with the highest probability as the final predicted sentiment label to complete the sentiment analysis task, the feature vector of the sentence is expressed as: x = [x c ; x w ​ where x c is a common sense knowledge vector with sentiment alignment of aspect view words, and x w is a sentence vector with context information generated by the BERT encoder; [;] represents concatenating vectors.

7. A cross-domain sentiment analysis method based on aspect-opinion word sentiment alignment according to claim 6, characterized in that, in the step of completing the sentiment analysis task, the sentiment probability of the given sentence x is output, and the calculation formula of the sentiment probability is as follows: where c i ∈ C is the possible sentiment polarity, and x i is the vector representation of the i-th node.

8. A cross-domain sentiment analysis method based on aspect-opinion word sentiment alignment according to claim 1, characterized in that, the optimization of the cross-domain sentiment analysis model includes: using the Adam optimizer to optimize the cross-domain sentiment analysis model, wherein the loss function used in the optimization process is expressed as follows: Among them, represents the loss of sentence vector representation reconstruction; represents the cross-entropy loss function for the sentiment classification task.

9. A cross-domain sentiment analysis device based on aspect-opinion word sentiment alignment, characterized in that, it includes: at least one processor; at least one memory for storing at least one program; when the at least one program is executed by the at least one processor, the at least one processor implements a cross-domain sentiment analysis method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Aspect word and aspect category joint extraction and detection method based on multi-task framework

    CN114548099A

  • Elegant Reasonism: methodology, process, technologies, and epistemology to view and engage real reality of a unified Universe.

    US20200372376A1