A method and device for aspect-level sentiment analysis based on transfer learning
By adopting a multi-step strategy based on transfer learning in aspect-level sentiment analysis, and using the RoBERTa model for self-supervised mask prediction and transfer learning for document-level sentiment analysis, the low resource problem caused by insufficient annotation data in the existing technology is solved. , improving the accuracy and generalization performance of the sentiment analysis model.
Patent Information
- Application Number
- CN202210302985.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-03-24
AI Technical Summary
Due to the lack of high-quality label data in aspect-level sentiment analysis in the existing technology, the generalization error of the deep learning model is large, making it difficult to improve the accuracy of sentiment polarity judgment, and it is difficult for traditional machine learning methods to introduce external domain knowledge to improve model performance.
Using a method based on transfer learning, the RoBERTa model is built for self-supervised mask prediction task training, and multi-step transfer learning is performed based on document-level sentiment analysis data to reduce dependence on target data and improve the generalization performance of the model and the context of emotional texts. Comprehension.
It effectively improves the low resources caused by the small amount of annotated data due to the highly domain-specific target tasks, and improves the accuracy and generalization performance of the aspect-level sentiment analysis model.
Smart Images

Figure CN114912423B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of natural language technology, and in particular relates to an aspect-level sentiment analysis method and device based on transfer learning. Background Art
[0002] Natural Language Processing (NLP) is an artificial intelligence technology that was created to enable computers to understand and process human language in the real world. It is an interdisciplinary subject between linguistics and computer science. Sentiment analysis is a task in NLP that has a wide range of applications, is closely related to reality, and is challenging. Aspect-level sentiment analysis can identify the sentiment polarity corresponding to specific attributes in sample data, such as the review text "This restaurant has a beautiful environment, but the service is terrible." More specific sentiment polarity discrimination is proposed for the two terms of environment and service. In recent years, researchers have increasingly used fine-grained text sentiment classification methods to make decisions based on review data from social networks and e-commerce platforms. Aspect-level sentiment text classification based on target entities and contextual review text is a fine-grained sentiment analysis task that requires a lot of relevant domain knowledge and expert-level annotation work when annotating data sets. Due to the lack of high-quality labeled data, the generalization error of the deep learning model trained in the fine-grained text classification task is large, which limits the accuracy of the model in the test set sentiment polarity judgment.
[0003] Sentiment analysis methods based on traditional machine learning, such as K-nearest neighbor algorithm, naive Bayes and support vector, can achieve text classification, but the work of traditional machine learning methods focuses on feature engineering, and it is difficult to improve model performance by introducing external domain knowledge. Deep learning models such as recurrent neural networks (RNNs) and convolutional neural networks extract semantic knowledge from text sequences, which can capture deep semantic information of evaluation entities and contexts, and effectively improve the accuracy of text sentiment classification. When building a deep learning neural network model, due to memory consumption and gradient decay problems, the model cannot gain more benefits by deepening the structure.
[0004] The Transformer model released by Google only uses the self-attention mechanism, which gets rid of the sequence dependency of the basic neural network when processing NLP tasks, and provides the most basic technical support for the bidirectional encoder model BERT. Facebook AI follows the neural network structure of the BERT model, adjusts the hyperparameters and the size of the training set, removes the pre-training subtask of the next sentence prediction, and proposes a more robust bidirectional encoder model RoBERTa model. The application of transfer learning in NLP research is mainly reflected in domain adaptation, especially in text classification tasks such as aspect-level sentiment analysis, which has little training data and high annotation costs. Based on the idea of transfer learning, the auxiliary module datasets other than aspect-level sentiment analysis are regarded as the source domain. When training text sentiment classification tasks, external knowledge obtained in related tasks can be used to help the model achieve the target task. Summary of the invention
[0005] In order to solve the above-mentioned defects, the present invention proposes an aspect-level sentiment analysis method and device based on transfer learning.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0007] A transfer learning-based aspect-level sentiment analysis method, including:
[0008] Obtaining and preprocessing an aspect-level sentiment analysis dataset, removing sentiment polarity labels, and obtaining a first sample sequence containing aspect-level evaluation entities and contexts as unlabeled data;
[0009] Build a RoBERTa model and use unlabeled data to train the RoBERTa model for mask prediction tasks to obtain a RoBERTa model that completes the training tasks at this stage;
[0010] Obtain document-level sentiment datasets in the same scenario as aspect-level sentiment analysis;
[0011] For the RoBERTa model that has completed the self-supervised mask prediction training task, train this model on the document-level sentiment analysis task;
[0012] Obtain the aspect-level sentiment analysis dataset again, and construct sentence pairs that integrate the review text information and aspect information as the second sample sequence;
[0013] The second sample sequence is input into the RoBERTa model that has completed the document-level sentiment analysis task, and aspect-level sentiment analysis is performed to output the sentiment category label.
[0014] A further improvement of the method is that each comment text in the first sample sequence is converted into a table format.
[0015] A further improvement of this method is that the mask prediction task training RoBERTa model includes:
[0016] Get the comment text sequence {w1,w2,.....w n-1 ,w n Perform random masking with a probability of 15% to obtain the mask flag; build a RoBERTa model, perform the pre-training task of mask prediction to train the RoBERTa model, and obtain the trained RoBERTa model.
[0017] A further improvement of the method is that the acquisition of a document-level sentiment data set in the same scenario as the aspect-level sentiment analysis includes: acquiring a document-level sentiment analysis data set, dividing sentiment polarity categories according to the score intervals corresponding to the comments, filtering out samples with empty labels and garbled comment text, and obtaining a document-level sentiment analysis data set in the same scenario after data processing.
[0018] A further improvement of the method is that: the RoBERTa model that completes the self-supervised mask prediction training task is trained for the document-level sentiment analysis task, including: capturing the structural knowledge and semantic information of different levels of the comment text in the document-level sentiment analysis data through the language model of the Transformer encoder, and setting a hierarchical learning rate in the process of training the RoBERTa model using the document-level sentiment analysis task to optimize the model parameters.
[0019] A further improvement of this method is that: the second sample sequence is input into the RoBERTa model that has completed the document-level sentiment analysis task, and aspect-level sentiment analysis is performed, and the output sentiment category label includes:
[0020] The second sample sequence input process includes fusing the semantic information and aspect information of the review text in the form of sentence pairs as the sample sequence of the input RoBERTa model. The formula is as follows:
[0021] input={ <s>in1, in2,..., in n-1 ,In n ,< / s> t1,t2,...t m}
[0022] In the formula, <s>is the classification flag, {w1,w2,.....w n-1 ,w n } is the comment text sequence,< / s> is a separator, {t1,t2,.....,t m} is the aspect word sequence;
[0023] A Softmax classifier is connected to the classification flag to determine the sentiment polarity corresponding to the aspect-level evaluation object. The cross entropy function is used to calculate the difference between the learning model distribution and the training distribution to obtain the final aspect-level sentiment analysis model. The sample sequence is input into this model for sentiment polarity prediction and the sentiment category label is output.
[0024] An aspect-level sentiment analysis device based on transfer learning, comprising:
[0025] A data acquisition module is used to acquire and preprocess the aspect-level sentiment analysis data set, remove the sentiment polarity label, and obtain a first sample sequence containing aspect-level evaluation entities and context as unlabeled data;
[0026] RoBERTa module, used to build the RoBERTa model, use unlabeled data to do mask prediction task to train the RoBERTa model, and obtain the RoBERTa model that completes the training task of this stage;
[0027] The training module is used to obtain the document-level sentiment dataset in the same scenario as the aspect-level sentiment analysis, and train the RoBERTa model that has completed the self-supervised mask prediction training task on the document-level sentiment analysis task;
[0028] The output module is used to obtain the aspect-level sentiment analysis dataset again, construct sentence pairs that integrate the comment text information and aspect information as the second sample sequence, input the second sample sequence into the RoBERTa model that has completed the document-level sentiment analysis task, perform aspect-level sentiment analysis, and output the sentiment category label.
[0029] Due to the adoption of the above technical solution, the technical progress achieved by the present invention is as follows: the present invention combines the model RoBERTa, investigates relevant open source data sets, and designs a sentiment analysis strategy based on multi-step transfer learning. The transferred knowledge is encoded into the model parameters to reduce the dependence on the target data, effectively improve the low resource caused by the small amount of labeled data due to the strong domain of the target task, and improve the generalization performance of the model. The RoBERTa model is trained using the self-supervised learning masked language prediction task to improve the model's ability to understand the context of emotional text, and the RoBERTa model is sequentially transferred to perform document-level sentiment analysis tasks to further train the RoBERTa model, so that the model can learn sentiment classification knowledge in related fields. The RoBERTa model finally obtained can achieve higher accuracy performance in aspect-level sentiment analysis tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a flow chart of the present invention;
[0031] Figure 2 This is the transfer learning model diagram of the present invention. DETAILED DESCRIPTION
[0032] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0033] like Figure 1 and Figure 2As shown, the present invention proposes an aspect-level sentiment analysis method and device based on transfer learning, which includes a data acquisition module, a RoBERTa module, a training module and an output module.
[0034] The method of the above-mentioned device includes: obtaining an aspect-level sentiment analysis data set and preprocessing it, removing the sentiment polarity label, and obtaining a first sample sequence containing aspect-level evaluation entities and context as unlabeled data; constructing a RoBERTa model, using the unlabeled data to perform a prediction pre-training task on the RoBERTa model, and obtaining a RoBERTa model that completes the training task at this stage; obtaining a document-level sentiment data set in the same scenario as the aspect-level sentiment analysis; training the RoBERTa model that has completed the self-supervised mask prediction training task by performing a document-level sentiment analysis task; obtaining an aspect-level sentiment analysis data set again, and constructing a sentence pair that integrates comment text information and aspect information as a second sample sequence; inputting the second sample sequence into the RoBERTa model that has completed the document-level sentiment analysis task, performing aspect-level sentiment analysis, and outputting a sentiment category label.
[0035] The following is combined with the following embodiments:
[0036] Step 1: Preprocess the corpus of the aspect-level sentiment analysis dataset SemEval2014 and remove the contradictory classification data. The data distribution is shown in Table 1:
[0037]
[0038] Table 1
[0039] The evaluation object of the aspect-level sentiment analysis task is a separate target entity, so there will be multiple evaluation objects in one comment sentence, for example: "Good food but the service was dreadful". The aspect words "food" and "service" correspond to positive and negative sentiment polarities respectively. At this stage, the correspondence between the samples and the labels is ignored and only the complete comment sentences are extracted as the corpus for mask language learning.
[0040] Step 2.1: Load the roberta-based model, strictly follow the division of training set and test set in SemEval 2014 data, only use the training set corpus for pre-training of the masking mechanism in masked language learning, and perform 15% random masking on the comment text sequence input to the model, for example: "Good [Mask] but the service was dreadful";
[0041] Step 2.2: In the process of model embedding layer converting sentences into word vectors to train masked language models, the RoBERTa model treats the [Mask] flag as noise and inserts the classification flag at the beginning of the sentence. <s> , use at the end of a sentence< / s> As a separator, obtain the word vector E through BPE character encoding token , with segment code E seg Relative position encoding E pos Perform feature fusion. Its expression is as follows:
[0042]
[0043] E word ={x1,x2,...x n}
[0044] Embedding layer vector input model, RoBERTa model has 12 layers, the encoding layer parameters of the lth layer are calculated through the self-attention mechanism as follows:
[0045] X l =Transformer(X l-1 ),l∈[1,12]
[0046] According to all the hidden states h∈[batch_size×max_size×hidden_size] of the last layer of the model, we determine whether the words in the [Mask] flag in the sentence are accurately restored. The loss function of the self-supervised learning mask language model (MLM) is as follows:
[0047]
[0048] Where x is the token sequence {[s], x 1 ,...,x n [ / s]}, m(x) represents the set of masked tokens, x\ m(x) is the token that has not been replaced in the input sequence, and λ is the L2 regularization parameter used to stabilize the value of the model parameter θ to avoid overfitting.
[0049] Step 3: The aspect-level sentiment analysis dataset contains two scenarios, Laptop and Restaurant, as target domains. The datasets in related fields are selected to select Restaurant_Review and Cell Phone_Review as related domains for the external classification knowledge sources of transfer learning.
[0050] The Restaurant_Review dataset contains, for example; "We are so glad we found this place." The sentiment polarity label is "positive"; the review information on smartphones in the Cell Phone_Review data is similar to the main content contained in the Laptop, such as screen display clarity, battery life, etc., for example: "Sold as new and we're not new but we're reconditioned and didn't work correctly", and the corresponding label is the satisfaction score "2"; the label source of the Cell Phone_Review dataset is the reviewer's rating of 1-10 for the smartphone user experience, and the score range is used as the division of the three categories of sentiment analysis. It can be observed that [0,4) has a negative sentiment tendency,
[0051] [4,7] is a neutral evaluation, [7,10] corresponds to a positive sentiment tendency, and the distribution of relevant domain data after document level sentiment analysis (DSC) corpus preprocessing is as follows
[0052] Table 2:
[0053]
[0054] Table 2
[0055] Step 4: Migrate the RoBERTa model in step 3 and use the DSC corpus for document-level sentiment analysis pre-training. The Restaurant_Review dataset corresponding to the Restaurant scene is a binary classification of sentiment polarity {positive, negative}, and the document-level sentiment analysis task corresponding to the Laptop notebook is a three-classification {positive, neutral, negative}.
[0056] Using labeled data from related fields for further pre-training is equivalent to fine-tuning the RoBERTa model directly on the document-level sentiment analysis task. Based on the language model of the Transformer encoder, encoding layers of different depths can capture different levels of structural knowledge and semantic information. Inspired by the literature, hierarchical learning rates are used in the fine-tuning process of the document-level sentiment analysis task. The formula is as follows:
[0057]
[0058] η l-1 =η l / 2.6
[0059] The adjacent 4 layers of the 12 coding layers of the RoBERTa model are divided into a group of coding layers, whose parameters are decomposed into {θ 1 ,θ 2 ,θ 3}. l is the learning rate of the l-group encoding layer, is the model parameter of the l-group encoding layer at the time of gradient update t, L(θ) is the loss function of the model, and the decay factor is 2.6. The learning rate of the model decays from the top layer to the bottom layer, and its purpose is to fully learn more general semantic features in the lower layers, rather than the knowledge specific to the pre-training task at the top layer.
[0060] The classification flag bit [s] of the last hidden state of the model outputs the sentence-level feature matrix h s ∈[batch_size×hidden_size], transformed by the mapping of the fully connected layer, where W i , W f is the weight matrix, b i , b f is the bias parameter, and the sigmoid function and softmax function are used to predict the sentiment polarity labels in the restaurant and smartphone scenarios:
[0061]
[0062] According to the network structure of the present invention, the sentiment classification fitting task selects the cross entropy loss function to train the entire model. In the back propagation process, the smaller the difference between the "output value" and the "target value", the better the model training effect. The expression is as follows:
[0063]
[0064] In the expression, M is the total number of categories, y i is the true sentiment category label corresponding to the sample, is the sentiment label predicted by the model, λ d is the L2 regularization coefficient, Θ is the set of model parameters, η l is the learning rate of updating parameters of the current layer.
[0065] Step 5: Integrate the aspect word information and comment text in the SemEval 2014 dataset to construct an input sequence in the form of sentence pairs. For example, after corpus preprocessing, the sentence “Good food but the service was dreadful” is in the form of “[s]Good food but the service was dreadful[ / s]food” with a positive sentiment label and “[s]Goodfood but the service was dreadful[ / s]service” with a negative sentiment label.
[0066] Step 6: Migrate the RoBERTa model for the document-level sentiment analysis task in step 4, retain the model's structure and initial weights, and <s>The Softmax classifier is connected as a specific task layer. The corpus preprocessed in step 5 is input into the RoBERTa model, and the gradient descent method combined with the layer-wise learning rate is used to update all layer parameters of the pre-trained language model and classifier.
[0067] The linear layer maps the hidden dimension of the RoBERTa model classification flag output vector to the number of categories of sentiment polarity. The softmax function calculates the predicted probability C of the kth item in the probability feature vector among the three categories of sentiment labels (positive, neutral, negative) k , select the category label with the largest probability value as the output of the model classifier:
[0068]
[0069] When the target domain data is finally used for sentiment level analysis tasks, the present invention selects the cross entropy function to calculate the difference between the true distribution and the model output distribution, and uses this difference to back propagate and update the model parameters. The expression is:
[0070]
[0071] Where K is the number of sentiment classification categories, y i is the true sentiment category label corresponding to the sample, is the sentiment label predicted by the model, λ a is the L2 regularization coefficient, Θ is the set of model parameters, η l is the learning rate of updating parameters of the current layer.
[0072] In order to demonstrate the effectiveness of the present invention, a specific experimental case using SemEval 2014 as the target task dataset is provided below:
[0073] 1. Evaluation indicators
[0074]
[0075] The classification effect of the aspect-level sentiment analysis task in terms of citation accuracy and macro F1 evaluation during the implementation of the technical solution.
[0076] 2. Hyperparameters
[0077] In the implementation plan, the same hyperparameter settings are selected for restaurants and notebooks in the dataset, and AdamW is selected as the optimizer for automatic convergence adjustment parameters during training. In order to enable the model to learn more accurate classification performance during training, multiple experiments are conducted on the hyperparameter settings of the model, and the most effective hyperparameter combinations in the mask prediction pre-training MLM and DSC document-level sentiment analysis pre-training phases and aspect-level sentiment analysis (ASC) are selected as shown in Table 3:
[0078]
[0079] Table 3
[0080] 3. Comparative test model
[0081] (1) TD-LSTM: The target word is extracted twice by the LSTM mechanism from left to right and from right to left. The last hidden state of LSTM is input into the softmax classifier, which fully utilizes the semantic information of the evaluation object in the fine-grained sentiment analysis task.
[0082] (2) IAN: The aspect-level target word features and comment context are modeled separately, and the hidden layer pooling of the recurrent neural network is used to process the output average, the hidden state of the label information, and the attention mechanism is used to calculate the text weight information. A new layer of attention is added to the original attention to describe the importance of each attention, which helps to explicitly consider the contribution of each aspect of the word to the sentiment analysis task through information interaction.
[0083] (3) BERT-base: The sentence pairs consisting of comment sentences and target words of the evaluation object separated by [ / s] are used as sample sequences. The input is a 12-layer Transformer bidirectional encoder with a hidden layer dimension of 768 dimensions. The hidden vector output by the classification flag is subjected to softmax classification processing.
[0084] (4) BERT-LSTM: Utilizes the attention mechanism to interactively learn context and target word knowledge.
[0085] (5) RAM: It integrates the multi-head attention mechanism and the bidirectional LSTM mechanism. It is good at capturing the long-distance dependencies between aspect information and context in complex sentence structures. The weighted memory provides different feature engineering for target words with different sentiment polarities in the sentence, thus enhancing the robustness of the model.
[0086] (6)AOA: The word embedding matrix and bidirectional LSTM are used to obtain the comment information and the hidden vectors of the middle layer of BERT, which enhances the model’s ability to capture semantic knowledge specific to aspect-level sentiment analysis. The LSTM mechanism is set to integrate the classification mark output vectors of each layer of the self-attention neural network.
[0087] Ablation experiments were designed to analyze the role of the training models at each stage in the transfer learning of the present invention: RoBERTa-bases directly calls the RoBERTa model obtained by training based on a large-scale corpus in a general field to perform ASC tasks; RoBERTa-MLM is a model obtained by extracting unlabeled data from the training set for self-supervised masked language learning pre-training; RoBERTa-DSC is a model obtained by introducing a sentiment analysis dataset in a related field and performing supervised learning pre-training for sentiment label classification; RoBERTa-MLM-DSC is a model for the sequential transfer model designed by the present invention to perform two-stage training tasks; the accuracy performance of each scheme is shown in Table 4:
[0088]
[0089] Table 4
[0090] As shown in Table 4, the deep learning model built with recurrent neural network and attention mechanism can effectively realize aspect-level text sentiment classification, and the basic BERT model can achieve the classification accuracy of neural network models with multiple module combinations. The use of the more robust bidirectional encoder model RoBERTa performs better in the ASC task than the combined use of the hidden vectors of the intermediate layer of the BERT model for specific tasks. The powerful feature extraction ability of the model ensures its performance in downstream tasks. The model after migration from supervised mask learning training can enhance the semantic understanding ability of the RoBERTa model in a specific context when processing the target task. Compared with directly calling the RoBERTa model, the accuracy in the Laptop and Restaurant scenarios is improved by 0.07% and 2.34% respectively. The model after migration document-level sentiment analysis pre-training learns the semantic knowledge of related fields and the classification ability of the trained RoBERTa model, and the accuracy in the Laptop and Restaurant scenarios is improved by 1.14% and 2.74% respectively. The model performance of the multi-step migration learning strategy of the present invention is better than other comparative experiments and the RoBERTa model obtained by performing MLM and DSC pre-training tasks separately, which proves the effectiveness of this method.
[0091] The embodiments described above are merely descriptions of preferred implementation modes of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.< / s>
Claims
1. A method for aspect-level sentiment analysis based on transfer learning, characterized in that: include: Obtaining and preprocessing an aspect-level sentiment analysis dataset, removing sentiment polarity labels, and obtaining a first sample sequence containing aspect-level evaluation entities and contexts as unlabeled data; Construct a RoBERTa model, use unlabeled data to perform mask prediction task to train the RoBERTa model, and obtain a RoBERTa model that completes the training task at this stage; the mask prediction task training RoBERTa model includes: obtaining the comment text sequence {w1,w2,.....w n-1 ,w n } Perform random masking with a probability of 15% to obtain the mask flag; build a RoBERTa model, perform the pre-training task of mask prediction to train the RoBERTa model, and obtain the trained RoBERTa model; Obtain document-level sentiment datasets in the same scenario as aspect-level sentiment analysis; For the RoBERTa model that has completed the self-supervised mask prediction training task, train this model on the document-level sentiment analysis task; Obtain the aspect-level sentiment analysis dataset again, and construct sentence pairs that integrate the review text information and aspect information as the second sample sequence; The second sample sequence is input into the RoBERTa model that has completed the document-level sentiment analysis task, and aspect-level sentiment analysis is performed to output sentiment category labels, including: The second sample sequence input process includes fusing the semantic information and aspect information of the review text in the form of sentence pairs as the sample sequence of the input RoBERTa model, which is expressed as follows: input={ <s>in1, in2,..., in n-1 ,In n ,< / s> t1,t2,...t m } In the formula, <s>is the classification flag, {w1,w2,.....w n-1 ,w n } is the comment text sequence,< / s> is a separator, {t1,t2,.....,t m } is the aspect word sequence; A Softmax classifier is connected to the classification flag to determine the sentiment polarity corresponding to the aspect-level evaluation object. The cross entropy function is used to calculate the difference between the learning model distribution and the training distribution to obtain the final aspect-level sentiment analysis model. The sample sequence is input into this model for sentiment polarity prediction and the sentiment category label is output.
2. The aspect-level sentiment analysis method based on transfer learning according to claim 1, characterized in that: Convert each review text in the first sample sequence into a table format.
3. The aspect-level sentiment analysis method based on transfer learning according to claim 1, characterized in that: The method of obtaining a document-level sentiment data set in the same scenario as the aspect-level sentiment analysis includes: obtaining a document-level sentiment analysis data set, dividing sentiment polarity categories according to the scoring intervals corresponding to the comments, filtering out samples with empty labels and garbled comment texts, and obtaining a document-level sentiment analysis data set in the same scenario after data processing.
4. The aspect-level sentiment analysis method based on transfer learning according to claim 1, characterized in that: The RoBERTa model that completes the self-supervised mask prediction training task and trains this model for the document-level sentiment analysis task includes: capturing the structural knowledge and semantic information of different levels of the comment text in the document-level sentiment analysis data through the language model of the Transformer encoder, and setting the hierarchical learning rate in the process of training the RoBERTa model using the document-level sentiment analysis task to optimize the model parameters.
5. An aspect-level sentiment analysis device based on transfer learning, characterized in that: include: A data acquisition module is used to acquire and preprocess the aspect-level sentiment analysis data set, remove the sentiment polarity label, and obtain a first sample sequence containing aspect-level evaluation entities and context as unlabeled data; The RoBERTa module is used to build a RoBERTa model, and use unlabeled data to perform mask prediction tasks to train the RoBERTa model to obtain a RoBERTa model that completes the training task at this stage; the mask prediction task training RoBERTa model includes: obtaining a comment text sequence {w1,w2,.....w n-1 ,w n } Perform random masking with a probability of 15% to obtain the mask flag; build a RoBERTa model, perform the pre-training task of mask prediction to train the RoBERTa model, and obtain the trained RoBERTa model; The training module is used to obtain the document-level sentiment dataset in the same scenario as the aspect-level sentiment analysis, and train the RoBERTa model that has completed the self-supervised mask prediction training task on the document-level sentiment analysis task; The output module is used to obtain the aspect-level sentiment analysis dataset again, construct sentence pairs that integrate the comment text information and aspect information as the second sample sequence, input the second sample sequence into the RoBERTa model that has completed the document-level sentiment analysis task, perform aspect-level sentiment analysis, and output sentiment category labels, including: The second sample sequence input process includes fusing the semantic information and aspect information of the review text in the form of sentence pairs as the sample sequence of the input RoBERTa model, which is expressed as follows: input={ <s>in1, in2,..., in n-1 ,In n ,< / s> t1,t2,...t m } In the formula, <s>is the classification flag, {w1,w2,.....w n-1 ,w n } is the comment text sequence,< / s> is a separator, {t1,t2,.....,t m } is the aspect word sequence; A Softmax classifier is connected to the classification flag to determine the sentiment polarity corresponding to the aspect-level evaluation object. The cross entropy function is used to calculate the difference between the learning model distribution and the training distribution to obtain the final aspect-level sentiment analysis model. The sample sequence is input into this model for sentiment polarity prediction and the sentiment category label is output.
Citation Information
Patent Citations
Transfer learning method based on false problem detection from text
CN113051398A
Target-oriented multi-modal sentiment classification method
CN113065577A
