A Method for Interpretable Chinese Comment Sentiment Analysis Based on Hybrid Neural Networks

CN115983254BActive Publication Date: 2026-08-14SOUTHEAST UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-09
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

其中分析器对评论的情感趋向进行分析,解释生成器从评论中提取模型的预测依据,从一定程度上解决了深度神经网络不可解释的问题,让模型更加可信

Benefits of technology

[0014]相比于现有的情感分析方法,本发明提出的方法针对中文评论拥有非常好的预测精度,而且解决了现有情感分析方法缺乏解释性的问题。本发明使用MacBERT构建分析器,MacBERT是专门针对中文的预训练模型,提取中文评论的语义语法信息时效果更好。同时本发明提出的方法添加了解释生成器,可以给出模型的预测依据,向用户展示模型主要根据文本的哪一部分做出判断。因此本发明中提出的方法针对中文评论拥有非常好的预测精度,同时具有更好的可解释性,对用户更加友好,增加了用户对模型的可信度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115983254B_ABST
    Figure CN115983254B_ABST
Patent Text Reader

Abstract

This invention provides an interpretable Chinese comment sentiment analysis method based on hybrid neural networks. The method proposes an interpretable Chinese comment sentiment model consisting of two modules: an analyzer and an interpretation generator. The analyzer is a MacBERT-TextCNN model that analyzes the sentiment trend of the comments; the interpretation generator is a two-layer recurrent convolutional neural network (RCNN) that extracts the model's prediction basis from the comments. Both modules are trained together during model training. Due to the black-box nature of deep neural networks, existing sentiment analysis models cannot interpret their analysis results. The model proposed in this invention adds an interpretation generator, which can extract text fragments from the original comments as the model's prediction basis. The extracted prediction sentences are short and continuous, allowing the analyzer to arrive at the same result. This enhanced prediction basis addresses the uninterpretability problem of deep neural networks to some extent, making the model more reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an interpretable Chinese comment sentiment analysis method based on hybrid neural networks, belonging to the field of sentiment analysis technology. Background Technology

[0002] With the rapid development of the internet, e-commerce has gradually integrated into people's daily lives, accumulating a vast amount of widely distributed user review data on e-commerce platforms. By analyzing user reviews, businesses can understand customer satisfaction with their products, stay informed about market trends, and understand user preferences and sentiments, which helps them launch new products and improve their services. Therefore, analyzing the sentiment and biases in user reviews across various platforms is of great significance to businesses. However, due to the sheer volume of user reviews, it is difficult for businesses to directly extract effective information from numerous comments. Therefore, they need to leverage artificial intelligence technology to extract useful information from these reviews. In recent years, deep learning has achieved remarkable results in the field of natural language processing. Some fundamental directions, including word vectorization, word segmentation, part-of-speech tagging, named entity recognition, and text structuring, have matured and can be directly applied to basic text processing tasks, such as automatic address recognition and filling, text file classification, article tagging and summary extraction, and title generation. Research has found that among various sentiment analysis algorithms, deep learning-based sentiment analysis algorithms achieve the best results because they can utilize contextual information.

[0003] However, in practical applications, people cannot fully trust the analytical results of models. This is because there is a lack of understanding and analysis of the internal workings of deep learning, and deep neural networks are often regarded as "black box" models, leading to the ability to observe only the model's predictions without understanding the reasons behind its decisions. Therefore, proposing an interpretable comment analysis model has significant theoretical and practical value. Summary of the Invention

[0004] To address the above problems, this invention proposes an interpretable Chinese comment sentiment analysis method and system based on hybrid neural networks. This method presents an interpretable Chinese comment sentiment model consisting of two modules: an analyzer and an interpretation generator. The two modules are trained together during model training, but can be considered independent units during use. The analyzer analyzes the sentiment trend of the comments, while the interpretation generator extracts the model's prediction basis from the comments, thus solving the problem of the lack of interpretability in deep neural networks to a certain extent and making the model more reliable.

[0005] To achieve the above objectives, the technical solution of the present invention is as follows: an interpretable Chinese comment sentiment analysis method based on a hybrid neural network, the method comprising the following steps:

[0006] (1) Obtaining the training sample set: Using a web crawler, comments longer than 5 characters were collected from e-commerce platforms. Comments with a rating of less than 3 points were categorized into the negative comment set, those with a rating of 3 points or more were categorized into the neutral comment set, and those with a rating of more than 3 points were categorized into the positive comment set. Since e-commerce platforms do not allow rating when adding comments, only the initial comments were crawled.

[0007] (2) Data preprocessing: First, remove the system's default positive reviews, then clean up the emoticons, kaomojis, and punctuation marks in the comments, then use the comparison deletion method to remove duplicate text, then delete comments with a length of less than 5 after cleaning, and finally use the jieba third-party library for word segmentation.

[0008] (3) Model Construction: A MacBERT-TextCNN analyzer model and an RCNN interpretation generator model were constructed. The analyzer first uses MacBERT to capture low-level semantic and syntactic information to obtain text representations, then uses TextCNN to extract features from the text before inputting them into a fully connected Softmax layer to obtain the output. The interpretation generator is a two-layer recurrent convolutional neural network whose output is a binary variable {z1,...,z...}. l}, where z t ∈0,1 indicates whether to select the t-th word as the basis for model prediction.

[0009] (4) Joint training of the analyzer and the interpretation generator: The analyzer and the interpretation generator are jointly trained using input sample data. During training, the text is first input into the interpretation generator to obtain the prediction basis, and then the prediction basis is input into the analyzer. This training method allows the analyzer and the interpretation generator to learn together.

[0010] An interpretable Chinese comment sentiment analysis system based on hybrid neural networks, characterized in that the system comprises:

[0011] (1) Data Management Module: This module has three functions: First, add data, crawl comments that are not in the database, obtain the sentiment trend of the comments and the basis for model prediction through the sentiment analysis and interpretation module, and then store them in the database together with the original comments; second, delete data; and third, query data.

[0012] (2) Sentiment Analysis and Interpretation Module: This module has two functions: sentiment analysis, which analyzes the sentiment trend of the input text; and model interpretation, which provides users with the basis for model analysis. Both functions are implemented through the model proposed in this invention.

[0013] (3) Information display module: The module has two functions. First, the prediction basis display allows you to view the prediction basis for each comment. Second, the statistical information display allows you to statistically analyze the sentiment trend and prediction basis of comments within a specified time period and display the statistical results in the form of charts, including the proportion of various comments, the display of product advantages, the display of product disadvantages, etc.

[0014] Compared to existing sentiment analysis methods, the method proposed in this invention achieves significantly higher prediction accuracy for Chinese comments and addresses the lack of interpretability in existing methods. This invention utilizes MacBERT to construct the analyzer; MacBERT is a pre-trained model specifically designed for Chinese, resulting in better extraction of semantic and syntactic information from Chinese comments. Furthermore, the proposed method incorporates an interpretation generator, providing the basis for the model's predictions and demonstrating to the user which parts of the text the model primarily bases its judgments on. Therefore, the method proposed in this invention achieves excellent prediction accuracy for Chinese comments, while also offering better interpretability, greater user-friendliness, and increased user trust in the model. Attached Figure Description

[0015] Figure 1 This is a flowchart of an interpretable Chinese comment sentiment analysis method based on hybrid neural networks;

[0016] Figure 2 This is a diagram illustrating the joint training process of the analyzer and the interpretation generator;

[0017] Figure 3 This is a diagram of the analyzer model structure;

[0018] Figure 4 This is a functional structure diagram of an interpretable Chinese comment sentiment analysis system based on hybrid neural networks;

[0019] Figure 5 This describes the compositional relationships among the functional modules of an interpretable Chinese comment sentiment analysis system based on hybrid neural networks. Detailed Implementation

[0020] To enhance understanding of the present invention, the embodiments will be described in detail below with reference to the accompanying drawings.

[0021] Example 1: As Figure 1 As shown, the interpretable Chinese comment sentiment analysis method based on hybrid neural networks includes the following steps:

[0022] (1) Obtaining the training sample set: Using a web crawler, comments longer than 5 characters were collected from e-commerce platforms. Comments with a rating of less than 3 points were categorized into the negative comment set, those with a rating of 3 points or more were categorized into the neutral comment set, and those with a rating of more than 3 points were categorized into the positive comment set. Since e-commerce platforms do not allow rating when adding comments, only the initial comments were crawled.

[0023] (2) Data preprocessing: First, remove the system's default positive reviews, then clean up the emoticons, kaomojis, and punctuation marks in the comments, then use the comparison deletion method to remove duplicate text, then delete comments with a length of less than 5 after cleaning, and finally use the jieba third-party library for word segmentation.

[0024] (3) Model Construction: A MacBERT-TextCNN analyzer model and an RCNN interpretation generator model were constructed. The analyzer first uses MacBERT to capture low-level semantic and syntactic information to obtain text representations, then uses TextCNN to extract features from the text before inputting them into a fully connected Softmax layer to obtain the output. The interpretation generator is a two-layer recurrent convolutional neural network, whose output is a binary variable {z1,...,z...}. l}, where z t ∈0,1 indicates whether to select the t-th word as the basis for model prediction.

[0025] (4) Joint training of the analyzer and the interpretation generator: The analyzer and the interpretation generator are jointly trained using input sample data. During training, the text is first input into the interpretation generator to obtain the prediction basis, and then the prediction basis is input into the analyzer. This training method allows the analyzer and the interpretation generator to learn together.

[0026] Example 2: As Figure 2 As shown, during training, the text is first input into the interpretation generator to obtain the prediction basis, and then the prediction basis is input into the analyzer. This training method allows the analyzer and interpretation generator to learn together. Let the interpretation generator be denoted as gen(·), and the input be denoted as... x t The words in the text are represented by the output of the generator, denoted as {z1,...,z...}. l}, where z t ∈0,1 indicates whether to select word x t This serves as the basis for model prediction. Therefore, Z ~ gen(X) ≡ p(Z|X). The probability of each word being selected is independent of other words, and after the generator gen(·) selects a word, to avoid selecting the same word again, a dependent word selection is introduced:

[0027]

[0028] The objective of joint training is to minimize the cost function cost(Z,X,Y)=L(Z,X,Y)+Ω(Z), where This represents the accuracy of the prediction data being input into the analyzer instead of the original text. The guided explanation generator gen(·) selects a short and coherent subset as the basis for prediction.

[0029] Example 3: As Figure 3 As shown, the analyzer first uses MacBERT to capture low-level semantic and syntactic information to obtain text representation. Then, it uses TextCNN to extract features from the text and inputs them into a fully connected Softmax layer to obtain the output. MacBERT is a pre-trained model that is fine-tuned during the training phase. TextCNN uses four types of convolutional kernels with lengths of 2, 3, 4, and 5, and the pooling layers consist of max pooling and average pooling.

[0030] Example 4: Figure 4 As shown, the interpretable Chinese comment sentiment analysis system based on hybrid neural networks includes:

[0031] (1) Data Management Module: This module has three functions: First, add data, crawl comments that are not in the database, obtain the sentiment trend of the comments and the basis for model prediction through the sentiment analysis and interpretation module, and then store them in the database together with the original comments; second, delete data; and third, query data.

[0032] (2) Sentiment Analysis and Interpretation Module: This module has two functions: sentiment analysis, which analyzes the sentiment trend of the input text; and model interpretation, which provides users with the basis for model analysis. Both functions are implemented through the model proposed in this invention.

[0033] (3) Information display module: The module has two functions. First, the prediction basis display allows you to view the prediction basis for each comment. Second, the statistical information display allows you to statistically analyze the sentiment trend and prediction basis of comments within a specified time period and display the statistical results in the form of charts, including the proportion of various comments, the display of product advantages, the display of product disadvantages, etc.

[0034] Example 5: Figure 5 As shown, the functional modules of the interpretable Chinese comment sentiment analysis system based on hybrid neural networks are arranged as follows: The data management module is responsible for updating the database and querying data; when adding new data, the data management module first inputs the comments into the sentiment analysis and interpretation module to obtain the sentiment trend of the comments and the basis for model prediction, and then stores them together with the original comments into the database. The data displayed by the information display module is obtained from the database through the data management module.

[0035] It should be noted that the above embodiments are not intended to limit the scope of protection of the present invention. Equivalent transformations or substitutions made based on the above technical solutions all fall within the scope of protection of the claims of the present invention.

Claims

1. A method for interpretable Chinese comment sentiment analysis based on hybrid neural networks, characterized in that, The method includes the following steps: (1) Obtaining the training sample set: The training sample set is derived from product reviews on e-commerce platforms. (2) Data preprocessing: The obtained comments are deduplicated, cleaned, and segmented. (3) Model Construction: Construct the analyzer MacBERT-TextCNN model and the explanation generator RCNN model respectively. (4) Joint training of the analyzer and the explanation generator: The input sample data is used to jointly train the analyzer and the explanation generator; The joint training of the analyzer and the interpretation generator aims to ensure that the prediction criteria extracted by the interpretation generator can produce the same result as the original text in the analyzer. Therefore, during training, the text is first input into the interpretation generator to obtain the prediction criteria, and then the prediction criteria are input into the analyzer. This training method allows the analyzer and the interpretation generator to learn together. The goal of joint training is to minimize the cost function. ,in This represents the accuracy of the prediction data being input into the analyzer instead of the original text. Guided interpreter generator Choose a short and coherent subset as the basis for prediction.

2. The interpretable Chinese comment sentiment analysis method based on hybrid neural networks according to claim 1, characterized in that, The training sample set was obtained by using web crawlers to collect comments from e-commerce platforms that were longer than 5 characters. Comments with a rating of less than 3 points were classified as negative comments, comments with a rating of 3 points or more were classified as neutral comments, and comments with a rating of more than 3 points were classified as positive comments.

3. The interpretable Chinese comment sentiment analysis method based on hybrid neural networks according to claim 1, characterized in that, The data preprocessing includes: first removing the system's default positive reviews, then cleaning up emoticons, kaomojis, and punctuation marks in the comments, then using the comparison deletion method to remove duplicate text, then deleting comments with a length of less than 5 after cleaning, and finally using the jieba third-party library for word segmentation.

4. The interpretable Chinese comment sentiment analysis method based on hybrid neural networks according to claim 1, characterized in that, The process of building the analyzer involves: first, using MacBERT to capture low-level semantic and syntactic information to obtain text representations; then, using TextCNN to extract features from the text and inputting them into a fully connected Softmax layer to obtain the output.

5. The interpretable Chinese comment sentiment analysis method based on hybrid neural networks according to claim 1, characterized in that, The construction of the interpreter generator includes: the interpreter generator is a two-layer recurrent convolutional neural network, and its output is a binary variable. ,in , indicating whether to select the t-th word as the basis for model prediction.

6. A sentiment analysis system for interpretable Chinese comments based on hybrid neural networks, characterized in that, The system for implementing the sentiment analysis method according to any one of claims 1-5, the system comprising: (1) Data Management Module: This module has three functions: adding data, deleting data, and querying data; (2) Sentiment Analysis and Interpretation Module: Analyzes the sentiment trend of the input text and provides users with the basis for model analysis; (3) Information display module: Statistical analysis of the sentiment trend and prediction basis of comments within a specified time period, and display the statistical results in the form of charts.

7. The interpretable Chinese comment sentiment analysis system based on hybrid neural networks according to claim 6, characterized in that, The data management module has a new data function that crawls comments not found in the database, obtains the sentiment trend and model prediction basis of the comments through the sentiment analysis and interpretation module, and then stores them in the database along with the original comments.

Citation Information

Patent Citations

  • A method for sentiment analysis of film reviews based on deep learning and natural language processing

    AU2020100710A4

  • Machine learning-based commodity comment data sentiment analysis method

    CN108062304A