CN114911942B - Text emotion analysis method, system and equipment based on confidence level interpretability - Google Patents

Text emotion analysis method, system and equipment based on confidence level interpretability Download PDF

Info

Publication number
CN114911942B
CN114911942B CN202210607887.5A CN202210607887A CN114911942B CN 114911942 B CN114911942 B CN 114911942B CN 202210607887 A CN202210607887 A CN 202210607887A CN 114911942 B CN114911942 B CN 114911942B
Authority
CN
China
Prior art keywords
confidence
data
deep learning
network
text
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210607887.5A
Other languages
Chinese (zh)
Other versions
CN114911942A (en
Inventor
张思
翟佩云
惠柠
徐佳丽
刘清堂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Central China Normal University
Original Assignee
Central China Normal University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Central China Normal University filed Critical Central China Normal University
Priority to CN202210607887.5A priority Critical patent/CN114911942B/en
Publication of CN114911942A publication Critical patent/CN114911942A/en
Application granted granted Critical
Publication of CN114911942B publication Critical patent/CN114911942B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • G06F16/353Clustering; Classification into predefined classes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Biomedical Technology (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a text emotion analysis method, a text emotion analysis system and text emotion analysis equipment based on the interpretability of confidence, which are characterized in that firstly, pre-analyzing text data is subjected to data preprocessing; then inputting the processed data into a deep learning network for classification; then constructing a confidence divider, defining a confidence function, setting a confidence threshold value, and dividing the deep learning network classification result into two parts of confidence intensity; classifying data with high confidence by a deep learning network according to the confidence degree, and classifying data with low confidence degree by an enhancement network; and finally, combining the two network classification results and outputting a final classification result. The invention constructs a new network model framework RTS-CF, and the longer keywords are rapidly extracted through RAKE, so that the method is simple and efficient; and dividing the test set into two parts of confidence intensity through a confidence function, and reclassifying the data with the low confidence intensity by combining the enhancement network. The integration method for optimizing the neural network by utilizing the enhanced network has strong interpretability and improves the overall classification performance.

Description

Text emotion analysis method, system and equipment based on confidence level interpretability
Technical Field
The invention belongs to the technical field of text data mining, relates to a text emotion analysis method, a system and equipment, and particularly relates to a text emotion analysis method, a system and equipment with high interpretability based on confidence.
Background
With the development of internet technology and the development of modeling deep learning, the research of text emotion analysis is becoming more and more popular, and related research has very important practical significance for scientific researchers as well as daily life, for example, government departments can guide public opinion development by analyzing network public opinion emotion tendencies, e-commerce merchants can know user preferences by analyzing user comment emotion tendencies, and the like. Through deep mining and analysis of texts in various fields, the user's hobbies and interests and emotion bias can be better known.
The text emotion analysis methods commonly used at present comprise emotion classification based on dictionary, emotion analysis based on traditional machine learning and emotion analysis method based on deep learning. The deep neural network model achieves a remarkable effect in emotion classification. The classification method based on the traditional machine learning is slightly inferior to the deep learning method in terms of classification accuracy, but has own advantages in terms of interpretability and time complexity. The integrated method of the deep learning method and the traditional machine learning method can improve the overall classification performance, has strong interpretability, can realize the grasp and understanding of the emotion tendencies of individuals, and is rarely used at present and worthy of exploration and attempt. The adoption of RAKE can quickly extract some longer technical terms, namely keywords, is simple and efficient, and achieves good effect on text classification.
Disclosure of Invention
The invention aims to provide a text emotion analysis method, a text emotion analysis system and text emotion analysis equipment with high interpretability based on confidence, which are used for improving the overall text classification performance by optimizing an integration method of a deep neural network by using an enhancement model.
The technical scheme adopted by the method is as follows: a text emotion analysis method based on the interpretability of confidence comprises the following steps:
step 1: performing data preprocessing on the pre-analysis text data;
step 2: inputting the preprocessed data into a deep learning network for classification;
step 3: constructing a confidence divider, defining a confidence function, setting a confidence threshold, and dividing the deep learning network classification result into two parts of strong confidence and weak confidence;
The confidence function Wherein d is a preset value; mean is the mean function; y 1,y2 represents the output value of the deep learning network softmax layer, which is regarded as the score of the two parts of strong confidence and weak confidence respectively, wherein/>0< Y i<1,∑yi=1;zi is the output value of the i-th node, which is used as the input value of softmax; n is the number of output nodes, namely the number of classified categories; /(I)Representing the sum of all predicted results;
step 4: classifying data with high confidence by the deep learning network according to the degree of confidence, and reclassifying data with low confidence by the enhancement network;
step 5: and combining the results of the deep learning network and the enhanced network, and outputting a final classification result.
The system of the invention adopts the technical proposal that: a confidence-based interpretable text emotion analysis system, comprising the following modules:
The module 1 is used for preprocessing data aiming at pre-analysis text data;
the module 2 is used for inputting the preprocessed data into the deep learning network for classification;
the module 3 is used for constructing a confidence divider, defining a confidence function, setting a confidence threshold value and dividing the deep learning network classification result into two parts of strong confidence and weak confidence;
The confidence function Wherein d is a preset value; mean is the mean function; y 1,y2 represents the output value of the deep learning network softmax layer, which can be regarded as the score of the two parts of strong confidence and weak confidence respectively, wherein/>0< Y i<1,∑yi=1;zi is the output value of the i-th node, which is used as the input value of softmax; n is the number of output nodes, namely the number of classified categories; /(I)Representing the sum of all predicted results;
The module 4 is used for classifying the data with high confidence by the deep learning network according to the degree of confidence, and reclassifying the data with low confidence by the enhancement network;
And the module 5 is used for combining the results of the deep learning network and the enhancement network and outputting a final classification result.
The technical scheme adopted by the equipment is as follows: a confidence-based interpretable text emotion analysis device, comprising:
One or more processors;
And a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the text emotion analysis method based on confidence level interpretability.
The invention has the following technical effects:
(1) The deep learning model R-TextCNN trained by the whole training set can achieve remarkable effect on emotion classification.
(2) By extracting the keywords through the RAKE, some longer professional terms can be extracted, and good effects can be obtained.
(3) Through the confidence function, the test set can be divided into two parts of high confidence and weak confidence, and the part of data with weak confidence is reclassified by combining a traditional machine learning model.
(4) And adopting GRIDSEARCHCV to automatically adjust parameters to obtain optimized parameters.
(5) The integration method for optimizing the neural network by utilizing the enhanced network model has strong interpretability and can improve the overall classification performance.
Drawings
FIG. 1 is a flow chart of a method according to an embodiment of the present invention;
FIG. 2 is a diagram of a deep learning network architecture of an example of the present invention;
FIG. 3 is a graph of the calculation of the softmax function of an example of the invention;
FIG. 4 is a diagram of an enhanced network architecture of an example of the present invention;
FIG. 5 is a hyperplane view of an enhanced network of an example of the present invention;
Fig. 6 is a diagram of an RTS-CF network architecture of an example of the present invention.
Detailed Description
In order to facilitate the understanding and practice of the invention, those of ordinary skill in the art will now make further details with reference to the drawings and examples, it being understood that the examples described herein are for the purpose of illustration and explanation only and are not intended to limit the invention thereto.
Educational text mining is a non-negligible area in text mining. Potential learning feelings and emotion tendencies of learners can be mined and found from simple texts, reference and basis can be provided for personalized teaching, teachers can be helped to quickly master learning conditions of the learners, learning attitudes and overall progress are included, timely answering and confusion are facilitated, and feedback is provided. As a research hotspot in the field of education text mining, the emotion tendencies of learners are calculated and analyzed through texts, so that the learning method not only can help to learn and analyze potential psychological changes of the learners, but also can help to diversify and enrich teaching resources and modes. Many online platforms play an important teaching aid, allowing learners to freely publish personal views and subjective feelings, and to perform social interactions with others. Text is the simplest and most common way of interaction among them. Here, standing at the emotion angle, the emotion tendencies of the learner can be analyzed from the text through the published viewpoints, the whole learning state of the learner can be known in time, and possibility is provided for teacher feedback and intervention.
Referring to fig. 1, the text emotion analysis method based on the confidence level interpretability provided by the invention comprises the following steps:
step 1: performing data preprocessing on the pre-analysis text data;
in this embodiment, the specific implementation of step 1 includes the following sub-steps:
Step 1.1: the acquired text data are arranged into required data types and stored in txt files;
step 1.2: reading and writing text file content, removing blank spaces and other useless symbols for subsequent use;
In this embodiment, for the subsequent classification work, the data needs to be processed into txt files for reading text content, symbols other than chinese, specified punctuation marks are removed, and stored in new txt files.
Step 2: inputting the preprocessed data into a deep learning network for classification;
please refer to fig. 2, the deep learning network R-TextCNN of the present embodiment includes a RAKE extraction keyword layer, a keyword embedding layer, a convolution layer, a max pooling layer, and a fully-connected softmax layer;
The RAKE extraction keyword layer of this embodiment is a method for rapidly and automatically extracting keywords. Dividing the text into a plurality of sentences by using appointed punctuation marks such as periods, question marks, exclamation marks, commas and the like; for each clause, using stop words as separators to divide the sentence into a plurality of phrases, wherein the phrases are candidate words to be sequenced; each phrase consists of a plurality of words, a score is given to each word, the score of each phrase is obtained by accumulation, Where deg is the degree of each word, and refers to the co-occurrence times of all words in the text in the candidate keywords, freq is the word frequency of each word; ranking the extracted candidate keywords from large to small; finally, outputting a plurality of phrases with the top ranking scores as keywords;
The keyword embedding layer of this embodiment converts the extracted keywords into embedding representations. N words mapped to word vectors are concatenated into a sentence. A sentence of length n is expressed as: x 1:n=x1⊕x2⊕...⊕xn; wherein x i∈RK is a k-dimensional word vector corresponding to the i-th word in the sentence; one is a connection operation; x i:i+j represents the concatenation of the word x i,xi+1,...,xi+j;
The convolution layer of the embodiment uses a convolution kernel w with the width d and the height h to carry out convolution operation with x i:i+h-1 (h words), and then uses an activation function to activate to obtain a corresponding feature c i, and the convolution operation is denoted as c i=f(w.xi:i+h-1 +b); wherein w is an initialization weight, b is a bias term, and h is a filter window length; after convolution operation, a vector c of n-h+1 dimensions is obtained: c= [ c 1,c2,...,ci,...,cn-h+1 ]; wherein n is the word number of each sentence;
The maximum pooling layer of this embodiment takes the maximum value of a plurality of one-dimensional vectors obtained after convolution, and then splices the maximum value together as the output value of this layer: z= { z 1,z2,z3,...,zi,...,zm }; wherein z i=max{ci;
the fully connected softmax layer of this embodiment sends z into the fully connected softmax layer to obtain the tag probability distribution of the sentence: Wherein y i is a predicted value corresponding to label i, and w i is the weight of the full connection layer; label i is the i-th class label.
The deep learning network adopted in the embodiment is a trained deep learning network; the training process comprises the following substeps:
(1) Collecting a training data text set, and dividing the text and the label into a training set and a testing set according to the sample ratio;
The present embodiment divides the data set into a training set and a test set by the train_test_split () function, setting the sample duty ratio test_size. For example, there are 100 data, test_size=0.2, then 80% of the training set, 80% of the test set, 20% of the test set, and 20.
(2) Creating an embedding matrix, obtaining an embedding vector through embedding an index, assigning the embedding vector into the embedding matrix, and loading a pre-trained word to be embedded into an embedding layer;
(3) Training a deep learning network using a training set;
(4) After training the data, the deep learning network is saved and used for predicting and classifying the test set.
Step 3: constructing a confidence divider, defining a confidence function, setting a confidence threshold, and dividing the deep learning network classification result into two parts of strong confidence and weak confidence;
Confidence function employed in the present embodiment D is the training frequency of the deep learning network, the minimum interval of the iteration frequency in training is preset, the iteration frequency when the loss function value of the first training of the deep learning network tends to be stable is taken as a reference, and a model is trained for testing data every time one iteration interval is added on the basis; if the minimum interval=5, the iteration frequency standard=50, and the training frequency d=3, the deep learning network needs to train and test when the iteration frequency is 55, 60 and 65 respectively; mean is the mean function; y 1,y2 represents the output value of the deep learning network softmax layer, which can be regarded as the score of the two parts of strong confidence and weak confidence respectively, wherein/>0< Y i<1,∑yi=1;zi is the output value of the i-th node, which is used as the input value of softmax; n is the number of output nodes, namely the number of classified categories; /(I)Representing the sum of all predicted results;
Please refer to fig. 3, the softmax function, also called normalized exponential function, adopted in this embodiment is a popularization of a classification function sigmoid on multiple classifications, so as to display a result of multiple classifications in a probability form, and the calculation process includes the following sub-steps:
(1) Converting the prediction result into a non-negative number: the prediction result z= { z 1,z2,...,zi,...,zn } of the model is converted to an exponential function f (x) =exp (x), so that the non-negativity of the probability is ensured.
(2) The sum of the probabilities of the various predictions is equal to 1: to ensure that the sum of the probabilities is equal to 1, the converted results are normalized. By dividing the converted result exp (z i) by the sum of all converted resultsObtain approximate probability/>
In the embodiment, after the softmax layer obtains two classification scores, an intuitive confidence function is customized, and the two types of data are classified into two types of data by confidence, wherein one type of data is the data with high confidence, namely the data with large difference between the two types of scores and good classification effect; one type is data with weak confidence, namely, a part of data with small difference between the two types of scores and poor classification.
Step 4: classifying data with high confidence by the deep learning network according to the degree of confidence, and reclassifying data with low confidence by the enhancement network;
Please refer to fig. 4, in this embodiment, the enhancement network performs classification, including setting parameter adjustment points, GRIDSEARCHCV, training SVM, and classification results;
Setting a parameter adjustment point, namely setting a penalty parameter C and a kernel function parameter gamma value between 0.1 and 100, and multiplying the penalty parameter C and the kernel function parameter gamma value by 0.1 or 10 each time as a step length according to the performance of the enhanced network model; after determining the approximate range, refining the search interval;
In GRIDSEARCHCV of this embodiment, each possibility is tried by loop traversal in the parameter selection of the search interval after refinement, and the best performing parameter is the final result. The final performance of the method has a great relation with the division result of the initial data, so that the method adopts a cross verification method to reduce the accidental;
After parameter tuning, the SVM in sklearn. SVM is called to train the enhanced network model, and a result obtained by previous parameter tuning is set during training, so that a trained enhanced network model is finally obtained;
According to the classification result of the embodiment, a trained enhanced network model is loaded, and the classification result is obtained by using the trained SVM to predict and classify the data with weak opposite credibility.
Please refer to fig. 5, which is a super-plan view of the enhanced network of the present embodiment;
In this embodiment, a maximum hyperplane is found in the feature space, so that the distance between all samples and the plane is the maximum (the distance between the sample set and the plane is calculated, that is, the distance between the nearest sample point and the hyperplane is calculated), and the learning target is to solve the parameter α, determine the hyperplane, and make the distance the maximum. And the solving parameter alpha adopts an SMO algorithm, two alpha are selected in each cycle to carry out optimization processing, and once a pair of alpha which is outside an interval boundary and is not subjected to interval processing or is not on the boundary is found, one alpha is increased while the other alpha is decreased until all alpha i meets the KKT condition and the constraint condition of the optimization problem.
Its classification implementation is further described below;
D={(x1,y1),(x2,y2),...,(xm,ym)}
Given a sample set: y i = { -1, +1}; where x i is an attribute and y i is a class label. The purpose is as follows: find an optimal (most generalizing) hyperplane, separate samples of different classes.
Target hyperplane to be trained: w s Tx+bs = 0; where w s is the normal vector and b s is the displacement term.
The distance from any point x to the hyperplane (w s,bs) is:
If the hyperplane successfully classifies the sample, the following holds:
several sample points for which the equal sign holds are called "support vectors", and the sum of the distances of two heterogeneous support vectors to the hyperplane is: Which is referred to as "spacing".
Finding hyperplanes with "maximum separation", i.e.It can be appreciated that maximizing ||w s||-1 is equivalent to minimizing |w s||2, the above formula is rewritten as: /(I)The expression is the "basic type" of the SVM.
Solving the above equation to obtain a model: f (x) =w s Tx+bs;
Adding Lagrangian multiplier α ii to each constraint in the formula is equal to or greater than 0), resulting in:
Let L have a bias of 0 for w s and b s, respectively, to obtain:
substituting the binary problem of the basic type of the SVM into the above formula to obtain the binary problem of the basic type of the SVM:
solving for w s (i.e., solving for α) and b s, and obtaining a model:
The above process is required to meet the KKT condition.
Alpha is found using SMO algorithm and b s is found using the nature of the support vector.
In this embodiment, for the part of data with weak confidence, a traditional machine learning method is adopted as an enhancement model to reclassify the data. The traditional machine learning method has the characteristic of strong interpretability.
Step 5: and combining the results of the deep learning network and the enhanced network, and outputting a final classification result.
Please refer to fig. 6, which is a diagram of RTS-CF network structure;
In this embodiment, first, processing of data type and content is performed on text data; secondly, extracting keywords by RAKE, and sequentially entering a keyword embedding layer, a convolution layer, a maximum pooling layer and a fully-connected softmax layer for classification; then enter a confidence divider through a confidence function The method comprises the steps of dividing the results into the results with strong confidence and weak confidence, finding out corresponding texts and labels through indexes, and obtaining list data with strong confidence and list data with weak confidence; then, the data with strong confidence coefficient enter a deep learning network to be classified, and the data with weak confidence coefficient enter an enhancement network to be classified; and finally, merging the classification results of the two networks through a concatate () function to obtain a final prediction result.
The method of the invention is to classify the emotion of the text sent by the individual. Firstly, loading data and preprocessing the data; training a deep learning network model (existing models such as TextCNN and RNN can also be adopted) by using the whole training data, and classifying the test data; constructing a confidence divider, defining a confidence function, and dividing the deep learning network model classification result into two parts of strong confidence and weak confidence; classifying data with high confidence by a deep learning network model according to the degree of confidence, and reclassifying the data with low confidence by an enhancement network model (existing naive Bayes, SVM with naive Bayes features and the like can also be adopted), wherein the enhancement model is a traditional machine learning model; and finally, combining the results of the deep learning network model and the enhanced network model, and outputting a final classification result. The invention can obtain the emotion tendency of the text sent by the person and know the interest theme of the person. The invention adopts an integrated method of a deep learning method and a machine learning method, aims at improving the overall classification performance, and realizes the grasp and understanding of the emotion tendencies of individuals, and the modeling method is rarely used at present and deserves exploration and trial. The method adopts the RAKE to extract the keywords rapidly, is simple and efficient, can extract some longer professional term keywords, belongs to an unsupervised method, and does not need a large amount of marked data. In future research efforts, attempts may be made to find other valid confidence functions and apply the framework to other models to study their validity and applicability.
It should be understood that the foregoing description of the preferred embodiments is not intended to limit the scope of the invention, but rather to limit the scope of the claims, and that those skilled in the art can make substitutions or modifications without departing from the scope of the invention as set forth in the appended claims.

Claims (7)

1. The text emotion analysis method based on the interpretability of the confidence is characterized by comprising the following steps of:
step 1: performing data preprocessing on the pre-analysis text data;
step 2: inputting the preprocessed data into a deep learning network for classification;
step 3: constructing a confidence divider, defining a confidence function, setting a confidence threshold, and dividing the deep learning network classification result into two parts of strong confidence and weak confidence;
The confidence function Wherein d is a preset value; mean is the mean function; y 1,y2 represents the output value of the deep learning network softmax layer, which is regarded as the score of the two parts of strong confidence and weak confidence respectively, wherein/>Z i is the output value of the i-th node, which is used as the input value of softmax; n is the number of output nodes, namely the number of classified categories; /(I)Representing the sum of all predicted results;
step 4: classifying data with high confidence by the deep learning network according to the degree of confidence, and reclassifying data with low confidence by the enhancement network;
step 5: and combining the results of the deep learning network and the enhanced network, and outputting a final classification result.
2. The confidence-based interpretable text emotion analysis method of claim 1, wherein: in the step 1, data preprocessing is performed, firstly, acquired text data are arranged into required data types, and the data types are stored in txt files; the text file content is read and written, and spaces and other useless symbols are removed for subsequent use.
3. The confidence-based interpretable text emotion analysis method of claim 1, wherein: the deep learning network R-TextCNN in the step 2 comprises a RAKE extraction keyword layer, a keyword embedding layer, a convolution layer, a maximum pooling layer and a fully-connected softmax layer;
The RAKE extracts a keyword layer, and the text is divided into a plurality of sentences by using the appointed punctuation marks; for each clause, using stop words as separators to divide the sentence into a plurality of phrases, wherein the phrases are candidate words to be sequenced; each phrase consists of a plurality of words, a score is given to each word, the score of each phrase is obtained by accumulation, Where deg is the degree of each word, and refers to the co-occurrence times of the word and all words in the text in the candidate keywords, freq is the word frequency of each word; ranking the extracted candidate keywords from large to small; finally, outputting a plurality of phrases with the top ranking scores as keywords;
The keyword embedding layer converts extracted keywords into embedding representations; connecting n words mapped into word vectors into a sentence; a sentence of length n is expressed as: Wherein x i∈RK is a k-dimensional word vector corresponding to the i-th word in the sentence; /(I) Is a connecting operation; x i:i+j represents the concatenation of the word x i,xi+1,...,xi+j;
the convolution layer uses a convolution kernel w with the width d and the height h to carry out convolution operation with x i:i+h-1, and then uses an activation function to activate the convolution kernel w to obtain a corresponding feature c i, and the convolution operation is expressed as c i=f(w.xi:i+h-1 +b); wherein f is an activation function, w is an initialization weight, b is a bias term, and h is a filter window length; after convolution operation, a vector c of n-h+1 dimensions is obtained: c= [ c 1,c2,...,ci,...,cn-h+1 ]; wherein n is the word number of each sentence;
The maximum pooling layer takes the maximum value of a plurality of one-dimensional vectors obtained after convolution, and then is spliced together to serve as the output value of the layer: z= { z 1,z2,z3,...,zi,...,zm }; wherein z i=max{ci;
the fully connected softmax layer sends z into the fully connected softmax layer to obtain the tag probability distribution of sentences Wherein y i is a predicted value corresponding to label i, and w i is the weight of the full connection layer; label i is the i-th class label.
4. The confidence-based interpretable text emotion analysis method of claim 1, wherein: reclassifying by the enhanced network in the step 4, wherein the reclassifying comprises setting parameter adjusting points, GRIDSEARCHCV, training SVMs and classification results;
Setting a parameter adjustment point, namely setting a penalty parameter C and a kernel function parameter gamma value between 0.1 and 100, and multiplying the penalty parameter C and the kernel function parameter gamma value by 0.1 or 10 each time as a step length according to the performance of the enhanced network model; after determining the approximate range, refining the search interval;
In the GRIDSEARCHCV, in the parameter selection of the refined search interval, each possibility is tried through cyclic traversal, and the best-performing parameter is the final result;
After parameter tuning, the SVM is called to train the enhanced network model, and a result obtained by the previous parameter tuning is set during training, so that a trained enhanced network model is finally obtained;
And loading the classification result, loading a trained enhanced network model, and predicting and classifying the data with weak opposite credibility by using the trained SVM to obtain the classification result.
5. The confidence-based interpretable text emotion analysis method of any one of claims 1 to 4, wherein: and 5, merging the classification results of the two networks through a concatate () function to obtain a final prediction result.
6. A confidence-based interpretable text emotion analysis system, comprising the following modules:
The module 1 is used for preprocessing data aiming at pre-analysis text data;
the module 2 is used for inputting the preprocessed data into the deep learning network for classification;
the module 3 is used for constructing a confidence divider, defining a confidence function, setting a confidence threshold value and dividing the deep learning network classification result into two parts of strong confidence and weak confidence;
The confidence function Wherein d is a preset value; mean is the mean function; y 1,y2 represents the output value of the deep learning network softmax layer, which is regarded as the score of the two parts of strong confidence and weak confidence respectively, wherein/>Z i is the output value of the i-th node, which is used as the input value of softmax; n is the number of output nodes, namely the number of classified categories; /(I)Representing the sum of all predicted results;
The module 4 is used for classifying the data with high confidence by the deep learning network according to the degree of confidence, and reclassifying the data with low confidence by the enhancement network;
And the module 5 is used for combining the results of the deep learning network and the enhancement network and outputting a final classification result.
7. A confidence-based interpretable text emotion analysis device, comprising:
One or more processors;
storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the text emotion analysis method of confidence-based interpretability of any of claims 1 to 5.
CN202210607887.5A 2022-05-31 2022-05-31 Text emotion analysis method, system and equipment based on confidence level interpretability Active CN114911942B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210607887.5A CN114911942B (en) 2022-05-31 2022-05-31 Text emotion analysis method, system and equipment based on confidence level interpretability

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210607887.5A CN114911942B (en) 2022-05-31 2022-05-31 Text emotion analysis method, system and equipment based on confidence level interpretability

Publications (2)

Publication Number Publication Date
CN114911942A CN114911942A (en) 2022-08-16
CN114911942B true CN114911942B (en) 2024-06-18

Family

ID=82770893

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210607887.5A Active CN114911942B (en) 2022-05-31 2022-05-31 Text emotion analysis method, system and equipment based on confidence level interpretability

Country Status (1)

Country Link
CN (1) CN114911942B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109597891A (en) * 2018-11-26 2019-04-09 重庆邮电大学 Text emotion analysis method based on two-way length Memory Neural Networks in short-term

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080249764A1 (en) * 2007-03-01 2008-10-09 Microsoft Corporation Smart Sentiment Classifier for Product Reviews
CN109815339B (en) * 2019-01-02 2022-02-08 平安科技(深圳)有限公司 Knowledge extraction method and device based on TextCNN, computer equipment and storage medium
CN113656548B (en) * 2021-08-18 2023-08-04 福州大学 Text classification model interpretation method and system based on data envelope analysis

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109597891A (en) * 2018-11-26 2019-04-09 重庆邮电大学 Text emotion analysis method based on two-way length Memory Neural Networks in short-term

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于全局语义学习的文本情感增强方法研究;王庆林;李晗;庞良健;徐新胜;;科学技术与工程;20200728(21);全文 *

Also Published As

Publication number Publication date
CN114911942A (en) 2022-08-16

Similar Documents

Publication Publication Date Title
CN108984526B (en) Document theme vector extraction method based on deep learning
CN109753566B (en) Model training method for cross-domain emotion analysis based on convolutional neural network
CN110188358B (en) Training method and device for natural language processing model
CN109325231B (en) Method for generating word vector by multitasking model
US11113323B2 (en) Answer selection using a compare-aggregate model with language model and condensed similarity information from latent clustering
CN113239700A (en) Text semantic matching device, system, method and storage medium for improving BERT
US20200311207A1 (en) Automatic text segmentation based on relevant context
CN111985247B (en) Microblog user interest identification method and system based on multi-granularity text feature representation
CN110321563B (en) Text emotion analysis method based on hybrid supervision model
CN111274790B (en) Chapter-level event embedding method and device based on syntactic dependency graph
CN109101490B (en) Factual implicit emotion recognition method and system based on fusion feature representation
CN111914556A (en) Emotion guiding method and system based on emotion semantic transfer map
CN114722805B (en) Little sample emotion classification method based on size instructor knowledge distillation
CN115952292B (en) Multi-label classification method, apparatus and computer readable medium
CN115168574A (en) Method and device for classifying problem texts with multi-value chains
CN112269874A (en) Text classification method and system
CN114417851A (en) Emotion analysis method based on keyword weighted information
CN114265935A (en) Science and technology project establishment management auxiliary decision-making method and system based on text mining
CN114238653A (en) Method for establishing, complementing and intelligently asking and answering knowledge graph of programming education
CN113312907B (en) Remote supervision relation extraction method and device based on hybrid neural network
CN116757195B (en) Implicit emotion recognition method based on prompt learning
CN113486143A (en) User portrait generation method based on multi-level text representation and model fusion
Preetham et al. Comparative Analysis of Research Papers Categorization using LDA and NMF Approaches
CN116595170A (en) Medical text classification method based on soft prompt
CN114911942B (en) Text emotion analysis method, system and equipment based on confidence level interpretability

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant