Aspect-level sentiment classification method and device, server and storage medium

By dynamically aggregating neighbor word information with different hop counts and utilizing a combination of graph convolutional networks and linear layers, the problem of insufficient aspect-level sentiment classification accuracy caused by a fixed number of layers in existing technologies is solved, achieving higher classification accuracy.

CN119669465BActive Publication Date: 2026-05-29PING AN TECH (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN TECH (SHENZHEN) CO LTD
Filing Date
2024-11-25
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing aspect-level sentiment classification methods suffer from insufficient accuracy because the number of layers in graph convolutional neural networks is fixed and they cannot effectively aggregate multi-hop neighbor word representations.

Method used

The convolutional processing is performed using a first target graph convolutional network and a syntactic adjacency matrix to dynamically aggregate neighbor word information with different hop counts. The syntactic adjacency matrix is ​​updated using a first target linear layer, and sentiment classification is performed by combining a second target graph convolutional network and a linear layer.

Benefits of technology

It improves the accuracy of aspect-level sentiment classification, enabling more accurate identification of the sentiment type of aspect words in sentences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669465B_ABST
    Figure CN119669465B_ABST
Patent Text Reader

Abstract

The application relates to the field of artificial intelligence, and provides an aspect-level sentiment classification method, which comprises the following steps: calling a target sentiment classification model when a target sentence needing sentiment classification and an aspect word are acquired; performing coding processing on the target sentence through an embedding layer to obtain a first embedding vector and generate a first syntax adjacency matrix of the target sentence; performing convolution processing on the first embedding vector and the first syntax adjacency matrix through a first target graph convolution network to obtain a first syntax feature vector; performing hop number classification processing on the first syntax feature vector through a first target linear layer to obtain a target hop number, and updating the first syntax adjacency matrix according to the target hop number; performing convolution processing on the first embedding vector and the updated first syntax adjacency matrix through a second target graph convolution network to obtain a second syntax feature vector; and performing sentiment classification processing on the second syntax feature vector through a second target linear layer. The method improves the accuracy of sentiment classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of emotion classification, and more particularly to an aspect-level emotion classification method, apparatus, server, and storage medium. Background Technology

[0002] Aspect-level sentiment classification is an important task in the field of sentiment analysis, aiming to identify the sentiment type of a given aspect term in a sentence. For example, in the financial insurance industry, aspect-level sentiment classification can be used to determine the sentiment type of a user's evaluation of the quality of an insurance product, thus determining whether the evaluation is negative or positive. Similarly, in the healthcare industry, aspect-level sentiment classification can be used to determine the sentiment type of a patient's evaluation of the competence of medical personnel, thus determining whether the evaluation is negative or positive.

[0003] Current aspect-level sentiment classification methods utilize graph convolutional neural networks (GCNNs) with a fixed number of layers to encode sentences, incorporating attention mechanisms. This helps aspect-level sentiment classification more explicitly focus on contextual information related to aspect words, improving accuracy to some extent. However, because the number of layers in a GCNN is fixed, it can only aggregate neighbor word representations with a fixed number of hops. For example, a two-layer GCNN can only aggregate neighbor word representations within two hops, failing to effectively collect features helpful for sentiment classification, thus compromising the accuracy of aspect-level sentiment classification. Summary of the Invention

[0004] This application provides an aspect-level emotion classification method, apparatus, server, and storage medium, aiming to improve the accuracy of aspect-level emotion classification.

[0005] In a first aspect, embodiments of this application provide an aspect-level sentiment classification method, including:

[0006] When the target sentence and aspect words that need to be classified for sentiment are obtained, the target sentiment classification model is invoked. The target sentiment classification model includes an embedding layer, a first target graph convolutional network, a first target linear layer, a second target graph convolutional network, and a second target linear layer.

[0007] The target sentence is encoded through the embedding layer to obtain a first embedding vector, and a first syntactic adjacency matrix of the target sentence is generated.

[0008] The first embedding vector and the first syntactic adjacency matrix are convolved by the first target graph convolutional network to obtain the first syntactic feature vector.

[0009] The first syntactic feature vector is classified by hop count through the first target linear layer to obtain the target hop count, and the first syntactic adjacency matrix is ​​updated according to the target hop count.

[0010] The second target graph convolutional network is used to convolve the first embedding vector and the updated first syntactic adjacency matrix to obtain the second syntactic feature vector.

[0011] The sentiment type of the aspect word is obtained by performing sentiment classification on the second syntactic feature vector through the second target linear layer.

[0012] Secondly, embodiments of this application also provide an aspect-level emotion classification device, the aspect-level emotion classification device comprising:

[0013] The model invocation module is configured to invoke the target sentiment classification model when the target sentence and aspect words for sentiment classification are obtained. The target sentiment classification model includes an embedding layer, a first target graph convolutional network, a first target linear layer, a second target graph convolutional network, and a second target linear layer.

[0014] The encoding module is configured to encode the target sentence through the embedding layer to obtain a first embedding vector and generate a first syntactic adjacency matrix of the target sentence;

[0015] The first graph convolution module is configured to perform convolution processing on the first embedding vector and the first syntactic adjacency matrix through the first target graph convolution network to obtain the first syntactic feature vector;

[0016] The hop count prediction module is configured to perform hop count classification on the first syntactic feature vector through the first target linear layer to obtain the target hop count, and update the first syntactic adjacency matrix according to the target hop count;

[0017] The second graph convolution module is configured to perform convolution processing on the first embedding vector and the updated first syntactic adjacency matrix through the second target graph convolution network to obtain the second syntactic feature vector.

[0018] The sentiment classification module is configured to perform sentiment classification processing on the second syntactic feature vector through the second target linear layer to obtain the sentiment type of the aspect word.

[0019] Thirdly, embodiments of this application also provide a server, the server including a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the aspect-level sentiment classification method as described in the first aspect.

[0020] Fourthly, embodiments of this application also provide a storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the aspect-level sentiment classification method as described in the first aspect.

[0021] This application provides an aspect-level sentiment classification method, apparatus, server, and storage medium. The method uses a first target graph convolutional network to convolve the embedding vector and syntactic adjacency matrix of a target sentence to obtain a first syntactic feature vector. A first target linear layer then performs hop count classification on the first syntactic feature vector to obtain the target hop count, and updates the syntactic adjacency matrix based on the target hop count. Finally, a second target graph convolutional network is used to convolve with the updated syntactic adjacency matrix. This dynamically aggregates the syntactic information of neighboring words with different hop counts for different sentences, resulting in a second syntactic feature vector. Since the second syntactic feature vector aggregates the syntactic information of neighboring words with different hop counts, sentiment classification using the second target linear layer on the second syntactic feature vector can obtain the accurate sentiment type of the aspect words, greatly improving the accuracy of aspect-level sentiment classification. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating an aspect-level sentiment classification method provided in an embodiment of this application;

[0024] Figure 2 This is a network hierarchy diagram of the target sentiment classification model in the embodiments of this application;

[0025] Figure 3 This is a network hierarchy diagram of the initial sentiment classification model in the embodiments of this application;

[0026] Figure 4 This is another network hierarchy diagram of the target sentiment classification model in the embodiments of this application;

[0027] Figure 5 This is a flowchart illustrating another aspect-level sentiment classification method provided in an embodiment of this application;

[0028] Figure 6 yes Figure 5 A flowchart illustrating a sub-step of the aspect-level sentiment classification method;

[0029] Figure 7 yes Figure 5 A flowchart illustrating another sub-step of the aspect-level sentiment classification method;

[0030] Figure 8 This is a schematic block diagram of an aspect-level emotion classification device provided in an embodiment of this application;

[0031] Figure 9 This is a schematic block diagram of the structure of a server provided in an embodiment of this application.

[0032] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and the accompanying drawings. Detailed Implementation

[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0034] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0035] Current aspect-level sentiment classification methods utilize graph convolutional neural networks (GCNNs) with a fixed number of layers to encode sentences, incorporating attention mechanisms. This helps aspect-level sentiment classification more explicitly focus on contextual information related to aspect words, improving accuracy to some extent. However, because the number of layers in a GCNN is fixed, it can only aggregate neighbor word representations with a fixed number of hops. For example, a two-layer GCNN can only aggregate neighbor word representations within two hops, failing to effectively collect features helpful for sentiment classification, thus compromising the accuracy of aspect-level sentiment classification.

[0036] To address the aforementioned issues, embodiments of this application provide an aspect-level sentiment classification method, apparatus, server, and storage medium. This method uses a first target graph convolutional network to convolve the embedding vector and syntactic adjacency matrix of a target sentence, obtaining a first syntactic feature vector. A first target linear layer then performs hop count classification on the first syntactic feature vector to obtain the target hop count, and updates the syntactic adjacency matrix based on the target hop count. Finally, a second target graph convolutional network is used to convolve with the updated syntactic adjacency matrix, dynamically aggregating the syntactic information of neighboring words with different hop counts for different sentences, resulting in a second syntactic feature vector. Since the second syntactic feature vector aggregates the syntactic information of neighboring words with different hop counts, sentiment classification using the second target linear layer on the second syntactic feature vector can obtain the accurate sentiment type of the aspect words, significantly improving the accuracy of aspect-level sentiment classification.

[0037] This application embodiment can acquire and process relevant data based on artificial intelligence (AI) technology. AI is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. Basic AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operating / interactive systems, and mechatronics. AI software technologies mainly include computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning. The server can be a standalone server or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and AI platforms.

[0038] For example, in customer service quality inspection scenarios in e-commerce, electronic payment, insurance, or online transactions, customer speech text can be collected in advance from the dialogue between customer service representatives and customers. This text can be broken down into multiple sentences, and the aspect words for each sentence can be identified. Then, each sentence and its corresponding aspect words can be associated and stored. When the number of stored sentences reaches a set number, the aspect-level sentiment classification method provided in this application embodiment can be used to perform sentiment classification processing on each pre-stored sentence and its corresponding aspect words to obtain the sentiment type of each pre-stored sentence and its corresponding aspect words. The sentiment type of each pre-stored sentence and its corresponding aspect words can then be output. This allows users to know whether the sentiment type of each sentence and its corresponding aspect words is positive or negative. In this way, users can optimize the customer service process for negative content, reduce customer complaint rates, and improve service quality.

[0039] For example, in the insurance field, customer reviews of insurance products can be obtained in advance, and these reviews can be broken down into multiple sentences. The aspect terms for each sentence can be identified, and then each sentence and its corresponding aspect terms can be associated and stored. When the number of stored sentences reaches a set limit, the aspect-level sentiment classification method provided in this application embodiment can be used to perform sentiment classification processing on each pre-stored sentence and its corresponding aspect terms to obtain the sentiment type of each pre-stored sentence and its corresponding aspect terms. The sentiment type of each pre-stored sentence and its corresponding aspect terms can then be output. This allows insurance companies to know whether a user's evaluation of an insurance product is positive or negative based on the sentiment type of each sentence and its corresponding aspect terms, facilitating timely action by the user.

[0040] For example, in the healthcare industry, patient evaluations of medical staff's services can be collected in advance, and this evaluation information can be broken down into multiple sentences. The aspect terms for each sentence can be identified, and then each sentence and its corresponding aspect terms can be associated and stored. When the number of stored sentences reaches a set limit, the aspect-level sentiment classification method provided in this application embodiment can be used to perform sentiment classification processing on each pre-stored sentence and its corresponding aspect terms to obtain the sentiment type of each pre-stored sentence and its corresponding aspect terms. The sentiment type of each pre-stored sentence and its corresponding aspect terms can then be output. This allows the hospital to understand the negative aspects of the patient's evaluation of the hospital based on the sentiment type of each sentence and its corresponding aspect terms, facilitating timely and appropriate measures to address these issues.

[0041] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0042] Please see Figure 1 , Figure 1 This is a flowchart illustrating an aspect-level sentiment classification method provided in an embodiment of this application.

[0043] like Figure 1 As shown, this aspect-level sentiment classification method includes steps S101 to S106.

[0044] Step S101: When the target sentence and aspect words for sentiment classification are obtained, the target sentiment classification model is invoked. 。

[0045] In this embodiment, the target sentence can be any sentence that requires aspect-level sentiment classification. For example, if an insurance company or bank needs to optimize its customer service process, it needs to perform sentiment classification on the customer's spoken text in the dialogue between customer service and customer. In this case, the customer's spoken text can be split into multiple sentences, and the aspect words of each sentence can be determined. Then, each sentence obtained from the sentence splitting can be determined as the target sentence that needs to be subject to aspect-level sentiment classification.

[0046] In some embodiments, the target sentiment classification model is obtained by pre-training an initial sentiment classification model using a first sample set, and then training the first graph convolutional network and the first linear layer of the pre-trained initial sentiment classification model using reinforcement learning and the third graph convolutional network and the third linear layer using supervised learning using a second sample set. The target sentiment classification model has the same network hierarchy structure as the initial sentiment classification model, but its parameters differ. For example, both the target sentiment classification model and the initial sentiment classification model include an embedding layer, two graph convolutional networks (GCNs), and two linear layers.

[0047] For example, such as Figure 2 As shown, the target sentiment classification model includes an embedding layer 11, a first target graph convolutional network 12, a first target linear layer 13, a second target graph convolutional network 14, and a second target linear layer 15. The embedding layer 11 is connected to the first target graph convolutional network 12 and the second target graph convolutional network 14; the first target graph convolutional network 12 is connected to the first target linear layer 13; the first target linear layer 13 is connected to the second target graph convolutional network 14; and the second target graph convolutional network 14 is connected to the second target linear layer 15. Figure 3As shown, the initial sentiment classification model includes an embedding layer 11, a first graph convolutional network 21, a first linear layer 22, a second graph convolutional network 23, and a second linear layer 24. The first target graph convolutional network 12 and the second target graph convolutional network 14 have the same network layer structure but different parameters. The first target linear layer 13 and the first linear layer 22 have the same network layer structure but different parameters. The second target graph convolutional network 14 and the second graph convolutional network 23 have the same network layer structure but different parameters. The second target linear layer 15 and the second linear layer 24 have the same network layer structure but different parameters.

[0048] Step S102: Encode the target sentence through the embedding layer to obtain the first embedding vector and generate the first syntactic adjacency matrix of the target sentence.

[0049] In this embodiment, the embedding layer may include BiLSTM (Bi-directional Long Short-Term Memory) or BERT (Bidirectional Encoder Representations from Transformers). For example, the target sentence is input into a BiLSTM. The forward LSTM in the BiLSTM determines the forward embedding vector of the target sentence, and the backward LSTM in the BiLSTM determines the backward embedding vector of the target sentence. Then, the forward and backward embedding vectors of the target sentence are concatenated to obtain the first embedding vector of the target sentence. This embodiment encodes the target sentence using BiLSTM or BERT, which can better capture the feature changes in the sequence, handle the variable factors such as emotion and tone in the text well, and also uncover some patterns and characteristics of the text sequence.

[0050] In some embodiments, generating the first syntactic adjacency matrix of the target sentence can be achieved by: performing syntactic parsing on each word in the target sentence using a preset syntactic parsing tool to obtain the syntactic parsing results, and determining the dependencies between each word in the target sentence based on the syntactic parsing results; and generating the first syntactic adjacency matrix of the target sentence based on the dependencies between each word in the target sentence. The first syntactic adjacency matrix is ​​a first-order syntactic adjacency matrix, and the preset syntactic parsing tool can be set based on actual conditions; this embodiment does not specifically limit its use. For example, the syntactic parsing tool could be Stanford CoreNLP (a complete natural language processing tool provided by Stanford University).

[0051] Step S103: Perform convolution processing on the first embedding vector and the first syntactic adjacency matrix through the first target graph convolutional network to obtain the first syntactic feature vector.

[0052] For example, the first embedding vector of the target sentence S can be represented as X∈R N×D N represents the number of words in the target sentence, and D represents the word embedding dimension. The first embedding vector and the first syntactic adjacency matrix are convolved by the first target graph convolutional network to obtain the first syntactic feature vector, which can be described by the following operation process:

[0053]

[0054] Where A is the first syntactic adjacency matrix of the target sentence S, and I is the identity matrix. Add the identity matrix I to the first syntactic adjacency matrix A, and let the nodes form self-loops. σ() can be the activation function ReLU or LeakReLU. for The degree matrix, The purpose is to Normalization is performed to avoid gradient explosion. W1 is the weight parameter of the first target graph convolutional network, b1 is the bias parameter of the first target graph convolutional network, and H1 is the first syntactic feature vector of the target sentence S.

[0055] In some embodiments, such as Figure 4 As shown, the target sentiment classification model also includes a target vector fusion layer 16. The first target graph convolutional network performs convolution processing on the first embedding vector and the first syntactic adjacency matrix to obtain the first syntactic feature vector, which may include: obtaining the second embedding vector of the aspect words of the target sentence from the first embedding vector; fusing the first embedding vector and the second embedding vector through the target vector fusion layer to obtain the target embedding vector; and performing convolution processing on the target embedding vector and the first syntactic adjacency matrix through the first target graph convolutional network to obtain the first syntactic feature vector.

[0056] For example, the first embedding vector and the second embedding vector are fused through a target vector fusion layer to obtain the target embedding vector. The target embedding vector and the first syntactic adjacency matrix are then convolved through a first target graph convolutional network to obtain the first syntactic feature vector. This process can be described as follows:

[0057]

[0058] Where A is the first syntactic adjacency matrix of the target sentence S, and I is the identity matrix. Add the identity matrix I to the first syntactic adjacency matrix A, allowing the nodes to form self-loops. σ() can be the activation function ReLU or LeakReLU. X is the first embedding vector of the target sentence S. aLet X' be the second embedding vector of the aspect words of the target sentence S, and let X' be the fused first embedding vector X of the target sentence S and the second embedding vector X' of the aspect words of the target sentence S. a The target embedding vector is obtained. for The degree matrix, The purpose is to Normalization is performed to avoid gradient explosion. W1 is the weight parameter of the first target graph convolutional network, b1 is the bias parameter of the first target graph convolutional network, W2 and W3 are the weight parameters of the target vector fusion layer, and H1 is the first syntactic feature vector of the target sentence S.

[0059] Step S104: Perform hop count classification on the first syntactic feature vector through the first target linear layer to obtain the target hop count, and update the first syntactic adjacency matrix according to the target hop count.

[0060] For example, the target hop count, obtained by classifying the first syntactic feature vector through the first target linear layer, can be described by the following calculation process: H policy =W4H+b2, where W4 is the weight parameter of the first target linear layer, b2 is the bias parameter of the first target linear layer, H is the first syntactic feature vector of the target sentence S, and H policy For the target number of hops, the first target linear layer can be an MLP (Multilayer Perceptron) layer.

[0061] In some embodiments, the order of the updated first syntactic adjacency matrix is ​​the same as the target hop count. Specifically, the order of the updated first syntactic adjacency matrix is ​​higher than the order of the unupdated first syntactic adjacency matrix. For example, the unupdated first syntactic adjacency matrix A is a first-order syntactic adjacency matrix, and the updated first syntactic adjacency matrix A... adj It is a third-order syntactic adjacency matrix.

[0062] Step S105: Perform convolution processing on the first embedding vector and the updated first syntactic adjacency matrix through the second target graph convolutional network to obtain the second syntactic feature vector.

[0063] For example, the second syntactic feature vector obtained by convolving the first embedding vector and the updated first syntactic adjacency matrix through a second target graph convolutional network can be described by the following operation:

[0064]

[0065] Among them, A adj This is the updated first syntactic adjacency matrix. Add the identity matrix I to the updated first syntactic adjacency matrix A′ to form self-loops between nodes. σ() can be the activation function ReLU or LeakReLU. for The degree matrix, The purpose is to Normalization is performed to avoid gradient explosion. W5 is the weight parameter of the second target graph convolutional network, b3 is the bias parameter of the second target graph convolutional network, and H2 is the second syntactic feature vector of the target sentence S.

[0066] Step S106: Perform sentiment classification on the second syntactic feature vector through the second target linear layer to obtain the sentiment type of the aspect word.

[0067] In this embodiment, the second syntactic feature vector is processed for sentiment classification using a second objective linear layer to obtain the probability of the sentiment type of each aspect word for each preset sentiment type. The preset sentiment type corresponding to the highest probability is then determined as the final sentiment type of the aspect word. For example, the sentiment classification of the second syntactic feature vector using the second objective linear layer to obtain the sentiment type of the aspect word can be described by the following calculation process:

[0068]

[0069] Where MeanPool(H2) represents the average pooling process applied to the second syntactic feature vector H2 to obtain the aspect word embedding vector H that incorporates syntactic information. aspect 'a' indicates the starting index of the aspect term in the target sentence S, and 'l' indicates the starting index of the aspect term in the target sentence S. a The length of the aspect term is indicated by q, which is the q-th character in the target sentence. Let H2 be the syntactic feature vector of the q-th character in the target sentence in the second syntactic feature vector. W6 is the weight parameter of the second target linear layer, and b4 is the bias parameter of the second target linear layer. The second target linear layer can be an MLP (Multilayer Perceptron) layer, and the sentiment type of the aspect words can include positive, negative, or neutral, etc. The sentiment type of the aspect term is the highest probability among the probabilities of each preset sentiment type.

[0070] In some embodiments, such as Figure 5 As shown, before step S101, the following steps are also included:

[0071] Step S107: Obtain the initial sentiment classification model.

[0072] In this embodiment, the initial sentiment classification model includes an embedding layer, a first graph convolutional network, a first linear layer, a second graph convolutional network, and a second linear layer. The embedding layer is connected to the first and second graph convolutional networks; the first graph convolutional network is connected to the first linear layer; the first linear layer is connected to the second graph convolutional network; and the second graph convolutional network is connected to the second linear layer.

[0073] Step S108: Pre-train the second graph convolutional network and the second linear layer based on the first training sample set to obtain the third graph convolutional network and the third linear layer.

[0074] In this embodiment, the first training sample set is pre-generated. The first training sample set includes multiple first training samples, including first sample sentences, first aspect words, syntactic adjacency matrices, and labeled first sentiment types. The syntactic adjacency matrix can be a first-order syntactic adjacency matrix or a multi-order syntactic adjacency matrix; this embodiment does not specifically limit this. The first sentiment type can include positive, negative, or neutral, etc.

[0075] For example, as shown in Table 1, the first training sample set P includes n first training samples, which can be denoted as first training sample P1, first training sample P2, ..., first training sample P... n The first training sample P1 includes the first sample sentence, first aspect words, syntactic adjacency matrix, and first sentiment type as "The newly bought laptop looks great", "Laptop", "A1", and "Positive" respectively. The second training sample P2 includes the first sample sentence, first aspect words, syntactic adjacency matrix, and first sentiment type as "The phone battery drains very quickly", "Battery", "A2", and "Negative" respectively. n The first sample sentence, first aspect words, syntactic adjacency matrix, and first sentiment type included were "This restaurant has good service", "service", "A3", and "positive", respectively.

[0076] Table 1

[0077] First Sample Sentence First aspect Syntactic adjacency matrix First Emotional Type <![CDATA[P1]]> My new laptop looks great. laptop <![CDATA[A1]]> positive <![CDATA[P2]]> The phone battery drains very quickly. Battery <![CDATA[A2]]> negative ... ... ... ... ... <![CDATA[P n ]]> The service at this restaurant was excellent. Serve <![CDATA[A n ]]> positive

[0078] In some embodiments, such as Figure 6 As shown, step S108 includes sub-steps S1081 to S1086.

[0079] Sub-step S1081: Select a first training sample from the first training sample set.

[0080] For example, the first training sample P1, first training sample P2, ..., first training sample P1 can be obtained from the first training sample set P shown in Table 1. nA first training sample is randomly selected from the set of first training samples P, and the first training sample selected each time is different. For example, the first training sample P1, the first training sample P2, ..., the first training sample P3 contained in the first training sample set P. n Select the first training sample P2.

[0081] Sub-step S1082: Encode the first sample sentence in the selected first training sample through the embedding layer to obtain the third embedding vector.

[0082] In this embodiment, the embedding layer may include BiLSTM or BERT. For example, the first sample sentence "the phone battery drains very quickly" from the first training sample P2 is input into a BiLSTM. The forward LSTM in the BiLSTM can determine the forward embedding vector of "the phone battery drains very quickly", and the backward LSTM in the BiLSTM can determine the backward embedding vector of "the phone battery drains very quickly". Then, the forward embedding vector and the backward embedding vector of "the phone battery drains very quickly" are concatenated to obtain the third embedding vector.

[0083] Sub-step S1083: The third embedding vector and the syntactic adjacency matrix are convolved through the second graph convolutional network to obtain the third syntactic feature vector.

[0084] For example, the third syntactic feature vector obtained by convolving the third embedding vector and the syntactic adjacency matrix through the second graph convolutional network can be described by the following operation:

[0085]

[0086] Among them, A i The syntactic adjacency matrix of the first sample sentence in the first selected training sample. Let A be the syntactic adjacency matrix. i Add the identity matrix I to make the nodes form self-loops, and σ() can be the activation function ReLU or LeakReLU. for The degree matrix, The purpose is to Normalization is performed to avoid gradient explosion, X i Let W1′ be the third embedding vector of the first sample sentence in the selected first training sample, and b1′ be the weight parameters of the second graph convolutional network. Let be the third syntactic feature vector of the first sample sentence in the selected first training sample, and let i be the index of the first training sample, taking a value from 1 to n. For example, if the selected first training sample is the first training sample P2, then the above formula can be expressed as:

[0087]

[0088] Sub-step S1084: Perform sentiment classification on the third syntactic feature vector through the second linear layer to obtain the first predicted probability distribution.

[0089] In this embodiment, the first predicted probability distribution is used to describe the probability of the sentiment type of the first aspect word for each preset sentiment type. The preset sentiment type can be positive, negative, or neutral. For example, if the first training sample is selected as the first training sample P2, and the first predicted probability distribution is [0.3, 0.5, 0.2], then the probabilities of the sentiment type of the first aspect word "battery" in the first training sample P2 being positive, negative, or neutral are 0.3, 0.5, and 0.2, respectively.

[0090] Sub-step S1085: Determine the first cross-entropy loss value based on the first predicted probability distribution and the first sentiment type, and update the parameters of the second graph convolutional network and the second linear layer based on the first cross-entropy loss value.

[0091] In this embodiment, based on the first predicted probability distribution and the first sentiment type, the probability that the sentiment type of the first aspect word is the first sentiment type can be determined, and then the cross-entropy loss function is used. Based on the probability that the sentiment type of the first aspect word is the first sentiment type, the first cross-entropy loss value can be calculated. For example, if the first training sample is selected as the first training sample P2, and the first predicted probability distribution is [0.3, 0.5, 0.2], then the probabilities of the sentiment type of the first aspect word "battery" in the first training sample P2 being positive, negative, or neutral are 0.3, 0.5, and 0.2, respectively. The probability that the sentiment type of the first aspect word "battery" in the first training sample P2 is the first sentiment type "negative" is 0.5. Therefore, the first cross-entropy loss value of the first training sample P2 is -1*log(0.5) = 0.3.

[0092] In some embodiments, the parameters of the second graph convolutional network may include the weight parameters W1′ and bias parameters b1′ of the second graph convolutional network, and the parameters of the second linear layer may include the weight parameters W2′ and bias parameters b2′ of the second linear layer. The backpropagation algorithm can be used to update the weight parameters W1′ and bias parameters b1′ of the second graph convolutional network and the weight parameters W2′ and bias parameters b2′ of the second linear layer based on the first cross-entropy loss value. After updating the parameters of the second graph convolutional network and the second linear layer, if there is an unselected first training sample in the first training sample set, the process returns to sub-step S1081, that is, to continue selecting a first training sample from the first training sample set.

[0093] Sub-step S1086: When each of the first training samples in the first training sample set is selected once, the updated second graph convolutional network is used as the third graph convolutional network and the updated second linear layer is used as the third linear layer.

[0094] For example, the first training sample set P includes n first training samples. After each first training sample in the first training sample set P is selected once, the parameters of the second graph convolutional network and the second linear layer are updated n times. At this point, the second graph convolutional network updated n times can be used as the third graph convolutional network, and the second linear layer updated n times can be used as the third linear layer. The weight parameters and bias parameters of the second graph convolutional network updated n times are W... 41 and b 41 That is, the weight parameters and bias parameters of the convolutional network in the third figure are W respectively. 41 and b 41 The weight parameters and bias parameters of the second linear layer after n updates are W, respectively. 51 and b 51 That is, the weight parameters and bias parameters of the third linear layer are W, respectively. 51 and b 51 .

[0095] Step S109: Based on the second training sample set, perform reinforcement learning training on the first graph convolutional network and the first linear layer, and perform supervised learning training on the third graph convolutional network and the third linear layer to obtain the target sentiment classification model.

[0096] In this embodiment, the second training sample set is pre-generated. The second training sample set includes multiple second training samples, including second sample sentences, second aspect words, and labeled second sentiment types. The labeled second sentiment type can be positive, negative, or neutral, etc. Since the second training sample set does not contain label data used to guide the training of the first graph convolutional network and the first linear layer, but does contain label data used to guide the training of the third graph convolutional network and the third linear layer, this embodiment utilizes reinforcement learning to train the first graph convolutional network and the first linear layer. This allows each sentence to dynamically aggregate syntactic neighbor information of different orders, which helps the network better aggregate sentiment information that is helpful for sentiment type judgment, greatly improving the classification accuracy of the sentiment classification model.

[0097] For example, as shown in Table 2, the second training sample set U includes m second training samples, which can be denoted as second training sample U1, second training sample U2, ..., second training sample U... mThe second training sample U1 includes the second sample sentence, second aspect words, and second sentiment type as "the water heater leaked after several months of use", "water heater", and "negative" respectively. The second training sample U2 includes the second sample sentence, second aspect words, and second sentiment type as "the newly bought mobile phone has high performance", "mobile phone", and "positive" respectively. m The second sample sentence, the second aspect word, and the second sentiment type included were "The waiter poured water on my hand and then walked away", "waiter", and "negative".

[0098] Table 2

[0099]

[0100] In some embodiments, such as Figure 7 As shown, step S109 includes sub-steps S10911 to S10922.

[0101] Sub-step S10911: Select a second training sample from the second training sample set.

[0102] For example, the second training sample set U, as shown in Table 2, can contain the second training sample U1, the second training sample U2, ..., the second training sample U... m A second training sample is randomly selected from the given samples, and the selected second training sample is different each time. For example, from the second training sample U1, the second training sample U2, ..., the second training sample U... m Then select the second training sample U1.

[0103] Sub-step S10912: Encode the second sample sentence in the selected second training sample through the embedding layer to obtain the sentence embedding vector and determine the second syntactic adjacency matrix of the second sample sentence.

[0104] In this embodiment, the embedding layer may include BiLSTM or BERT. For example, the second sample sentence "The water heater has been used for several months and is leaking" from the second training sample U1 is input into BiLSTM. The forward LSTM in BiLSTM can determine the forward embedding vector of "The water heater has been used for several months and is leaking", and the backward LSTM in BiLSTM can determine the backward embedding vector of "The water heater has been used for several months and is leaking". Then, the forward embedding vector and the backward embedding vector of "The water heater has been used for several months and is leaking" are concatenated to obtain the sentence embedding vector of the second sample sentence "The water heater has been used for several months and is leaking".

[0105] In some embodiments, determining the second syntactic adjacency matrix of the second sample sentence may include: performing syntactic parsing on each word in the second sample sentence using a preset syntactic parsing tool to obtain the corresponding syntactic parsing result, and determining the dependency relationship between each word in the second sample sentence based on the syntactic parsing result; and generating the second syntactic adjacency matrix of the second sample sentence based on the dependency relationship between each word in the second sample sentence.

[0106] For example, if the selected second training sample is the second training sample U1, the Stanford CoreNLP tool can be used to perform syntactic parsing on each word in the second sample sentence "The water heater has been used for several months and is leaking water" in the second training sample U1, to obtain the syntactic parsing result of the second sample sentence "The water heater has been used for several months and is leaking water". Based on the syntactic parsing result of the second sample sentence "The water heater has been used for several months and is leaking water", the dependencies between each word in the second sample sentence "The water heater has been used for several months and is leaking water" can be determined. Then, based on the dependencies between each word in the second sample sentence "The water heater has been used for several months and is leaking water", the second syntactic adjacency matrix of the second sample sentence "The water heater has been used for several months and is leaking water" can be generated.

[0107] Sub-step S10913: Sample word embedding vectors from sentence embedding vectors according to preset hop count and second syntactic adjacency matrix, and fuse sentence embedding vectors and word embedding vectors to obtain fused embedding vectors.

[0108] In this embodiment, the initial value of the preset hop count is 1. After each predicted hop count is obtained, the preset hop count can be updated to the predicted hop count. For example, if the first predicted hop count is 3, the current value of the preset hop count can be updated from 1 to 3. Or, if the second predicted hop count is 2, the current value of the preset hop count can be updated from 3 to 2.

[0109] In some embodiments, sampling word embedding vectors from sentence embedding vectors based on a preset hop count and a second syntactic adjacency matrix may include: randomly selecting a word from a plurality of words contained in a second training sentence in a selected second training sample as a sampled word; selecting words from the second syntactic adjacency matrix whose hop count with the sampled word is less than or equal to a preset hop count as neighboring words of the sampled word; randomly selecting a neighboring word from a plurality of neighboring words of the sampled word, and sampling word embedding vectors corresponding to the selected neighboring word from the sentence embedding vectors.

[0110] In some embodiments, sentence embedding vectors and word embedding vectors can be fused using a vector fusion layer to obtain a fused embedding vector. For example, the fused embedding vector obtained by fusing sentence embedding vectors and word embedding vectors using a vector fusion layer can be described by the following operation: Xrkj =W 11 X kj +W 12 X sj , where X sj X is the sentence embedding vector of the second sample sentence in the j-th selected second training sample. kj X is the word embedding vector corresponding to the k-th word in the second sample sentence of the j-th selected second training sample. rkj For the fusion of X sj and X kj The resulting fused embedding vector, W 11 and W 12 These are the weight parameters for the vector fusion layer.

[0111] Sub-step S10914: Convolve the fused embedding vector and the second syntactic adjacency matrix through the first graph convolutional network to obtain the fourth syntactic feature vector.

[0112] For example, the fourth syntactic feature vector can be obtained by convolving the fused embedding vector and the second syntactic adjacency matrix through the first graph convolutional network, which can be described by the following operation:

[0113]

[0114] Among them, A j Let the second syntactic adjacency matrix be the second sample sentence in the j-th second training sample. Let A be the second syntactic adjacency matrix. j Add the identity matrix I to make the nodes form self-loops, and σ() can be the activation function ReLU or LeakReLU. for The degree matrix, The purpose is to Normalization is performed to avoid gradient explosion. sj X is the sentence embedding vector of the second sample sentence in the j-th selected second training sample. kj X is the word embedding vector corresponding to the k-th word in the second sample sentence of the j-th selected second training sample. rkj For the fusion of X sj and X kj The resulting fused embedding vector, W is the fourth syntactic feature vector of the second sample sentence in the j-th selected second training sample. 11 and W 12 W represents the weight parameters of the vector fusion layer. 21 Let b be the weight parameters of the convolutional network in the first graph. 21 These are the bias parameters of the convolutional network in the first image.

[0115] Sub-step S10915: Perform hop count classification on the fourth syntactic feature vector through the first linear layer to obtain the predicted hop count.

[0116] For example, the predicted hop count, obtained by classifying the fourth syntactic feature vector through the first linear layer, can be described by the following calculation process: Among them, W 31 b is the weight parameter of the first linear layer. 31 These are the bias parameters for the first linear layer. H is the fourth syntactic feature vector of the second sample sentence in the j-th selected second training sample. pre To predict the number of jumps.

[0117] Sub-step S10916: Update the second syntactic adjacency matrix according to the predicted hop count, and update the preset hop count to the predicted hop count.

[0118] In this embodiment, the initial value of the preset hop count is 1, and the initial second syntactic adjacency matrix is ​​a first-order syntactic adjacency matrix. After each predicted hop count is obtained, the second syntactic adjacency matrix can be updated according to the predicted hop count, and the preset hop count is updated to the predicted hop count. For example, if the first predicted hop count is 3, the first-order second syntactic adjacency matrix can be updated to a third-order second syntactic adjacency matrix, and the current value of the preset hop count can be updated from 1 to 3. As another example, if the second predicted hop count is 2, the third-order second syntactic adjacency matrix can be updated to a second-order second syntactic adjacency matrix, and the current value of the preset hop count can be updated from 3 to 2.

[0119] Sub-step S10917: Store the fused embedding vector, the updated second syntactic adjacency matrix, and the second aspect words and second sentiment types in the selected second training samples as reinforcement learning samples in the preset cache area.

[0120] In this embodiment, a preset cache area is used to cache reinforcement learning samples, and the preset cache area can cache a preset number of reinforcement learning samples. The preset number can be set based on actual conditions, and this embodiment does not impose a specific limitation on it. For example, the preset number can be 30 or 50.

[0121] In some embodiments, when the number of reinforcement learning samples in the preset buffer is less than a preset number, and the number of samplings of the sentence embedding vector is less than a preset number, the process returns to sub-step S10913, that is, to continue sampling word embedding vectors from the sentence embedding vector according to the preset hop count and the second syntactic adjacency matrix, and to fuse the sentence embedding vector and the word embedding vector to obtain a fused embedding vector. When the number of reinforcement learning samples in the preset buffer is less than a preset number, and the number of samplings of the sentence embedding vector reaches a preset number, the process returns to sub-step S10911, that is, to continue selecting a second training sample from the second training sample set. The preset number of samplings can be set based on actual conditions, and this embodiment does not specifically limit this. For example, the preset number of samplings is 4.

[0122] Sub-step S10918: When the number of reinforcement learning samples in the preset buffer reaches the preset number, the fusion embedding vector and the second syntactic adjacency matrix in each reinforcement learning sample are convolved by the third graph convolutional network to obtain multiple fifth syntactic feature vectors.

[0123] For example, if the preset number is 30 and the preset number of reinforcement learning samples in the buffer is 30, then for any reinforcement learning sample among these 30 reinforcement learning samples, the fusion embedding vector and the second syntactic adjacency matrix in the reinforcement learning sample can be convolved by the third graph convolutional network to obtain the corresponding fifth syntactic feature vector, thus obtaining 30 fifth syntactic feature vectors.

[0124] It is understandable that the specific implementation of obtaining the corresponding fifth syntactic feature vector by convolving the fused embedding vector and the second syntactic adjacency matrix in the reinforcement learning sample through the third graph convolutional network can refer to the corresponding process in the aforementioned embodiment, and will not be repeated here. The weight parameters and bias parameters of the third graph convolutional network are W... 41 and b 41 .

[0125] Sub-step S10919: Perform sentiment classification on each fifth syntactic feature vector through the third linear layer to obtain the second predicted probability distribution of each reinforcement learning sample.

[0126] In this embodiment, the second predicted probability distribution is used to describe the probability that the sentiment type of the second aspect word in the reinforcement learning sample is each preset sentiment type. It is understood that the specific implementation of obtaining the second predicted probability distribution for each reinforcement learning sample by performing sentiment classification processing on each fifth syntactic feature vector through the third linear layer can refer to the corresponding process in the aforementioned embodiment, and will not be repeated here. The weight parameters and bias parameters of the third linear layer are W... 51 and b 51 .

[0127] Sub-step S10920: Determine the second cross-entropy loss value and the current learning reward based on the second predicted probability distribution of each reinforcement learning sample and the second sentiment type in each reinforcement learning sample.

[0128] In this embodiment, the reinforcement learning sample includes a fused embedding vector, an updated second syntactic adjacency matrix, second aspect words, and a second sentiment type. The second predicted probability distribution of the reinforcement learning sample describes the probability of the sentiment type of the second aspect words in the reinforcement learning sample for each preset sentiment type, which may include positive, negative, or neutral, etc.

[0129] In some embodiments, determining the second cross-entropy loss value based on the second predicted probability distribution of each reinforcement learning sample and the second sentiment type in each reinforcement learning sample may include: determining the cross-entropy loss value of each reinforcement learning sample based on the second predicted probability distribution of each reinforcement learning sample and the second sentiment type in each reinforcement learning sample; accumulating the cross-entropy loss values ​​of each reinforcement learning sample to obtain an accumulation result, and dividing the accumulation result by a preset number to obtain the second cross-entropy loss value.

[0130] For example, for each reinforcement learning sample, based on the second predicted probability distribution and the corresponding second sentiment type of the reinforcement learning sample, the probability that the sentiment type of the second aspect word in the reinforcement learning sample is the second sentiment type can be determined, and then the cross-entropy loss function can be used. Based on the probability that the sentiment type of the second-aspect word is the second sentiment type, the cross-entropy loss value of the reinforcement learning sample can be calculated.

[0131] For example, the preset buffer stores 30 reinforcement learning samples, denoted as reinforcement learning sample G1, reinforcement learning sample G2, ..., reinforcement learning sample G... 30 Let the second prediction probability distribution of reinforcement learning sample G1 be [0.6, 0.2, 0.2], meaning the probabilities of the sentiment type of the second aspect word in reinforcement learning sample G1 being positive, negative, and neutral are 0.6, 0.2, and 0.2 respectively. Since the second sentiment type in reinforcement learning sample G1 is positive, the probability that the sentiment type of the second aspect word in reinforcement learning sample G1 is positive is 0.6, and the cross-entropy loss value of reinforcement learning sample G1 is -1*log(0.6) = 0.22. Similarly, reinforcement learning samples G2, G3, ..., G... can be obtained. 30The cross-entropy loss value is used to finally combine reinforcement learning samples G1, G2, G3, ..., G... 30 The second cross-entropy loss value is obtained by summing the cross-entropy loss values ​​and then dividing the sum by 30.

[0132] In some embodiments, determining the current learning reward based on the second predicted probability distribution of each reinforcement learning sample and the second sentiment type in each reinforcement learning sample may include: determining the predicted probability that the sentiment type of the second aspect word in each reinforcement learning sample is the second sentiment type based on the second predicted probability distribution of each reinforcement learning sample; determining the reward for each reinforcement learning sample based on the predicted probability that the sentiment type of the second aspect word in each reinforcement learning sample is the second sentiment type and a preset decay coefficient; accumulating the rewards for each reinforcement learning sample to obtain a cumulative reward, and dividing the cumulative reward by a preset number to obtain the current learning reward. The preset decay coefficient can be set according to actual conditions, and this embodiment does not specifically limit it.

[0133] For example, the preset buffer stores 30 reinforcement learning samples, denoted as reinforcement learning sample G1, reinforcement learning sample G2, ..., reinforcement learning sample G... 30 Let the second prediction probability distribution of reinforcement learning sample G1 be [0.6, 0.2, 0.2], meaning the probabilities of the sentiment type of the second aspect word in reinforcement learning sample G1 being positive, negative, and neutral are 0.6, 0.2, and 0.2, respectively. Since the second sentiment type in reinforcement learning sample G1 is positive, the prediction probability of the sentiment type of the second aspect word in reinforcement learning sample G1 being positive is 0.6, according to the second prediction probability distribution [0.6, 0.2, 0.2]. Then, using the formula Reward = (1-α)*alpha (where α is the prediction probability of the sentiment type of the second aspect word in the reinforcement learning sample being the second sentiment type, and alpha is the decay coefficient), the reward for reinforcement learning sample G1 can be obtained as Reward1 = (1-α1)*alpha, where α1 is the prediction probability of the sentiment type of the second aspect word in reinforcement learning sample G1 being positive. Assuming the decay coefficient is 0.6, the reward for reinforcement learning sample G1 is Reward1 = (1-0.6)*0.6 = 0.24. In a similar manner, reinforcement learning samples G2, G3, ..., G can be obtained. 30 The reward will ultimately be the reinforcement learning sample G1, reinforcement learning sample G2, reinforcement learning sample G3, ..., reinforcement learning sample G 30 The rewards are accumulated, and then the accumulated result is divided by 30 to get the current learning reward.

[0134] Sub-step S10921: Update the parameters of the first graph convolutional network and the first linear layer according to the current learning reward, update the parameters of the third graph convolutional network and the third linear layer according to the second cross-entropy loss value, and clear the preset cache.

[0135] In this embodiment, the convergence of the third graph convolutional network and the third linear layer can be determined based on the second cross-entropy loss value. If the third graph convolutional network and the third linear layer have not converged, their parameters can be updated based on the second cross-entropy loss value. Specifically, the backpropagation algorithm can be used to update the parameters of the third graph convolutional network and the third linear layer based on the second cross-entropy loss value. If the second cross-entropy loss value is greater than a preset loss value, the third graph convolutional network and the third linear layer are determined to have not converged; if the second cross-entropy loss value is less than or equal to the preset loss value, the third graph convolutional network and the third linear layer are determined to have converged. The preset loss value can be set based on actual conditions, and this embodiment does not impose specific limitations on it.

[0136] In some embodiments, multiple historical learning rewards and the completion time of each historical learning reward are obtained. A reward change curve is generated based on the multiple historical learning rewards, the completion time of each historical learning reward, the current learning reward, and the current time. The slope of the reward change curve is determined, and if the slope is less than or equal to a preset slope, the first graph convolutional network and the first linear layer are determined to have converged. If the slope is greater than the preset slope, the first graph convolutional network and the first linear layer are determined to have not converged. If the first graph convolutional network and the first linear layer have not converged, the parameters of the first graph convolutional network and the first linear layer are updated based on the current learning reward. The historical learning reward is the learning reward calculated within a preset time period before the current time. The backpropagation gradient algorithm can be used to update the parameters of the first graph convolutional network and the first linear layer based on the current learning reward. The preset slope and preset time period can be set based on actual conditions, and this embodiment does not specifically limit them. For example, if the preset time period is 60 minutes, the learning reward calculated within 60 minutes before the current time can be obtained as the historical learning reward.

[0137] Sub-step S10922: After the first graph convolutional network, the first linear layer, the third graph convolutional network, and the third linear layer converge, the embedding layer, the converged first graph convolutional network, the first linear layer, the third graph convolutional network, and the third linear layer are determined as the target sentiment classification network.

[0138] In this embodiment, after updating the parameters of the first graph convolutional network and the first linear layer, and after updating the parameters of the third graph convolutional network and the third linear layer, the process returns to sub-step S10911, that is, to continue selecting a second training sample from the second training sample set until the first graph convolutional network, the first linear layer, the third graph convolutional network, and the third linear layer converge. After the first graph convolutional network, the first linear layer, the third graph convolutional network, and the third linear layer converge, the embedding layer, the converged first graph convolutional network, the converged first linear layer, the converged third graph convolutional network, and the converged third linear layer are determined as the target sentiment classification network. That is, the first target graph convolutional network in the target sentiment classification network is the converged first graph convolutional network, the first target linear layer is the converged first linear layer, the second target graph convolutional network is the converged third graph convolutional network, and the second target linear layer is the converged third linear layer.

[0139] In some embodiments, when updating the parameters of the first graph convolutional network, the first linear layer, the third graph convolutional network, and the third linear layer, the parameters of the vector fusion layer can also be updated. After the vector fusion layer, the first graph convolutional network, the first linear layer, the third graph convolutional network, and the third linear layer converge, the embedding layer, the converged vector fusion layer, the first graph convolutional network, the first linear layer, the third graph convolutional network, and the third linear layer are determined as the target sentiment classification network.

[0140] Please see Figure 8 , Figure 8 This is a schematic block diagram of an aspect-level emotion classification device provided in an embodiment of this application.

[0141] like Figure 8 As shown, the aspect-level emotion classification device 200 includes:

[0142] The model invocation module 210 is configured to invoke the target sentiment classification model when the target sentence and aspect words that need to be classified for sentiment are obtained. The target sentiment classification model includes an embedding layer, a first target graph convolutional network, a first target linear layer, a second target graph convolutional network, and a second target linear layer.

[0143] The encoding module 220 is configured to encode the target sentence through the embedding layer to obtain a first embedding vector and generate a first syntactic adjacency matrix of the target sentence;

[0144] The first graph convolution module 230 is configured to perform convolution processing on the first embedding vector and the first syntactic adjacency matrix through the first target graph convolution network to obtain the first syntactic feature vector;

[0145] The hop count prediction module 240 is configured to perform hop count classification on the first syntactic feature vector through the first target linear layer to obtain the target hop count, and update the first syntactic adjacency matrix according to the target hop count;

[0146] The second graph convolution module 250 is configured to perform convolution processing on the first embedding vector and the updated first syntactic adjacency matrix through the second target graph convolution network to obtain the second syntactic feature vector.

[0147] The sentiment classification module 260 is configured to perform sentiment classification processing on the second syntactic feature vector through the second target linear layer to obtain the sentiment type of the aspect word.

[0148] In some embodiments, the target sentiment classification model further includes a target vector fusion layer, and the aspect-level sentiment classification device 200 further includes:

[0149] The vector fusion module is configured to obtain the second embedding vector of the aspect word from the first embedding vector, and fuse the first embedding vector and the second embedding vector through the target vector fusion layer to obtain the target embedding vector;

[0150] The first graph convolution module 230 is further configured to perform convolution processing on the target embedding vector and the first syntactic adjacency matrix through the first target graph convolution network to obtain the first syntactic feature vector.

[0151] In some embodiments, the aspect-level emotion classification device 200 further includes:

[0152] The acquisition module is configured to acquire an initial sentiment classification model, which includes an embedding layer, a first graph convolutional network, a first linear layer, a second graph convolutional network, and a second linear layer.

[0153] The pre-training module is configured to pre-train the second graph convolutional network and the second linear layer based on the first training sample set to obtain the third graph convolutional network and the third linear layer. The first training sample set includes multiple first training samples, including first sample sentences, first aspect words, syntactic adjacency matrices, and labeled first sentiment types.

[0154] The reinforcement and supervised learning module is configured to perform reinforcement learning training on the first graph convolutional network and the first linear layer and supervised learning training on the third graph convolutional network and the third linear layer based on the second training sample set, to obtain a target sentiment classification model. The second training sample set includes multiple second training samples, including second sample sentences, second aspect words, and labeled second sentiment types.

[0155] In some embodiments, the pre-training module is further configured to:

[0156] Select a first training sample from the first training sample set;

[0157] The first sample sentence in the selected first training sample is encoded through the embedding layer to obtain the third embedding vector;

[0158] The third embedding vector and the syntactic adjacency matrix are convolved by the second graph convolutional network to obtain the third syntactic feature vector.

[0159] The third syntactic feature vector is processed by the second linear layer to perform sentiment classification, and a first prediction probability distribution is obtained. The first prediction probability distribution is used to describe the probability of the sentiment type of the first aspect word for each preset sentiment type.

[0160] Based on the first predicted probability distribution and the first sentiment type, a first cross-entropy loss value is determined, and the parameters of the second graph convolutional network and the second linear layer are updated based on the first cross-entropy loss value.

[0161] If there is an unselected first training sample in the first training sample set, return to the step of selecting a first training sample from the first training sample set;

[0162] When each of the first training samples in the first training sample set is selected once, the updated second graph convolutional network is used as the third graph convolutional network and the updated second linear layer is used as the third linear layer.

[0163] In some embodiments, the reinforcement and supervised learning module is further configured to:

[0164] Select a second training sample from the second training sample set;

[0165] The embedding layer encodes the second sample sentence in the selected second training sample to obtain the sentence embedding vector and determines the second syntactic adjacency matrix of the second sample sentence.

[0166] Based on the preset number of hops and the second syntactic adjacency matrix, word embedding vectors are sampled from the sentence embedding vectors, and the sentence embedding vectors and word embedding vectors are fused to obtain a fused embedding vector.

[0167] The first graph convolutional network is used to convolve the fused embedding vector and the second syntactic adjacency matrix to obtain the fourth syntactic feature vector;

[0168] The fourth syntactic feature vector is processed by the first linear layer to classify the number of hops, and the predicted number of hops is obtained.

[0169] The second syntactic adjacency matrix is ​​updated based on the predicted hop count, and the preset hop count is updated to the predicted hop count;

[0170] The fused embedding vector, the updated second syntactic adjacency matrix, and the second aspect words and second sentiment types from the selected second training samples are stored as reinforcement learning samples in a preset cache.

[0171] When the number of reinforcement learning samples in the preset buffer is less than a preset number, and the number of samplings of the sentence embedding vector is less than a preset number, return to the step of sampling word embedding vectors from the sentence embedding vectors according to the preset number of hops and the second syntactic adjacency matrix, and fusing the sentence embedding vectors and the word embedding vectors to obtain the fused embedding vectors;

[0172] When the number of reinforcement learning samples in the preset buffer is less than the preset number, and the number of samplings of the sentence embedding vector reaches the preset number, return to the step of selecting a second training sample from the second training sample set;

[0173] When the number of reinforcement learning samples in the preset buffer reaches the preset number, the third graph convolutional network is used to perform convolution processing on the fusion embedding vector and the second syntactic adjacency matrix of each reinforcement learning sample to obtain multiple fifth syntactic feature vectors.

[0174] The third linear layer performs sentiment classification on each of the fifth syntactic feature vectors to obtain the second prediction probability distribution of each reinforcement learning sample. The second prediction probability distribution is used to describe the probability of the sentiment type of the second aspect word in the reinforcement learning sample being each preset sentiment type.

[0175] The second cross-entropy loss value and the current learning reward are determined based on the second predicted probability distribution of each reinforcement learning sample and the second sentiment type in each reinforcement learning sample.

[0176] The parameters of the first graph convolutional network and the first linear layer are updated according to the current learning reward. The parameters of the third graph convolutional network and the third linear layer are updated according to the second cross-entropy loss value. The preset cache is then cleared.

[0177] Return to the step of selecting a second training sample from the second training sample set, until the first graph convolutional network, the first linear layer, the third graph convolutional network, and the third linear layer converge.

[0178] In some embodiments, the reinforcement and supervised learning module is further configured to:

[0179] The cross-entropy loss value of each reinforcement learning sample is determined based on the second predicted probability distribution of each reinforcement learning sample and the second sentiment type in each reinforcement learning sample.

[0180] The cross-entropy loss value of each reinforcement learning sample is accumulated to obtain the accumulated result, and the accumulated result is divided by the preset number to obtain the second cross-entropy loss value.

[0181] In some embodiments, the reinforcement and supervised learning module is further configured to:

[0182] Based on the second prediction probability distribution of each reinforcement learning sample, the sentiment type of the second aspect word in each reinforcement learning sample is determined as the prediction probability of the second sentiment type;

[0183] The reward for each reinforcement learning sample is determined based on the predicted probability that the sentiment type of the second aspect word in each reinforcement learning sample is the second sentiment type and the preset decay coefficient.

[0184] The rewards for each reinforcement learning sample are accumulated to obtain a cumulative reward, and the cumulative reward is divided by the preset number to obtain the current learning reward.

[0185] It should be noted that those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the device and each module and unit described above can be referred to the corresponding processes in the aforementioned aspect-level emotion classification method embodiments, and will not be repeated here.

[0186] The apparatus provided in the above embodiments can be implemented as a computer program, which can be used in, for example... Figure 9 It is running on the server shown.

[0187] Please see Figure 9 , Figure 9 This is a schematic block diagram of the structure of a server provided in an embodiment of this application.

[0188] like Figure 9 As shown, the server includes a processor, memory, and network interface connected via a system bus, wherein the memory may include storage media and internal memory.

[0189] The storage medium may store the operating system and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any aspect-level sentiment classification method.

[0190] The processor provides computing and control capabilities to support the operation of the entire server.

[0191] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the solution of this application and does not constitute a limitation on the server to which the solution of this application is applied. A specific server may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0192] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.

[0193] In one embodiment, the processor is used to run a computer program stored in memory to perform the following steps:

[0194] When the target sentence and aspect words that need to be classified for sentiment are obtained, the target sentiment classification model is invoked. The target sentiment classification model includes an embedding layer, a first target graph convolutional network, a first target linear layer, a second target graph convolutional network, and a second target linear layer.

[0195] The target sentence is encoded through the embedding layer to obtain a first embedding vector, and a first syntactic adjacency matrix of the target sentence is generated.

[0196] The first embedding vector and the first syntactic adjacency matrix are convolved by the first target graph convolutional network to obtain the first syntactic feature vector.

[0197] The first syntactic feature vector is classified by hop count through the first target linear layer to obtain the target hop count, and the first syntactic adjacency matrix is ​​updated according to the target hop count.

[0198] The second target graph convolutional network is used to convolve the first embedding vector and the updated first syntactic adjacency matrix to obtain the second syntactic feature vector.

[0199] The sentiment type of the aspect word is obtained by performing sentiment classification on the second syntactic feature vector through the second target linear layer.

[0200] In some embodiments, the target sentiment classification model further includes a target vector fusion layer, wherein the processor, when performing convolution processing on the first embedding vector and the first syntactic adjacency matrix through the first target graph convolutional network to obtain the first syntactic feature vector, is used to implement:

[0201] Obtain the second embedding vector of the aspect word from the first embedding vector;

[0202] The first embedding vector and the second embedding vector are fused through the target vector fusion layer to obtain the target embedding vector;

[0203] The first target graph convolutional network is used to convolve the target embedding vector and the first syntactic adjacency matrix to obtain the first syntactic feature vector.

[0204] In some embodiments, before the processor invokes the target sentiment classification model upon obtaining the target sentence and aspect words requiring sentiment classification, it is further configured to:

[0205] Obtain an initial sentiment classification model, which includes an embedding layer, a first graph convolutional network, a first linear layer, a second graph convolutional network, and a second linear layer;

[0206] The second graph convolutional network and the second linear layer are pre-trained based on the first training sample set to obtain the third graph convolutional network and the third linear layer. The first training sample set includes multiple first training samples, including first sample sentences, first aspect words, syntactic adjacency matrices, and labeled first sentiment types.

[0207] The first graph convolutional network and the first linear layer are trained using reinforcement learning based on the second training sample set, and the third graph convolutional network and the third linear layer are trained using supervised learning to obtain the target sentiment classification model. The second training sample set contains multiple second training samples, including second sample sentences, second aspect words, and labeled second sentiment types.

[0208] In some embodiments, when the processor performs pre-training on the second graph convolutional network and the second linear layer based on the first training sample set to obtain the third graph convolutional network and the third linear layer, it is configured to:

[0209] Select a first training sample from the first training sample set;

[0210] The first sample sentence in the selected first training sample is encoded through the embedding layer to obtain the third embedding vector;

[0211] The third embedding vector and the syntactic adjacency matrix are convolved by the second graph convolutional network to obtain the third syntactic feature vector.

[0212] The third syntactic feature vector is processed by the second linear layer to perform sentiment classification, and a first prediction probability distribution is obtained. The first prediction probability distribution is used to describe the probability of the sentiment type of the first aspect word for each preset sentiment type.

[0213] Based on the first predicted probability distribution and the first sentiment type, a first cross-entropy loss value is determined, and the parameters of the second graph convolutional network and the second linear layer are updated based on the first cross-entropy loss value.

[0214] If there is an unselected first training sample in the first training sample set, return to the step of selecting a first training sample from the first training sample set;

[0215] When each of the first training samples in the first training sample set is selected once, the updated second graph convolutional network is used as the third graph convolutional network and the updated second linear layer is used as the third linear layer.

[0216] In some embodiments, when the processor performs reinforcement learning training on the first graph convolutional network and the first linear layer based on a second training sample set, and supervised learning training on the third graph convolutional network and the third linear layer, it is configured to:

[0217] Select a second training sample from the second training sample set;

[0218] The embedding layer encodes the second sample sentence in the selected second training sample to obtain the sentence embedding vector and determines the second syntactic adjacency matrix of the second sample sentence.

[0219] Based on the preset number of hops and the second syntactic adjacency matrix, word embedding vectors are sampled from the sentence embedding vectors, and the sentence embedding vectors and word embedding vectors are fused to obtain a fused embedding vector.

[0220] The first graph convolutional network is used to convolve the fused embedding vector and the second syntactic adjacency matrix to obtain the fourth syntactic feature vector;

[0221] The fourth syntactic feature vector is processed by the first linear layer to classify the number of hops, and the predicted number of hops is obtained.

[0222] The second syntactic adjacency matrix is ​​updated based on the predicted hop count, and the preset hop count is updated to the predicted hop count;

[0223] The fused embedding vector, the updated second syntactic adjacency matrix, and the second aspect words and second sentiment types from the selected second training samples are stored as reinforcement learning samples in a preset cache.

[0224] When the number of reinforcement learning samples in the preset buffer is less than a preset number, and the number of samplings of the sentence embedding vector is less than a preset number, return to the step of sampling word embedding vectors from the sentence embedding vectors according to the preset number of hops and the second syntactic adjacency matrix, and fusing the sentence embedding vectors and the word embedding vectors to obtain the fused embedding vectors;

[0225] When the number of reinforcement learning samples in the preset buffer is less than the preset number, and the number of samplings of the sentence embedding vector reaches the preset number, return to the step of selecting a second training sample from the second training sample set;

[0226] When the number of reinforcement learning samples in the preset buffer reaches the preset number, the third graph convolutional network is used to perform convolution processing on the fusion embedding vector and the second syntactic adjacency matrix of each reinforcement learning sample to obtain multiple fifth syntactic feature vectors.

[0227] The third linear layer performs sentiment classification on each of the fifth syntactic feature vectors to obtain the second prediction probability distribution of each reinforcement learning sample. The second prediction probability distribution is used to describe the probability of the sentiment type of the second aspect word in the reinforcement learning sample being each preset sentiment type.

[0228] The second cross-entropy loss value and the current learning reward are determined based on the second predicted probability distribution of each reinforcement learning sample and the second sentiment type in each reinforcement learning sample.

[0229] The parameters of the first graph convolutional network and the first linear layer are updated according to the current learning reward. The parameters of the third graph convolutional network and the third linear layer are updated according to the second cross-entropy loss value. The preset cache is then cleared.

[0230] Return to the step of selecting a second training sample from the second training sample set, until the first graph convolutional network, the first linear layer, the third graph convolutional network, and the third linear layer converge.

[0231] In some embodiments, the processor, when determining the second cross-entropy loss value based on the second predicted probability distribution of each reinforcement learning sample and the second sentiment type in each reinforcement learning sample, is configured to:

[0232] The cross-entropy loss value of each reinforcement learning sample is determined based on the second predicted probability distribution of each reinforcement learning sample and the second sentiment type in each reinforcement learning sample.

[0233] The cross-entropy loss value of each reinforcement learning sample is accumulated to obtain the accumulated result, and the accumulated result is divided by the preset number to obtain the second cross-entropy loss value.

[0234] In some embodiments, the processor, when determining the current learning reward based on a second predicted probability distribution for each reinforcement learning sample and a second sentiment type in each reinforcement learning sample, is configured to:

[0235] Based on the second prediction probability distribution of each reinforcement learning sample, the sentiment type of the second aspect word in each reinforcement learning sample is determined as the prediction probability of the second sentiment type;

[0236] The reward for each reinforcement learning sample is determined based on the predicted probability that the sentiment type of the second aspect word in each reinforcement learning sample is the second sentiment type and the preset decay coefficient.

[0237] The rewards for each reinforcement learning sample are accumulated to obtain a cumulative reward, and the cumulative reward is divided by the preset number to obtain the current learning reward.

[0238] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the server described above can be referred to the corresponding process in the aforementioned aspect-level sentiment classification method embodiment, and will not be repeated here.

[0239] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a server (which may be a personal computer, a server, or a network server, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0240] This application also provides a storage medium storing a computer program, the computer program including program instructions, and the method implemented when the program instructions are executed can be found in various embodiments of the aspect-level sentiment classification method of this application.

[0241] The storage medium can be volatile or non-volatile. It can be an internal storage unit of the server as described in the foregoing embodiments, such as the server's hard drive or memory. Alternatively, it can be an external storage server, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card.

[0242] Furthermore, the storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store the operating system, applications required for at least one function, etc.; and the data storage area may store data created based on the use of blockchain nodes, etc.

[0243] The blockchain referred to in this application is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0244] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0245] It should also be understood that the term "and / or" as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. It should be noted that, herein, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0246] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. The above descriptions are merely specific implementations of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An aspect-level sentiment classification method, characterized in that, include: When the target sentence and aspect words that need to be classified for sentiment are obtained, the target sentiment classification model is invoked. The target sentiment classification model includes an embedding layer, a target vector fusion layer, a first target graph convolutional network, a first target linear layer, a second target graph convolutional network, and a second target linear layer. The target sentence is encoded through the embedding layer to obtain a first embedding vector. The words in the target sentence are parsed syntactically using a preset syntactic parsing tool to obtain syntactic parsing results. Based on the syntactic parsing results, the dependencies between the words in the target sentence are determined. Based on the dependencies between the words in the target sentence, the first syntactic adjacency matrix of the target sentence is generated. The second embedding vector of the aspect word is obtained from the first embedding vector. The first embedding vector and the second embedding vector are fused through the target vector fusion layer to obtain the target embedding vector. The target embedding vector and the first syntactic adjacency matrix are convolved through the first target graph convolutional network to obtain the first syntactic feature vector. The first syntactic feature vector is classified by hop count through the first target linear layer to obtain the target hop count. The first syntactic adjacency matrix is ​​updated according to the target hop count. The order of the updated first syntactic adjacency matrix is ​​the same as the target hop count, and the order of the updated first syntactic adjacency matrix is ​​higher than the order of the first syntactic adjacency matrix before the update. The second target graph convolutional network is used to convolve the first embedding vector and the updated first syntactic adjacency matrix to obtain the second syntactic feature vector. The sentiment type of the aspect word is obtained by performing sentiment classification on the second syntactic feature vector through the second target linear layer.

2. The aspect-level sentiment classification method according to claim 1, characterized in that, The process of obtaining the target sentence and aspect words for sentiment classification, before calling the target sentiment classification model, also includes: Obtain an initial sentiment classification model, which includes an embedding layer, a first graph convolutional network, a first linear layer, a second graph convolutional network, and a second linear layer; The second graph convolutional network and the second linear layer are pre-trained based on the first training sample set to obtain the third graph convolutional network and the third linear layer. The first training sample set includes multiple first training samples, including first sample sentences, first aspect words, syntactic adjacency matrices, and labeled first sentiment types. The first graph convolutional network and the first linear layer are trained using reinforcement learning based on the second training sample set, and the third graph convolutional network and the third linear layer are trained using supervised learning to obtain the target sentiment classification model. The second training sample set contains multiple second training samples, including second sample sentences, second aspect words, and labeled second sentiment types.

3. The aspect-level sentiment classification method according to claim 2, characterized in that, The pre-training of the second graph convolutional network and the second linear layer based on the first training sample set includes: Select a first training sample from the first training sample set; The first sample sentence in the selected first training sample is encoded through the embedding layer to obtain the third embedding vector; The third embedding vector and the syntactic adjacency matrix are convolved by the second graph convolutional network to obtain the third syntactic feature vector. The third syntactic feature vector is processed by the second linear layer to perform sentiment classification, and a first prediction probability distribution is obtained. The first prediction probability distribution is used to describe the probability of the sentiment type of the first aspect word for each preset sentiment type. Based on the first predicted probability distribution and the first sentiment type, a first cross-entropy loss value is determined, and the parameters of the second graph convolutional network and the second linear layer are updated based on the first cross-entropy loss value. If there is an unselected first training sample in the first training sample set, return to the step of selecting a first training sample from the first training sample set; When each of the first training samples in the first training sample set is selected once, the updated second graph convolutional network is used as the third graph convolutional network and the updated second linear layer is used as the third linear layer.

4. The aspect-level sentiment classification method according to claim 2, characterized in that, The step of performing reinforcement learning training on the first graph convolutional network and the first linear layer based on the second training sample set, and performing supervised learning training on the third graph convolutional network and the third linear layer, includes: Select a second training sample from the second training sample set; The embedding layer encodes the second sample sentence in the selected second training sample to obtain the sentence embedding vector and determines the second syntactic adjacency matrix of the second sample sentence. Based on the preset number of hops and the second syntactic adjacency matrix, word embedding vectors are sampled from the sentence embedding vectors, and the sentence embedding vectors and word embedding vectors are fused to obtain a fused embedding vector. The first graph convolutional network is used to convolve the fused embedding vector and the second syntactic adjacency matrix to obtain the fourth syntactic feature vector; The fourth syntactic feature vector is processed by the first linear layer to classify the number of hops, and the predicted number of hops is obtained. The second syntactic adjacency matrix is ​​updated based on the predicted hop count, and the preset hop count is updated to the predicted hop count; The fused embedding vector, the updated second syntactic adjacency matrix, and the second aspect words and second sentiment types from the selected second training samples are stored as reinforcement learning samples in a preset cache. When the number of reinforcement learning samples in the preset buffer is less than a preset number, and the number of samplings of the sentence embedding vector is less than a preset number, return to the step of sampling word embedding vectors from the sentence embedding vectors according to the preset number of hops and the second syntactic adjacency matrix, and fusing the sentence embedding vectors and the word embedding vectors to obtain the fused embedding vectors; When the number of reinforcement learning samples in the preset buffer is less than the preset number, and the number of samplings of the sentence embedding vector reaches the preset number, return to the step of selecting a second training sample from the second training sample set; When the number of reinforcement learning samples in the preset buffer reaches the preset number, the third graph convolutional network is used to perform convolution processing on the fusion embedding vector and the second syntactic adjacency matrix of each reinforcement learning sample to obtain multiple fifth syntactic feature vectors. The third linear layer performs sentiment classification on each of the fifth syntactic feature vectors to obtain the second prediction probability distribution of each reinforcement learning sample. The second prediction probability distribution is used to describe the probability of the sentiment type of the second aspect word in the reinforcement learning sample being each preset sentiment type. The second cross-entropy loss value and the current learning reward are determined based on the second predicted probability distribution of each reinforcement learning sample and the second sentiment type in each reinforcement learning sample. The parameters of the first graph convolutional network and the first linear layer are updated according to the current learning reward. The parameters of the third graph convolutional network and the third linear layer are updated according to the second cross-entropy loss value. The preset cache is then cleared. Return to the step of selecting a second training sample from the second training sample set, until the first graph convolutional network, the first linear layer, the third graph convolutional network, and the third linear layer converge.

5. The aspect-level sentiment classification method according to claim 4, characterized in that, The step of determining the second cross-entropy loss value based on the second predicted probability distribution of each reinforcement learning sample and the second sentiment type in each reinforcement learning sample includes: The cross-entropy loss value of each reinforcement learning sample is determined based on the second predicted probability distribution of each reinforcement learning sample and the second sentiment type in each reinforcement learning sample. The cross-entropy loss value of each reinforcement learning sample is accumulated to obtain the accumulated result, and the accumulated result is divided by the preset number to obtain the second cross-entropy loss value.

6. The aspect-level sentiment classification method according to claim 4, characterized in that, The current learning reward is determined based on the second predicted probability distribution of each reinforcement learning sample and the second sentiment type in each reinforcement learning sample, including: Based on the second prediction probability distribution of each reinforcement learning sample, the sentiment type of the second aspect word in each reinforcement learning sample is determined as the prediction probability of the second sentiment type; The reward for each reinforcement learning sample is determined based on the predicted probability that the sentiment type of the second aspect word in each reinforcement learning sample is the second sentiment type and the preset decay coefficient. The rewards for each reinforcement learning sample are accumulated to obtain a cumulative reward, and the cumulative reward is divided by the preset number to obtain the current learning reward.

7. An aspect-level emotion classification device, characterized in that, The aspect-level emotion classification device includes: The model invocation module is configured to invoke the target sentiment classification model when the target sentence and aspect words for sentiment classification are obtained. The target sentiment classification model includes an embedding layer, a target vector fusion layer, a first target graph convolutional network, a first target linear layer, a second target graph convolutional network, and a second target linear layer. The encoding module is configured to encode the target sentence through the embedding layer to obtain a first embedding vector, perform syntactic parsing on each word in the target sentence based on a preset syntactic parsing tool to obtain syntactic parsing results, determine the dependency relationships between each word in the target sentence based on the syntactic parsing results, and generate a first syntactic adjacency matrix of the target sentence based on the dependency relationships between each word in the target sentence. The first graph convolution module is configured to obtain the second embedding vector of the aspect word from the first embedding vector, fuse the first embedding vector and the second embedding vector through the target vector fusion layer to obtain the target embedding vector, and convolve the target embedding vector and the first syntactic adjacency matrix through the first target graph convolution network to obtain the first syntactic feature vector. The hop count prediction module is configured to perform hop count classification on the first syntactic feature vector through the first target linear layer to obtain the target hop count, and update the first syntactic adjacency matrix according to the target hop count. The order of the updated first syntactic adjacency matrix is ​​the same as the target hop count, and the order of the updated first syntactic adjacency matrix is ​​higher than the order of the first syntactic adjacency matrix before the update. The second graph convolution module is configured to perform convolution processing on the first embedding vector and the updated first syntactic adjacency matrix through the second target graph convolution network to obtain the second syntactic feature vector. The sentiment classification module is configured to perform sentiment classification processing on the second syntactic feature vector through the second target linear layer to obtain the sentiment type of the aspect word.

8. A server, characterized in that, The server includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the aspect-level sentiment classification method as described in any one of claims 1 to 6.

9. A storage medium for computer-readable storage, characterized in that, The storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the aspect-level sentiment classification method as described in any one of claims 1 to 6.