CN114764564A - Aspect-level emotion polarity classification method based on fusion linguistic knowledge - Google Patents
Aspect-level emotion polarity classification method based on fusion linguistic knowledge Download PDFInfo
- Publication number
- CN114764564A CN114764564A CN202210465093.XA CN202210465093A CN114764564A CN 114764564 A CN114764564 A CN 114764564A CN 202210465093 A CN202210465093 A CN 202210465093A CN 114764564 A CN114764564 A CN 114764564A
- Authority
- CN
- China
- Prior art keywords
- layer
- speech
- linguistic knowledge
- test
- equal
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/284—Lexical analysis, e.g. tokenisation or collocates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/243—Classification techniques relating to the number of classes
- G06F18/2431—Multiple classes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/25—Fusion techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/253—Grammatical analysis; Style critique
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Computational Linguistics (AREA)
- Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Machine Translation (AREA)
Abstract
The invention discloses an aspect-level emotion polarity classification method based on fusion linguistic knowledge, which comprises the following steps of: (1) establishing a training sample set and a testing sample set; (2) building an aspect level emotion classification model based on fusion linguistic knowledge; (3) performing iterative training on the aspect-level emotion polarity classification model; (4) and obtaining the classification result of the aspect level emotion polarity. The invention constructs an aspect-level emotion polarity classification network based on fusion linguistic knowledge, analyzes and extracts the specific linguistic knowledge in the comment data by utilizing the existing SOTA model, builds a linguistic knowledge fusion network based on a graph neural network and an attention mechanism, fuses the linguistic knowledge implied in the comment data into the final word expression, and improves the accuracy of the aspect-level emotion polarity classification.
Description
Technical Field
The invention belongs to the technical field of natural language processing, relates to a text emotion polarity classification method, and particularly relates to an aspect-level emotion polarity classification method based on fusion linguistic knowledge.
Background
Today, people often express their emotions such as joy, anger, sadness, music, etc. by making comments on the internet. The sentiment information contained in the comments can help a consumer to quickly judge whether a certain service is worth consuming, and can also help a service provider to improve the product of the consumer. It is difficult to determine the sentiment expressed by a comment, especially when the same comment contains sentiment information that is diametrically opposite for different aspects of the same thing. Therefore, how to accurately and efficiently mine potential fine-grained subjective emotion in comment data is an urgent problem to be solved in the current text emotion analysis field.
The aspect-level sentiment polarity classification method is a powerful tool for mining potential fine-grained subjective sentiment information in comment data. The aspect-level sentiment polarity classification ASC is used for judging the sentiment polarity of a given aspect word in a comment sentence, the aspect word refers to a word or a phrase describing a specific aspect of an entity in the comment sentence, and the sentiment polarity comprises negative, neutral and positive. For example, a comment sentence "beautiful in shape but not highly famous" for a certain historical relic implies two diametrically opposite emotional polarities of "positive" and "negative" for the given aspect words "shape" and "famous", respectively.
With the continuous and deep research of scientific research personnel on the classification task of the aspect-level emotion polarities, a plurality of classification methods of the aspect-level emotion polarities are proposed:
the patent document of Chongqing university at its application, "an aspect level sentiment classification model" (application No.: 202010778078.1, application publication No.: CN 111985205A) discloses an aspect level sentiment polarity classification model. The method comprises the steps of firstly converting sentences into word vectors by using an embedding layer, then inputting the word vectors into a neural network layer based on a gating cycle unit GRU to convert the word vectors into corresponding hidden state sequences, and then capturing information important for the emotion polarity of a given aspect from the hidden state sequences by using a multi-head attention mechanism MHA instead of a common cyclic neural network RNN, so that the relation between the sentences and the given aspect is strengthened. However, the invention has the defect that the RNN is simply replaced by MHA, and the classification accuracy of comment data with different language styles is still deficient regardless of the expression mode and language habit specific to the comment data.
Kai Shuang et al published an article titled Interactive POS-aware network for aspect-level sentiment classification in 2020 on neuro output, and disclosed an aspect-level sentiment polarity classification method, which considers that part of sample data with 'limitation' exists in comment data set, and the final expression of the model can be influenced by the part of data, so that the article provides an Interactive tag POS perception network IPAN, which explicitly introduces POS information, firstly distinguishes different POS type information through a POS filter gate, and then uses an attention mechanism based on POS to help the model concentrate on the lemmas containing important sentiment orientations. But there is a problem in that the method only notices the influence of the part of speech of the lemma in the comment sentence on the emotional polarity, but ignores the influence of the special grammatical relation possibly existing between the lemma in the comment sentence on the aspect-level emotional polarity.
In summary, for the application of fine-grained sentiment polarity classification, the existing method ignores the expression mode and language style specific to the comment data, and does not effectively utilize linguistic knowledge, which is rich in meaning, but specifically refers to the relation between part-of-speech tags and grammar in the invention to mine the sentiment polarity of the aspect level contained in the comment data, so that the problem of low classification accuracy occurs.
Disclosure of Invention
The invention aims to provide an aspect emotion polarity classification method based on fusion linguistic knowledge, aiming at the defects of the prior art. The invention fully considers the uniqueness of the comment data, integrates linguistic knowledge into the deep learning model, and is used for solving the problem that the accuracy of classification of the aspect-level emotion polarity is low because the specific language style and expression mode of the comment data are ignored and the emotion polarity accumulated in the comment data cannot be effectively mined by utilizing the linguistic knowledge in many current classification methods of the aspect-level emotion polarity.
The technical scheme adopted by the invention comprises the following steps:
(1) establishing a training sample set XtrainAnd test sample set Xtest:
(1a) Obtaining N comment sentences C ═ { C ═ CnN is more than or equal to 1 and less than or equal to N, wherein c nThe n-th comment sentence is represented, is shown by cnThe mth lemma in the sequence is N not less than 1000, M not less than 32 and not more than 64;
(1b) for each comment sentence cnEach element ofPerforming IOB labeling to obtain an IOB label sequence set R ═ R corresponding to CnN is more than or equal to 1 and less than or equal to N, wherein rnDenotes cnCorresponding IOB tag sequence, rn={γm|1≤m≤M,γm∈{O,I,B}},γmIndicating IOB labels corresponding to the mth word element, O, I, B respectively indicating that the word element does not belong to the aspect word, belongs to the aspect word and is the first word element of the aspect word;
(1c) extracting each comment sentence cnEach of the word elementsCorresponding part-of-speech tag POS is obtained, and a part-of-speech tag sequence set P ═ { P } corresponding to C is obtainednN is more than or equal to 1 and less than or equal to N, and a part-of-speech dependency graph set is constructed according to PWherein p isnDenotes cnA sequence of corresponding part-of-speech tags, to representThe corresponding part-of-speech tag is,noun, verb, conj, adj, adv, and unk respectively represent nouns, verbs, conjunctions, adjectives, adverbs, and other parts of speech,denotes cnA corresponding part-of-speech dependency graph;
(1d) extracting each comment sentence cnCorresponding syntax parsing tree, obtaining C corresponding syntax parsing tree set T ═ TnN is more than or equal to 1 and less than or equal to N, and a part-of-speech dependency graph set is constructed according to TWherein, tn、Respectively represent cnCorresponding syntax parse tree and syntax dependency graph;
(1e) Constructing a data set S ═ SnN is more than or equal to 1 and less than or equal to N, and N is randomly selected1Training sample set X consisting of individual data and corresponding real emotion polaritiestrain=(Strain;Ytrain) Will remain N2Combining the individual data and the corresponding real emotion polarities into a test sample set Xtest=(Stest;Ytest) Wherein, in the step (A),representing the nth data, S, in the data settrainA set of training data is represented that is, denotes the n-th1Individual training data, YtrainDenotes StrainThe corresponding set of true emotion polarities are set, to representCorresponding true emotional polarity, StestA set of test data is represented that is, denotes the n-th2Test data, YtestDenotes StestA corresponding set of true emotion polarities for the respective emotion patterns, to representThe corresponding true emotional polarity of the user's hand,N2=N-N1;
(2) building an aspect level emotion polarity classification model M based on fusion linguistic knowledge;
building text feature embedding modules M including sequential connectionsembedLinguistic knowledge extraction module MextractAnd linguistic knowledge fusion module MpoolAspect level Emotion polarity Classification model M, wherein MembedAdopting a Bert network structure; mextractThe system comprises a graph neural network consisting of double-layer graph convolution layers which are arranged in parallel; mpoolThe system comprises an attention analyzer, a normalization layer and a full connection layer which are sequentially connected and are composed of a plurality of full connection layers;
(3) performing iterative training on the aspect level emotion polarity classification model M:
(3a) The iteration frequency is T, the maximum iteration frequency is T more than or equal to 20, the T-th aspect-level emotion polarity classification model fusing linguistic knowledge is M', and T is 1, Mt=M;
(3b) Will train sample set XtrainModel M for classifying aspect-level emotion polaritytThe input, text feature embedding moduleTo StrainEach comment statement in (1)Each element ofEmbedding text features one by one to obtain a text feature sequence I corresponding to the text feature sequence In1;
(3c) Linguistic knowledge extraction moduleThe double-layer graph volume layer module in the system is respectively embedded into the text characteristicsText feature embedding sequence In1Performing part-of-speech dependency graphs based on their correspondencesAnd grammatical dependency graphsRespectively obtaining the feature sequences fused with part-of-speech knowledgeAnd feature sequences that fuse grammatical knowledge
(3d) Linguistic knowledge fusion modulePair of attention analyzersExtracted characteristic sequence fusing part-of-speech knowledgeAnd feature sequences that fuse grammatical knowledgePerforming significance evaluation to obtain attention weightAndand through a normalization layer pairAndnormalizing to obtain the final attention weightAndby usingAndare respectively pairedAndweighting and splicing to obtain the final characteristic sequence fusing linguistic knowledgeFinally, using the full connection layer pair Are classified to obtainPredicted emotion classification ofThen StrainThe result of the aspect level emotion polarity classification of (1) is
(3e) Using cross-entropy losses byAndcomputational linguistics knowledge fusion moduleLoss value L oftAnd through a back propagation algorithm, through a loss value LtComputingWeight parameter gradient d omegatThen using a random gradient descent method through d omegatTo pairWeight parameter omega oftUpdating is carried out;
(3f) judging whether T is greater than or equal to T, if so, obtaining a trained aspect-level emotion polarity classification model M', otherwise, making T equal to T +1, and executing the step (3 b);
(4) obtaining an aspect-level emotion polarity classification result;
set X of test samplestestThe input of the aspect-level emotion polarity classification model M' is subjected to forward propagation to obtain XtestAspect level sentiment polarity classification result setWherein the content of the first and second substances,denotes the n-th2Aspect level emotional polarity of a sequence of frames.
Compared with the prior art, the invention has the following advantages:
firstly, the method analyzes the specific expression mode of the comment data from the linguistic angle, fully excavates the linguistic knowledge contained in the comment data, overcomes the defect that the existing fine-grained emotion analysis model cannot effectively adapt to the linguistic style of the comment data, so that the classification effect of the aspect-level emotion polarity is poor, has higher practical value, and improves the performance of a text emotion analysis system.
Secondly, the invention carries out graph convolution on word embedding according to the part of speech dependency graph and the grammar dependency graph respectively, and further fuses the text representation fused with the linguistic knowledge and the grammar knowledge by using an attention mechanism, so that the invention obtains better effect on the fusion of the linguistic knowledge.
Drawings
FIG. 1 is a flow chart of the present invention.
FIG. 2 is a schematic diagram of the linguistic knowledge extraction module of the present invention.
Detailed Description
The invention is described in further detail below with reference to the figures and the examples of embodiment.
Referring to fig. 1, the present invention includes the steps of:
step 1) establishing a training sample set XtrainAnd test sample set Xtest:
Step 1a) obtaining N comment sentences C ═ { C ═ CnN is more than or equal to 1 and less than or equal to N, wherein cnThe n-th comment sentence is represented, is shown by cnIn the mth lemma, N is more than or equal to 1000, and M is more than or equal to 32 and less than or equal to 64.
Step 1b) for each comment statement cnEach of which isWord elementPerforming IOB labeling to obtain an IOB label sequence set R ═ R corresponding to CnN is more than or equal to 1 and less than or equal to N, wherein rnDenotes cnCorresponding IOB tag sequence, rn={γm|1≤m≤M,γm∈{O,I,B}},γmThe IOB tag indicates that the mth lemma corresponds to, and O, I, B indicates that the lemma does not belong to the aspect word, belongs to the aspect word, and belongs to the aspect word and is the first lemma of the aspect word.
Step 1c) extracting each comment statement cnEach of the word elementsCorresponding part-of-speech tag POS is obtained, and a part-of-speech tag sequence set P ═ { P } corresponding to C is obtainednN is more than or equal to 1 and less than or equal to N, and a part-of-speech dependency graph set is constructed according to PWherein p isnDenotes cnA sequence of corresponding part-of-speech tags, representThe corresponding part-of-speech tag is,noun, verb, conj, adj, adv, and unk respectively represent nouns, verbs, conjunctions, adjectives, adverbs, and other parts of speech,is shown by cnCorresponding parts of speech dependency graph.Is a matrix of size M, if comment statement cnWord element inThe part-of-speech tag is noun, lemmaThe part of speech tag of (1) is non, verb, conj or adj; or lemmaThe part of speech tag is verb, the lemmaThe part of speech tag of (1) is non, verb, conj or adv; or a word elementThe part-of-speech tag of is conj, the lemmaThe part-of-speech tag is non, verb, conj, adj or adv; or a word elementThe part-of-speech tag of is adj, the lemmaThe part-of-speech tag of (1) is a non, conj, adj or adv; or lemmaThe part of speech tag is adv, the lemmaThe part-of-speech tag is verb, conj, adj or adv; or a word elementThe part-of-speech tag of is conj, the lemmaThe part of speech tag is non, verb, conj, adj or adv, thenM in m1Line m2Array element value of column is 1, if comment statement c nWord element inThe part of speech tag is noun, no matter the lemmaWhy the part-of-speech tag of (c),m in m1Line m2Column and m2Line m1The array element values of the columns are all 0.
Step 1d) extracting each comment statement cnCorresponding syntax parsing tree, obtaining C corresponding syntax parsing tree set T ═ TnN is more than or equal to 1 and less than or equal to N, and a part-of-speech dependency graph set is constructed according to TWherein, tn、Respectively represent cnCorresponding syntax parse tree and syntax dependency graph;is a matrix of size M, according to the comment statement cnCorresponding syntax parse tree tnIf comment on statement cnWord element inAnd the lemmaAt tnThere is a direct edge in the middle of the picture,m in m1Line m2Row and m2Line m1The array element value of the column is 1, otherwise it is 0.
Step 1e) construct a dataset S ═ SnN is less than or equal to 1 and less than or equal to N, and N is randomly selected1Training sample set X consisting of individual data and corresponding real emotion polaritiestrain=(Strain;Ytrain) Will remain N2Combining the individual data and the corresponding real emotion polarities into a test sample set Xtest=(Stest;Ytest) Wherein, in the process,representing the nth data, S, in the data settrainA set of training data is represented that is, denotes the n-th1Individual training data, YtrainDenotes StrainA corresponding set of true emotion polarities for the respective emotion patterns, to representCorresponding true emotional polarity, StestA set of test data is represented that is, denotes the n-th2Number of tests According to YtestDenotes StestThe corresponding set of true emotion polarities are set, to representThe corresponding polarity of the true emotion,N2=N-N1;
step 2), building an aspect-level emotion polarity classification model M based on fusion linguistic knowledge;
building text feature embedding modules M including sequential connectionsembedLinguistic knowledge extraction module MextractAnd linguistic knowledge fusion module MpoolAspect level Emotion polarity Classification model M, wherein MembedAdopting a Bert network structure; mextractThe system comprises a graph neural network consisting of double-layer graph convolution layers which are arranged in parallel; mpoolThe system comprises an attention analyzer, a normalization layer and a full connection layer which are connected in sequence and are composed of a plurality of full connection layers;
text feature embedding module MembedFormed by connecting in order 12 encoders that the structure is the same, the concrete structure of every encoder is: multi-headed self-attention → layer regularization layer → forward propagation layer → layer regularization layer.
Linguistic knowledge extraction moduleThe two double-layer graph volume layers have the same structure, and the specific structure of the double-layer graph volume layer is as follows: first image volume layer → random inactivation layer → second image volume layer; the formula for graph convolution is:
wherein, the first and the second end of the pipe are connected with each other,represents the hidden layer state corresponding to the ith morpheme of the l layer, sigma represents an activation function, WlParameter matrix, g, representing the l ijE {0,1} th and jth lemma corresponding values in the graph, g e { gpos,gsyn}。
Linguistic knowledge fusion moduleThe included attention analyzer includes 2 fully connected layers.
Step 3) performing iterative training on the aspect-level emotion polarity classification model M:
step 3a) setting the iteration frequency as T, the maximum iteration frequency as T not less than 20, and the T-th aspect-level emotion polarity classification model fusing linguistic knowledge as M', and making T1, Mt=M。
Step 3b) training sample set XtrainModel M for classifying aspect-level emotion polaritytThe input, text feature embedding moduleTo StrainEach comment sentence in (1)Each element of (1)Embedding text features one by one to obtain a text feature sequence I corresponding to the text feature sequence In1。
Step 3c) linguistic knowledge extraction moduleThe double-layer graph volume layer module in the system is respectively embedded into the text characteristicsText feature embedding sequence In1Performing dependency graph based on correspondence thereofAnd grammatical dependency graphsRespectively obtaining the feature sequences fused with part-of-speech knowledgeAnd feature sequences incorporating grammatical knowledge
Step 3d) linguistic knowledge fusion moduleAttention analyzer pair of (1)Extracted characteristic sequence fusing part-of-speech knowledgeAnd feature sequences that fuse grammatical knowledge Performing significance evaluation to obtain attention weightAndand through a normalization layer pairAndnormalizing to obtain the final attention weightAndby usingAndare respectively paired withAndweighting and splicing to obtain the final characteristic sequence fusing linguistic knowledgeFinally, the full connection layer pair is utilizedAre classified to obtainPredicted emotion classification ofThen StrainThe result of the aspect level sentiment polarity classification of (1) is
Step 3e) adopts cross entropy loss, and the calculation formula is as follows:whereinNumber of classes 3, y representing the cross entropy loss function, C representing the sentiment polarityiWhether a sample is a genuine label of the i-th class, yiRepresenting the probability of the prediction sample being of the i-th class,representing a regularization term byAnd
computational linguistics knowledge fusion moduleLoss value L oftAnd by a back propagation algorithm, by a loss value LtComputingWeight parameter gradient d omegatThen using a random gradient descent method through d omegatTo pairWeight parameter omegatAnd (6) updating.
And 3f) judging whether T is greater than or equal to T, if so, obtaining a trained aspect-level emotion polarity classification model M', otherwise, making T equal to T +1, and executing the step 3 b).
Step 4), obtaining an aspect-level emotion polarity classification result;
set X of test samples testThe input of the aspect-level emotion polarity classification model M' is subjected to forward propagation to obtain XtestAspect level sentiment polarity classification result setWherein the content of the first and second substances,denotes the n-th2Aspect level emotional polarity of a sequence of frames.
Claims (4)
1. An aspect-level emotion polarity classification method based on fusion linguistic knowledge is characterized by comprising the following steps of:
(1) establishing a training sample set XtrainAnd test sample set Xtest:
(1a) Obtaining N comment sentences C ═ { C ═ CnN is more than or equal to 1 and less than or equal to N, wherein cnThe n-th comment sentence is represented, denotes cnThe mth lemma in the sequence is N not less than 1000, M not less than 32 and not more than 64;
(1b) for each comment sentence cnEach element ofPerforming IOB labeling to obtain an IOB label sequence set R ═ R corresponding to CnN is more than or equal to 1 and less than or equal to N, wherein rnIs shown by cnCorresponding IOB tag sequence, rn={γm|1≤m≤M,γm∈{O,I,B}},γmIndicating IOB labels corresponding to the mth word element, O, I, B respectively indicating that the word element does not belong to the aspect word, belongs to the aspect word and is the first word element of the aspect word;
(1c) extracting each comment sentence cnEach element of ChineseCorresponding part-of-speech tag POS is obtained, and a part-of-speech tag sequence set P ═ { P } corresponding to C is obtainednN is more than or equal to 1 and less than or equal to N, and a part-of-speech dependency graph set is constructed according to PWherein p isnDenotes cnA sequence of corresponding part-of-speech tags, To representThe corresponding part-of-speech tag is used,noun, verb, conj, adj, adv, and unk respectively represent nouns, verbs, conjunctions, adjectives, adverbs, and other parts of speech,denotes cnA corresponding part-of-speech dependency graph;
(1d) extracting each comment sentence cnCorresponding syntax parsing tree, obtaining C corresponding syntax parsing tree set T ═ TnN is more than or equal to 1 and less than or equal to N, and a part-of-speech dependency graph set is constructed according to TWherein, tn、Respectively represent cnCorresponding syntax parse tree and syntax dependency graph;
(1e) constructing a data set S ═ SnN is more than or equal to 1 and less than or equal to N, and N is randomly selected1Training sample set X consisting of individual data and corresponding real emotion polaritiestrain=(Strain;Ytrain) Will remain N2Combining the individual data and the corresponding real emotion polarities into a test sample set Xtest=(Stest;Ytest) Wherein, in the process,representing the nth data, S, in the data settrainA set of training data is represented that is, denotes the n-th1Individual training data, YtrainDenotes StrainThe corresponding set of true emotion polarities are set, to representCorresponding true emotional polarity, StestA set of test data is represented that is, denotes the n-th2Test data, YtestDenotes StestThe corresponding set of true emotion polarities are set, to representThe corresponding true emotional polarity of the user's hand,N2=N-N1;
(2) building an aspect level emotion polarity classification model M based on fusion linguistic knowledge;
building text feature embedding modules M including sequential connections embedLinguistic knowledge extraction module MextractAnd linguistic knowledge fusion module MpoolAspect level Emotion polarity Classification model M, wherein MembedAdopting a Bert network structure; mextractThe system comprises a graph neural network consisting of double-layer graph convolution layers which are arranged in parallel; mpoolThe system comprises an attention analyzer, a normalization layer and a full connection layer which are sequentially connected and are composed of a plurality of full connection layers;
(3) performing iterative training on the aspect level emotion polarity classification model M:
(3a) the iteration frequency is T, the maximum iteration frequency is T more than or equal to 20, the T-th aspect-level emotion polarity classification model fusing linguistic knowledge is M', and T is 1, Mt=M;
(3b) Will train sample set XtrainModel M for classifying aspect-level emotion polaritytInput, text feature embedding module Me t mbedTo StrainEach comment statement in (1)Each element ofEmbedding text features one by one to obtain a text feature sequence I corresponding to the text feature sequence In1;
(3c) Linguistic knowledge extraction moduleThe double-layer graph convolution layer module in the system is respectively embedded into the text characteristicsText feature embedding sequence In1Performing part-of-speech dependency graphs based on their correspondencesAnd grammatical dependency graphsRespectively obtaining the feature sequences fused with part-of-speech knowledgeAnd feature sequences that fuse grammatical knowledge
(3d) Linguistic knowledge fusion modulePair of attention analyzersExtracted characteristic sequence fusing part-of-speech knowledgeAnd feature sequences that fuse grammatical knowledgePerforming significance evaluation to obtain attention weightAndand through a normalization layer pairAndnormalizing to obtain the final attention weightAndby usingAndare respectively pairedAndweighting and splicing to obtain the final characteristic sequence fusing linguistic knowledgeFinally, the full connection layer pair is utilizedAre classified to obtainPredicted emotion classificationThen StrainThe result of the aspect level emotion polarity classification of (1) is
(3e) Using cross-entropy losses byAndcomputational linguistics knowledge fusion moduleLoss value L oftAnd by a back propagation algorithm, by a loss value LtComputingWeight parameter gradient d omegatThen using a random gradient descent method through d ωtTo pairWeight parameter omegatUpdating is carried out;
(3f) judging whether T is greater than or equal to T, if so, obtaining a trained aspect-level emotion polarity classification model M', otherwise, making T equal to T +1, and executing the step (3 b);
(4) obtaining an aspect-level emotion polarity classification result;
set X of test samplestestThe input of the aspect-level emotion polarity classification model M' is subjected to forward propagation to obtain X testAspect level sentiment polarity classification result setWherein the content of the first and second substances,denotes the n-th2Aspect level emotional polarity of a sequence of frames.
2. The fusion language of claim 1The method for classifying aspect-level emotion polarities of linguistic knowledge is characterized in that the comment sentences c in the step (1c)nCorresponding parts-of-speech dependency graphWherein:
if comment statement cnWord element inThe part-of-speech tag is noun, lemmaThe part-of-speech tag is non, verb, conj or adj, or a lemmaThe part of speech tag is verb, the word elementThe part-of-speech tag is non, verb, conj or adv, or a lemmaPart-of-speech tag of (1) is conj, a word elementThe part-of-speech tag is non, verb, conj, adj or adv or a word elementThe part of speech tag of is adj, the lemmaPart-of-speech tag of noun, conj, adj, or adv, or a tokenThe part of speech tag is adv, the lemmaThe part-of-speech tag is verb, conj, adj or adv, or a lemmaThe part-of-speech tag of is conj, the lemmaThe part of speech tag is non, verb, conj, adj or adv, thenM in1Line m2Array element value of the column is 1;
3. The method for classifying sentiment polarities at aspect level fused with linguistic knowledge according to claim 1, wherein the comment sentence c in the step (1d) isnCorresponding syntax dependency graphWherein:
4. The method for classifying emotion polarities of an aspect level fused with linguistic knowledge according to claim 1, wherein the classification model M of the emotion polarities of the aspect level fused with linguistic knowledge in the step (2) is:
text feature embedding module MembedThe encoder is formed by connecting 12 encoders with the same structure in sequence, and the specific structure of each encoder is as follows: multi-headed attention layer → layer regularization layer → forward propagation layer → layer regularization layer;
linguistic knowledge extraction moduleThe two double-layer graph volume layers have the same structure, and the specific structure of the double-layer graph volume layer is as follows: the first graphic volume layer → the random inactivation layer → the second graphic volume layer; the formula for graph convolution is:
wherein the content of the first and second substances, Represents the hidden layer state corresponding to the ith morpheme of the l layer, sigma represents an activation function, WlParameter matrix, g, representing the lijE {0,1} th and jth lemma corresponding values in the graph, g e { gpos,gsyn};
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210465093.XA CN114764564A (en) | 2022-04-25 | 2022-04-25 | Aspect-level emotion polarity classification method based on fusion linguistic knowledge |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210465093.XA CN114764564A (en) | 2022-04-25 | 2022-04-25 | Aspect-level emotion polarity classification method based on fusion linguistic knowledge |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114764564A true CN114764564A (en) | 2022-07-19 |
Family
ID=82364643
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210465093.XA Pending CN114764564A (en) | 2022-04-25 | 2022-04-25 | Aspect-level emotion polarity classification method based on fusion linguistic knowledge |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114764564A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116562305A (en) * | 2023-07-10 | 2023-08-08 | 江西财经大学 | Aspect emotion four-tuple prediction method and system |
-
2022
- 2022-04-25 CN CN202210465093.XA patent/CN114764564A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116562305A (en) * | 2023-07-10 | 2023-08-08 | 江西财经大学 | Aspect emotion four-tuple prediction method and system |
CN116562305B (en) * | 2023-07-10 | 2023-09-12 | 江西财经大学 | Aspect emotion four-tuple prediction method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107092596B (en) | Text emotion analysis method based on attention CNNs and CCR | |
WO2021114745A1 (en) | Named entity recognition method employing affix perception for use in social media | |
WO2018218705A1 (en) | Method for recognizing network text named entity based on neural network probability disambiguation | |
WO2018028077A1 (en) | Deep learning based method and device for chinese semantics analysis | |
CN108038205B (en) | Viewpoint analysis prototype system for Chinese microblogs | |
KR20190063978A (en) | Automatic classification method of unstructured data | |
Sartakhti et al. | Persian language model based on BiLSTM model on COVID-19 corpus | |
CN113361258A (en) | Aspect-level emotion analysis method and system based on graph convolution network and attention selection | |
CN114519356B (en) | Target word detection method and device, electronic equipment and storage medium | |
CN112434161B (en) | Aspect-level emotion analysis method adopting bidirectional long-short term memory network | |
CN116204674B (en) | Image description method based on visual concept word association structural modeling | |
CN111967267B (en) | XLNET-based news text region extraction method and system | |
CN111831783B (en) | Method for extracting chapter-level relation | |
Almutiri et al. | Markov models applications in natural language processing: a survey | |
CN111767714B (en) | Text smoothness determination method, device, equipment and medium | |
CN114818717A (en) | Chinese named entity recognition method and system fusing vocabulary and syntax information | |
CN113051887A (en) | Method, system and device for extracting announcement information elements | |
CN114881042A (en) | Chinese emotion analysis method based on graph convolution network fusion syntax dependence and part of speech | |
CN116578688A (en) | Text processing method, device, equipment and storage medium based on multiple rounds of questions and answers | |
CN116029305A (en) | Chinese attribute-level emotion analysis method, system, equipment and medium based on multitask learning | |
CN112287240A (en) | Case microblog evaluation object extraction method and device based on double-embedded multilayer convolutional neural network | |
CN114764564A (en) | Aspect-level emotion polarity classification method based on fusion linguistic knowledge | |
CN114547303A (en) | Text multi-feature classification method and device based on Bert-LSTM | |
CN114356990A (en) | Base named entity recognition system and method based on transfer learning | |
Shruthi et al. | A prior case study of natural language processing on different domain |
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 |