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 PDF

Info

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
Application number
CN202210465093.XA
Other languages
Chinese (zh)
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.)
Xidian University
Original Assignee
Xidian 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 Xidian University filed Critical Xidian University
Priority to CN202210465093.XA priority Critical patent/CN114764564A/en
Publication of CN114764564A publication Critical patent/CN114764564A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/2431Multiple classes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/253Grammatical analysis; Style critique
    • 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
    • G06N3/084Backpropagation, 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

Aspect-level emotion polarity classification method based on fusion linguistic knowledge
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,
Figure BDA0003615120800000021
Figure BDA0003615120800000022
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 of
Figure BDA0003615120800000023
Performing 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 elements
Figure BDA0003615120800000031
Corresponding 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 P
Figure BDA0003615120800000032
Wherein p isnDenotes cnA sequence of corresponding part-of-speech tags,
Figure BDA0003615120800000033
Figure BDA0003615120800000034
to represent
Figure BDA0003615120800000035
The corresponding part-of-speech tag is,
Figure BDA0003615120800000036
noun, verb, conj, adj, adv, and unk respectively represent nouns, verbs, conjunctions, adjectives, adverbs, and other parts of speech,
Figure BDA0003615120800000037
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 T
Figure BDA0003615120800000038
Wherein, tn
Figure BDA0003615120800000039
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),
Figure BDA00036151208000000310
representing the nth data, S, in the data settrainA set of training data is represented that is,
Figure BDA00036151208000000311
Figure BDA00036151208000000312
denotes the n-th1Individual training data, YtrainDenotes StrainThe corresponding set of true emotion polarities are set,
Figure BDA00036151208000000313
Figure BDA00036151208000000314
to represent
Figure BDA00036151208000000315
Corresponding true emotional polarity, StestA set of test data is represented that is,
Figure BDA00036151208000000316
Figure BDA00036151208000000317
denotes the n-th2Test data, YtestDenotes StestA corresponding set of true emotion polarities for the respective emotion patterns,
Figure BDA00036151208000000318
Figure BDA00036151208000000319
to represent
Figure BDA00036151208000000320
The corresponding true emotional polarity of the user's hand,
Figure BDA00036151208000000321
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 module
Figure BDA0003615120800000041
To StrainEach comment statement in (1)
Figure BDA0003615120800000042
Each element of
Figure BDA0003615120800000043
Embedding text features one by one to obtain a text feature sequence I corresponding to the text feature sequence In1
(3c) Linguistic knowledge extraction module
Figure BDA0003615120800000044
The double-layer graph volume layer module in the system is respectively embedded into the text characteristics
Figure BDA0003615120800000045
Text feature embedding sequence In1Performing part-of-speech dependency graphs based on their correspondences
Figure BDA0003615120800000046
And grammatical dependency graphs
Figure BDA0003615120800000047
Respectively obtaining the feature sequences fused with part-of-speech knowledge
Figure BDA0003615120800000048
And feature sequences that fuse grammatical knowledge
Figure BDA0003615120800000049
(3d) Linguistic knowledge fusion module
Figure BDA00036151208000000410
Pair of attention analyzers
Figure BDA00036151208000000411
Extracted characteristic sequence fusing part-of-speech knowledge
Figure BDA00036151208000000412
And feature sequences that fuse grammatical knowledge
Figure BDA00036151208000000413
Performing significance evaluation to obtain attention weight
Figure BDA00036151208000000414
And
Figure BDA00036151208000000415
and through a normalization layer pair
Figure BDA00036151208000000416
And
Figure BDA00036151208000000417
normalizing to obtain the final attention weight
Figure BDA00036151208000000418
And
Figure BDA00036151208000000419
by using
Figure BDA00036151208000000420
And
Figure BDA00036151208000000421
are respectively paired
Figure BDA00036151208000000422
And
Figure BDA00036151208000000423
weighting and splicing to obtain the final characteristic sequence fusing linguistic knowledge
Figure BDA00036151208000000424
Finally, using the full connection layer pair
Figure BDA00036151208000000425
Are classified to obtain
Figure BDA00036151208000000426
Predicted emotion classification of
Figure BDA00036151208000000427
Then StrainThe result of the aspect level emotion polarity classification of (1) is
Figure BDA00036151208000000428
(3e) Using cross-entropy losses by
Figure BDA00036151208000000429
And
Figure BDA00036151208000000430
computational linguistics knowledge fusion module
Figure BDA00036151208000000431
Loss value L oftAnd through a back propagation algorithm, through a loss value LtComputing
Figure BDA00036151208000000432
Weight parameter gradient d omegatThen using a random gradient descent method through d omegatTo pair
Figure BDA00036151208000000433
Weight 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 set
Figure BDA00036151208000000434
Wherein the content of the first and second substances,
Figure BDA00036151208000000435
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,
Figure BDA0003615120800000051
Figure BDA0003615120800000052
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 element
Figure BDA0003615120800000053
Performing 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 elements
Figure BDA0003615120800000054
Corresponding 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 P
Figure BDA0003615120800000055
Wherein p isnDenotes cnA sequence of corresponding part-of-speech tags,
Figure BDA0003615120800000056
Figure BDA0003615120800000057
represent
Figure BDA0003615120800000058
The corresponding part-of-speech tag is,
Figure BDA0003615120800000059
noun, verb, conj, adj, adv, and unk respectively represent nouns, verbs, conjunctions, adjectives, adverbs, and other parts of speech,
Figure BDA0003615120800000061
is shown by cnCorresponding parts of speech dependency graph.
Figure BDA0003615120800000062
Is a matrix of size M, if comment statement cnWord element in
Figure BDA0003615120800000063
The part-of-speech tag is noun, lemma
Figure BDA0003615120800000064
The part of speech tag of (1) is non, verb, conj or adj; or lemma
Figure BDA0003615120800000065
The part of speech tag is verb, the lemma
Figure BDA0003615120800000066
The part of speech tag of (1) is non, verb, conj or adv; or a word element
Figure BDA0003615120800000067
The part-of-speech tag of is conj, the lemma
Figure BDA0003615120800000068
The part-of-speech tag is non, verb, conj, adj or adv; or a word element
Figure BDA0003615120800000069
The part-of-speech tag of is adj, the lemma
Figure BDA00036151208000000610
The part-of-speech tag of (1) is a non, conj, adj or adv; or lemma
Figure BDA00036151208000000611
The part of speech tag is adv, the lemma
Figure BDA00036151208000000612
The part-of-speech tag is verb, conj, adj or adv; or a word element
Figure BDA00036151208000000613
The part-of-speech tag of is conj, the lemma
Figure BDA00036151208000000614
The part of speech tag is non, verb, conj, adj or adv, then
Figure BDA00036151208000000615
M in m1Line m2Array element value of column is 1, if comment statement c nWord element in
Figure BDA00036151208000000616
The part of speech tag is noun, no matter the lemma
Figure BDA00036151208000000617
Why the part-of-speech tag of (c),
Figure BDA00036151208000000618
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 T
Figure BDA00036151208000000619
Wherein, tn
Figure BDA00036151208000000620
Respectively represent cnCorresponding syntax parse tree and syntax dependency graph;
Figure BDA00036151208000000621
is a matrix of size M, according to the comment statement cnCorresponding syntax parse tree tnIf comment on statement cnWord element in
Figure BDA00036151208000000622
And the lemma
Figure BDA00036151208000000623
At tnThere is a direct edge in the middle of the picture,
Figure BDA00036151208000000624
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,
Figure BDA00036151208000000625
representing the nth data, S, in the data settrainA set of training data is represented that is,
Figure BDA00036151208000000626
Figure BDA00036151208000000627
denotes the n-th1Individual training data, YtrainDenotes StrainA corresponding set of true emotion polarities for the respective emotion patterns,
Figure BDA00036151208000000628
Figure BDA00036151208000000629
to represent
Figure BDA00036151208000000630
Corresponding true emotional polarity, StestA set of test data is represented that is,
Figure BDA00036151208000000631
Figure BDA00036151208000000632
denotes the n-th2Number of tests According to YtestDenotes StestThe corresponding set of true emotion polarities are set,
Figure BDA00036151208000000633
Figure BDA0003615120800000071
to represent
Figure BDA0003615120800000072
The corresponding polarity of the true emotion,
Figure BDA0003615120800000073
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 module
Figure BDA0003615120800000074
The 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:
Figure BDA0003615120800000075
wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0003615120800000076
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 module
Figure BDA0003615120800000077
The 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 module
Figure BDA0003615120800000078
To StrainEach comment sentence in (1)
Figure BDA0003615120800000079
Each element of (1)
Figure BDA00036151208000000710
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 module
Figure BDA00036151208000000711
The double-layer graph volume layer module in the system is respectively embedded into the text characteristics
Figure BDA00036151208000000712
Text feature embedding sequence In1Performing dependency graph based on correspondence thereof
Figure BDA00036151208000000713
And grammatical dependency graphs
Figure BDA00036151208000000714
Respectively obtaining the feature sequences fused with part-of-speech knowledge
Figure BDA00036151208000000715
And feature sequences incorporating grammatical knowledge
Figure BDA0003615120800000081
Step 3d) linguistic knowledge fusion module
Figure BDA0003615120800000082
Attention analyzer pair of (1)
Figure BDA0003615120800000083
Extracted characteristic sequence fusing part-of-speech knowledge
Figure BDA0003615120800000084
And feature sequences that fuse grammatical knowledge
Figure BDA0003615120800000085
Performing significance evaluation to obtain attention weight
Figure BDA0003615120800000086
And
Figure BDA0003615120800000087
and through a normalization layer pair
Figure BDA0003615120800000088
And
Figure BDA0003615120800000089
normalizing to obtain the final attention weight
Figure BDA00036151208000000810
And
Figure BDA00036151208000000811
by using
Figure BDA00036151208000000812
And
Figure BDA00036151208000000813
are respectively paired with
Figure BDA00036151208000000814
And
Figure BDA00036151208000000815
weighting and splicing to obtain the final characteristic sequence fusing linguistic knowledge
Figure BDA00036151208000000816
Finally, the full connection layer pair is utilized
Figure BDA00036151208000000817
Are classified to obtain
Figure BDA00036151208000000818
Predicted emotion classification of
Figure BDA00036151208000000819
Then StrainThe result of the aspect level sentiment polarity classification of (1) is
Figure BDA00036151208000000820
Step 3e) adopts cross entropy loss, and the calculation formula is as follows:
Figure BDA00036151208000000821
wherein
Figure BDA00036151208000000822
Number 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,
Figure BDA00036151208000000823
representing a regularization term by
Figure BDA00036151208000000824
And
Figure BDA00036151208000000830
computational linguistics knowledge fusion module
Figure BDA00036151208000000825
Loss value L oftAnd by a back propagation algorithm, by a loss value LtComputing
Figure BDA00036151208000000826
Weight parameter gradient d omegatThen using a random gradient descent method through d omegatTo pair
Figure BDA00036151208000000827
Weight 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 set
Figure BDA00036151208000000828
Wherein the content of the first and second substances,
Figure BDA00036151208000000829
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,
Figure FDA0003615120790000011
Figure FDA0003615120790000012
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 of
Figure FDA0003615120790000013
Performing 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 Chinese
Figure FDA0003615120790000014
Corresponding 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 P
Figure FDA0003615120790000015
Wherein p isnDenotes cnA sequence of corresponding part-of-speech tags,
Figure FDA0003615120790000016
Figure FDA0003615120790000017
To represent
Figure FDA0003615120790000018
The corresponding part-of-speech tag is used,
Figure FDA0003615120790000019
noun, verb, conj, adj, adv, and unk respectively represent nouns, verbs, conjunctions, adjectives, adverbs, and other parts of speech,
Figure FDA00036151207900000110
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 T
Figure FDA00036151207900000111
Wherein, tn
Figure FDA00036151207900000112
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,
Figure FDA0003615120790000021
representing the nth data, S, in the data settrainA set of training data is represented that is,
Figure FDA0003615120790000022
Figure FDA0003615120790000023
denotes the n-th1Individual training data, YtrainDenotes StrainThe corresponding set of true emotion polarities are set,
Figure FDA0003615120790000024
Figure FDA0003615120790000025
to represent
Figure FDA0003615120790000026
Corresponding true emotional polarity, StestA set of test data is represented that is,
Figure FDA0003615120790000027
Figure FDA0003615120790000028
denotes the n-th2Test data, YtestDenotes StestThe corresponding set of true emotion polarities are set,
Figure FDA0003615120790000029
Figure FDA00036151207900000210
to represent
Figure FDA00036151207900000211
The corresponding true emotional polarity of the user's hand,
Figure FDA00036151207900000212
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)
Figure FDA00036151207900000213
Each element of
Figure FDA00036151207900000214
Embedding text features one by one to obtain a text feature sequence I corresponding to the text feature sequence In1
(3c) Linguistic knowledge extraction module
Figure FDA0003615120790000031
The double-layer graph convolution layer module in the system is respectively embedded into the text characteristics
Figure FDA0003615120790000032
Text feature embedding sequence In1Performing part-of-speech dependency graphs based on their correspondences
Figure FDA0003615120790000033
And grammatical dependency graphs
Figure FDA0003615120790000034
Respectively obtaining the feature sequences fused with part-of-speech knowledge
Figure FDA0003615120790000035
And feature sequences that fuse grammatical knowledge
Figure FDA0003615120790000036
(3d) Linguistic knowledge fusion module
Figure FDA0003615120790000037
Pair of attention analyzers
Figure FDA0003615120790000038
Extracted characteristic sequence fusing part-of-speech knowledge
Figure FDA0003615120790000039
And feature sequences that fuse grammatical knowledge
Figure FDA00036151207900000310
Performing significance evaluation to obtain attention weight
Figure FDA00036151207900000311
And
Figure FDA00036151207900000312
and through a normalization layer pair
Figure FDA00036151207900000313
And
Figure FDA00036151207900000314
normalizing to obtain the final attention weight
Figure FDA00036151207900000315
And
Figure FDA00036151207900000316
by using
Figure FDA00036151207900000317
And
Figure FDA00036151207900000318
are respectively paired
Figure FDA00036151207900000319
And
Figure FDA00036151207900000320
weighting and splicing to obtain the final characteristic sequence fusing linguistic knowledge
Figure FDA00036151207900000321
Finally, the full connection layer pair is utilized
Figure FDA00036151207900000322
Are classified to obtain
Figure FDA00036151207900000323
Predicted emotion classification
Figure FDA00036151207900000324
Then StrainThe result of the aspect level emotion polarity classification of (1) is
Figure FDA00036151207900000325
(3e) Using cross-entropy losses by
Figure FDA00036151207900000326
And
Figure FDA00036151207900000327
computational linguistics knowledge fusion module
Figure FDA00036151207900000328
Loss value L oftAnd by a back propagation algorithm, by a loss value LtComputing
Figure FDA00036151207900000329
Weight parameter gradient d omegatThen using a random gradient descent method through d ωtTo pair
Figure FDA00036151207900000330
Weight 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 set
Figure FDA00036151207900000331
Wherein the content of the first and second substances,
Figure FDA00036151207900000332
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 graph
Figure FDA0003615120790000041
Wherein:
Figure FDA0003615120790000042
is a matrix of size M × M;
if comment statement cnWord element in
Figure FDA0003615120790000043
The part-of-speech tag is noun, lemma
Figure FDA0003615120790000044
The part-of-speech tag is non, verb, conj or adj, or a lemma
Figure FDA0003615120790000045
The part of speech tag is verb, the word element
Figure FDA0003615120790000046
The part-of-speech tag is non, verb, conj or adv, or a lemma
Figure FDA0003615120790000047
Part-of-speech tag of (1) is conj, a word element
Figure FDA0003615120790000048
The part-of-speech tag is non, verb, conj, adj or adv or a word element
Figure FDA0003615120790000049
The part of speech tag of is adj, the lemma
Figure FDA00036151207900000410
Part-of-speech tag of noun, conj, adj, or adv, or a token
Figure FDA00036151207900000411
The part of speech tag is adv, the lemma
Figure FDA00036151207900000412
The part-of-speech tag is verb, conj, adj or adv, or a lemma
Figure FDA00036151207900000413
The part-of-speech tag of is conj, the lemma
Figure FDA00036151207900000414
The part of speech tag is non, verb, conj, adj or adv, then
Figure FDA00036151207900000415
M in1Line m2Array element value of the column is 1;
if comment statement cnWord element in (1)
Figure FDA00036151207900000416
The part-of-speech tag of (1) is no, then no matter the lemma
Figure FDA00036151207900000417
Is what is the part-of-speech tag of (c),
Figure FDA00036151207900000418
m in1Line m2Row and m2Line m 1The array 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 graph
Figure FDA00036151207900000419
Wherein:
Figure FDA00036151207900000420
is a matrix of size M × M;
statement according to comment cnCorresponding syntax parse tree tnIf comment on statement cnWord element in (1)
Figure FDA00036151207900000421
And the lemma
Figure FDA00036151207900000422
At tnThere is a direct edge in the middle of the picture,
Figure FDA00036151207900000423
m in1Line m2Row and m2Line m1The array element value of the column is 1, otherwise it is 0.
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 module
Figure FDA0003615120790000051
The 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:
Figure FDA0003615120790000052
wherein the content of the first and second substances,
Figure FDA0003615120790000053
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};
Linguistic knowledge fusion module
Figure FDA0003615120790000054
The included attention analyzer includes 2 fully connected layers.
CN202210465093.XA 2022-04-25 2022-04-25 Aspect-level emotion polarity classification method based on fusion linguistic knowledge Pending CN114764564A (en)

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)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116562305A (en) * 2023-07-10 2023-08-08 江西财经大学 Aspect emotion four-tuple prediction method and system

Cited By (2)

* Cited by examiner, † Cited by third party
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