Sentence sentiment analysis method and device based on semantic and syntactic dual channels

By adopting a semantic and syntactic dual-channel method in statement sentiment analysis, the problem of relying on tree noise and instability in the prior art is solved, and more accurate and stable sentiment analysis results are achieved.

CN115048938BActive Publication Date: 2025-06-10SOUTH CHINA NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art is difficult to effectively solve the problems of tree dependence and instability in statement sentiment analysis, and rely too much on single information modeling, ignoring the importance of multiple information, resulting in inaccurate sentiment analysis.

Method used

Using a dual-channel method based on semantic and syntax, we use a neural network model to consider syntactic and semantic information at the same time, extract global information, reduce the introduction of noise, and conduct more comprehensive sentiment analysis.

Benefits of technology

It improves the accuracy and stability of sentence sentiment analysis and ensures the reliability of sentiment analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115048938B_ABST
    Figure CN115048938B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of sentiment analysis, and particularly to a method for sentence sentiment analysis based on a dual-channel of semantics and syntax. The method includes: obtaining a sentence representation of a sentence to be tested, where the sentence to be tested includes a plurality of sentences; inputting the sentence representation of the sentence to be tested into a sentence encoding module in a preset neural network model to obtain a word embedding representation of the sentence to be tested; inputting the word embedding representation and the sentence representation of the sentence to be tested into a semantic channel in the neural network model to obtain a semantic feature representation of the sentence to be tested; inputting the word embedding representation and the sentence representation of the sentence to be tested into a syntactic channel in the neural network model to obtain a syntactic feature representation of the sentence to be tested; and inputting the word embedding representation, the semantic feature representation, and the syntactic feature representation of the sentence to be tested into a classification module of the neural network model to obtain a sentiment analysis result output by the classification module of the neural network model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of sentiment analysis, and particularly to a method, device, equipment and storage medium for sentence sentiment analysis based on a dual-channel of semantics and syntax. Background Art

[0002] The aspect-based sentiment analysis task (ABSA) of text is a fine-grained task of predicting the different sentiment polarities of different aspect words in the same sentence. The main problem is how to construct a strong dependence relationship between aspect words and sentiment. Recently, extracting syntactic dependence relationships on syntactic dependence trees by graph neural networks has become a mainstream trend.

[0003] Currently, the bidirectional long short-term memory network (Bi-LSTM) is used to initialize the nodes (words) of the tree, and then the stacked GCN is further used to enhance the extraction of syntactic feature embeddings. However, these methods do not well solve the noise and instability existing in the dependence tree itself, and overly rely on single information modeling while ignoring the importance of multi-source information, thus unable to accurately perform accurate sentiment analysis on sentences. Summary of the Invention

[0004] Based on this, the purpose of the present invention is to provide a method, device, equipment and storage medium for sentence sentiment analysis based on a dual-channel of semantics and syntax, which simultaneously considers syntactic and semantic information by using the syntactic and semantic dual-channels, improves the extraction of global information, avoids introducing too much irrelevant noise, and more comprehensively performs sentiment analysis on sentences, thereby improving the accuracy and stability of sentence sentiment analysis.

[0005] In a first aspect, an embodiment of the present application provides a method for sentence sentiment analysis based on a dual-channel of semantics and syntax, including the following steps:

[0006] Obtain the sentence representation of the sentence to be tested and a preset neural network model; wherein, the sentence to be tested includes several sentences, each sentence includes several words, and the words include aspect words and context words; the preset neural network model includes a sentence encoding module, a semantic channel, a syntactic channel and a classification module connected in sequence;

[0007] Input the sentence representation of the sentence to be tested into the sentence encoding module in the preset neural network model to obtain the word embedding representation of the sentence to be tested, wherein the word embedding representation includes the word embedding vectors corresponding to each word;

[0008] Input the word embedding representation and the sentence representation of the sentence to be tested into the semantic channel in the neural network model to obtain the semantic feature representation of the sentence to be tested;

[0009] Input the word embedding representation and sentence representation of the sentence to be tested into the syntactic channel in the neural network model to obtain the syntactic feature representation of the sentence to be tested;

[0010] Input the word embedding representation, semantic feature representation and syntactic feature representation of the sentence to be tested into the classification module of the neural network model to obtain the sentiment analysis result output by the classification module of the neural network model.

[0011] In a second aspect, an embodiment of the present application provides a sentence sentiment analysis device based on a semantic and syntactic dual-channel, including:

[0012] An acquisition module, configured to acquire the sentence representation of the sentence to be tested and a preset neural network model; wherein, the sentence to be tested includes several sentences, a sentence includes several words, and the words include aspect words and context words; the preset neural network model includes a sentence encoding module, a semantic channel, a syntactic channel, and a classification module connected in sequence;

[0013] A word embedding module, configured to input the sentence representation of the sentence to be tested into the sentence encoding module in the preset neural network model to obtain the word embedding representation of the sentence to be tested, wherein the word embedding representation includes word embedding vectors corresponding to each word;

[0014] A semantic feature module, configured to input the word embedding representation and sentence representation of the sentence to be tested into the semantic channel in the neural network model to obtain the semantic feature representation of the sentence to be tested;

[0015] A syntactic feature module, configured to input the word embedding representation and sentence representation of the sentence to be tested into the syntactic channel in the neural network model to obtain the syntactic feature representation of the sentence to be tested;

[0016] A sentiment analysis module, configured to input the word embedding representation, semantic feature representation and syntactic feature representation of the sentence to be tested into the classification module of the neural network model to obtain the sentiment analysis result output by the classification module of the neural network model.

[0017] In a third aspect, an embodiment of the present application provides a computer device, including: a processor, a memory, and a computer program stored on the memory and executable on the processor; when the computer program is executed by the processor, it implements the steps of the sentence sentiment analysis method based on a semantic and syntactic dual-channel as described in the first aspect.

[0018] In a fourth aspect, an embodiment of the present application provides a storage medium, the storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps of the sentence sentiment analysis method based on a semantic and syntactic dual-channel as described in the first aspect.

[0019] In an embodiment of the present application, a method, apparatus, device, and storage medium for sentence sentiment analysis based on a dual-channel of semantics and syntax are provided. By simultaneously considering syntactic and semantic information through the dual-channel of syntax and semantics, the extraction of global information is improved, excessive irrelevant noise is avoided, and the sentence is more comprehensively sentiment-analyzed, thereby improving the accuracy and stability of the sentence sentiment analysis.

[0020] For better understanding and implementation, the present invention will be described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A flowchart of a method for sentence sentiment analysis based on a dual-channel of semantics and syntax according to an embodiment of the present application;

[0022] Figure 2 A flowchart of S3 in the method for sentence sentiment analysis based on a dual-channel of semantics and syntax according to an embodiment of the present application;

[0023] Figure 3 A flowchart of S301 in the method for sentence sentiment analysis based on a dual-channel of semantics and syntax according to an embodiment of the present application;

[0024] Figure 4 A flowchart of S302 in the method for sentence sentiment analysis based on a dual-channel of semantics and syntax according to an embodiment of the present application;

[0025] Figure 5 A flowchart of S4 in the method for sentence sentiment analysis based on a dual-channel of semantics and syntax according to an embodiment of the present application;

[0026] Figure 6 A flowchart of S401 in the method for sentence sentiment analysis based on a dual-channel of semantics and syntax according to an embodiment of the present application;

[0027] Figure 7 A flowchart of S402 in the method for sentence sentiment analysis based on a dual-channel of semantics and syntax according to an embodiment of the present application;

[0028] Figure 8 A flowchart of S5 in the method for sentence sentiment analysis based on a dual-channel of semantics and syntax according to an embodiment of the present application;

[0029] Figure 9 A schematic structural diagram of a device for sentence sentiment analysis based on a dual-channel of semantics and syntax according to an embodiment of the present application;

[0030] Figure 10 A schematic structural diagram of a computer device according to an embodiment of the present application. Detailed implementation manners

[0031] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.

[0032] The terms used in the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. The singular forms "a", "the", and "said" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0033] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".

[0034] Please refer to Figure 1 , Figure 1 , which is a schematic flowchart of a method for sentence sentiment analysis based on a dual-channel of semantics and syntax provided for an embodiment of the present application. The method includes the following steps:

[0035] S1: Obtain the sentence representation of the sentence to be measured and a preset neural network model.

[0036] The execution subject of the method for sentence sentiment analysis based on a dual-channel of semantics and syntax is an analysis device for the method for sentence sentiment analysis based on a dual-channel of semantics and syntax (hereinafter referred to as the analysis device). In an alternative embodiment, the analysis device may be a computer device, which may be a server, or a server cluster formed by combining multiple computer devices.

[0037] The sentence to be measured includes several words, and the word is an entity described in the sentence, which may be a noun, an adjective, etc.; the word includes context words and aspect words.

[0038] In this embodiment, the analysis device can obtain the sentence representation of the sentence to be tested input by the user and a preset neural network model. The neural network model adopts a DSS hierarchical model, and the DSS hierarchical model includes a sentence encoding module, a semantic channel, a syntactic channel, and a classification module connected in sequence;

[0039] Among them, the sentence representation of the sentence to be tested is:

[0040] S = {w 1 , w 2 ,..., w a+1 ,..., w a+m ,..., w n}

[0041] In the formula, S is the sentence representation of the sentence to be tested, which contains the vectors w n corresponding to n context words and the vectors w a+m corresponding to the aspect words composed of m aspect words.

[0042] In an optional embodiment, in order to better perform word embedding processing on the words in the sentence to be tested, the analysis device performs dimensionality reduction processing on the vectors corresponding to each word in the sentence representation of the sentence to be tested according to a preset lookup embedding table, and obtains the sentence representation of the sentence to be tested after dimensionality reduction processing.

[0043] S2: Input the sentence representation of the sentence to be tested into the sentence encoding module in the preset neural network model, and obtain the word embedding representation of the sentence to be tested.

[0044] The word embedding representation includes the word embedding vectors corresponding to each word.

[0045] The sentence encoding module can adopt a BERT (Bidirectional Encoder Representation from Transformers) model or a GloVe model to perform word embedding processing on the words of the sentence to be tested.

[0046] In this embodiment, the analysis device inputs the sentence representation of the sentence to be tested into the sentence encoding module in the preset neural network model, uses the BERT model to encode the sentence to be tested, and obtains the word embedding representation corresponding to each word of the sentence to be tested. Among them, the word embedding representation is:

[0047] H = {h 1 , h 2 ,..., h n} = BERT({w 1 , w 2 ,..., w n})

[0048] Wherein, H is the word embedding representation of the to-be-detected statement, including the word embedding representations h corresponding to each word n .

[0049] S3: Input the word embedding representation and the sentence representation of the to-be-detected statement into the semantic channel in the neural network model to obtain the semantic feature representation of the to-be-detected statement.

[0050] The semantic channel is a semantic feature encoder. In this embodiment, the analysis device inputs the word embedding representation and the sentence representation of the to-be-detected statement into the semantic channel in the neural network model to obtain the semantic feature representation of the to-be-detected statement.

[0051] In an optional embodiment, the semantic channel includes a semantic global feature calculation module and a semantic local feature calculation module connected in sequence. Please refer to Figure 2 , Figure 2 which is a schematic flowchart of S3 in the sentence sentiment analysis method based on semantic and syntactic dual channels provided by an embodiment of the present application, including steps S301 to S303, specifically as follows:

[0052] S301: Input the word embedding representation of the to-be-detected statement into the semantic global feature calculation module in the semantic channel to obtain the semantic global feature representation of the to-be-detected statement.

[0053] In this embodiment, the analysis device inputs the word embedding representation of the to-be-detected statement into the semantic global feature calculation module in the semantic channel to obtain the semantic global feature representation of the to-be-detected statement.

[0054] S302: Input the sentence representation of the to-be-detected statement into the semantic local feature calculation module in the semantic channel to obtain the semantic local feature representation of the to-be-detected statement.

[0055] In this embodiment, the analysis device inputs the sentence representation of the to-be-detected statement into the semantic local feature calculation module in the semantic channel to obtain the semantic local feature representation of the to-be-detected statement.

[0056] S303: Perform multi-layer residual connection processing on the word embedding representation, the semantic global feature representation, and the semantic local feature representation of the to-be-detected statement to obtain the semantic feature representation of the to-be-detected statement.

[0057] In this embodiment, the analysis device performs multi-layer residual connection processing on the word embedding representation, the semantic global feature representation, and the semantic local feature representation of the to-be-detected statement according to a preset residual calculation formula to obtain the semantic feature representation of the to-be-detected statement, specifically as follows:

[0058]

[0059] In the formula, O sem_final is the semantic feature representation of the to-be-tested statement, is the overall semantic feature representation of the to-be-tested statement, is the semantic local feature representation.

[0060] In an optional embodiment, the overall semantic feature calculation module includes a mapping module, a multi-head self-attention module, and a word-by-word convolution module that are connected in sequence. Please refer to Figure 3 , Figure 3 which is the schematic flowchart of S301 in the sentence sentiment analysis method based on semantic and syntactic dual channels provided by an embodiment of the present application, including steps S3011 to S3013, specifically as follows:

[0061] S3011: Input the word embedding vectors corresponding to each word in the word embedding representation of the to-be-tested statement into the mapping module to obtain a plurality of subspaces with equal dimensions output by the mapping module.

[0062] The subspaces include a first subspace and a second subspace. Among them, the first subspace is:

[0063]

[0064] In the formula, K is the first subspace, H is the word embedding representation of the to-be-tested statement, is the parameter matrix of the first subspace, d h is the output dimension of the sentence encoding layer, h is the number of subspaces;

[0065] The second subspace is:

[0066]

[0067] In the formula, Q is the second subspace, is the parameter matrix of the second subspace,

[0068] In this embodiment, the analysis device inputs the word embedding vectors corresponding to each word in the word embedding representation of the to-be-tested statement into the mapping module to obtain a plurality of subspaces with equal dimensions output by the mapping module.

[0069] S3012: Input the subspaces into the multi-head self-attention module, and according to the preset hidden layer calculation algorithm, obtain the hidden layer representations corresponding to each subspace output by the multi-head self-attention module.

[0070] In an alternative embodiment, the analysis device may adopt the MultiHeadSA model as the multi-head self-attention module. The analysis device inputs the subspace into the multi-head self-attention module and, according to a preset hidden layer calculation algorithm, obtains the hidden layer representations corresponding to each subspace output by the multi-head self-attention module. Wherein, the hidden layer calculation algorithm is as follows:

[0071]

[0072] In the formula, is the hidden layer representation corresponding to the m-th subspace of the multi-head self-attention module, where 1 ≤ m ≤ h, and softmax() is the normalized exponential function;

[0073] S3013: Input the hidden layer representation into the word-by-word convolution module, and according to a preset word-by-word convolution algorithm, obtain the hidden state parameters output by the word-by-word convolution module as the semantic overall feature representation of the to-be-tested statement.

[0074] In an alternative embodiment, the analysis device may adopt the TWC model as the word-by-word convolution module. The analysis device inputs the hidden layer representation into the word-by-word convolution module and, according to a preset word-by-word convolution algorithm, obtains the hidden state parameters output by the word-by-word convolution module as the semantic overall feature representation of the to-be-tested statement. Wherein, the word-by-word convolution algorithm is as follows:

[0075]

[0076] In the formula, is the hidden state parameter output by the word-by-word convolution module, Concat() is the concatenation function, and W O is the preset weight parameter; σ() is the first activation function, is the first trainable weight parameter, is the first bias parameter, is the second trainable weight parameter, is the second bias parameter.

[0077] Please refer to Figure 4 , Figure 4 which is the flowchart of S302 in the sentence sentiment analysis method based on semantic and syntactic dual channels provided by an embodiment of the present application, including steps S3021 to S3023, specifically as follows:

[0078] S3021: Obtain the position coordinates of the aspect word and the context words in the sentence representation of the to-be-tested statement, and according to the semantic relative distance calculation algorithm in the semantic local feature calculation module, obtain the semantic relative distance between each aspect word and each context word.

[0079] The semantic relative distance calculation algorithm is as follows:

[0080]

[0081] In the formula, SRD i is the semantic relative distance corresponding to the i-th aspect word, and P i is the position coordinate of the context word in the sentence representation of the sentence to be tested, and P a is the position coordinate of the aspect word in the sentence representation of the sentence to be tested, and len asp is the length of the sequence composed of the vectors corresponding to the aspect word;

[0082] In this embodiment, the analysis device obtains the position coordinates of the aspect word and the context word in the sentence representation of the sentence to be tested, and obtains the semantic relative distance between each aspect word and each context word according to the semantic relative distance calculation algorithm in the semantic local feature calculation module.

[0083] S3022: Obtain a first attention vector between each aspect word and each context word according to the semantic relative distance and a preset semantic distance threshold, and construct a first attention matrix corresponding to the aspect word.

[0084] In this embodiment, the analysis device obtains a first attention vector between each aspect word and each context word according to the semantic relative distance and a preset semantic distance threshold, and constructs a first attention matrix corresponding to the aspect word, specifically as follows:

[0085]

[0086]

[0087] In the formula, is the first attention vector, α sem is the semantic distance threshold, and M sem is the first attention matrix; are all-zero vector and all-one vector respectively; d h is the hidden layer dimension of the vector of the context word. The zero vector is used to mask irrelevant information at a long distance to further extract the semantic local feature representation and strengthen the connection between the context word and the aspect word.

[0088] S3023: Obtain the semantic local feature representation of the sentence to be tested output by the semantic local feature calculation module according to the first attention matrix, the hidden layer representation corresponding to each subspace, and the first element dot product algorithm in the semantic local feature calculation module.

[0089] The first element dot product algorithm is as follows:

[0090]

[0091] In the formula, is the semantic local feature representation of the to-be-tested statement, and M sem is the first attention matrix.

[0092] In this embodiment, the analysis device obtains the semantic local feature representation of the to-be-tested statement output by the semantic local feature calculation module according to the first attention matrix, the hidden layer representations corresponding to each subspace, and the first element dot product algorithm in the semantic local feature calculation module.

[0093] S4: Input the word embedding representation and the sentence representation of the to-be-tested statement into the syntactic channel in the neural network model to obtain the syntactic feature representation of the to-be-tested statement.

[0094] In this embodiment, the analysis device inputs the word embedding representation and the sentence representation of the to-be-tested statement into the syntactic channel in the neural network model to obtain the syntactic feature representation of the to-be-tested statement.

[0095] In an optional embodiment, the syntactic channel includes a syntactic global feature calculation module and a syntactic local feature calculation module connected in sequence. Please refer to Figure 5 , Figure 5 which is the flowchart of S4 in the method for sentence sentiment analysis based on semantic and syntactic dual channels provided by an embodiment of the present application, including steps S401 to S403, specifically as follows:

[0096] S401: Input the word embedding representation of the to-be-tested statement into the syntactic global feature calculation module in the syntactic channel to obtain the syntactic global feature representation of the to-be-tested statement.

[0097] In an optional embodiment, the analysis device uses a multi-head graph convolutional module as the syntactic global feature calculation module and inputs the word embedding representation of the to-be-tested statement into the syntactic global feature calculation module in the syntactic channel to obtain the syntactic global feature representation of the to-be-tested statement.

[0098] S402: Input the sentence representation of the to-be-tested statement into the syntactic local feature calculation module in the syntactic channel to obtain the syntactic local feature representation of the to-be-tested statement.

[0099] In this embodiment, the analysis device inputs the sentence representation of the to-be-tested statement into the syntactic local feature calculation module in the syntactic channel to obtain the syntactic local feature representation of the to-be-tested statement.

[0100] S403: Perform multi-layer residual connection processing on the word embedding representation, syntactic global feature representation, and syntactic local feature representation of the to-be-tested statement to obtain the syntactic feature representation of the to-be-tested statement.

[0101] In this embodiment, the analysis device performs multi-layer residual connection processing on the word embedding representation, syntactic global feature representation, and syntactic local feature representation of the to-be-tested statement to obtain the syntactic feature representation of the to-be-tested statement, which is specifically as follows:

[0102]

[0103] In the formula, O syn_final is the syntactic feature representation of the to-be-tested statement, is the syntactic global feature representation of the to-be-tested statement, is the syntactic local feature representation.

[0104] Please refer to Figure 6 , Figure 6 which is the schematic flowchart of S401 in the statement sentiment analysis method based on semantic and syntactic dual channels provided by an embodiment of the present application, including steps S4011 to S4014, specifically as follows:

[0105] S4011: Obtain the dependency edge information of the to-be-tested statement, and construct the dependency edge matrix of the to-be-tested statement according to the dependency edge information.

[0106] The dependency edge information is reflected as the dependency relationship between words in the to-be-tested statement.

[0107] In this embodiment, the analysis device constructs the dependency edge matrix of the to-be-tested statement according to the dependency edge information in the dependency information, where the dependency edge matrix is:

[0108] A = {a i,j} n×n

[0109] In the formula, A is the dependency edge matrix, and a i,j is the dependency edge feature representation. a i,j = 1 represents that the dependency edge information is the dependency relationship between words, and a i,j = 0 represents that the dependency edge information is the non-dependency relationship between words.

[0110] S4012: Input the word embedding representation of the to-be-tested statement and the dependency edge matrix into the syntactic global feature calculation module, and use the word embedding representation of the to-be-tested statement as the first-layer input node information of the syntactic global feature calculation module. According to the preset input node algorithm, obtain the input node information corresponding to each layer of the syntactic global feature calculation module.

[0111] The input node algorithm is as follows:

[0112]

[0113] In the formula, is the input node information corresponding to the l-th layer of the syntactic global feature calculation module, where MHGCN() is the multi-head graph convolution function, A is the dependency edge matrix, is the weight parameter corresponding to the l-th layer of the syntactic global feature calculation module;

[0114] In this embodiment, the analysis device inputs the word embedding representation of the to-be-tested statement and the dependency edge matrix into the syntactic global feature calculation module, and uses the word embedding representation of the to-be-tested statement as the input node information of the first layer of the syntactic global feature calculation module. According to the preset input node algorithm, the input node information corresponding to each layer of the syntactic global feature calculation module is obtained.

[0115] S4013: According to the preset node update algorithm, update the input node information corresponding to each layer of the syntactic global feature calculation module to obtain the updated input node information corresponding to each layer of the syntactic global feature calculation module.

[0116] The node update algorithm is as follows:

[0117]

[0118] In the formula, is the input node information of the l-th layer of the updated syntactic global feature calculation module, W l is the first trainable weight parameter matrix, b l is the second trainable weight parameter matrix, ReLU() is the second activation function, and * is the multiplication symbol;

[0119] In this embodiment, the analysis device updates the input node information corresponding to each layer of the syntactic global feature calculation module according to the preset node update algorithm to obtain the updated input node information corresponding to each layer of the syntactic global feature calculation module.

[0120] S4014: According to the preset splicing algorithm, splice the input node information corresponding to each layer of the updated syntactic global feature calculation module to obtain the hidden state parameter output by the syntactic global feature calculation module as the syntactic global feature representation of the to-be-tested statement.

[0121] The splicing algorithm is as follows:

[0122]

[0123] In the formula, is the hidden state parameter output by the syntactic overall feature calculation module, Concat() is the concatenation function, and W O is the preset weight parameter.

[0124] In this embodiment, the analysis device concatenates the input node information corresponding to each layer of the updated syntactic overall feature calculation module according to a preset concatenation algorithm to obtain the hidden state parameter output by the syntactic overall feature calculation module, which is used as the syntactic overall feature representation of the to-be-tested statement.

[0125] Please refer to Figure 7 , Figure 7 which is a schematic flowchart of S402 in the sentence sentiment analysis method based on semantic and syntactic dual channels provided by an embodiment of the present application, including steps S4021 to S4023, specifically as follows:

[0126] S4021: Obtain a dependency syntactic tree, and set the aspect word of the to-be-tested statement on the root node of the dependency syntactic tree, and set the context words of the to-be-tested statement on the child nodes of the dependency syntactic tree.

[0127] The dependency syntactic tree analyzes a sentence into a dependency syntactic tree, describes the dependency relationships between various words, and the dependency syntactic tree includes several root nodes and child nodes, and the root nodes and the child nodes are directly connected;

[0128] In this embodiment, the analysis device obtains a dependency syntactic tree, and sets the aspect word of the to-be-tested statement on the root node of the dependency syntactic tree, and sets the context words of the to-be-tested statement on the child nodes of the dependency syntactic tree.

[0129] S4022: According to the distances between the root nodes and the child nodes in the dependency syntactic graph corresponding to the to-be-tested statement, obtain the syntactic relative distances between the aspect words corresponding to the root nodes and the context words, and according to the syntactic relative distances and a preset syntactic distance threshold, obtain the second attention vectors between each aspect word and each context word, and construct the second attention matrix corresponding to the aspect word.

[0130] In this embodiment, the analysis device obtains the distances between the root nodes and the child nodes in the dependency syntactic graph corresponding to the to-be-tested statement as the syntactic relative distances between the aspect words and the context words, specifically as follows:

[0131]

[0132] In the formula, SDD i is the syntactic relative distance corresponding to the i-th aspect word, aspm is the root node corresponding to the m-th aspect word, and token is the child node corresponding to the context word.

[0133] According to the syntactic relative distance and a preset syntactic distance threshold, obtain a second attention vector between each aspect word and each context word, and construct a second attention matrix corresponding to the aspect word, specifically as follows:

[0134]

[0135]

[0136] In the formula, is the second attention vector, α syn is the syntactic distance threshold, and M syn is the second attention matrix.

[0137] S4023: According to the second attention matrix, the input node information corresponding to each layer of the syntactic overall feature calculation module, and the second element dot product algorithm in the syntactic local feature attention mechanism, obtain the syntactic local feature representation of the to-be-detected sentence output by the syntactic local feature attention mechanism.

[0138] The second element dot product algorithm is:

[0139]

[0140] In the formula, is the syntactic local feature representation of the to-be-detected sentence, and M syn is the second attention matrix.

[0141] In this embodiment, the analysis device obtains the syntactic local feature representation of the to-be-detected sentence output by the syntactic local feature attention mechanism according to the second attention matrix, the input node information corresponding to each layer of the syntactic overall feature calculation module, and the second element dot product algorithm in the syntactic local feature attention mechanism.

[0142] S5: Input the word embedding representation, semantic feature representation, and syntactic feature representation of the to-be-detected sentence into the classification module of the neural network model, and obtain the sentiment analysis result output by the classification module of the neural network model.

[0143] In this embodiment, the analysis device inputs the word embedding representation, semantic feature representation, and syntactic feature representation of the to-be-detected sentence into the classification module of the neural network model, and obtains the sentiment analysis result output by the classification module of the neural network model.

[0144] In an alternative embodiment, the classification module includes a pooling layer and an activation layer. Please refer toFigure 8 , Figure 8 It is a schematic flowchart of S5 in the sentence sentiment analysis method based on semantic and syntactic dual channels provided by an embodiment of the present application, including steps S501 to S502, specifically as follows:

[0145] S501: Input the semantic feature representation and syntactic feature representation of the to-be-tested sentence into the pooling layer in the classification module, perform average pooling processing, and obtain the semantic feature representation and syntactic feature representation after average pooling processing.

[0146] In this embodiment, the analysis device inputs the semantic feature representation and syntactic feature representation of the to-be-tested sentence into the pooling layer in the classification module, and performs average pooling processing, specifically as follows:

[0147] O avg_sem = MeanPool(O sem_final )

[0148] O avg_syn = MeanPool(O syn_final )

[0149] In the formula, O avg_sem is the semantic feature representation after the average pooling processing, O avg_syn is the syntactic feature representation after the average pooling processing, and MeanPool() is the average pooling function.

[0150] S502: Concatenate the word embedding representation, the semantic feature representation after average pooling processing, and the syntactic feature representation of the to-be-tested sentence to obtain an emotion feature representation, input the emotion feature representation into the classification layer in the classification module, according to the preset emotion analysis algorithm, obtain an emotion classification polarity probability distribution vector, and according to the emotion classification polarity probability distribution vector, obtain the emotion polarity corresponding to the dimension with the largest probability, and use the emotion polarity as the emotion analysis result of the to-be-tested sentence.

[0151] In this embodiment, the analysis device concatenates the word embedding representation, the semantic feature representation after average pooling processing, and the syntactic feature representation of the to-be-tested sentence to obtain an emotion feature representation, inputs the emotion feature representation into the classification layer in the classification module, and according to the preset emotion analysis algorithm, obtains an emotion classification polarity probability distribution vector, where the emotion analysis algorithm is:

[0152]

[0153] In the formula, is the emotion classification polarity probability distribution vector, O all is the emotion feature representation, O all = [Oavg_sem ; O avg_syn , W T is the parameter matrix of the classification module, and b is the bias value of the classification module;

[0154] According to the sentiment classification polarity probability distribution vector, obtain the sentiment polarity corresponding to the dimension with the largest probability as the sentiment analysis result of the text dataset to be tested. Among them, the sentiment polarity includes positive, neutral, and negative. Specifically, when it is calculated that u = [u_positive, u_negative, u_neutral] = [0.1, 0.7, 0.2], the largest probability is u_negative, and the sentiment polarity corresponding to the dimension with the largest probability is negative, which is used as the sentiment analysis result of the text dataset to be tested.

[0155] Please refer to Figure 9 , Figure 9 is a schematic structural diagram of a sentence sentiment analysis device based on semantic and syntactic dual channels provided by an embodiment of the present application. The device can implement all or part of the sentence sentiment analysis device based on semantic and syntactic dual channels through software, hardware, or a combination of both. The device 9 includes:

[0156] An acquisition module 91, configured to acquire a sentence representation of a sentence to be tested and a preset neural network model; wherein, the sentence to be tested includes several sentences, a sentence includes several words, and the words include aspect words and context words; the preset neural network model includes a sentence encoding module, a semantic channel, a syntactic channel, and a classification module connected in sequence;

[0157] A word embedding module 92, configured to input the sentence representation of the sentence to be tested into the sentence encoding module in the preset neural network model to obtain a word embedding representation of the sentence to be tested, where the word embedding representation includes word embedding vectors corresponding to each word;

[0158] A semantic feature module 93, configured to input the word embedding representation and the sentence representation of the sentence to be tested into the semantic channel in the neural network model to obtain a semantic feature representation of the sentence to be tested;

[0159] A syntactic feature module 94, configured to input the word embedding representation and the sentence representation of the sentence to be tested into the syntactic channel in the neural network model to obtain a syntactic feature representation of the sentence to be tested;

[0160] A sentiment analysis module 95, configured to input the word embedding representation, the semantic feature representation, and the syntactic feature representation of the sentence to be tested into the classification module of the neural network model to obtain a sentiment analysis result output by the classification module of the neural network model.

[0161] In this embodiment, a sentence representation of a sentence to be tested and a preset neural network model are obtained through an acquisition module. The sentence to be tested includes a plurality of sentences, each sentence includes a plurality of words, and each word includes an aspect word and context words. The preset neural network model includes a sentence encoding module, a semantic channel, a syntactic channel, and a classification module connected in sequence. Through a word embedding module, the sentence representation of the sentence to be tested is input into the sentence encoding module in the preset neural network model to obtain a word embedding representation of the sentence to be tested, where the word embedding representation includes word embedding vectors corresponding to each word. Through a semantic feature module, the word embedding representation and the sentence representation of the sentence to be tested are input into the semantic channel in the neural network model to obtain a semantic feature representation of the sentence to be tested. Through a syntactic feature module, the word embedding representation and the sentence representation of the sentence to be tested are input into the syntactic channel in the neural network model to obtain a syntactic feature representation of the sentence to be tested. Through a sentiment analysis module, the word embedding representation, the semantic feature representation, and the syntactic feature representation of the sentence to be tested are input into the classification module of the neural network model to obtain a sentiment analysis result output by the classification module of the neural network model. By simultaneously considering syntactic and semantic information in a syntactic and semantic dual-channel manner, the extraction of global information is improved, the introduction of excessive irrelevant noise is avoided, and the sentiment analysis of sentences is more comprehensive, thereby improving the accuracy and stability of the sentiment analysis of sentences.

[0162] Please refer to Figure 10 , Figure 10 FIG. [FIG. number] is a schematic structural diagram of a computer device provided by an embodiment of the present application. The computer device 10 includes: a processor 101, a memory 102, and a computer program 103 stored on the memory 102 and executable on the processor 101. The computer device may store multiple instructions, and the instructions are suitable for being loaded and executed by the processor 101 to perform the above Figures 1 to 7 method steps. The specific execution process may refer to the Figures 1 to 7 specific description, which will not be elaborated here.

[0163] It should be noted that in the above translation, for the parts with tags like ,

[0162] etc., since their specific content is not clear from the context, they are directly retained as they are in the translation. Also, for the part about "FIG. [FIG. number]" in , the "[FIG. number]" needs to be filled with the actual figure number according to the original text which is not fully provided here.Among them, the processor 101 may include one or more processing cores. The processor 101 uses various interfaces and circuits to connect various parts within the server. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 102, and by invoking the data in the memory 102, it executes various functions of the statement sentiment analysis device 9 based on the dual channels of semantics and syntax and processes data. Optionally, the processor 101 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 101 may integrate one or a combination of several of the central processing unit 101 (CPU), graphics processing unit 101 (GPU), and modem, etc. Among them, the CPU mainly processes the operating system, user interface, application programs, etc.; the GPU is responsible for the rendering and drawing of the content to be displayed on the touch display screen; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 101 and may be implemented separately by a single chip.

[0164] Among them, the memory 102 may include random access memory 102 (RAM), or may also include read-only memory 102 (ROM). Optionally, the memory 102 includes a non-transitory computer-readable storage medium. The memory 102 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 102 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for at least one function (such as touch instructions, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store the data involved in the above-mentioned various method embodiments. Optionally, the memory 102 may also be at least one storage device located far from the aforementioned processor 101.

[0165] The embodiment of the present application also provides a storage medium, and the storage medium may store multiple instructions, and the instructions are suitable for being loaded and executed by the processor to perform the above Figures 1 to 7 method steps, and the specific execution process can refer to the Figures 1 to 7 specific description, which will not be elaborated here.

[0166] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above-mentioned functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0167] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0168] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in the form of hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0169] In the embodiments provided by the present invention, it should be understood that the disclosed device / terminal device and method can be implemented in other ways. For example, the device / terminal device embodiments described above are only illustrative. For example, the division of the module or unit is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the device or unit can be in electrical, mechanical or other forms.

[0170] The unit described as a separated component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0171] In addition, in each embodiment of the present invention, each functional unit may be integrated into a processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

[0172] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-mentioned embodiment methods of the present invention, it may also be completed by instructing relevant hardware through a computer program. The computer program may be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments may be implemented. Among them, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate form, etc.

[0173] The present invention is not limited to the above-mentioned embodiments. If various modifications or deformations of the present invention do not depart from the spirit and scope of the present invention, and if these modifications and deformations are within the scope of the claims of the present invention and equivalent technical scope, then the present invention also intends to include these modifications and deformations.

Claims

1. A method for sentence sentiment analysis based on a dual-channel of semantics and syntax, characterized in that, it includes the following steps: Obtain the sentence representation of the sentence to be tested and a preset neural network model; wherein, the sentence to be tested includes several sentences, a sentence includes several words, and the words include aspect words and context words; the preset neural network model includes a sentence encoding module, a semantic channel, a syntax channel, and a classification module connected in sequence; the semantic channel includes a semantic global feature calculation module and a semantic local feature calculation module connected in sequence; the syntax channel includes a syntax global feature calculation module and a syntax local feature calculation module connected in sequence; Input the sentence representation of the sentence to be tested into the sentence encoding module in the preset neural network model to obtain the word embedding representation of the sentence to be tested, wherein the word embedding representation includes word embedding vectors corresponding to each word; Input the word embedding representation of the sentence to be tested into the semantic global feature calculation module in the semantic channel to obtain the semantic global feature representation of the sentence to be tested; Input the sentence representation of the sentence to be tested into the semantic local feature calculation module in the semantic channel to obtain the semantic local feature representation of the sentence to be tested; Perform multi-layer residual connection processing on the word embedding representation, semantic global feature representation, and semantic local feature representation of the sentence to be tested to obtain the semantic feature representation of the sentence to be tested; Input the word embedding representation of the sentence to be tested into the syntax global feature calculation module in the syntax channel to obtain the syntax global feature representation of the sentence to be tested; Input the sentence representation of the sentence to be tested into the syntax local feature calculation module in the syntax channel to obtain the syntax local feature representation of the sentence to be tested; Perform multi-layer residual connection processing on the word embedding representation, syntax global feature representation, and syntax local feature representation of the sentence to be tested to obtain the syntax feature representation of the sentence to be tested; Input the word embedding representation, semantic feature representation, and syntax feature representation of the sentence to be tested into the classification module of the neural network model to obtain the sentiment analysis result output by the classification module of the neural network model.

2. The method for sentence sentiment analysis based on a dual-channel of semantics and syntax according to claim 1, characterized in that: The semantic global feature calculation module includes a mapping module, a multi-head self-attention module, and a per-word convolution module connected in sequence; The step of inputting the word embedding representation of the sentence to be tested into the semantic global feature calculation module in the semantic channel to obtain the semantic global feature representation of the sentence to be tested includes the steps: Input the word embedding vectors corresponding to each word in the word embedding representation of the sentence to be tested into the mapping module to obtain several subspaces of equal dimension output by the mapping module, wherein the subspaces include a first subspace and a second subspace, and the first subspace is: Where K is the first subspace, and H is the word embedding representation of the sentence to be measured, is the parameter matrix of the first subspace, , is the output dimension of the sentence encoding layer, , is the number of subspaces; The second subspace is: Wherein, Q is the second subspace, is the parameter matrix of the second subspace, , ; Input the subspace into the multi-head self-attention module, and obtain the hidden layer representations corresponding to each subspace output by the multi-head self-attention module according to a preset hidden layer calculation algorithm, where the hidden layer calculation algorithm is as follows: Wherein, is the hidden layer representation corresponding to the m th subspace of the multi-head self-attention module, where 1 ≤ m ≤ h , and softmax() is the normalized exponential function; Input the hidden layer representation into the per-word convolution module, and obtain the hidden state parameters output by the per-word convolution module as the semantic global feature representation of the to-be-detected statement according to a preset per-word convolution algorithm, where the per-word convolution algorithm is as follows: In the formula, is the hidden state parameter output by the word-by-word convolution module, and Concat() is the concatenation function, is the preset weight parameter; is the first activation function, is the first trainable weight parameter, is the first bias parameter, is the second trainable weight parameter, is the second bias parameter.

3. The method for sentence sentiment analysis based on semantic and syntactic dual channels according to claim 2, characterized in that The step of inputting the sentence representation of the to-be-detected statement into the semantic local feature calculation module in the semantic channel to obtain the semantic local feature representation of the to-be-detected statement includes the following steps: Obtain the position coordinates of the aspect word and the context words in the sentence representation of the to-be-detected statement, and obtain the semantic relative distance between each aspect word and each context word according to the semantic relative distance calculation algorithm in the semantic local feature calculation module, where the semantic relative distance calculation algorithm is as follows: In the formula, is the semantic relative distance corresponding to the i th aspect word, is the position coordinate of the context word in the sentence representation of the sentence to be tested, is the position coordinate of the aspect word in the sentence representation of the sentence to be tested, is the length of the sequence composed of the vectors corresponding to the aspect word; Obtain the first attention vector between each aspect word and each context word according to the semantic relative distance and a preset semantic distance threshold, and construct the first attention matrix corresponding to the aspect word; Obtain the semantic local feature representation of the to-be-detected statement output by the semantic local feature calculation module according to the first attention matrix, the hidden layer representations corresponding to each subspace, and the first element dot product algorithm in the semantic local feature calculation module, where the first element dot product algorithm is as follows: In the formula, is the semantic local feature representation of the statement to be measured, is the first attention matrix.

4. The method for sentence sentiment analysis based on semantic and syntactic dual channels according to claim 1, characterized in that The step of inputting the word embedding representation of the to-be-detected statement into the syntactic global feature calculation module in the syntactic channel to obtain the syntactic global feature representation of the to-be-detected statement includes the following steps: Obtain the dependency edge information of the to-be-detected statement; the dependency edge information is the dependency connection relationship between words; construct the dependency edge matrix of the to-be-detected statement according to the dependency edge information; Input the word embedding representation of the to-be-detected statement and the dependency edge matrix into the syntactic global feature calculation module, and use the word embedding representation of the to-be-detected statement as the first-layer input node information of the syntactic global feature calculation module, and obtain the input node information corresponding to each layer of the syntactic global feature calculation module according to a preset input node algorithm, where the input node algorithm is as follows: In the formula, is the input node information corresponding to the l th layer of the syntactic overall feature calculation module, where , MHGCN () is the multi-head graph convolution function, A is the dependency edge matrix, is the weight parameter corresponding to the l th layer of the syntactic overall feature calculation module; Update the input node information corresponding to each layer of the syntactic global feature calculation module according to a preset node update algorithm to obtain the updated input node information corresponding to each layer of the syntactic global feature calculation module, where the node update algorithm is as follows: In the formula, is the input node information of the l th layer of the updated syntactic overall feature calculation module, is the first trainable weight parameter matrix, is the second trainable weight parameter matrix, Re LU () is the second activation function, and * is the multiplication symbol; According to a preset splicing algorithm, splice the input node information corresponding to each layer of the updated syntactic global feature calculation module to obtain the hidden state parameters output by each layer of the syntactic global feature calculation module, and use the hidden state parameters output by the last convolutional layer of the multi-head self-attention module as the syntactic global feature representation of the sentence to be tested, where the splicing algorithm is as follows: Wherein, is the hidden state parameter output by the l -th layer of the syntactic overall feature calculation module, Concat() is a splicing function, is a preset weight parameter.

5. The method for sentence sentiment analysis based on semantic and syntactic dual channels according to claim 4, characterized in that: The step of inputting the sentence representation of the sentence to be tested into the syntactic local feature calculation module in the syntactic channel to obtain the syntactic local feature representation of the sentence to be tested includes the following steps: Obtain a dependency syntax tree, set the aspect word of the sentence to be tested on the root node of the dependency syntax tree, and set the context words of the sentence to be tested on the child nodes of the dependency syntax tree, where the dependency syntax tree includes a plurality of root nodes and child nodes, and the root node is directly connected to the child node; According to the distances between each root node and each child node in the dependency syntax graph corresponding to the sentence to be tested, obtain the syntactic relative distances between the aspect words corresponding to each root node and each context word, and according to the syntactic relative distances and a preset syntactic distance threshold, obtain the second attention vectors between each aspect word and each context word, and construct the second attention matrix corresponding to the aspect word; According to the second attention matrix, the input node information corresponding to each layer of the syntactic global feature calculation module, and the second element dot product algorithm in the syntactic local feature attention mechanism, obtain the syntactic local feature representation of the sentence to be tested output by the syntactic local feature attention mechanism, where the second element dot product algorithm is as follows: Wherein, is the syntactic local feature representation of the statement to be measured, is the second attention matrix.

6. The method for sentence sentiment analysis based on semantic and syntactic dual channels according to claim 1, characterized in that: The classification module includes a pooling layer and an activation layer connected in sequence; The step of inputting the word embedding representation, semantic feature representation, and syntactic feature representation of the sentence to be tested into the classification module of the neural network model to obtain the sentiment analysis result output by the classification module of the neural network model includes the following steps: Input the semantic feature representation and syntactic feature representation of the sentence to be tested into the pooling layer in the classification module for average pooling processing to obtain the semantic feature representation and syntactic feature representation after average pooling processing; Splice the word embedding representation, the semantic feature representation after average pooling processing, and the syntactic feature representation of the sentence to be tested to obtain a sentiment feature representation, input the sentiment feature representation into the classification layer in the classification module, and according to a preset sentiment analysis algorithm, obtain a sentiment classification polarity probability distribution vector, and according to the sentiment classification polarity probability distribution vector, obtain the sentiment polarity corresponding to the dimension with the largest probability, and use the sentiment polarity as the sentiment analysis result of the sentence to be tested, where the sentiment analysis algorithm is as follows: wherein, is the emotional classification polarity probability distribution vector, is the emotional feature representation, is the parameter matrix of the classification module, and b is the bias value of the classification module.

7. A sentence sentiment analysis device based on semantic and syntactic dual channels, characterized in that, including: An acquisition module, configured to acquire a sentence representation of a sentence to be tested and a preset neural network model; wherein, the sentence to be tested includes a plurality of sentences, each sentence includes a plurality of words, and each word includes an aspect word and context words; the preset neural network model includes a sentence encoding module, a semantic channel, a syntactic channel, and a classification module connected in sequence; the semantic channel includes a semantic global feature calculation module and a semantic local feature calculation module connected in sequence; the syntactic channel includes a syntactic global feature calculation module and a syntactic local feature calculation module connected in sequence; A word embedding module, configured to input the sentence representation of the sentence to be tested into the sentence encoding module in the preset neural network model to obtain a word embedding representation of the sentence to be tested, wherein the word embedding representation includes word embedding vectors corresponding to each word; A semantic feature module, configured to input the word embedding representation of the sentence to be tested into the semantic global feature calculation module in the semantic channel to obtain a semantic global feature representation of the sentence to be tested; Input the sentence representation of the sentence to be tested into the semantic local feature calculation module in the semantic channel to obtain a semantic local feature representation of the sentence to be tested; Perform multi-layer residual connection processing on the word embedding representation, semantic global feature representation, and semantic local feature representation of the sentence to be tested to obtain a semantic feature representation of the sentence to be tested; A syntactic feature module, configured to input the word embedding representation of the sentence to be tested into the syntactic global feature calculation module in the syntactic channel to obtain a syntactic global feature representation of the sentence to be tested; Input the sentence representation of the sentence to be tested into the syntactic local feature calculation module in the syntactic channel to obtain a syntactic local feature representation of the sentence to be tested; Perform multi-layer residual connection processing on the word embedding representation, syntactic global feature representation, and syntactic local feature representation of the sentence to be tested to obtain a syntactic feature representation of the sentence to be tested; An emotion analysis module, configured to input the word embedding representation, semantic feature representation, and syntactic feature representation of the sentence to be tested into the classification module of the neural network model to obtain an emotion analysis result output by the classification module of the neural network model.

8. A computer device, characterized in that, it includes: A processor, a memory, and a computer program stored on the memory and executable on the processor; when the computer program is executed by the processor, the steps of the method for sentence emotion analysis based on a dual semantic and syntactic channel according to any one of claims 1 to 6 are implemented.