Emotion analysis method and system based on double-layer interaction joint model

CN117473040BActive Publication Date: 2026-09-22WUHAN LANSHAN TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310771118.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2026-09-22
Estimated Expiration
2043-06-28

AI Technical Summary

Technical Problem

[0005]AE和SC的学习可能会相互影响

Benefits of technology

[0045]本发明支持网络舆情数据的情绪分析联合任务,在常见情感分类模型处理网络舆情数据中的方面提取和情感分类联合问题不理想的情况下,合理建立两个子任务之间的双向关联,使情绪分析更加准确。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117473040B_ABST
    Figure CN117473040B_ABST
Patent Text Reader

Abstract

The application discloses an emotion analysis method and system based on a double-layer interactive joint model, carries out data set collection and preprocessing, and comprises the following steps: collecting network public opinion data related to current affairs hotspots, and removing invalid text information; data labeling, comprising constructing a labeling platform, labeling validity and emotion labels according to labeling specifications, and storing in a data set after cross-validation; text feature extraction, comprising converting text into a word sequence and inputting the word sequence into a BERT model to obtain text word encoding, and obtaining hidden states for aspect extraction and sentiment classification two subtasks through GRU; semantic level interaction, comprising selectively combining different specific task features, learning a common optimal combination, and realizing shallow interaction of the two tasks at the semantic level; task level interaction, comprising predicting aspect items using a linear classifier, introducing an AOA model to realize sentiment classification, and then utilizing interaction information maximization to make aspect extraction and sentiment classification share information in an output layer, and realize interaction balance at the task level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of natural language intelligent processing, and more specifically, relates to a sentiment analysis method based on a two-layer interactive joint model. Background Technology

[0002] With the development of mobile internet and the popularization of social networking platforms, the public has begun to spread information and express their emotions and attitudes toward current hot topics on new media platforms such as Weibo and WeChat, and the term "online public opinion" has emerged[1]. Online public opinion refers to the sum of the public's views, attitudes and emotions toward hot topics in terms of society and morality[2]. For example, the thoughts and opinions of the public on the epidemic event published on the Internet are typical online public opinion. In the new media environment, online public opinion data has shown exponential growth. Collecting and analyzing online public opinion data and fully mining the deep emotional information in the text can timely and effectively control and manage the event, which has very important theoretical significance and practical value[3].

[0003] Traditional sentiment analysis research mainly focuses on predictions at the sentence or document level [4], determining the overall sentiment polarity for the entire sentence or document. In order to make predictions, it is assumed that a single emotion is conveyed for a single topic in a given text, but this may not be the case in reality. In this case, the need to identify more granular aspect-level opinions and emotions is known as Aspect Based Sentiment Analysis (ABSA), which has received increasing attention in the past decade [5]. In the ABSA problem, the object of concern for sentiment expression shifts from a complete sentence or document to an entity or an aspect of an entity. For example, an entity could be a specific product in the e-commerce field, whose attributes or characteristics (such as price and size) are its aspects.

[0004] Generally speaking, the main research direction of ABSA involves the identification of sentiment elements at various aspect levels, namely aspects, aspect categories, opinion items, and sentiment polarity[6]. For example, given a sentence “This pizza is delicious,” the corresponding sentiment elements are “pizza,” “food,” “delicious,” and “positive,” where “pizza” and “delicious” are explicitly expressed in the sentence, and “food” and “positive” belong to predefined aspect categories and sentiment sets. Early work of ABSA started with identifying each individual sentiment element separately. For example, the Aspect Extraction (AE) task aims to extract all aspect terms mentioned in a given text[7]; while the Sentiment Classification (SC) task predicts the sentiment polarity of a specific aspect in a sentence[8].

[0005] Learning AE (Aspect-Based) and SC (Sentence-Based) tasks can influence each other. On one hand, sentiment words are better understood when the required aspect is given. For example, in the sentences "The battery has a large capacity" and "The computer case is too big to move," the sentiment word "large" is positive when describing the aspect "battery," but negative for "computer." This effectively shows that combining aspect features is beneficial for SC. On the other hand, since sentiment expressions are often close to aspects, underlying sentiment features may provide useful signals for AE. For example, if we observe the word "spicy" in restaurant reviews, it is likely to be associated with a food-related aspect. Therefore, combining sentiment features also helps with aspect detection. These two examples illustrate the significance of reasonably establishing a bidirectional association between the two tasks.

[0006] Related literature:

[0007] [1] Xiao Hong, Xu Shaohua. Research on the analysis of online public opinion tendencies based on syntactic analysis and sentiment dictionary [J]. Small and Microcomputer Systems, 2014, 35(4):811-813.

[0008] [2] Yang Pin, Li Tao, Zhao Kui. A quantitative analysis method for online public opinion [J]. Computer Applications Research, 2009, 26(3):1066-1068.

[0009] [3] Hao Yazhou, Zheng Qinghua, Chen Yanping, et al. Abnormal behavior identification for online public opinion data [J]. Computer Research and Development, 2016, 53(3):611-620.

[0010] [4]H.Yu and V.Hatzivassiloglou, "Towards answering opinion questions: Separating facts from opinions and identifying the polarity of opinionsentences," in EMNLP, 2003, pp.129-136.

[0011] [5] A.Nazir, Y.Rao, L.Wu, and L.Sun, "Issues and challenges of aspect-based sentiment analysis: A comprehensive survey," IEEE Trans.Affect.Comput., 2020.

[0012] [6] W. Zhang, Y. Deng, X. Li, Y. Yuan, L. Bing, and W. Lam, "Aspect sentiment quadprediction as paraphrase generation," in EMNLP, 2021, pp.9209-9219.

[0013] [7] P.Liu, SRJoty, and HMMeng, "Fine-grained opinion mining with recurrent neural networks and word embeddings," in EMNLP, 2015, pp.1433-1443.

[0014] [8] L. Jiang, M. Yu, M. Zhou, X. Liu, and T. Zhao, "Targetdependent twittersentiment classification," in ACL, 2011, pp.151-160. Summary of the Invention

[0015] Most existing methods either extract task-specific features sequentially, leading to insufficient feature interaction, or encode aspect and sentiment features in parallel, meaning that feature representations in each task are largely independent of each other, except for input sharing. Both types of methods ignore the inherent connection between aspect extraction and sentiment classification. To address this issue, this invention provides a two-layer interactive joint sentiment analysis method to appropriately simulate bidirectional interaction between two tasks.

[0016] To achieve the above objectives, this invention proposes a sentiment analysis method based on a two-layer interaction joint model, comprising the following steps:

[0017] Step 1: Dataset collection and preprocessing, including collecting online public opinion data related to current events on major social media platforms and then removing invalid information from the text;

[0018] Step 2, data annotation, includes building an annotation platform, annotating validity and sentiment labels according to annotation specifications, and then storing the data in the dataset after cross-validation;

[0019] Step 3, text feature extraction, includes converting the text in the dataset processed in Step 2 into word sequences and inputting them into the BERT model to obtain text word codes; then passing the text word codes through GRU to obtain hidden states for the two subtasks of aspect extraction and sentiment classification;

[0020] Step 4, semantic-level interaction, includes selectively combining the aspect extraction (AE) and sentiment classification (SC) features obtained in Step 3 for different specific tasks. By learning the optimal combination of shared representation and specific task representation, a shallow semantic-level interaction between the two tasks is achieved.

[0021] Step 5, task-level interaction, includes using a linear classifier to predict aspect terms after the semantic-level interaction in step 4, introducing an AOA model to achieve sentiment classification, and then using the interaction information maximization method to enable aspect extraction and sentiment classification to share information at the output layer, thereby achieving task-level interaction balance.

[0022] Moreover, given dataset Contains N samples in Represents a length of n i And includes l i Sentences on each aspect, Indicates a and The beginning and end boundaries are marked with emotional polarity indicators. The aspects; firstly, at the encoding layer, BERT is used to extract the semantic information of the input sentence to obtain... Where d B This represents the embedding size of BERT, where n is the length of the input sentence. Inputting B into a GRU yields the hidden states for both the AE and SC tasks. and Where d G This represents the dimensionality of the GRU; then, it is obtained by selectively combining different task-specific features. and To achieve shallow semantic-level interaction; then, mutual information maximization technology is used to ensure bidirectional interaction between the two tasks; finally, the identified aspects and their corresponding sentiment polarities are obtained in the output layer.

[0023] Moreover, the task-level interaction module, based on the method of maximizing interaction information, after obtaining the aspect score β and the emotional attention score γ, further improves β and γ through the mutual learning between aspect and emotion in the two tasks AE and SC, so as to achieve task-level bidirectional interaction.

[0024] Furthermore, in step 5, the following optimizations are performed.

[0025] 1) Optimization goals for task extraction:

[0026]

[0027] in, and For the true aspect term boundary distribution, and This refers to the predicted aspect term boundary distribution.

[0028] 2) Optimization goal of sentiment classification task:

[0029]

[0030] Among them, y k Predict the distribution for sentiment labels. This represents the true distribution of emotion labels.

[0031] 3) Employing symmetric JS divergence to define a similarity measurement metric maximizes the similarity between two distributions, thereby achieving an interactive balance between the two tasks.

[0032]

[0033] After maximizing the interactive information, the model is optimized by combining the above three parts.

[0034]

[0035] Where θ is the model parameter set, δ ae and δ sc The optimization objectives are AE and SC, respectively, and λ is a balance parameter. The model finally outputs two parts: one is all aspects extracted using a heuristic algorithm based on the predicted boundary distribution, and the other is the sentiment polarity corresponding to each of the extracted aspects.

[0036] On the other hand, the present invention provides a sentiment analysis system based on a two-layer interaction joint model, which is used to implement the sentiment analysis method based on a two-layer interaction joint model as described above.

[0037] Moreover, it includes the following modules,

[0038] The first module is used for dataset collection and preprocessing, including collecting online public opinion data related to current events on major social media platforms and then removing invalid information from the text.

[0039] The second module is used for data annotation, including building an annotation platform, annotating validity and sentiment labels according to annotation specifications, and then storing the data in the dataset after cross-validation.

[0040] The third module is used for text feature extraction, which includes converting the text in the processed dataset into word sequences and inputting them into the BERT model to obtain text word codes; then passing the text word codes through GRU to obtain hidden states for the two subtasks of aspect extraction and sentiment classification.

[0041] The fourth module is used for semantic-level interaction. It includes selectively combining features of different specific tasks such as aspect extraction (AE) and sentiment classification (SC). By learning the optimal combination of shared representation and task-specific representation, it enables shallow semantic-level interaction between the two tasks.

[0042] The fifth module is used for task-level interaction. After semantic-level interaction, it uses a linear classifier to predict aspect terms, introduces an AOA model to achieve sentiment classification, and then uses the interaction information maximization method to enable aspect extraction and sentiment classification to share information at the output layer, thereby achieving task-level interaction balance.

[0043] Alternatively, it may include a processor and a memory, with the memory used to store program instructions and the processor used to call the stored instructions in the memory to execute a sentiment analysis method based on a two-layer interaction joint model as described above.

[0044] Alternatively, it may include a readable storage medium on which a computer program is stored, which, when executed, implements a sentiment analysis method based on a two-layer interaction joint model as described above.

[0045] This invention supports a joint task of sentiment analysis for online public opinion data. When common sentiment classification models are not ideal in handling aspect extraction and sentiment classification joint problems of online public opinion data, a reasonable bidirectional correlation is established between the two sub-tasks to make the sentiment analysis more accurate.

[0046] The present invention is simple and convenient to implement, highly practical, and solves the problems of low practicality and inconvenience in actual application of related technologies. It can improve user experience and has significant market value. Attached Figure Description

[0047] Figure 1 This is a flowchart of an embodiment of the present invention;

[0048] Figure 2 This is a flowchart of dataset annotation in an embodiment of the present invention;

[0049] Figure 3 This is a schematic diagram of the overall framework of the model in an embodiment of the present invention;

[0050] Figure 4 This is a framework diagram of the semantic-level interaction module in the model of this embodiment of the invention. Detailed Implementation

[0051] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.

[0052] This invention discloses a sentiment analysis method based on a two-layer interactive joint model, addressing the problem that mainstream models cannot directly handle or perform poorly when dealing with the joint analysis of aspect extraction and sentiment classification. The method involves collecting online public opinion data related to the COVID-19 pandemic to construct a Chinese dataset of online public opinion; model pre-training, including training the DLIA model using the dataset from step 2; obtaining textual features of the input sentence at the encoding layer using BERT and GRU, and then achieving semantic-level interaction by selectively combining different task-specific features; achieving task-level bidirectional interaction using mutual information maximization technology; and finally obtaining the identified aspects and their corresponding sentiment polarities at the output layer. This invention supports the joint sentiment analysis task of online public opinion data. When common sentiment classification models are not ideal in handling the joint aspect extraction and sentiment classification problem in online public opinion data, it reasonably establishes a bidirectional association between the two sub-tasks, making sentiment analysis more accurate.

[0053] First, the technical terminology of this invention will be explained and described:

[0054] ABSA: ABSA is an abbreviation for Aspect Based Sentiment Analysis, which is a task that simultaneously extracts opinion and aspect terms and the relationships between them from a given corpus.

[0055] AE: AE is an abbreviation for Aspect Extraction, which aims to extract all aspects of a given sentence.

[0056] SC: SC is an abbreviation for Sentiment Classification, which aims to predict the sentiment polarity of a sentence in a certain aspect.

[0057] BERT: BERT stands for Bidirectional Encoder Representation from Transformers, a pre-trained language representation model. It emphasizes that instead of using traditional unidirectional language models or shallow concatenation of two unidirectional language models for pre-training, it adopts a new masked language model (MLM) to generate deep bidirectional language representations.

[0058] GRU: GRU stands for Gate Recurrent Unit. It is a type of recurrent neural network. Like LSTM (Long-Short Term Memory), it was proposed to solve problems such as long-term memory and gradients in backpropagation. It can better capture the large-interval dependencies in time-series data.

[0059] See Figure 1 This invention provides a sentiment analysis method based on a two-layer interaction joint model, comprising the following steps:

[0060] Step 1: First, construct a Chinese dataset of online public opinion on current events, including collecting online public opinion data related to current events on major social media platforms, and then removing invalid information such as illegal characters, web links, and advertisements from the text.

[0061] The specific implementation of the example is as follows:

[0062] Step 1.1: Summarize the hot topics related to current events (such as the epidemic) on major Chinese social networking platforms (such as People's Daily, Weibo, WeChat official accounts, forums), search according to keywords and topic categories, and use web crawling technology to collect various types of public opinion data as raw corpus for annotation, including personal online short comments, popular science articles, notices and announcements and personal diaries, etc.

[0063] Step 1.2: Filter low-quality text with unclear OCR text recognition and irregular characters; remove advertising, popular science articles and non-Mandarin data through keyword matching; delete data that is too short and vague, including short text containing only punctuation marks, emoticons, the phrase "forward Weibo", and data with chaotic context.

[0064] Step 1.3: Noise reduction was performed on the relatively standardized data. Regular expression matching was used to remove unnecessary spaces, line breaks, web links and other invalid information from the text. The filtered data was then stored in the document in JSON format for the next step of annotation.

[0065] Step 2: Build an annotation platform and annotate the organized data, including building the annotation platform, annotating validity and sentiment labels according to annotation specifications, and then storing the data in the dataset after cross-validation.

[0066] See Figure 2 The specific implementation of the example is as follows:

[0067] Step 2.1: Parse the JSON file and display the data on the labeled webpage;

[0068] Step 2.2: First, determine whether the current data is valid (i.e., whether it contains emotional information), and then mark the fine-grained emotional information and corresponding emotional categories of all valid data according to specific normative criteria;

[0069] Step 2.3: Perform cross-validation of the data to ensure consistency of the annotations, and store the final results in a new JSON file.

[0070] Step 3: Use the prepared dataset to extract text features, including converting the text in the dataset processed in Step 2 into word sequences and inputting them into the BERT model to obtain text word codes; then pass the text word codes through GRU to obtain hidden states for the two subtasks of aspect extraction and sentiment classification.

[0071] Given dataset Contains N samples in Represents a length of n i And includes l i Sentences on each aspect, Indicates a and The beginning and end boundaries are marked with emotional polarity indicators. The aspect term, i is the sample label, and j is the aspect term label.

[0072] See Figure 3 First, BERT is used in the encoding layer to extract the semantic information of the input sentence. Where d B This represents the embedding size of BERT, where n is the length of the input sentence, R is the real number field, and b1, b2, ..., b n Let B represent the vectors corresponding to the first to nth words in the sentence. Inputting B into a GRU yields the hidden states for the AE and SC tasks. and Where d G This represents the dimensionality of the GRU; then, it is obtained by selectively combining different task-specific features. and To achieve shallow semantic-level interaction; then, mutual information maximization technology is used to ensure bidirectional interaction between the two tasks; finally, the identified aspects and their corresponding sentiment polarities are obtained in the output layer.

[0073] The formula for the semantic-level interaction is:

[0074]

[0075] Where, α aa and α ss α represents the parameters of AE and SC for a specific task, respectively. as α sa All of these represent parameters that share task characteristics. and These represent the final outputs of AE and SC at the coding layer, respectively.

[0076] This computational approach enables a certain degree of feature representation sharing between two specific tasks at the encoding layer, enhancing their semantic-level correlation. To accelerate training, α is defined... D =α as =α sa α represents the degree of activation of one task by different tasks. D A larger value indicates a higher degree of feature sharing between the two tasks. Define α. S =α aa =α ss This represents the activation level of the same task, and α D +α S =1. By adjusting α D and α S The value can be freely combined between shared representation and task-specific representation. Therefore, the formula can be simplified to:

[0077]

[0078]

[0079] Here, α controls the shared information transmitted from another task. In this embodiment, the current affairs hot topic online public opinion Chinese dataset uses a pre-trained model for text feature extraction, including the following steps:

[0080] Step 3 of the embodiment is implemented as follows:

[0081] Step 3.1: Extract semantic information of the input sentence using BERT at the encoding layer. Where d B This represents the BERT embedding size, where n is the length of the input sentence;

[0082] Step 3.2: Input B into GRU to obtain the hidden state for the two tasks AE and SC. and Where d G This indicates the size of the GRU dimension.

[0083] Step 4: Perform shallow semantic-level interaction, which involves selectively combining the aspect extraction (AE) and sentiment classification (SC) features obtained in Step 3 for different specific tasks. By learning the optimal combination of shared representation and task-specific representation, shallow semantic-level interaction between the two tasks is achieved.

[0084] See Figure 4This method automatically learns the optimal combination of shared representations and task-specific representations, enabling bidirectional feature interaction between the two tasks at the encoding layer and achieving better performance than networks that rely on search discovery and brute-force enumeration. The specific calculation process is detailed in formulas (1-3) above and will not be repeated here. This calculation method enables feature representation sharing between the two tasks to a certain extent at the encoding layer, enhancing their semantic-level correlation. To accelerate training, α is defined... D =α as =α sa α represents the degree of activation of one task by different tasks. D A larger value indicates a higher degree of feature sharing between the two tasks. Define α. S =α aa =α ss This represents the activation level of the same task, and α D +α S =1. By adjusting α D and α S The value can be freely combined between shared representation and task-specific representation.

[0085] Step 5: Perform deep task-level interaction, including semantic-level interaction in step 4, using a linear classifier to predict aspect terms, introducing an AOA model to achieve sentiment classification, and then using interaction information maximization technology to enable aspect extraction and sentiment classification to share information at the output layer, achieving task-level interaction balance.

[0086] The task-level interaction module is based on interaction information maximization technology. After obtaining the aspect score β and the emotional attention score γ, it further improves β and γ through mutual learning between the two tasks AE and SC, thereby achieving task-level bidirectional interaction. The interaction information maximization technique is existing technology and will not be elaborated upon in this invention.

[0087] The optimization implementation of step 5 includes the following measures:

[0088] 1) Optimization goals for task extraction:

[0089]

[0090] in, and For the true aspect term boundary distribution, and Let n be the boundary distribution of the predicted aspect terms, n be the length of the input sentence, and k be the word labels in the sentence.

[0091] 2) Optimization goal of sentiment classification task:

[0092]

[0093] Among them, y k Predict the distribution for sentiment labels. This represents the true distribution of emotion labels.

[0094] 3) Use JS divergence, which has symmetry, to define the similarity measurement index, maximize the similarity between the two distributions, and thus achieve an interactive balance between the two tasks.

[0095]

[0096] Where JS(β||γ) represents the JS divergence, KL() represents the KL divergence, and β and γ represent aspect extraction score and attention score, respectively.

[0097] In ordinary sequential and parallel encoding, sentiment features do not directly affect aspect features. However, after maximizing interaction information, the model needs to be optimized by combining the above three parts.

[0098]

[0099] Where θ is the model parameter set, δ ae and δ sc Let λ be the optimization objective for AE and SC, respectively, and λ be a balancing parameter. The model ultimately outputs two parts: first, all aspects extracted using a heuristic algorithm based on the predicted boundary distribution; and second, the sentiment polarity corresponding to each extracted aspect.

[0100] The specific implementation of the example is as follows:

[0101] Step 5.1: Extract aspects by predicting the boundaries, i.e., the start and end positions. Use a linear classifier to predict the start position score g. s and the score at the end position g e ,

[0102]

[0103]

[0104] Among them, V s and V e All are trainable vectors, and sigmoid() represents the activation function. Boundary prediction distribution g s and g e The meanings are different, so the aspect score β cannot be calculated directly. It can be approximated by the average boundary distribution.

[0105]

[0106] Here, pooling(·) represents a custom average pooling function with a window size of 1×3.

[0107] Step 5.2: Introduce the AOA model to achieve sentiment classification, define the attention score as γ, and use γ as a sentiment feature to further assist in aspect boundary prediction.

[0108] Step 5.3: After obtaining the aspect score β and the emotional attention score γ, the symmetric JS divergence is used to define the similarity measurement index, which maximizes the similarity between the two distributions, thereby achieving an interactive balance between the two tasks and further improving β and γ.

[0109] In practical implementation, the method proposed in this invention can be automated by those skilled in the art using computer software technology. System devices for implementing the method, such as computer-readable storage media storing the corresponding computer program of this invention and computer equipment including the computer program running the corresponding computer program, should also be within the scope of protection of this invention. For example, a corresponding system can be provided to modularly implement the collection and filtering of Chinese data on current affairs and online public opinion, and model training.

[0110] In some possible embodiments, a sentiment analysis system based on a two-layer interaction joint model is provided, including the following modules:

[0111] The first module is used for dataset collection and preprocessing, including collecting online public opinion data related to current events on major social media platforms and then removing invalid information from the text.

[0112] The second module is used for data annotation, including building an annotation platform, annotating validity and sentiment labels according to annotation specifications, and then storing the data in the dataset after cross-validation.

[0113] The third module is used for text feature extraction, which includes converting the text in the processed dataset into word sequences and inputting them into the BERT model to obtain text word codes; then passing the text word codes through GRU to obtain hidden states for the two subtasks of aspect extraction and sentiment classification.

[0114] The fourth module is used for semantic-level interaction. It includes selectively combining features of different specific tasks such as aspect extraction (AE) and sentiment classification (SC). By learning the optimal combination of shared representation and task-specific representation, it enables shallow semantic-level interaction between the two tasks.

[0115] The fifth module is used for task-level interaction. After semantic-level interaction, it uses a linear classifier to predict aspect terms, introduces an AOA model to achieve sentiment classification, and then uses the interaction information maximization method to enable aspect extraction and sentiment classification to share information at the output layer, thereby achieving task-level interaction balance.

[0116] In some possible embodiments, a sentiment analysis system based on a two-layer interaction joint model is provided, including a processor and a memory. The memory is used to store program instructions, and the processor is used to call the stored instructions in the memory to execute a sentiment analysis method based on a two-layer interaction joint model as described above.

[0117] In some possible embodiments, a sentiment analysis system based on a two-layer interaction joint model is provided, including a readable storage medium on which a computer program is stored. When the computer program is executed, it implements a sentiment analysis method based on a two-layer interaction joint model as described above.

[0118] To improve efficiency, the collection and filtering of Chinese data on current affairs and trending topics in online public opinion can be pre-processed using a semi-manual annotation method. First, machines are used to collect, structure, and filter the online public opinion data. Then, manual annotation is used to supplement the data with additional information. After cleaning the data, a Chinese dataset of current affairs and trending topics in online public opinion is obtained.

[0119] The model is trained using a Chinese dataset of current affairs and online public opinion. First, semantic-level interaction features are learned at the encoding layer to facilitate information sharing between the two tasks. Then, mutual information maximization techniques are used to ensure bidirectional interaction between the two tasks, thereby reasonably establishing a bidirectional relationship between the two tasks.

[0120] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.

Claims

1. A sentiment analysis method based on a two-layer interaction joint model, characterized in that: Includes the following steps, Step 1: Dataset collection and preprocessing, including collecting online public opinion data related to current events on major social media platforms and then removing invalid information from the text; Step 2, data annotation, includes building an annotation platform, annotating validity and sentiment labels according to annotation specifications, and then storing the data in the dataset after cross-validation; Step 3, text feature extraction, includes converting the text in the dataset processed in Step 2 into word sequences and inputting them into the BERT model to obtain text word encoding; The text encoding is then processed by GRU to obtain the hidden states used for the two subtasks of aspect extraction and sentiment classification; Step 4, semantic-level interaction, includes selectively combining the aspect extraction (AE) and sentiment classification (SC) features obtained in Step 3 for different specific tasks. By learning the optimal combination of shared representation and specific task representation, a shallow semantic-level interaction between the two tasks is achieved. Step 5, task-level interaction, includes using a linear classifier to predict aspect terms after performing the semantic-level interaction in step 4, introducing an AOA model to achieve sentiment classification, and then using the interaction information maximization method to enable aspect extraction and sentiment classification to share information at the output layer, thereby achieving a task-level interaction balance. The task-level interaction is based on maximizing interactive information and scores in terms of acquisition. and emotional attention score Subsequently, through the mutual learning between aspects and emotions via the two tasks AE and SC, further improvement was achieved. and This enables two-way interaction at the task level; Perform the following optimizations: 1) Optimization goals for the task extraction aspect: in, and For the true aspect term boundary distribution, and For the predicted aspect term boundary distribution; 2) Optimization goal of sentiment classification task: in, Predict the distribution for sentiment labels. The true distribution of emotion labels; 3) Employing symmetric JS divergence to define a similarity measurement metric maximizes the similarity between two distributions, thereby achieving an interactive balance between the two tasks. After maximizing the interactive information, the model is optimized by combining the above three parts. in, For the model parameter set, and The optimization objectives are AE and SC, respectively. It is a balancing parameter. The model finally outputs two parts: one is all aspects extracted using heuristic algorithms based on the predicted boundary distribution, and the other is the sentiment polarity corresponding to each of the extracted aspects.

2. The sentiment analysis method based on a two-layer interaction joint model according to claim 1, characterized in that: Given dataset Includes Sample ,in Represents a length of And includes Sentences on each aspect, Indicates a and The beginning and end boundaries are marked with emotional polarity indicators. The aspects; firstly, at the encoding layer, BERT is used to extract the semantic information of the input sentence to obtain... ,in This represents the embedding size of BERT, where n is the length of the input sentence. Inputting B into a GRU yields the hidden states for both the AE and SC tasks. and ,in This represents the dimensionality of the GRU; then, it is obtained by selectively combining different task-specific features. and To achieve shallow semantic-level interaction, mutual information maximization technology is used to ensure bidirectional interaction between the two tasks. Finally, the identified aspects and their corresponding sentiment polarities are obtained in the output layer.

3. A sentiment analysis system based on a two-layer interaction joint model, characterized in that: This is used to implement a sentiment analysis method based on a two-layer interaction joint model as described in any one of claims 1-2.

4. The sentiment analysis system based on a two-layer interaction joint model according to claim 3, characterized in that: Includes the following modules, The first module is used for dataset collection and preprocessing, including collecting online public opinion data related to current events on major social media platforms and then removing invalid information from the text. The second module is used for data annotation, including building an annotation platform, annotating validity and sentiment labels according to annotation specifications, and then storing the data in the dataset after cross-validation. The third module is used for text feature extraction, which includes converting the text in the processed dataset into word sequences and inputting them into the BERT model to obtain text word codes; then passing the text word codes through GRU to obtain hidden states for the two subtasks of aspect extraction and sentiment classification. The fourth module is used for semantic-level interaction. It includes selectively combining features of different specific tasks such as aspect extraction (AE) and sentiment classification (SC). By learning the optimal combination of shared representation and task-specific representation, it enables shallow semantic-level interaction between the two tasks. The fifth module is used for task-level interaction. After semantic-level interaction, it uses a linear classifier to predict aspect terms, introduces an AOA model to achieve sentiment classification, and then uses the interaction information maximization method to enable aspect extraction and sentiment classification to share information at the output layer, thereby achieving task-level interaction balance.

5. An apparatus, characterized in that: It includes a processor and a memory, the memory being used to store program instructions, and the processor being used to call the stored instructions in the memory to execute a sentiment analysis method based on a two-layer interaction joint model as described in any one of claims 1-2.

6. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which, when executed, implements a sentiment analysis method based on a two-layer interaction joint model as described in any one of claims 1-2.

Citation Information

Patent Citations

  • Aspect sentiment analysis model based on multi-task learning

    CN114722142A

  • Emotion recognition method based on deep learning multi-modal deep-scale emotion feature fusion

    CN116010874A