High-accuracy emotion judgment and negative data recall method and system

Through the combination of deep neural networks and shallow neural networks, a high-accurate emotion judgment model is built, which solves the shortcomings of traditional methods in complex emotion recognition, realizes high-accurate emotion analysis and negative data recall, and improves user experience .

CN119088964AActive Publication Date: 2024-12-06HUNAN SHIWEI TECH CO LTD

Patent Information

Application Number
CN202411138731.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-12-06
Estimated Expiration
2044-08-19

AI Technical Summary

Technical Problem

Traditional emotion analysis methods have low accuracy when dealing with complex sentence patterns, metaphors and satire, and it is difficult to effectively identify users' emotional tendencies.

Method used

Using a combination of deep neural networks and shallow neural networks, a high-accurate emotion judgment model is constructed through the integration of text word segmentation, feature extraction, preliminary emotion classification model and deep emotion classification model, and improve it through negative data recall and model optimization. The accuracy of emotional judgment.

Benefits of technology

The accuracy of the full data emotional judgment is achieved by more than 90% and the negative data recall is above 95%, which can quickly identify and process negative emotions, improve user experience and maintain the long-term effectiveness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088964A_ABST
    Figure CN119088964A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of sentiment analysis, in particular to a high-accuracy sentiment judgment and negative data recall method and system. The method comprises the following steps: acquiring user text data, and performing text word segmentation on the user text data to obtain user text word segmentation data; performing feature extraction on the user text word segmentation data to obtain text word segmentation feature data; performing preliminary sentiment classification model construction on the text word segmentation data to obtain a preliminary sentiment classification model, and performing deep sentiment classification model construction to obtain a deep sentiment classification model; performing model integration to obtain an emotion judgment model; acquiring real-time user text data, and performing emotion judgment on the real-time user text data by using the emotion judgment model to obtain emotion classification label data; and performing negative data enhancement according to negative sentiment tag data in the sentiment classification tag data to obtain negative text feature enhanced data. According to the invention, various emotion information, especially negative emotion information, can be identified and processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of sentiment analysis, and in particular to a high-accuracy sentiment determination and negative data recall method and system. Background Art

[0002] In recent years, with the rapid development of the Internet and social media, a large amount of user-generated content (UGC) has emerged on various platforms. The text data published by users on social media, forums, online comments and other platforms contain their emotions, opinions and attitudes. How to automatically extract emotional information from these large amounts of text data and accurately identify users' emotional tendencies has become an important research direction in the field of natural language processing (NLP). This technology is not only widely used in business decision-making and market analysis, but also plays an important role in user experience optimization, product recommendation and other aspects.

[0003] Sentiment Analysis, also known as sentiment classification or opinion mining, is the process of identifying, extracting and analyzing subjective information through natural language processing, text analysis, computational linguistics and other technologies. Traditional sentiment analysis methods are mostly based on sentiment dictionaries and rules, relying on pre-defined sentiment vocabulary and grammatical rules to judge sentiment tendencies. However, these methods perform poorly when dealing with complex sentences, metaphors, sarcasm and other phenomena, and have low accuracy. Summary of the invention

[0004] In order to solve the above technical problems, the present invention proposes a high-accuracy sentiment judgment and negative data recall method and system to solve at least one of the above technical problems.

[0005] The present application provides a high-accuracy sentiment determination and negative data recall method, the method comprising:

[0006] S1. Obtain user text data, and perform text segmentation on the user text data to obtain user text segmentation data;

[0007] S2, extracting features from the user text segmentation data to obtain text segmentation feature data;

[0008] S3. Construct a preliminary sentiment classification model for the word segmentation data of this article to obtain a preliminary sentiment classification model, and construct a deep sentiment classification model for the text word segmentation feature data to obtain a deep sentiment classification model; integrate the preliminary sentiment classification model and the deep sentiment classification model to obtain a sentiment judgment model;

[0009] S4, obtaining real-time user text data, and using the emotion determination model to perform emotion determination on the real-time user text data to obtain emotion classification label data, wherein the emotion classification label data includes positive emotion label data, negative emotion label data, and neutral emotion label data;

[0010] S5. Extract negative data based on the negative sentiment label data in the sentiment classification label data to obtain user negative text data; perform clustering processing on the user negative text data to obtain negative text feature data; enhance negative data based on the negative text feature data to obtain negative text feature enhanced data, so as to optimize the sentiment judgment model.

[0011] The system of the present invention currently runs two sets of emotion judgment models, deep neural network and shallow neural network, at the same time, achieving an emotion judgment accuracy of more than 90% for all data and a negative data recall rate of more than 95%; at the same time, the staff continuously adds more training data to train and optimize the emotion model to achieve a higher emotion judgment accuracy. By continuously acquiring new negative emotion data and using it for model training and optimization, it is ensured that the emotion judgment model can adapt to new emotional expressions and changes in user behavior, and can maintain the long-term effectiveness and accuracy of the model. The rapid identification and processing of negative emotions by the present invention can quickly respond to user dissatisfaction and improve user experience.

[0012] Optionally, S1 includes:

[0013] Get user text data;

[0014] Perform word boundary detection based on user text data to obtain text word boundary data;

[0015] Disambiguate the text word boundary data to obtain text disambiguation data;

[0016] Perform unregistered word processing on the text disambiguation data and the preset word segmentation dictionary data to obtain text new word data;

[0017] Perform word segmentation on the new word data of the text to obtain the user text word segmentation data.

[0018] The present invention accurately detects word boundaries in the text, and can effectively segment the coherent text into independent words or phrases, which is the basis of subsequent natural language processing tasks. In particular, in languages ​​without obvious boundaries (such as Chinese), word boundary detection is particularly important. After word boundary detection, there may be multiple word segmentation methods in the text. The ambiguity resolution step selects the most appropriate word segmentation method through context information, reduces misunderstandings caused by ambiguous words, improves the accuracy of word segmentation, and is particularly beneficial for languages ​​with rich meanings and strong context dependence. In the preset word segmentation dictionary, some words may not exist, especially emerging words, proper nouns or misspelled words. The unregistered word processing step can identify and include new words by detecting and processing these words, thereby increasing the vocabulary coverage and adaptability of the model. Combining the preset word segmentation dictionary for word segmentation processing helps to ensure the accurate segmentation of common vocabulary and specific field terms. By processing new words and unregistered words, the dictionary can be dynamically updated so that the system can remain efficient and accurate when facing new text data. By taking into account the disambiguation of meaning and the processing of unregistered words, the word segmentation results can better retain contextual information, thus providing more accurate input for subsequent tasks such as sentiment analysis and topic modeling. Unregistered word processing enables the system to dynamically adapt to language changes and the introduction of new vocabulary, especially in real-time updated content such as social media and news, enabling the system to keep up with the times. From word boundary detection to the final word segmentation, each step is interrelated to ensure the consistency and accuracy of the word segmentation results, which helps to reduce the occurrence of mis-segmentation and improve the quality of text analysis.

[0019] Optionally, S2 includes:

[0020] Perform word vector conversion on user text segmentation data to obtain word vector data;

[0021] Perform inverse document frequency calculation on the word vector data to obtain inverse document frequency data;

[0022] Construct a syntax tree based on the word vector data to obtain syntax tree data;

[0023] Perform topic modeling on the inverse document frequency data to obtain topic distribution data;

[0024] Perform sentiment dictionary matching based on user text segmentation data to obtain segmentation sentiment feature data;

[0025] Perform dependency analysis based on word vector data to obtain word segmentation dependency feature data;

[0026] Calculate the sentiment intensity based on the word segmentation sentiment feature data to obtain the user text sentiment feature data;

[0027] The reverse document frequency data, syntax tree data, topic distribution data, word segmentation dependency feature data and user text sentiment feature data are integrated to obtain text word segmentation feature data.

[0028] In the present invention, by converting the text segmentation data into word vectors, the words in the text are mapped to a high-dimensional vector space, capturing the semantic relationship between words. This provides a semantic basis for subsequent analysis tasks. By calculating the importance of words in the document, TF-IDF can effectively distinguish common words from distinguishing keywords, and identify words with significant meaning in the text. Syntax tree analysis reveals the syntactic structure of the sentence, which helps to understand the complex grammatical relationship in the text, and is of great help for deeper language understanding and analysis, such as semantic analysis and information extraction. Through topic modeling (such as LDA), the main topics in the text can be identified, which helps to understand the macro content and topic distribution of the text, and is very useful for text classification, clustering and topic analysis. By matching the words in the text with the sentiment dictionary, the sentiment features of the text are extracted, which provides direct support for sentiment analysis and sentiment classification. Dependency analysis reveals the grammatical relationship between words in the text, especially the subject-predicate-object structure, modification relationship, etc., which is of great significance for understanding the core semantic structure of the sentence. The sentiment intensity of the text is calculated by sentiment feature data, and the polarity and intensity of the sentiment are quantified to provide support for more fine-grained sentiment analysis.

[0029] Optionally, the preliminary sentiment classification model construction includes:

[0030] Perform data balancing based on text segmentation feature data to obtain feature balanced data;

[0031] Perform batch input layer processing according to the feature balanced data to obtain feature input layer data;

[0032] Perform word vector embedding layer processing on the feature input layer data to obtain feature word vector embedding layer data;

[0033] Perform convolution layer processing on the feature word vector embedding layer data to obtain feature convolution layer data;

[0034] Perform activation layer calculation on the feature convolution layer data to obtain feature activation layer data;

[0035] Performing pooling layer processing on the feature activation layer data to obtain feature pooling layer data;

[0036] Perform feature splicing on the feature pooling layer data to obtain feature splicing data;

[0037] Perform full connection layer processing on the feature concatenated data to obtain feature full connection layer data;

[0038] Perform output layer processing on the feature fully connected layer data to obtain feature category probability data;

[0039] According to the text segmentation feature data, the feature category probability data is loss optimized and iterated to obtain a preliminary sentiment classification model.

[0040] In the present invention, in the training data, the emotion categories may be unbalanced (such as positive emotion data far more than negative emotion data), which will cause the model to be biased towards the majority class. The data balancing step balances the data set by oversampling the minority class or downsampling the majority class. The model's recognition ability for minority classes (such as negative emotions) is improved, the model is prevented from being overly biased towards the majority class, and the fairness and generalization ability of the model are enhanced. Batch processing makes the training process more efficient and stable, reduces memory pressure, and helps to optimize the convergence speed of algorithms (such as SGD). By utilizing the semantic expression ability of word vectors, the semantic information in the text can be better understood and represented, providing rich semantic features for subsequent feature extraction. The convolutional layer can efficiently capture local patterns and features in the text, such as emotional expressions at the phrase level, and improve sensitivity to local features. The activation layer introduces nonlinearity to help the model capture complex emotional patterns and improve the model's expression ability and classification accuracy. The pooling layer reduces the dimension of the features, reduces the computational complexity, while retaining key features to prevent overfitting. Feature concatenation combines features extracted by different convolution kernels to form a richer feature representation, which helps capture multiple feature information of the text. The fully connected layer maps high-dimensional features to the category space, which helps the final decision of the classification task and extracts global feature information. The probability distribution of the output layer makes the classification results interpretable and helps to judge the confidence of the classification. Continuously optimize the performance of the model, improve the classification accuracy, gradually reduce the classification error through iterative training, and improve the generalization ability of the model.

[0041] Optionally, deep sentiment classification model construction includes:

[0042] Perform word sequence input layer processing according to the text word segmentation feature data to obtain feature word sequence input layer data;

[0043] Perform word vector embedding on the feature word sequence input layer data to obtain feature word embedding data;

[0044] Perform hidden layer processing on the feature word embedding data to obtain feature hidden layer data;

[0045] Performing linear output layer processing on the feature hidden layer data to obtain feature linear output layer data;

[0046] The feature linear output layer data is optimized and iterated according to the text segmentation feature data to obtain the construction of the deep sentiment classification model.

[0047] The multi-layer hidden layer processing in the present invention can extract complex features and emotional patterns in the text and improve the accuracy of sentiment classification. The word vector embedding provides rich semantic information, enabling the model to better understand and process the emotional expression in the text. The linear output layer maps high-dimensional features to specific categories, providing clear classification results and probability distributions, which helps to interpret the results. The optimization iterative process continuously adjusts the model to improve its performance and generalization ability in practical applications.

[0048] Optionally, the hidden layer processing includes:

[0049] Perform multi-scale convolution processing on the feature word embedding data to obtain feature word multi-scale convolution data;

[0050] Perform multi-dimensional activation calculation on the multi-scale convolution data of the feature words to obtain feature multi-dimensional activation data;

[0051] Perform global and local pooling processing on the feature multi-dimensional activation data to obtain feature global and local pooling data;

[0052] Perform multi-head self-attention processing on the feature global local pooling data to obtain feature multi-head attention data;

[0053] Densely connect the feature multi-head attention data to obtain feature densely connected data;

[0054] Serialize the feature dense connection data to obtain feature serialized data;

[0055] Perform instance normalization on the feature serialization data to obtain the feature hidden layer data.

[0056] The multi-scale convolution in the present invention can capture different local features in the text, such as phrases, sentence structures, etc. Convolution kernels of different scales can identify multi-level information in the text, so that the model can understand the text content and emotional expression more comprehensively. The activation function introduces nonlinearity, so that the model can learn more complex feature relationships and patterns. This is very important for processing complex emotional expressions and identifying emotional nuances. Global pooling can capture the overall characteristics of the entire sentence, while local pooling can retain more fine-grained local information, can provide richer and more sophisticated feature representations, and help improve the model's ability to recognize different emotions. Multi-head self-attention can identify long-range dependencies in the text, so that the model pays attention to different parts of the text, enhances the model's sensitivity to emotional clues, and helps to identify implicit emotional information and complex emotional patterns. Dense connection can promote the transfer and reuse of features and enhance the diversity of feature representation. This structure helps the model capture more detailed information and improve the comprehensiveness of feature expression. Serialization helps to structure the management of features so that subsequent processing can better utilize these features, which can help the model retain the order information of input features and enhance the understanding of text structure. Instance normalization can reduce data heterogeneity, balance the feature scales of different instances, help improve model training stability and convergence speed, and enhance the model's generalization ability on different input data.

[0057] Optionally, the model ensemble includes:

[0058] Perform weighted average integration on the preliminary sentiment classification model and the deep sentiment classification model to obtain the integrated model output data;

[0059] According to the output data of the integrated model, the preliminary sentiment classification model and the deep sentiment classification model, an output probability screening layer is added to obtain the sentiment judgment model.

[0060] The weighted average integration in the present invention can take advantage of the advantages of different models and make up for the shortcomings of a single model. For example, a preliminary sentiment classification model may be better at quickly capturing simple sentiment features, while a deep sentiment classification model can deeply extract complex sentiment features. Through weighted averaging, a more comprehensive classification result can be obtained. By combining the outputs of multiple models, the integrated model can generally improve the overall classification accuracy. The weighted average can assign different weights according to the performance of each model to optimize the final result. The output probability screening layer can set a threshold to filter out prediction results with low confidence and improve the final prediction quality. For example, if the prediction probability of all categories is lower than a certain threshold, the sample can be marked as "uncertain" to avoid misjudgment. Through the processing of the screening layer, more fine-grained sentiment classification information is provided, such as the confidence of the classification result, the most likely category and its alternative category, etc.

[0061] Optionally, S4 includes:

[0062] Acquire real-time user text data, and use the emotion judgment model to perform emotion judgment on the real-time user text data to obtain emotion probability distribution data, wherein the emotion probability distribution data includes preliminary emotion classification probability data, deep emotion classification probability data and emotion judgment data;

[0063] Calculate the emotion probability similarity based on the preliminary emotion classification probability data, the deep emotion classification probability data and the emotion judgment data to obtain the emotion probability similarity data;

[0064] When it is determined that the emotion probability similarity data is less than or equal to the preset emotion probability similarity threshold data, the preliminary emotion classification probability data, the deep emotion classification probability data and the emotion judgment data are integrated to obtain the emotion classification label data;

[0065] When it is determined that the emotion probability similarity data is greater than the preset emotion probability similarity threshold data, voting is performed according to the preliminary emotion classification probability data, the deep emotion classification probability data and the emotion judgment data to obtain the emotion classification label data.

[0066] The present invention ensures the credibility and stability of sentiment classification results through the output and integration of multiple models. Similarity calculation and voting mechanisms help effectively deal with the differences between different models and provide reasonable solutions. Real-time acquisition and analysis of user text data, timely response to sentiment changes, and the ability to adjust the decision-making mechanism according to actual needs. By combining multiple decision-making strategies, the robustness and adaptability of the model in dealing with complex sentiment expressions and fuzzy sentiment states are improved.

[0067] Optionally, S5 includes:

[0068] Negative data is extracted based on the negative sentiment label data in the sentiment classification label data to obtain the user's negative text data;

[0069] Perform feature extraction based on the user's negative text data to obtain the user's negative text feature data;

[0070] Performing clustering processing on the user's negative text feature data to obtain negative text feature data;

[0071] Perform cluster area screening on negative text feature data to obtain negative text feature screening data;

[0072] Perform cluster analysis on the negative text feature screening data to obtain negative text pattern data;

[0073] Performing data expansion on the negative text pattern data to obtain negative text expansion data;

[0074] The negative text extension data and the user's negative text data are merged and features are extracted to obtain negative text feature enhancement data for sentiment judgment model optimization.

[0075] The multi-level clustering and pattern analysis in the present invention helps to identify and understand the diversity and complexity of negative emotions. Cluster area screening and data merging ensure the representativeness of the analysis and the quality of the data, and reduce noise. Data expansion increases the diversity of training data and improves the robustness and generalization ability of the model. By constructing more comprehensive negative emotion feature data, it provides richer input for model training and optimization, and improves the accuracy and effect of emotion judgment.

[0076] Optionally, a high-accuracy sentiment determination and negative data recall system is used to execute the high-accuracy sentiment determination and negative data recall method as described above, and the high-accuracy sentiment determination and negative data recall system comprises:

[0077] A user text segmentation module is used to obtain user text data and perform text segmentation on the user text data to obtain user text segmentation data;

[0078] A text segmentation feature extraction module is used to extract features from user text segmentation data to obtain text segmentation feature data;

[0079] The sentiment judgment model construction module is used to construct a preliminary sentiment classification model for the word segmentation data of the article to obtain a preliminary sentiment classification model, and to construct a deep sentiment classification model for the text word segmentation feature data to obtain a deep sentiment classification model; the preliminary sentiment classification model and the deep sentiment classification model are integrated to obtain a sentiment judgment model;

[0080] A real-time user text emotion determination module is used to obtain real-time user text data, and use an emotion determination model to perform emotion determination on the real-time user text data to obtain emotion classification label data, wherein the emotion classification label data includes positive emotion label data, negative emotion label data, and neutral emotion label data;

[0081] The negative data recall optimization module is used to extract negative data based on the negative sentiment label data in the sentiment classification label data to obtain the user's negative text data; perform clustering processing based on the user's negative text data to obtain negative text feature data; perform negative data enhancement based on the negative text feature data to obtain negative text feature enhancement data to perform sentiment judgment model optimization operations.

[0082] The objects of the present invention are:

[0083] 1. Through multi-level feature extraction, it can capture subtle emotional changes and deep semantic information in the text, providing a more accurate basis for sentiment analysis. The efficient execution of word segmentation and feature extraction processes ensures the performance and efficiency of the system when processing large-scale data.

[0084] 2. For the shallow judgment model, a preliminary integration of fasttext and textcnn or one of them is used. For the deep judgment model, multi-head attention is used, which can be cnn+mutilhead or encoder-decoder, to achieve a multi-level understanding of text emotions. The preliminary model is good at capturing simple emotional features, while the deep model can recognize more complex emotional patterns. The outputs of different models are weighted averaged, and the final classification results are optimized through the output probability screening layer. Combining the advantages of multiple models, the accuracy and robustness of emotional judgment are improved.

[0085] 3. Real-time processing and determination of user emotions enable the system to quickly respond to changes in user emotional states and adapt to dynamic user interaction environments. Supports real-time data stream processing and can update sentiment analysis results in a timely manner when data sources change. Through data enhancement and feature merging, the model can learn more diverse negative emotional expressions, enhancing the adaptability and generalization of the model in different emotional scenarios. The model can continuously adjust and optimize according to new data and emotional patterns to improve the long-term stability and accuracy of the system. By accurately identifying and responding to users' negative emotions, it helps companies or platforms quickly deal with user dissatisfaction and improve user experience and satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0086] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting implementations made with reference to the following drawings:

[0087] Figure 1 A flowchart of the steps of a high-accuracy sentiment determination and negative data recall method according to an embodiment is shown;

[0088] Figure 2 A flowchart showing a method for word segmentation of user text according to an embodiment of the present invention is shown;

[0089] Figure 3 A flowchart showing a method for extracting text word segmentation features according to an embodiment of the present invention is shown;

[0090] Figure 4 A flowchart showing a method for determining a user's text emotion in real time according to an embodiment of the present invention is provided;

[0091] Figure 5 A flowchart showing the steps of a negative data recall optimization method according to an embodiment is shown;

[0092] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0093] The following is a clear and complete description of the technical method of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by technicians in this field without creative work are within the scope of protection of the present invention.

[0094] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor methods and / or microcontroller methods.

[0095] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.

[0096] See also Figures 1 to 5 The present application provides a high-accuracy sentiment determination and negative data recall method, the method comprising:

[0097] S1. Obtain user text data, and perform text segmentation on the user text data to obtain user text segmentation data;

[0098] Specifically, the text data input by the user is obtained through the user interface, API, or file import. Stop words, punctuation marks, special characters, etc. are removed to normalize the text. The text is split into a word list using a word segmentation algorithm (such as Jieba word segmentation, LTP, SnowNLP, etc.).

[0099] S2, extracting features from the user text segmentation data to obtain text segmentation feature data;

[0100] Specifically, the segmented text data is converted into vector representation (such as Word2Vec, GloVe, BERT, etc.) and specific features are extracted, such as term frequency (TF), inverse document frequency (IDF), part-of-speech tagging, etc.

[0101] S3. Construct a preliminary sentiment classification model for the word segmentation data of this article to obtain a preliminary sentiment classification model, and construct a deep sentiment classification model for the text word segmentation feature data to obtain a deep sentiment classification model; integrate the preliminary sentiment classification model and the deep sentiment classification model to obtain a sentiment judgment model;

[0102] Specifically, the deep sentiment classification model is a deep neural network and the preliminary sentiment classification model is a shallow neural network. The preliminary sentiment classification model and the deep sentiment classification model are integrated (such as adding a voting layer) to obtain a sentiment judgment model.

[0103] Deep / shallow neural networks can be built using the FastText algorithm or the TextCNN algorithm. FastText is a fast text classification model based on word embedding and linear classifiers. It quickly computes text representations by averaging word vectors and uses a linear classifier for classification. Segment the text and remove stop words. Use FastText to convert the segmented text into word vectors and calculate the average word vector. Use the average word vector as a feature to train a linear classifier (such as logistic regression or linear support vector machine). Evaluate the performance of the model and adjust hyperparameters to improve the model accuracy.

[0104] TextCNN is a text classification model based on convolutional neural network (CNN). It extracts local features in text through multiple convolution kernels and uses fully connected layers for classification. Performs word segmentation and word embedding conversion on text. Uses multiple convolution kernels to extract text features. Uses max pooling layer to extract important features. Uses fully connected layers for classification. Trains TextCNN model using training data. Evaluates the performance of the model and adjusts hyperparameters to improve the model accuracy.

[0105] Specifically, the word segmentation data in this article is divided into data sets to obtain training data sets and test data sets;

[0106] Perform convolution calculation on the training data set to obtain the convolution layer data of the training data;

[0107] Perform multi-head attention calculation on the convolutional layer data of the training data to obtain the multi-head self-attention layer data of the training data;

[0108] Pooling the multi-head self-attention layer data of the training data to obtain the pooling layer data of the training data;

[0109] Perform full connection calculation on the training data pooling layer data to obtain the training data full connection layer data;

[0110] The fully connected layer data of the training data is exponentially calculated and iteratively trained through the test data set to obtain the sentiment judgment model.

[0111] Specifically, a deep neural network model is constructed for the word segmentation data of this article to obtain a preliminary sentiment classification model; a deep sentiment classification model including a multi-head attention layer is constructed for the text segmentation feature data to obtain a deep sentiment classification model; a voting layer is added to the preliminary sentiment classification model and the deep sentiment classification model to obtain a sentiment judgment model.

[0112] S4, obtaining real-time user text data, and using the emotion determination model to perform emotion determination on the real-time user text data to obtain emotion classification label data, wherein the emotion classification label data includes positive emotion label data, negative emotion label data, and neutral emotion label data;

[0113] Specifically, the text data most recently input by the user is obtained through the real-time interface, and the sentiment determination model is used to perform sentiment classification on the real-time text data, and the sentiment classification label is output.

[0114] S5. Extract negative data based on the negative sentiment label data in the sentiment classification label data to obtain user negative text data; perform clustering processing on the user negative text data to obtain negative text feature data; enhance negative data based on the negative text feature data to obtain negative text feature enhanced data, so as to optimize the sentiment judgment model.

[0115] Specifically, filter out text data with negative sentiment from the classification labels. Perform clustering processing (such as K-means, DBSCAN, etc.) on the negative text data to identify different negative sentiment topics. Perform feature enhancement on the clustering results (such as adjusting the word weights of negative texts, generating reverse words, etc.). Use the enhanced negative text feature data to update and optimize the sentiment judgment model.

[0116] Specifically, we obtain user comment data from the platform. We use word segmentation tools to segment the comment data. We use TF-IDF to extract features from the segmented text. We build a preliminary sentiment classification model and a deep sentiment classification model, and integrate the two models to obtain a sentiment judgment model.

[0117] Get the latest real-time user comment data from the platform, use the integrated model to perform sentiment classification on the real-time user comment data, and obtain classification labels. Extract negative sentiment comments, perform feature extraction and clustering. Perform data enhancement and put it into the model for further training to improve the performance of the sentiment judgment model.

[0118] The system of the present invention currently runs two sets of emotion judgment models, deep neural network and shallow neural network, at the same time, achieving an emotion judgment accuracy of more than 90% for all data and a negative data recall rate of more than 95%; at the same time, the staff continuously adds more training data to train and optimize the emotion model to achieve a higher emotion judgment accuracy. By continuously acquiring new negative emotion data and using it for model training and optimization, it is ensured that the emotion judgment model can adapt to new emotional expressions and changes in user behavior, and can maintain the long-term effectiveness and accuracy of the model. The rapid identification and processing of negative emotions by the present invention can quickly respond to user dissatisfaction and improve user experience.

[0119] Optionally, S1 includes:

[0120] S11, obtaining user text data;

[0121] Specifically, user text data is obtained through user input interface, API, file import, etc.

[0122] S12, performing word boundary detection according to user text data to obtain text word boundary data;

[0123] Specifically, word boundary detection is performed using an algorithm based on a statistical model or rule, such as a conditional random field (CRF), a hidden Markov model (HMM), and the like.

[0124] Conditional Random Field (CRF) is a probabilistic graphical model used to label and segment sequential data. In word boundary detection, CRF can be used to predict the position label of each character, such as "this" (the beginning of the word), "of" (inside the word), "." (the end of the word), "goods" (a separate word), etc. Extract features for each character, such as context characters, part of speech of the character, whether it is a number, whether it is a punctuation, etc. Use the labeled text data to train the CRF model and learn the labeling pattern of the character sequence. Perform label prediction on the newly input text to generate a word boundary label sequence.

[0125] Hidden Markov Model (HMM) is a statistical model that models by transition probabilities between states and emission probabilities of each state. In word boundary detection, HMM uses word boundary labels as hidden states and characters as observations. Observation features of characters are extracted. State transition probabilities and emission probabilities are estimated using labeled data. The Viterbi algorithm is used to find the most likely word boundary label sequence.

[0126] S13, disambiguating text word boundary data to obtain text disambiguation data;

[0127] Specifically, ambiguity resolution is performed using methods such as context analysis and part-of-speech tagging, such as semantic-based algorithms and neural network models (such as BERT).

[0128] Determine the exact meaning of words with multiple interpretations by analyzing the contextual information of the words and the word's part of speech. This approach can use a rule-based system or a combination of statistical and machine learning methods, such as using a part-of-speech tagger and context windows for analysis. Segment the text and tag the parts of speech. Determine the specific meaning of the words based on the contextual information through rules or models. Use word part-of-speech tags and semantic information to determine the correct meaning of each word.

[0129] Using the pre-trained BERT model, we can obtain the embedding vector of words through context, and then perform semantic matching to resolve ambiguity. Neural network models such as BERT can capture the nuances of words through context and give more accurate word meanings. Segment and encode the text to meet the input requirements of the BERT model. Input the sentence and obtain the context embedding vector of each word. Perform semantic resolution by matching the embedding vector of the word with the predefined word meaning vector.

[0130] S14, performing unregistered word processing on the text disambiguation data and the preset word segmentation dictionary data to obtain text new word data;

[0131] Specifically, an unregistered word detection algorithm is used, such as a rule-based method based on dictionary matching, a statistical method or a neural network model.

[0132] S15. Segment the text new word data to obtain user text word segmentation data.

[0133] Specifically, word segmentation is performed using a word segmentation algorithm (such as a Viterbi algorithm based on a maximum probability path, a word segmentation algorithm based on a two-way maximum matching, etc.).

[0134] The Viterbi algorithm is a dynamic programming algorithm that is widely used to solve the optimal path problem. In word segmentation, the Viterbi algorithm can find the most likely word segmentation path through a probability model. Use a large corpus to build a dictionary and calculate the probability of occurrence of each word. Define the state transition probability and emission probability. The state transition probability is the probability of transitioning from one word to the next. The emission probability is the probability of generating a character sequence given a word. Use dynamic programming to find the optimal word segmentation path.

[0135] The Bidirectional Maximum Matching (BiMM) algorithm combines the forward maximum matching (FMM) and the reverse maximum matching (RMM) to improve the accuracy of word segmentation by comparing the word segmentation results of the two methods. The forward maximum matching (FMM) scans the text from left to right and matches the longest word each time. The reverse maximum matching (RMM) scans the text from right to left and matches the longest word each time. Compare the results of the two methods and select the result with fewer segmented words, or select the best result based on other rules.

[0136] Specifically, the new word data of the text is segmented to obtain the user text word segmentation data, wherein the word segmentation is calculated by the word segmentation calculation formula, and the word segmentation calculation formula is specifically:

[0137]

[0138] S(w i ) is the word w i The higher the score, the greater the probability of the segmentation path. exp is an exponential function, u i For the word w i The mean data in the Gaussian distribution, σ i For the word w i The mean and standard deviation in a Gaussian distribution, P(w i |w i-1 ) is the word w i Given the previous word w i-1 The conditional probability, w i is the i-th text new word data, θ i For the word w i The contextual perspective is used to introduce directional information about words in the context.

[0139] The present invention accurately detects word boundaries in the text, and can effectively segment the coherent text into independent words or phrases, which is the basis of subsequent natural language processing tasks. In particular, in languages ​​without obvious boundaries (such as Chinese), word boundary detection is particularly important. After word boundary detection, there may be multiple word segmentation methods in the text. The ambiguity resolution step selects the most appropriate word segmentation method through context information, reduces misunderstandings caused by ambiguous words, improves the accuracy of word segmentation, and is particularly beneficial for languages ​​with rich meanings and strong context dependence. In the preset word segmentation dictionary, some words may not exist, especially emerging words, proper nouns or misspelled words. The unregistered word processing step can identify and include new words by detecting and processing these words, thereby increasing the vocabulary coverage and adaptability of the model. Combining the preset word segmentation dictionary for word segmentation processing helps to ensure the accurate segmentation of common vocabulary and specific field terms. By processing new words and unregistered words, the dictionary can be dynamically updated so that the system can remain efficient and accurate when facing new text data. By taking into account the disambiguation of meaning and the processing of unregistered words, the word segmentation results can better retain contextual information, thus providing more accurate input for subsequent tasks such as sentiment analysis and topic modeling. Unregistered word processing enables the system to dynamically adapt to language changes and the introduction of new vocabulary, especially in real-time updated content such as social media and news, enabling the system to keep up with the times. From word boundary detection to the final word segmentation, each step is interrelated to ensure the consistency and accuracy of the word segmentation results, which helps to reduce the occurrence of mis-segmentation and improve the quality of text analysis.

[0140] Optionally, S2 includes:

[0141] S21, converting the user text segmentation data into word vectors to obtain word vector data;

[0142] Specifically, a pre-trained word vector model (such as Word2Vec, GloVe, BERT, etc.) is used to convert the word segmentation data into a vector representation.

[0143] S22, performing reverse document frequency calculation on the word vector data to obtain reverse document frequency data;

[0144] Specifically, the TF-IDF value is calculated, the frequency of the terms in the document collection is counted, and the inverse document frequency (IDF) is calculated.

[0145] S23, constructing a syntax tree according to the word vector data to obtain syntax tree data;

[0146] Specifically, a syntax tree structure is constructed using a syntax parsing algorithm (such as dependency syntax analysis, phrase structure tree, etc.).

[0147] S24, performing topic modeling on the reverse document frequency data to obtain topic distribution data;

[0148] Specifically, use topic modeling algorithms (such as LDA, PCA, etc.) to extract the topic distribution of the text. First, perform preprocessing on the text, such as word segmentation, stop word removal, and word form restoration. Use the bag of words model to convert the text data into a word frequency matrix, or TF-IDF matrix. Use the LDA algorithm to train the word frequency matrix and extract a specified number of topics. Calculate the distribution of each topic in each document, that is, the topic distribution data.

[0149] Perform word segmentation, stop word removal, word form restoration, etc. on the text. Use the bag-of-words model or TF-IDF matrix to represent the document. Use PCA to reduce the dimension of the TF-IDF matrix and extract the main components. The projection value of each document on the main component is the topic distribution data.

[0150] S25, performing sentiment dictionary matching according to the user text segmentation data to obtain the segmentation sentiment feature data;

[0151] Specifically, a predefined sentiment dictionary is used to match sentiment words in the text and extract sentiment features.

[0152] S26. Perform dependency analysis based on the word vector data to obtain word segmentation dependency feature data;

[0153] Specifically, use a dependency parsing algorithm (such as Stanford Parser) to analyze the dependencies between words. Perform word segmentation and part-of-speech tagging on the text. Convert the segmented words into word vector representations. If pre-trained word vectors (such as Word2Vec, GloVe, etc.) are used, directly search for the corresponding vectors. Use a dependency parsing algorithm or tool (such as StanfordParser, spaCy, etc.) to analyze the sentence structure and generate a dependency tree. The generated dependency tree is the syntax tree data, which describes the dependencies between words.

[0154] S27, calculating the sentiment intensity according to the word segmentation sentiment feature data to obtain the user text sentiment feature data;

[0155] Specifically, based on the sentiment dictionary and the sentiment intensity formula, the sentiment intensity of each sentiment word is calculated.

[0156] S28. Integrate the reverse document frequency data, syntax tree data, topic distribution data, word segmentation dependency feature data, and user text sentiment feature data to obtain text word segmentation feature data.

[0157] Specifically, the reverse document frequency data, syntax tree data, topic distribution data, word segmentation dependency feature data and user text sentiment feature data are feature fused.

[0158] In the present invention, by converting the text segmentation data into word vectors, the words in the text are mapped to a high-dimensional vector space, capturing the semantic relationship between words. This provides a semantic basis for subsequent analysis tasks. By calculating the importance of words in the document, TF-IDF can effectively distinguish common words from distinguishing keywords, and identify words with significant meaning in the text. Syntax tree analysis reveals the syntactic structure of the sentence, which helps to understand the complex grammatical relationship in the text, and is of great help for deeper language understanding and analysis, such as semantic analysis and information extraction. Through topic modeling (such as LDA), the main topics in the text can be identified, which helps to understand the macro content and topic distribution of the text, and is very useful for text classification, clustering and topic analysis. By matching the words in the text with the sentiment dictionary, the sentiment features of the text are extracted, which provides direct support for sentiment analysis and sentiment classification. Dependency analysis reveals the grammatical relationship between words in the text, especially the subject-predicate-object structure, modification relationship, etc., which is of great significance for understanding the core semantic structure of the sentence. The sentiment intensity of the text is calculated by sentiment feature data, and the polarity and intensity of the sentiment are quantified to provide support for more fine-grained sentiment analysis.

[0159] Optionally, the preliminary sentiment classification model construction includes:

[0160] Perform data balancing based on text segmentation feature data to obtain feature balanced data;

[0161] Specifically, data balancing techniques such as undersampling, oversampling, SMOTE, etc. are used to balance the proportions of positive, negative, and neutral samples.

[0162] Text segmentation feature data, where the number of samples of different categories (such as positive, negative, neutral) is unbalanced. You can simply copy the minority class samples, or use a generative method (such as SMOTE) to generate new samples. Directly copy the minority class samples until their number is equal to the number of majority class samples. Or use the synthetic minority class oversampling technique to generate new minority class samples by interpolation.

[0163] Perform batch input layer processing according to the feature balanced data to obtain feature input layer data;

[0164] Specifically, the balanced feature data is divided into batches and prepared to be input into the input layer of the neural network. In the process of neural network training, batch processing is a commonly used method that divides the input data into multiple small batches and performs forward propagation and back propagation on each batch. This method helps improve training efficiency, stabilize gradient updates, and make full use of hardware resources.

[0165] The balanced feature data and corresponding classification labels obtained from the previous step. Set the number of samples contained in each batch (such as 32, 64, etc.). Divide the balanced feature data and label data according to the batch size.

[0166] Perform word vector embedding layer processing on the feature input layer data to obtain feature word vector embedding layer data;

[0167] Specifically, an embedding layer is used to convert input features into a fixed-length word vector embedding representation. Word embedding is a method that maps discrete words to a continuous vector space, so that the semantic relationship between words can be represented by the distance and direction between vectors, including Word2Vec, GloVe, and FastText.

[0168] The input data is usually preprocessed and segmented text data. Convert the text data into an index representation (i.e., each word corresponds to a unique index). Define an embedding layer to convert the input word index into the corresponding word vector. The embedding layer looks up a pre-trained or randomly initialized word vector based on the word index and maps it to a fixed-length vector representation.

[0169] The main function of the embedding layer is to convert the high-dimensional sparse word index representation into a low-dimensional dense word vector representation, so that the subsequent neural network layer can process text data more efficiently. The embedding layer captures the semantic relationship between words and enhances the expressiveness and generalization ability of the model.

[0170] Perform convolution layer processing on the feature word vector embedding layer data to obtain feature convolution layer data;

[0171] Specifically, a one-dimensional convolutional layer (1D-CNN) is applied to extract local context features. Multiple convolutional filters are applied to the embedded layer data to perform convolution operations to extract local features. The convolutional kernel slides in the text to capture local n-gram features, which helps to understand the contextual relationship of words.

[0172] Perform activation layer calculation on the feature convolution layer data to obtain feature activation layer data;

[0173] Specifically, an activation function (such as ReLU) is applied to introduce nonlinearity. In neural networks, activation functions are used to introduce nonlinearity so that the model can learn and represent more complex functions. Common activation functions include ReLU (Rectified Linear Unit), Sigmoid, Tanh, etc. The ReLU activation function sets the part of the input value less than 0 to 0 and retains the part greater than 0. The ReLU activation function is applied element by element to the feature convolution layer data to obtain the feature activation layer data.

[0174] Performing pooling layer processing on the feature activation layer data to obtain feature pooling layer data;

[0175] Specifically, apply maximum pooling or average pooling to reduce data dimensions and prevent overfitting. Define a maximum pooling layer to downsample the convolution layer output and extract important features. Define a global maximum pooling layer to take the maximum value of each feature map as output to further extract features.

[0176] Perform feature splicing on the feature pooling layer data to obtain feature splicing data;

[0177] Specifically, the pooling layer data of multiple layers or channels are spliced ​​together to form a unified feature vector. In neural networks, feature splicing is used to splice feature data from multiple layers or channels together to form a unified feature vector. Feature splicing can effectively integrate multi-level information and improve the model's expressiveness and classification performance. Use the splicing operation to merge the pooling layer data of multiple layers or channels.

[0178] Perform full connection layer processing on the feature concatenated data to obtain feature full connection layer data;

[0179] Specifically, a fully connected layer is used to map the concatenated data to the output space. A fully connected layer is defined to map the input features to the output space, such as using a linear transformation and an activation function to process the input features.

[0180] Perform output layer processing on the feature fully connected layer data to obtain feature category probability data;

[0181] Specifically, the softmax activation function is used to calculate the probability of each category. The output layer is the last layer of the neural network, which is used to generate the final prediction results. In classification tasks, the softmax activation function is usually used to calculate the probability of each category. The softmax function converts the output of each neuron in the output layer into a probability value, and the sum of all probability values ​​is 1.

[0182] According to the text segmentation feature data, the feature category probability data is loss optimized and iterated to obtain a preliminary sentiment classification model.

[0183] Specifically, the cross entropy loss function is used to calculate the loss, and an optimization algorithm (such as Adam, SGD) is applied to perform gradient descent and model parameter updates.

[0184] In the present invention, in the training data, the emotion categories may be unbalanced (such as positive emotion data far more than negative emotion data), which will cause the model to be biased towards the majority class. The data balancing step balances the data set by oversampling the minority class or downsampling the majority class. The model's recognition ability for minority classes (such as negative emotions) is improved, the model is prevented from being overly biased towards the majority class, and the fairness and generalization ability of the model are enhanced. Batch processing makes the training process more efficient and stable, reduces memory pressure, and helps to optimize the convergence speed of algorithms (such as SGD). By utilizing the semantic expression ability of word vectors, the semantic information in the text can be better understood and represented, providing rich semantic features for subsequent feature extraction. The convolutional layer can efficiently capture local patterns and features in the text, such as emotional expressions at the phrase level, and improve sensitivity to local features. The activation layer introduces nonlinearity to help the model capture complex emotional patterns and improve the model's expression ability and classification accuracy. The pooling layer reduces the dimension of the features, reduces the computational complexity, while retaining key features to prevent overfitting. Feature concatenation combines features extracted by different convolution kernels to form a richer feature representation, which helps capture multiple feature information of the text. The fully connected layer maps high-dimensional features to the category space, which helps the final decision of the classification task and extracts global feature information. The probability distribution of the output layer makes the classification results interpretable and helps to judge the confidence of the classification. Continuously optimize the performance of the model, improve the classification accuracy, gradually reduce the classification error through iterative training, and improve the generalization ability of the model.

[0185] Optionally, deep sentiment classification model construction includes:

[0186] Perform word sequence input layer processing according to the text word segmentation feature data to obtain feature word sequence input layer data;

[0187] Specifically, text segmentation feature data is converted into fixed-length sequence data, and padding and truncation methods are often used to process text sequences of different lengths.

[0188] Perform word vector embedding on the feature word sequence input layer data to obtain feature word embedding data;

[0189] Specifically, a pre-trained word vector model or a custom word vector layer is used to convert word sequences into embedding vectors. The custom word vector layer is a technique that maps discrete words to a continuous vector space. Through this mapping, words can be represented as dense vectors of fixed dimensions that capture the semantic relationship between words. The custom word vector layer is learned during the training process and can better adapt to specific tasks and fields. The input text data needs to be segmented and indexed. Define an embedding layer to convert the word index into a word vector.

[0190] Perform hidden layer processing on the feature word embedding data to obtain feature hidden layer data;

[0191] Specifically, deep learning models (such as RNN, LSTM, GRU, etc.) are used to process sequence data and extract temporal and contextual features.

[0192] Specifically, encoders and decoders are used for deep processing. Sequence encoding: The encoder converts the input sequence into a fixed-length vector to capture the global information of the sequence. Sequence decoding: The decoder uses the context vector to generate the output sequence to capture the local information and dependencies of the sequence.

[0193] Convert the input word index into a fixed-length word vector representation. Use the LSTM encoder to encode the input sequence into a fixed-length context vector. Use the LSTM decoder to decode the context vector into the target sequence. Use a fully connected layer to map the decoder output to a vector of the vocabulary size and use the softmax activation function to calculate the probability of each word.

[0194] Performing linear output layer processing on the feature hidden layer data to obtain feature linear output layer data;

[0195] Specifically, a fully connected layer (dense layer) (linear transformation and softmax calculation) is used to map the hidden layer output to the output dimension, and a softmax activation function is used to output the category probability.

[0196] The feature linear output layer data is optimized and iterated according to the text segmentation feature data to obtain the construction of the deep sentiment classification model.

[0197] Specifically, the loss function (such as cross entropy) is calculated, and an optimization algorithm (such as Adam, SGD, etc.) is used to perform gradient descent and parameter updates to iteratively optimize the model.

[0198] The multi-layer hidden layer processing in the present invention can extract complex features and emotional patterns in the text and improve the accuracy of sentiment classification. The word vector embedding provides rich semantic information, enabling the model to better understand and process the emotional expression in the text. The linear output layer maps high-dimensional features to specific categories, providing clear classification results and probability distributions, which helps to interpret the results. The optimization iterative process continuously adjusts the model to improve its performance and generalization ability in practical applications.

[0199] Optionally, the hidden layer processing includes:

[0200] Perform multi-scale convolution processing on the feature word embedding data to obtain feature word multi-scale convolution data;

[0201] Specifically, convolution kernels of different sizes are used to perform convolution operations on word embedding data to capture text features of different scales. Multiple sizes of convolution kernels (such as 3×1, 5×1, 7×1, etc.) are applied.

[0202] Perform multi-dimensional activation calculation on the multi-scale convolution data of the feature words to obtain feature multi-dimensional activation data;

[0203] Specifically, a nonlinear activation function (such as ReLU, tanh, etc.) is used to activate the multi-scale convolution output.

[0204] Perform global and local pooling processing on the feature multi-dimensional activation data to obtain feature global and local pooling data;

[0205] Specifically, global pooling (such as global average pooling, global maximum pooling) and local pooling (such as maximum pooling, average pooling) are combined to retain important features and reduce data dimensions.

[0206] Perform multi-head self-attention processing on the feature global local pooling data to obtain feature multi-head attention data;

[0207] Specifically, a multi-head self-attention mechanism (such as the multi-head attention mechanism in Transformer) is used to capture the dependencies between words in the sequence.

[0208] Densely connect the feature multi-head attention data to obtain feature densely connected data;

[0209] Specifically, the outputs of multiple attention heads are concatenated to form a dense feature representation.

[0210] Serialize the feature dense connection data to obtain feature serialized data;

[0211] Specifically, the connected dense features are serialized for subsequent operations (such as normalization, etc.).

[0212] Perform instance normalization on the feature serialization data to obtain the feature hidden layer data.

[0213] Specifically, the instance normalization method is used to normalize the data distribution of each instance. The feature serialization data is calculated and subtracted from the mean, and normalized by dividing by the standard deviation.

[0214] Specifically, and more importantly, the instance normalization process includes:

[0215] Performing filtering instance normalization processing on the feature serialization data to obtain the first feature hidden layer data;

[0216] Perform extreme value instance normalization processing on the feature serialization data to obtain the second feature hidden layer data;

[0217] Performing feature fusion on the first feature hidden layer data and the second feature hidden layer data to obtain feature hidden layer data;

[0218] Specifically, the mean and standard deviation of each feature are calculated, and a threshold (such as 3 times the standard deviation) is set to detect outliers. The detected outliers are removed from the data set. The filtered data is standardized to obtain the first feature hidden layer data.

[0219] Use the extreme value normalization method to scale the data to a specified range (such as [0,1]), consider the maximum and minimum values ​​of each feature, and obtain the second feature hidden layer data.

[0220] Fuse the first feature hidden layer data with the second feature hidden layer data, using weighted average, feature concatenation or other fusion strategies. Directly concatenate the two sets of feature vectors into a new vector. Assign weights according to the importance of each feature and perform weighted average of the two sets of features.

[0221] The normalization process of filtering instances includes:

[0222] Calculate statistical features according to the feature serialization data to obtain feature serialization statistical feature data;

[0223] Perform weighted calculation based on the feature serialization statistical feature data to obtain filtering threshold data;

[0224] Performing filtering instance normalization processing on the feature serialization data according to the filtering threshold data to obtain the first feature hidden layer data;

[0225] Specifically, the statistical features of the feature serialization data, such as the mean, standard deviation, quartiles, etc., are calculated. Based on the statistical features, weights are assigned to each feature, and the filter threshold is calculated. Input the feature serialization statistical feature data. Assign weights and determine the feature importance based on the standard deviation or other statistical features of the feature. Calculate the filter threshold data in the following ways: set a fixed standard deviation multiple (such as 3 times the standard deviation), or other weighting methods based on statistics, such as weighting based on the interquartile range (IQR).

[0226] Apply filter thresholds to normalize feature serialization data, remove outliers and standardize data. Input feature serialization data and filter threshold data.

[0227] For each data instance, determine whether it is within the filter threshold range: if the data instance is within the range, it is retained. If it is out of the range, it is considered an outlier and processed (such as removed or corrected). The retained data is normalized, such as zero mean unit variance normalization, to obtain the first feature hidden layer data.

[0228] The extreme value instance normalization process includes:

[0229] Calculate the feature importance weights of the feature serialization data to obtain feature importance weight data;

[0230] The feature serialization data is weighted and normalized according to the feature importance weight data to obtain the second feature hidden layer data.

[0231] Specifically, a trained model (such as random forest, XGBoost) is used to calculate the feature importance score, or a statistical method (such as variance analysis, information gain) is used to evaluate the importance of the feature. A weight value is assigned to each feature, and the weight value can be normalized according to the feature importance score so that the sum of all weights is 1. The feature importance weight data is obtained.

[0232] According to the calculated feature importance weight data, the feature serialization data is normalized to the extreme value, and the data range of each feature is adjusted. i Normalize: x′ i is the second feature hidden layer data, min(x i ) is the minimum value of the i-th feature serialization data, max(x i ) is the maximum value of the i-th feature serialization data, w i is the feature importance weight data corresponding to the i-th feature serialization data.

[0233] The multi-scale convolution in the present invention can capture different local features in the text, such as phrases, sentence structures, etc. Convolution kernels of different scales can identify multi-level information in the text, so that the model can understand the text content and emotional expression more comprehensively. The activation function introduces nonlinearity, so that the model can learn more complex feature relationships and patterns. This is very important for processing complex emotional expressions and identifying emotional nuances. Global pooling can capture the overall characteristics of the entire sentence, while local pooling can retain more fine-grained local information, can provide richer and more sophisticated feature representations, and help improve the model's ability to recognize different emotions. Multi-head self-attention can identify long-range dependencies in the text, so that the model pays attention to different parts of the text, enhances the model's sensitivity to emotional clues, and helps to identify implicit emotional information and complex emotional patterns. Dense connection can promote the transfer and reuse of features and enhance the diversity of feature representation. This structure helps the model capture more detailed information and improve the comprehensiveness of feature expression. Serialization helps to structure the management of features so that subsequent processing can better utilize these features, which can help the model retain the order information of input features and enhance the understanding of text structure. Instance normalization can reduce data heterogeneity, balance the feature scales of different instances, help improve model training stability and convergence speed, and enhance the model's generalization ability on different input data.

[0234] Optionally, the model ensemble includes:

[0235] Perform weighted average integration on the preliminary sentiment classification model and the deep sentiment classification model to obtain the integrated model output data;

[0236] Specifically, the output probabilities of the two models are weighted averaged and the weight parameters are set. (For example, the weights of the preliminary model and the deep model are w1 and w2 respectively). The weighted average y=w1×y1+w2×y2 is calculated, where y is the final weighted output.

[0237] According to the output data of the integrated model, the preliminary sentiment classification model and the deep sentiment classification model, an output probability screening layer is added to obtain the sentiment judgment model.

[0238] Specifically, a screening layer is added to screen the probability output by the model. The screening layer can determine the final sentiment classification label based on a set threshold or other conditions. For example, the most credible sentiment label can be screened out based on preset conditions (such as the highest probability, fixed threshold, etc.).

[0239] The weighted average integration in the present invention can take advantage of the advantages of different models and make up for the shortcomings of a single model. For example, a preliminary sentiment classification model may be better at quickly capturing simple sentiment features, while a deep sentiment classification model can deeply extract complex sentiment features. Through weighted averaging, a more comprehensive classification result can be obtained. By combining the outputs of multiple models, the integrated model can generally improve the overall classification accuracy. The weighted average can assign different weights according to the performance of each model to optimize the final result. The output probability screening layer can set a threshold to filter out prediction results with low confidence and improve the final prediction quality. For example, if the prediction probability of all categories is lower than a certain threshold, the sample can be marked as "uncertain" to avoid misjudgment. Through the processing of the screening layer, more fine-grained sentiment classification information is provided, such as the confidence of the classification result, the most likely category and its alternative category, etc.

[0240] Optionally, S4 includes:

[0241] S41, acquiring real-time user text data, and using the emotion determination model to perform emotion determination on the real-time user text data to obtain emotion probability distribution data, wherein the emotion probability distribution data includes preliminary emotion classification probability data, deep emotion classification probability data, and emotion determination data;

[0242] Specifically, the text data input by the user is obtained in real time, and the text is sentimentally classified using the trained sentiment judgment model, and the classification probability is output. The preliminary sentiment classification probability data is the output data of the preliminary sentiment classification model, the deep sentiment classification probability data is the output data of the deep sentiment classification model, and the sentiment judgment data is the output data of the sentiment judgment model.

[0243] S42, performing emotion probability similarity calculation based on the preliminary emotion classification probability data, the deep emotion classification probability data, and the emotion determination data to obtain emotion probability similarity data;

[0244] Specifically, the similarity between the preliminary emotion classification probability data, the deep emotion classification probability data and the emotion judgment data can be calculated, and similarity metrics such as Euclidean distance and cosine similarity can be used. The similarity between each data is calculated to obtain emotion probability similarity data.

[0245] S43: When it is determined that the emotion probability similarity data is less than or equal to the preset emotion probability similarity threshold data, the preliminary emotion classification probability data, the deep emotion classification probability data and the emotion judgment data are integrated to obtain emotion classification label data;

[0246] Specifically, when the similarity data is less than or equal to a preset threshold, the preliminary sentiment classification probability data, the deep sentiment classification probability data, and the sentiment judgment data are integrated to form a consistent sentiment classification label.

[0247] S44: When it is determined that the emotion probability similarity data is greater than the preset emotion probability similarity threshold data, voting is performed according to the preliminary emotion classification probability data, the deep emotion classification probability data and the emotion judgment data to obtain the emotion classification label data.

[0248] Specifically, when the similarity data is greater than a preset threshold, a voting mechanism is used to determine the final sentiment classification label based on the output probability of each model. Based on the probability of each model output, a voting mechanism is used to determine the final sentiment label.

[0249] The present invention ensures the credibility and stability of sentiment classification results through the output and integration of multiple models. Similarity calculation and voting mechanisms help effectively deal with the differences between different models and provide reasonable solutions. Real-time acquisition and analysis of user text data, timely response to sentiment changes, and the ability to adjust the decision-making mechanism according to actual needs. By combining multiple decision-making strategies, the robustness and adaptability of the model in dealing with complex sentiment expressions and fuzzy sentiment states are improved.

[0250] Optionally, S5 includes:

[0251] S51, extracting negative data according to the negative sentiment label data in the sentiment classification label data to obtain negative text data of the user;

[0252] Specifically, the texts corresponding to negative emotions in the sentiment classification label data are screened out, and the relevant data of negative emotions are extracted.

[0253] S52, extracting features based on the user's negative text data to obtain the user's negative text feature data;

[0254] Specifically, text feature extraction methods (such as TF-IDF, word vector, topic modeling, etc.) are used to extract features of negative text.

[0255] S54, performing clustering processing on the user's negative text feature data to obtain negative text feature data;

[0256] Specifically, clustering algorithms (such as K-means, DBSCAN, hierarchical clustering, etc.) are used to cluster negative text feature data to identify different negative topics or patterns.

[0257] S55, performing cluster area screening on the negative text feature data to obtain negative text feature screening data;

[0258] Specifically, the size of each cluster is calculated, and valid clusters are screened out according to a preset area or sample quantity threshold.

[0259] S55, performing cluster analysis on the negative text feature screening data to obtain negative text pattern data;

[0260] Specifically, further analyze the filtered clusters to determine the characteristics and patterns of each cluster. Analyze the high-frequency words in the cluster to determine the theme of the cluster. For example, if the high-frequency words in a cluster are "bad", "terrible", and "complaint", it can be inferred that the theme of the cluster is the user's dissatisfaction with the product or service. Use topic modeling methods (such as LDA) to extract the theme words of each cluster to help understand the theme of each cluster.

[0261] According to the characteristic words and themes of each cluster, the negative sentiment pattern of the cluster is determined. For example: Pattern 1: Product quality issues - characteristic words include "poor quality", "broken", "not durable", etc. Pattern 2: Poor service attitude - characteristic words include "bad attitude", "unfriendly", "impatient", etc. Pattern 3: Logistics and delivery issues - characteristic words include "delay", "missed delivery", "slow delivery", etc. Negative text pattern data includes the characteristic description of each cluster and the corresponding theme pattern.

[0262] S56, performing data expansion on the negative text mode data to obtain negative text expansion data;

[0263] Specifically, negative text pattern data is expanded through data augmentation methods (such as synonym replacement, text generation, etc.) to generate more negative samples.

[0264] Use an existing synonym dictionary (such as WordNet, CNKI Thesaurus, etc.), or a list of synonyms learned from a corpus. Selectively replace some words in a sentence so that the overall meaning of the sentence remains unchanged. For each word in a negative text sample, find its synonym. Randomly select a synonym to replace and generate a new sentence. Original sentence: "The customer service attitude is very poor.", Synonym replacement: "The customer service attitude is particularly poor."

[0265] S57, merging and extracting features of the negative text extension data and the user's negative text data to obtain negative text feature enhancement data for optimizing the sentiment judgment model.

[0266] Specifically, the expanded data is merged with the original user negative text data, and feature extraction is performed again.

[0267] The multi-level clustering and pattern analysis in the present invention helps to identify and understand the diversity and complexity of negative emotions. Cluster area screening and data merging ensure the representativeness of the analysis and the quality of the data, and reduce noise. Data expansion increases the diversity of training data and improves the robustness and generalization ability of the model. By constructing more comprehensive negative emotion feature data, it provides richer input for model training and optimization, and improves the accuracy and effect of emotion judgment.

[0268] Optionally, a high-accuracy sentiment determination and negative data recall system is used to execute the high-accuracy sentiment determination and negative data recall method as described above, and the high-accuracy sentiment determination and negative data recall system comprises:

[0269] A user text segmentation module is used to obtain user text data and perform text segmentation on the user text data to obtain user text segmentation data;

[0270] A text segmentation feature extraction module is used to extract features from user text segmentation data to obtain text segmentation feature data;

[0271] The sentiment judgment model construction module is used to construct a preliminary sentiment classification model for the word segmentation data of the article to obtain a preliminary sentiment classification model, and to construct a deep sentiment classification model for the text word segmentation feature data to obtain a deep sentiment classification model; the preliminary sentiment classification model and the deep sentiment classification model are integrated to obtain a sentiment judgment model;

[0272] A real-time user text emotion determination module is used to obtain real-time user text data, and use an emotion determination model to perform emotion determination on the real-time user text data to obtain emotion classification label data, wherein the emotion classification label data includes positive emotion label data, negative emotion label data, and neutral emotion label data;

[0273] The negative data recall optimization module is used to extract negative data based on the negative sentiment label data in the sentiment classification label data to obtain the user's negative text data; perform clustering processing based on the user's negative text data to obtain negative text feature data; perform negative data enhancement based on the negative text feature data to obtain negative text feature enhancement data to perform sentiment judgment model optimization operations.

[0274] The objects of the present invention are:

[0275] 1. Through multi-level feature extraction, it can capture subtle emotional changes and deep semantic information in the text, providing a more accurate basis for sentiment analysis. The efficient execution of word segmentation and feature extraction processes ensures the performance and efficiency of the system when processing large-scale data.

[0276] 2. For the shallow judgment model, a preliminary integration of fasttext and textcnn or one of them is used. For the deep judgment model, multi-head attention is used, which can be cnn+mutilhead or encoder-decoder, to achieve a multi-level understanding of text emotions. The preliminary model is good at capturing simple emotional features, while the deep model can recognize more complex emotional patterns. The outputs of different models are weighted averaged, and the final classification results are optimized through the output probability screening layer. Combining the advantages of multiple models, the accuracy and robustness of emotional judgment are improved.

[0277] 3. Real-time processing and determination of user emotions enable the system to quickly respond to changes in user emotional states and adapt to dynamic user interaction environments. Supports real-time data stream processing and can update sentiment analysis results in a timely manner when data sources change. Through data enhancement and feature merging, the model can learn more diverse negative emotional expressions, enhancing the adaptability and generalization of the model in different emotional scenarios. The model can continuously adjust and optimize according to new data and emotional patterns to improve the long-term stability and accuracy of the system. By accurately identifying and responding to users' negative emotions, it helps companies or platforms quickly deal with user dissatisfaction and improve user experience and satisfaction.

[0278] Therefore, from any point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the attached application documents rather than the above description, and it is intended that all changes falling within the meaning and scope of equivalent elements of the application documents are included in the present invention.

[0279] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.

Claims

1. A high-accuracy sentiment determination and negative data recall method, characterized in that: The method comprises: S1. Obtain user text data, and perform text segmentation on the user text data to obtain user text segmentation data; S2, extracting features from the user text segmentation data to obtain text segmentation feature data; S3. Construct a preliminary sentiment classification model for the word segmentation data of this article to obtain a preliminary sentiment classification model, and construct a deep sentiment classification model for the text word segmentation feature data to obtain a deep sentiment classification model; integrate the preliminary sentiment classification model and the deep sentiment classification model to obtain a sentiment judgment model; S4, obtaining real-time user text data, and using the emotion determination model to perform emotion determination on the real-time user text data to obtain emotion classification label data, wherein the emotion classification label data includes positive emotion label data, negative emotion label data, and neutral emotion label data; S5. Extract negative data based on the negative sentiment label data in the sentiment classification label data to obtain user negative text data; perform clustering processing on the user negative text data to obtain negative text feature data; enhance negative data based on the negative text feature data to obtain negative text feature enhanced data, so as to optimize the sentiment judgment model.

2. The method according to claim 1, characterized in that S1 includes: Get user text data; Perform word boundary detection based on user text data to obtain text word boundary data; Disambiguate the text word boundary data to obtain text disambiguation data; Perform unregistered word processing on the text disambiguation data and the preset word segmentation dictionary data to obtain text new word data; Perform word segmentation on the new word data of the text to obtain the user text word segmentation data.

3. The method according to claim 1, characterized in that S2 include: Perform word vector conversion on user text segmentation data to obtain word vector data; Perform inverse document frequency calculation on the word vector data to obtain inverse document frequency data; Construct a syntax tree based on the word vector data to obtain syntax tree data; Perform topic modeling on the inverse document frequency data to obtain topic distribution data; Perform sentiment dictionary matching based on user text segmentation data to obtain segmentation sentiment feature data; Perform dependency analysis based on word vector data to obtain word segmentation dependency feature data; Calculate the sentiment intensity based on the word segmentation sentiment feature data to obtain the user text sentiment feature data; The reverse document frequency data, syntax tree data, topic distribution data, word segmentation dependency feature data and user text sentiment feature data are integrated to obtain text word segmentation feature data.

4. The method according to claim 1, characterized in that: The initial sentiment classification model construction includes: Perform data balancing based on text segmentation feature data to obtain feature balanced data; Perform batch input layer processing according to the feature balanced data to obtain feature input layer data; Perform word vector embedding layer processing on the feature input layer data to obtain feature word vector embedding layer data; Perform convolution layer processing on the feature word vector embedding layer data to obtain feature convolution layer data; Perform activation layer calculation on the feature convolution layer data to obtain feature activation layer data; Performing pooling layer processing on the feature activation layer data to obtain feature pooling layer data; Perform feature splicing on the feature pooling layer data to obtain feature splicing data; Perform full connection layer processing on the feature concatenated data to obtain feature full connection layer data; Perform output layer processing on the feature fully connected layer data to obtain feature category probability data; According to the text segmentation feature data, the feature category probability data is loss optimized and iterated to obtain a preliminary sentiment classification model.

5. The method according to claim 1, characterized in that The construction of deep sentiment classification model includes: Perform word sequence input layer processing according to the text word segmentation feature data to obtain feature word sequence input layer data; Perform word vector embedding on the feature word sequence input layer data to obtain feature word embedding data; Perform hidden layer processing on the feature word embedding data to obtain feature hidden layer data; Performing linear output layer processing on the feature hidden layer data to obtain feature linear output layer data; The feature linear output layer data is optimized and iterated according to the text segmentation feature data to obtain the construction of the deep sentiment classification model.

6. The method according to claim 5, characterized in that The hidden layer processing includes: Perform multi-scale convolution processing on the feature word embedding data to obtain feature word multi-scale convolution data; Perform multi-dimensional activation calculation on the multi-scale convolution data of the feature words to obtain feature multi-dimensional activation data; Perform global and local pooling processing on the feature multi-dimensional activation data to obtain feature global and local pooling data; Perform multi-head self-attention processing on the feature global local pooling data to obtain feature multi-head attention data; Densely connect the feature multi-head attention data to obtain feature densely connected data; Serialize the feature dense connection data to obtain feature serialized data; Perform instance normalization on the feature serialization data to obtain the feature hidden layer data.

7. The method according to claim 1, characterized in that The model ensemble includes: Perform weighted average integration on the preliminary sentiment classification model and the deep sentiment classification model to obtain the integrated model output data; According to the output data of the integrated model, the preliminary sentiment classification model and the deep sentiment classification model, an output probability screening layer is added to obtain the sentiment judgment model.

8. The method according to claim 1, characterized in that S4 includes: Acquire real-time user text data, and use the emotion judgment model to perform emotion judgment on the real-time user text data to obtain emotion probability distribution data, wherein the emotion probability distribution data includes preliminary emotion classification probability data, deep emotion classification probability data and emotion judgment data; Calculate the emotion probability similarity based on the preliminary emotion classification probability data, the deep emotion classification probability data and the emotion judgment data to obtain the emotion probability similarity data; When it is determined that the emotion probability similarity data is less than or equal to the preset emotion probability similarity threshold data, the preliminary emotion classification probability data, the deep emotion classification probability data and the emotion judgment data are integrated to obtain the emotion classification label data; When it is determined that the emotion probability similarity data is greater than the preset emotion probability similarity threshold data, voting is performed according to the preliminary emotion classification probability data, the deep emotion classification probability data and the emotion judgment data to obtain the emotion classification label data.

9. The method according to claim 1, characterized in that S5 include: Extract negative data based on negative sentiment label data in sentiment classification label data to obtain negative text data of users; Perform feature extraction based on the user's negative text data to obtain the user's negative text feature data; Performing clustering processing on the user's negative text feature data to obtain negative text feature data; Perform cluster area screening on negative text feature data to obtain negative text feature screening data; Perform cluster analysis on the negative text feature screening data to obtain negative text pattern data; Performing data expansion on the negative text pattern data to obtain negative text expansion data; The negative text extension data and the user's negative text data are merged and features are extracted to obtain negative text feature enhancement data for sentiment judgment model optimization.

10. A high-accuracy sentiment determination and negative data recall system, characterized in that: Used to execute the high-accuracy sentiment determination and negative data recall method as claimed in claim 1, the high-accuracy sentiment determination and negative data recall system comprises: A user text segmentation module is used to obtain user text data and perform text segmentation on the user text data to obtain user text segmentation data; A text segmentation feature extraction module is used to extract features from user text segmentation data to obtain text segmentation feature data; The sentiment judgment model construction module is used to construct a preliminary sentiment classification model for the word segmentation data of the article to obtain a preliminary sentiment classification model, and to construct a deep sentiment classification model for the text word segmentation feature data to obtain a deep sentiment classification model; the preliminary sentiment classification model and the deep sentiment classification model are integrated to obtain a sentiment judgment model; A real-time user text emotion determination module is used to obtain real-time user text data, and use an emotion determination model to perform emotion determination on the real-time user text data to obtain emotion classification label data, wherein the emotion classification label data includes positive emotion label data, negative emotion label data, and neutral emotion label data; The negative data recall optimization module is used to extract negative data based on the negative sentiment label data in the sentiment classification label data to obtain the user's negative text data; perform clustering processing based on the user's negative text data to obtain negative text feature data; perform negative data enhancement based on the negative text feature data to obtain negative text feature enhancement data to perform sentiment judgment model optimization operations.

Citation Information

Patent Citations

  • Emotion classifying method fusing intrinsic feature and shallow feature

    CN105824922A

  • Social public opinion monitoring system based on microblogs and monitoring method thereof

    CN111444404A

  • Big data analysis method and system based on community governance data

    CN113569008A

  • Multi-task learning sentiment classification method fusing multi-head attention mechanism

    CN114238577A

  • Text-based sentiment classification method and device, computer equipment and storage medium

    CN114358201A

Cited By

  • Customer service response evaluation method and system based on large language model

    CN119494588A

  • Product comment detection method based on anti-provincial chain reasoning

    CN120179917A

  • Virtual scene level generation method and device, electronic equipment, computer readable storage medium and computer program product

    CN120860601A

  • Level generation method and device of virtual scene, electronic equipment, computer readable storage medium and computer program product

    CN120860601B