+

CN113673222B - A fine-grained sentiment analysis method for social media text based on two-way collaborative network - Google Patents

A fine-grained sentiment analysis method for social media text based on two-way collaborative network Download PDF

Info

Publication number
CN113673222B
CN113673222B CN202110782124.XA CN202110782124A CN113673222B CN 113673222 B CN113673222 B CN 113673222B CN 202110782124 A CN202110782124 A CN 202110782124A CN 113673222 B CN113673222 B CN 113673222B
Authority
CN
China
Prior art keywords
backward
network
hidden layer
layer unit
sentiment
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
CN202110782124.XA
Other languages
Chinese (zh)
Other versions
CN113673222A (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.)
South China University of Technology SCUT
Original Assignee
South China University of Technology SCUT
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 South China University of Technology SCUT filed Critical South China University of Technology SCUT
Priority to CN202110782124.XA priority Critical patent/CN113673222B/en
Publication of CN113673222A publication Critical patent/CN113673222A/en
Application granted granted Critical
Publication of CN113673222B publication Critical patent/CN113673222B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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 OR CALCULATING; 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Machine Translation (AREA)

Abstract

The invention discloses a social media text fine-grained emotion analysis method based on a relation perception bidirectional collaborative network, which is used for analyzing an analysis object, a viewpoint and an emotion in a user utterance in a fine-grained emotion analysis system. The method comprises the following steps: segmenting words of sentences in user utterance text data, and expressing the words by word vectors; respectively inputting the word vectors into a forward collaborative network and a backward collaborative network to obtain forward analysis object coding representation and backward analysis object coding representation, forward viewpoint coding representation and backward viewpoint coding representation and forward emotion coding representation and backward emotion coding representation; respectively carrying out fusion operation on the forward analysis object coded representation, the backward viewpoint coded representation and the backward emotion coded representation, inputting the fusion operation into a classification network, and respectively outputting labeling results of the analysis object, the viewpoint and the emotion; according to the labeling result and the real result, performing iterative training on a minimized cross entropy loss function; and inputting the social media text to be classified into the forward and backward cooperative network and the classification network to obtain a fine-grained emotion analysis result.

Description

基于双向协同网络的社交媒体文本细粒度情感分析方法A fine-grained sentiment analysis method for social media text based on bidirectional collaborative network

技术领域technical field

本发明涉及自然语言处理中的社交媒体文本细粒度情感分析技术领域,具体涉及一种基于关系感知的双向协同网络的社交媒体文本细粒度情感分析方法。The invention relates to the technical field of fine-grained sentiment analysis of social media texts in natural language processing, in particular to a method for fine-grained sentiment analysis of social media texts based on a relationship-aware bidirectional collaborative network.

背景技术Background technique

随着互联网的发展,社交媒体作为人们彼此之间用来分享见解、经验和观点的平台,已经成为人们生活不可缺少的部分。社交媒体中涉及了大量的文本内容,很多时候,企业单位需要获取用户对某些产品服务等内容的情感评价,以帮助提升产品或服务的质量。不同于对整个句子或者文档的情感分析,细粒度情感分析是对文本中更加细粒度的属性作出情感极性的判断,该任务需要抽取出文本中情感分析的对象和描述该分析对象情感的观点词,并判断该分析对象的情感倾向。在如今互联网的迅速发展下,细粒度情感分析已经有着越来越重要的实践和应用价值。With the development of the Internet, social media has become an integral part of people's lives as a platform for people to share insights, experiences and perspectives with each other. Social media involves a large amount of text content. In many cases, enterprises need to obtain users' emotional evaluations of certain products and services to help improve the quality of products or services. Different from the sentiment analysis of the whole sentence or document, the fine-grained sentiment analysis is to judge the sentiment polarity of the more fine-grained attributes in the text. This task needs to extract the object of sentiment analysis in the text and the viewpoint that describes the sentiment of the object to be analyzed. words, and judge the emotional tendency of the analysis object. With the rapid development of the Internet today, fine-grained sentiment analysis has become more and more important in practice and application value.

在细粒度情感分析任务中,国内外现有的方法大多数只关注3个子任务中的一种或者两种。然而,该任务的3个子任务之间的信息可以对彼此有互相促进的作用,如一段文本中,抽取出情感分析的对象后,该信息可以进一步帮助观点词的抽取,而抽取出的观点词又可以反映出分析对象的情感偏向。反过来,在一段文本中,首先对文本做情感分析,情感分析的结果可以帮助提取出反映这些情感的观点词,对观点词的抽取又可以帮助提取出和这些观点词相关的分析对象。这种双向的子任务之间的关系信息可以帮助当前子任务得到更好的抽取或分类结果,然而,现有的方法中没有考虑到过这种双向的子任务之间的关系信息,考虑到这一点,目前亟待提出一种基于双向协同网络的社交媒体文本细粒度情感分析方法。In the fine-grained sentiment analysis task, most of the existing methods at home and abroad only focus on one or two of the three subtasks. However, the information between the three subtasks of this task can promote each other. For example, in a text, after the object of sentiment analysis is extracted, the information can further help the extraction of opinion words, while the extracted opinion words It can also reflect the emotional bias of the analysis object. Conversely, in a piece of text, sentiment analysis is first performed on the text. The result of sentiment analysis can help to extract opinion words that reflect these sentiments, and the extraction of opinion words can help to extract the analysis objects related to these opinion words. This bidirectional relationship information between subtasks can help the current subtask to obtain better extraction or classification results. However, the existing methods have not considered such bidirectional relationship information between subtasks. Considering In this regard, it is urgent to propose a fine-grained sentiment analysis method for social media texts based on two-way collaborative networks.

发明内容SUMMARY OF THE INVENTION

本发明的目的是为了解决现有技术中的上述缺陷,提供一种基于关系感知的双向协同网络的社交媒体文本细粒度情感分析方法。该方法先利用前向协同网络考虑到前向的3种任务之间的关系信息,然后利用后向协同网络考虑到后向的3种任务之间的关系信息,接着融合多前向和后向的不同任务间的关系信息,得到最终的分析对象、观点和情感的标注结果。The purpose of the present invention is to solve the above-mentioned defects in the prior art, and to provide a fine-grained sentiment analysis method for social media text based on a relationship-aware bidirectional collaborative network. The method first uses the forward collaborative network to consider the relationship information between the three forward tasks, and then uses the backward collaborative network to consider the relationship information between the three backward tasks, and then fuses multiple forward and backward tasks. The relationship information between different tasks is obtained, and the final analysis object, opinion and sentiment annotation results are obtained.

本发明的目的可以通过采取如下技术方案达到:The purpose of the present invention can be achieved by adopting the following technical solutions:

一种基于双向协同网络的社交媒体文本细粒度情感分析方法,所述分析方法包括以下步骤:A fine-grained sentiment analysis method for social media text based on two-way collaborative network, the analysis method comprises the following steps:

S1、将用户话语文本数据中的每个句子切分为词w=(w1,w2,...,wi,...,wN),将词用词向量

Figure BDA0003157446890000021
表示,其中w是词序列,Ew是词向量序列,wi是第i个词,
Figure BDA0003157446890000022
是第i个词的词向量,1≤i≤N,N为词的个数,emb为词向量维度大小,
Figure BDA0003157446890000023
为维度为emb的实数向量空间;S1. Divide each sentence in the user utterance text data into words w=(w 1 , w 2 , . . . , wi , . . . , w N ), and use the word vector
Figure BDA0003157446890000021
Representation, where w is the word sequence, E w is the word vector sequence, w i is the ith word,
Figure BDA0003157446890000022
is the word vector of the ith word, 1≤i≤N, N is the number of words, emb is the dimension of the word vector,
Figure BDA0003157446890000023
is a real vector space of dimension emb;

S2、将词向量

Figure BDA0003157446890000024
分别输入前向协同网络和后向协同网络中得到前向和后向的分析对象编码表示
Figure BDA0003157446890000025
Figure BDA0003157446890000026
Figure BDA0003157446890000027
前向和后向的观点编码表示
Figure BDA0003157446890000028
Figure BDA0003157446890000029
前向和后向的情感编码表示
Figure BDA00031574468900000210
Figure BDA00031574468900000211
其中
Figure BDA00031574468900000212
是第i个词的前向分析对象编码表示,
Figure BDA00031574468900000213
是第i个词的后向分析对象编码表示,
Figure BDA00031574468900000214
是第i个词的前向观点编码表示,
Figure BDA00031574468900000215
是第i个词的后向观点编码表示,
Figure BDA0003157446890000031
是第i个词的前向情感编码表示,
Figure BDA0003157446890000032
是第i个词的后向情感编码表示,1≤i≤N,d为前向和后向分析对象、观点和情感编码表示的维度大小,
Figure BDA0003157446890000033
为维度为d的实数向量空间;S2, the word vector
Figure BDA0003157446890000024
Input the forward collaborative network and the backward collaborative network respectively to obtain the forward and backward analysis object coding representation
Figure BDA0003157446890000025
Figure BDA0003157446890000026
and
Figure BDA0003157446890000027
Forward and backward view-encoded representations
Figure BDA0003157446890000028
and
Figure BDA0003157446890000029
Forward and Backward Sentiment Coding Representations
Figure BDA00031574468900000210
and
Figure BDA00031574468900000211
in
Figure BDA00031574468900000212
is the forward parsed object-encoded representation of the ith word,
Figure BDA00031574468900000213
is the backward-analyzed object-encoded representation of the ith word,
Figure BDA00031574468900000214
is the forward view-encoded representation of the ith word,
Figure BDA00031574468900000215
is the backward opinion-encoded representation of the ith word,
Figure BDA0003157446890000031
is the forward sentiment encoding representation of the ith word,
Figure BDA0003157446890000032
is the backward sentiment coding representation of the i-th word, 1≤i≤N, d is the dimension size of the forward and backward analysis object, opinion and sentiment coding representation,
Figure BDA0003157446890000033
is a real vector space of dimension d;

S3、分别将前向和后向的分析对象编码表示

Figure BDA0003157446890000034
Figure BDA0003157446890000035
观点编码表示
Figure BDA0003157446890000036
Figure BDA0003157446890000037
情感编码表示
Figure BDA0003157446890000038
Figure BDA0003157446890000039
进行融合运算,输入到分析对象分类网络、观点分类网络、情感分类网络中,分别输出分析对象、观点、情感的标注结果Pa、Po、Ps,其中
Figure BDA00031574468900000310
ca、co和cs分别是分析对象标签个数、观点标签个数和情感标签个数,
Figure BDA00031574468900000311
Figure BDA00031574468900000312
分别为维度为N×ca、N×co和N×cs的实数向量空间;S3. Respectively encode the forward and backward analysis objects
Figure BDA0003157446890000034
and
Figure BDA0003157446890000035
opinion coding
Figure BDA0003157446890000036
and
Figure BDA0003157446890000037
emotion coding representation
Figure BDA0003157446890000038
and
Figure BDA0003157446890000039
Perform fusion operation, input into the analysis object classification network, opinion classification network, and sentiment classification network, and output the labeling results Pa, P o , and P s of the analysis object, opinion, and emotion respectively , among which
Figure BDA00031574468900000310
c a , c o and c s are the number of object labels, opinion labels and sentiment labels, respectively,
Figure BDA00031574468900000311
and
Figure BDA00031574468900000312
are real vector spaces with dimensions N× ca , N×c o and N×c s , respectively;

S4、根据标注结果和真实结果,以最小化交叉熵损失函数为目标对前向协同网络、后向协同网络、分析对象分类网络、观点分类网络、情感分类网络迭代训练;S4. According to the labeled results and the real results, iteratively trains the forward collaborative network, the backward collaborative network, the analysis object classification network, the opinion classification network, and the sentiment classification network with the goal of minimizing the cross-entropy loss function;

S5、将待分类的社交媒体文本输入前向协同网络、后向协同网络、分析对象分类网络、观点分类网络、情感分类网络中得到细粒度情感分析结果。S5. Input the social media text to be classified into the forward collaborative network, the backward collaborative network, the analysis object classification network, the opinion classification network, and the sentiment classification network to obtain fine-grained sentiment analysis results.

进一步地,所述步骤S2中将词向量

Figure BDA00031574468900000313
分别输入前向和后向协同网络中得到前向和后向的分析对象编码表示
Figure BDA00031574468900000314
Figure BDA00031574468900000315
Figure BDA00031574468900000316
前向和后向的观点编码表示
Figure BDA00031574468900000317
Figure BDA00031574468900000318
前向和后向的情感编码表示
Figure BDA00031574468900000319
Figure BDA00031574468900000320
具体实施过程如下:Further, in the step S2, the word vector is
Figure BDA00031574468900000313
Enter the forward and backward collaborative network to obtain the forward and backward parsed object coding representations, respectively
Figure BDA00031574468900000314
Figure BDA00031574468900000315
and
Figure BDA00031574468900000316
Forward and backward view-encoded representations
Figure BDA00031574468900000317
and
Figure BDA00031574468900000318
Forward and Backward Sentiment Coding Representations
Figure BDA00031574468900000319
and
Figure BDA00031574468900000320
The specific implementation process is as follows:

S21、将词向量

Figure BDA00031574468900000321
输入前向协同网络得到前向的分析对象编码表示
Figure BDA00031574468900000322
前向的观点编码表示
Figure BDA00031574468900000323
和前向的情感编码表示
Figure BDA00031574468900000324
S21, the word vector
Figure BDA00031574468900000321
Enter the forward collaborative network to obtain a forward encoded representation of the analyzed object
Figure BDA00031574468900000322
Forward View Encoded Representation
Figure BDA00031574468900000323
and forward sentiment encoding representation
Figure BDA00031574468900000324

S22、将词向量

Figure BDA00031574468900000325
输入后向协同网络得到后向的分析对象编码表示
Figure BDA0003157446890000041
后向的观点编码表示
Figure BDA0003157446890000042
和后向的情感编码表示
Figure BDA0003157446890000043
S22, the word vector
Figure BDA00031574468900000325
Input the backward collaborative network to obtain the backward encoded representation of the analyzed object
Figure BDA0003157446890000041
Backward View Encoding Representation
Figure BDA0003157446890000042
and backward emotion coding representation
Figure BDA0003157446890000043

进一步地,所述步骤S21中将词向量

Figure BDA0003157446890000044
输入前向协同网络得到前向的分析对象编码表示
Figure BDA0003157446890000045
前向的观点编码表示
Figure BDA0003157446890000046
和前向的情感编码表示
Figure BDA0003157446890000047
具体实施过程如下:Further, in the step S21, the word vector
Figure BDA0003157446890000044
Enter the forward collaborative network to obtain a forward encoded representation of the analyzed object
Figure BDA0003157446890000045
Forward View Encoded Representation
Figure BDA0003157446890000046
and forward sentiment encoding representation
Figure BDA0003157446890000047
The specific implementation process is as follows:

S211、将词向量

Figure BDA0003157446890000048
输入前向协同网络的第一卷积神经网络得到前向分析对象隐层单元
Figure BDA0003157446890000049
S211, the word vector
Figure BDA0003157446890000048
Input the first convolutional neural network of the forward collaborative network to obtain the hidden layer unit of the forward analysis object
Figure BDA0003157446890000049

Figure BDA00031574468900000410
Figure BDA00031574468900000410

其中,

Figure BDA00031574468900000411
是前向协同网络的第一卷积神经网络进行卷积运算后第i个词对应的前向分析对象隐层单元,再将前向分析对象隐层单元
Figure BDA00031574468900000412
输入前向协同网络的第一全连接网络得到前向的分析对象编码表示
Figure BDA00031574468900000413
in,
Figure BDA00031574468900000411
is the hidden layer unit of the forward analysis object corresponding to the i-th word after the first convolutional neural network of the forward collaborative network performs the convolution operation, and then the hidden layer unit of the forward analysis object is
Figure BDA00031574468900000412
The first fully connected network input to the forward collaborative network obtains the forward parsed object encoding representation
Figure BDA00031574468900000413

Figure BDA00031574468900000414
Figure BDA00031574468900000414

其中,

Figure BDA00031574468900000415
是权重为wca的前向协同网络的第一卷积神经网络,
Figure BDA00031574468900000416
是权重为wa的前向协同网络的第一全连接网络。in,
Figure BDA00031574468900000415
is the first convolutional neural network of the forward synergistic network with weight w ca ,
Figure BDA00031574468900000416
is the first fully connected network of the forward cooperative network with weight wa .

S212、将词向量

Figure BDA00031574468900000417
输入前向协同网络的第二卷积神经网络得到前向观点隐层单元
Figure BDA00031574468900000418
S212, the word vector
Figure BDA00031574468900000417
The second convolutional neural network input to the forward synergistic network obtains the forward view hidden layer unit
Figure BDA00031574468900000418

Figure BDA00031574468900000419
Figure BDA00031574468900000419

其中,

Figure BDA00031574468900000420
是前向协同网络的第二卷积神经网络进行卷积运算后第i个词对应的前向观点隐层单元,
Figure BDA00031574468900000421
是权重为wco的前向协同网络的第二卷积神经网络,将前向观点隐层单元
Figure BDA00031574468900000422
和前向分析对象隐层单元
Figure BDA00031574468900000423
进行关系计算得到观点对分析对象的关系隐层单元HO2A:in,
Figure BDA00031574468900000420
is the forward view hidden layer unit corresponding to the i-th word after the second convolutional neural network of the forward collaborative network performs the convolution operation,
Figure BDA00031574468900000421
is the second convolutional neural network of the forward synergistic network with weight w co , which combines the forward view hidden layer unit
Figure BDA00031574468900000422
and forward analysis object hidden layer unit
Figure BDA00031574468900000423
Perform relational calculation to obtain the relational hidden layer unit H O2A of the viewpoint to the analysis object:

Figure BDA0003157446890000051
Figure BDA0003157446890000051

其中,softmax(·)是归一化指数函数,×代表矩阵乘法操作,

Figure BDA0003157446890000052
Figure BDA0003157446890000053
的转置,将观点对分析对象的关系隐层单元HO2A和前向观点隐层单元
Figure BDA0003157446890000054
输入前向协同网络的第二全连接网络得到前向的观点编码表示
Figure BDA0003157446890000055
where softmax( ) is the normalized exponential function, × represents the matrix multiplication operation,
Figure BDA0003157446890000052
Yes
Figure BDA0003157446890000053
The transpose of the view to the analysis object relation hidden layer unit H O2A and forward view hidden layer unit
Figure BDA0003157446890000054
The second fully-connected network that feeds the forward collaborative network obtains a forward opinion-encoded representation
Figure BDA0003157446890000055

Figure BDA0003157446890000056
Figure BDA0003157446890000056

其中,

Figure BDA0003157446890000057
是权重为wo的前向协同网络的第二全连接网络;in,
Figure BDA0003157446890000057
is the second fully connected network of the forward cooperative network with weight wo ;

S213、将词向量

Figure BDA0003157446890000058
输入前向协同网络的第三卷积神经网络得到前向情感隐层单元
Figure BDA0003157446890000059
S213, the word vector
Figure BDA0003157446890000058
The third convolutional neural network input to the forward synergistic network obtains the forward emotional hidden layer unit
Figure BDA0003157446890000059

Figure BDA00031574468900000510
Figure BDA00031574468900000510

其中,

Figure BDA00031574468900000511
是前向协同网络的第三卷积神经网络进行卷积运算后第i个词对应的前向情感隐层单元,
Figure BDA00031574468900000512
是权重为wcs的卷积神经网络,将前向情感隐层单元
Figure BDA00031574468900000513
和前向分析对象隐层单元
Figure BDA00031574468900000514
进行关系计算得到情感对分析对象的关系隐层单元HS2A:in,
Figure BDA00031574468900000511
is the forward emotional hidden layer unit corresponding to the i-th word after the third convolutional neural network of the forward collaborative network performs the convolution operation,
Figure BDA00031574468900000512
is a convolutional neural network with a weight of w cs , which converts the forward emotional hidden layer unit
Figure BDA00031574468900000513
and forward analysis object hidden layer unit
Figure BDA00031574468900000514
Perform relational calculation to obtain the relational hidden layer unit H S2A of the sentiment to the analysis object:

Figure BDA00031574468900000515
Figure BDA00031574468900000515

将前向情感隐层单元

Figure BDA00031574468900000516
和前向观点隐层单元
Figure BDA00031574468900000517
进行关系计算得到情感对观点的关系隐层单元HS2O:The forward emotional hidden layer unit
Figure BDA00031574468900000516
and forward view hidden units
Figure BDA00031574468900000517
Perform relational calculation to obtain the relational hidden layer unit H S2O of sentiment to opinion:

Figure BDA00031574468900000518
Figure BDA00031574468900000518

其中,

Figure BDA00031574468900000519
Figure BDA00031574468900000520
的转置,将情感对分析对象的关系隐层单元HS2A,情感对观点的关系隐层单元HS2O和前向情感隐层单元
Figure BDA00031574468900000521
输入前向协同网络的第三全连接网络得到前向的情感编码表示
Figure BDA00031574468900000522
in,
Figure BDA00031574468900000519
Yes
Figure BDA00031574468900000520
The transposition of the sentiment-to-analysis object relational hidden layer unit H S2A , the sentiment-to-view relational hidden layer unit H S2O and the forward sentiment hidden layer unit
Figure BDA00031574468900000521
The third fully-connected network that feeds the forward synergistic network obtains a forward emotion-encoded representation
Figure BDA00031574468900000522

Figure BDA00031574468900000523
Figure BDA00031574468900000523

其中,

Figure BDA0003157446890000061
是权重为ws的前向协同网络的第三全连接网络。in,
Figure BDA0003157446890000061
is the third fully connected network of the forward cooperative network with weight ws .

进一步地,所述步骤S22中将词向量

Figure BDA0003157446890000062
输入后向协同网络得到后向的分析对象编码表示
Figure BDA0003157446890000063
后向的观点编码表示
Figure BDA0003157446890000064
和后向的情感编码表示
Figure BDA0003157446890000065
具体实施过程如下:Further, in the step S22, the word vector
Figure BDA0003157446890000062
Input the backward collaborative network to obtain the backward encoded representation of the analyzed object
Figure BDA0003157446890000063
Backward View Encoding Representation
Figure BDA0003157446890000064
and backward emotion coding representation
Figure BDA0003157446890000065
The specific implementation process is as follows:

S221、将词向量

Figure BDA0003157446890000066
输入后向协同网络的第一卷积神经网络得到后向情感隐层单元
Figure BDA0003157446890000067
S221. The word vector
Figure BDA0003157446890000066
The first convolutional neural network input to the backward collaborative network gets the backward emotional hidden layer unit
Figure BDA0003157446890000067

Figure BDA0003157446890000068
Figure BDA0003157446890000068

其中,

Figure BDA0003157446890000069
是后向协同网络的第一卷积神经网络进行卷积运算后第i个词对应的后向情感隐层单元,再将后向情感隐层单元
Figure BDA00031574468900000610
输入后向协同网络的第一全连接网络得到后向的情感编码表示
Figure BDA00031574468900000611
in,
Figure BDA0003157446890000069
is the backward emotional hidden layer unit corresponding to the i-th word after the first convolutional neural network of the backward collaborative network performs the convolution operation, and then the backward emotional hidden layer unit is
Figure BDA00031574468900000610
The first fully-connected network that feeds the backward collaborative network obtains a backward sentiment-encoded representation
Figure BDA00031574468900000611

Figure BDA00031574468900000612
Figure BDA00031574468900000612

其中,

Figure BDA00031574468900000613
是权重为wcs_的后向协同网络的第一卷积神经网络,
Figure BDA00031574468900000614
是权重为ws_的后向协同网络的第一全连接网络;in,
Figure BDA00031574468900000613
is the first convolutional neural network of the backward collaborative network with weight w cs_ ,
Figure BDA00031574468900000614
is the first fully connected network of the backward collaborative network with weight ws_ ;

S222、将词向量

Figure BDA00031574468900000615
输入后向协同网络的第二卷积神经网络得到后向观点隐层单元
Figure BDA00031574468900000616
S222, the word vector
Figure BDA00031574468900000615
The second convolutional neural network input to the backward synergistic network obtains the backward view hidden layer unit
Figure BDA00031574468900000616

Figure BDA00031574468900000617
Figure BDA00031574468900000617

其中,

Figure BDA00031574468900000618
是后向协同网络的第二卷积神经网络进行卷积运算后第i个词对应的后向观点隐层单元,
Figure BDA00031574468900000619
是权重为wco_的卷积神经网络,将后向观点隐层单元
Figure BDA00031574468900000620
和后向情感隐层单元
Figure BDA00031574468900000621
进行关系计算得到观点对情感的关系隐层单元HO2S:in,
Figure BDA00031574468900000618
is the backward view hidden layer unit corresponding to the i-th word after the second convolutional neural network of the backward collaborative network performs the convolution operation,
Figure BDA00031574468900000619
is a convolutional neural network with weight w co_ , which converts the backward view hidden layer unit
Figure BDA00031574468900000620
and the backward emotional hidden layer unit
Figure BDA00031574468900000621
Carry out relational calculation to obtain the relational hidden layer unit H O2S of opinion to emotion:

Figure BDA00031574468900000622
Figure BDA00031574468900000622

其中,softmax(·)是归一化指数函数,×代表矩阵乘法操作,

Figure BDA0003157446890000071
Figure BDA0003157446890000072
的转置,将观点对情感的关系隐层单元HO2S和后向观点隐层单元
Figure BDA0003157446890000073
输入后向协同网络的第二全连接网络得到后向的分析对象编码表示
Figure BDA0003157446890000074
where softmax( ) is the normalized exponential function, × represents the matrix multiplication operation,
Figure BDA0003157446890000071
Yes
Figure BDA0003157446890000072
The transpose of the view-to-sentiment relationship hidden unit H O2S and backward view hidden unit
Figure BDA0003157446890000073
The second fully connected network input to the backward collaborative network obtains the backward parsed object encoding representation
Figure BDA0003157446890000074

Figure BDA0003157446890000075
Figure BDA0003157446890000075

其中,

Figure BDA0003157446890000076
是权重为wo_的后向协同网络的第二全连接网络;in,
Figure BDA0003157446890000076
is the second fully connected network of the backward collaborative network with weight w o_ ;

S223、将词向量

Figure BDA0003157446890000077
输入后向协同网络的第三卷积神经网络得到后向分析对象隐层单元
Figure BDA0003157446890000078
S223, the word vector
Figure BDA0003157446890000077
The third convolutional neural network inputting the backward synergistic network obtains the hidden layer unit of the backward analysis object
Figure BDA0003157446890000078

Figure BDA0003157446890000079
Figure BDA0003157446890000079

其中,

Figure BDA00031574468900000710
是后向协同网络的第三卷积神经网络进行卷积运算后第i个词对应的后向分析对象隐层单元,
Figure BDA00031574468900000711
是权重为wca_的后向协同网络的第三卷积神经网络,将后向分析对象隐层单元
Figure BDA00031574468900000712
和后向情感隐层单元
Figure BDA00031574468900000713
进行关系计算得到分析对象对情感的关系隐层单元HA2S:in,
Figure BDA00031574468900000710
is the hidden layer unit of the backward analysis object corresponding to the i-th word after the third convolutional neural network of the backward collaborative network performs the convolution operation,
Figure BDA00031574468900000711
is the third convolutional neural network of the backward collaborative network with weight w ca_ , which analyzes the hidden layer unit of the object backward
Figure BDA00031574468900000712
and the backward emotional hidden layer unit
Figure BDA00031574468900000713
The relationship calculation is performed to obtain the relationship hidden layer unit H A2S of the analysis object's emotion:

Figure BDA00031574468900000714
Figure BDA00031574468900000714

将后向分析对象隐层单元

Figure BDA00031574468900000715
和后向观点隐层单元
Figure BDA00031574468900000716
进行关系计算得到分析对象对观点的关系隐层单元HA2O:The hidden layer unit of the backward analysis object
Figure BDA00031574468900000715
and the backward view hidden unit
Figure BDA00031574468900000716
Perform relational calculation to obtain the relational hidden layer unit H A2O of the analysis object to the viewpoint:

Figure BDA00031574468900000717
Figure BDA00031574468900000717

其中,

Figure BDA00031574468900000718
Figure BDA00031574468900000719
的转置,将分析对象对情感的关系隐层单元HA2S、分析对象对观点的关系隐层单元HA2O和后向分析对象隐层单元
Figure BDA00031574468900000720
输入后向协同网络的第三全连接网络得到后向的分析对象表示
Figure BDA00031574468900000721
in,
Figure BDA00031574468900000718
Yes
Figure BDA00031574468900000719
The transposition of the hidden layer unit H A2S of the relationship between the analysis object and the sentiment, the hidden layer unit H A2O of the relationship between the analysis object and the opinion, and the hidden layer unit of the backward analysis object
Figure BDA00031574468900000720
The third fully connected network input to the backward collaborative network obtains the backward analytical object representation
Figure BDA00031574468900000721

Figure BDA00031574468900000722
Figure BDA00031574468900000722

其中,

Figure BDA00031574468900000723
是权重为wa_的后向协同网络的第三全连接网络。in,
Figure BDA00031574468900000723
is the third fully connected network of the backward cooperative network with weight wa_ .

进一步地,所述步骤S3中分别将前向和后向的分析对象编码表示

Figure BDA0003157446890000081
Figure BDA0003157446890000082
观点编码表示
Figure BDA0003157446890000083
Figure BDA0003157446890000084
情感编码表示
Figure BDA0003157446890000085
Figure BDA0003157446890000086
进行融合运算,输入到分类网络中,分别输出分析对象、观点、情感的标注结果Pa、Po、Ps,具体实施过程如下:Further, in the step S3, the forward and backward analysis object codes are respectively represented
Figure BDA0003157446890000081
and
Figure BDA0003157446890000082
opinion coding
Figure BDA0003157446890000083
and
Figure BDA0003157446890000084
emotion coding representation
Figure BDA0003157446890000085
and
Figure BDA0003157446890000086
Perform fusion operation, input it into the classification network, and output the annotation results P a , P o , and P s of the analyzed objects, opinions, and emotions, respectively. The specific implementation process is as follows:

S31、将前向的分析对象编码表示

Figure BDA0003157446890000087
和后向的分析对象编码表示
Figure BDA0003157446890000088
进行融合运算,输入到分析对象分类网络中,输出分析对象标注结果
Figure BDA0003157446890000089
S31. Code the forward analysis object to represent
Figure BDA0003157446890000087
and the backward parsed object encoding representation
Figure BDA0003157446890000088
Fusion operation is performed, input to the analysis object classification network, and output analysis object labeling results
Figure BDA0003157446890000089

Figure BDA00031574468900000810
Figure BDA00031574468900000810

其中,

Figure BDA00031574468900000811
是分析对象分类网络,由一个权重为wcls_a的全连接网络组成;in,
Figure BDA00031574468900000811
is the analysis object classification network, which consists of a fully connected network with a weight of w cls_a ;

S32、将前向的观点编码表示

Figure BDA00031574468900000812
和后向的观点编码表示
Figure BDA00031574468900000813
进行融合运算,输入到观点分类网络中,输出观点标注结果
Figure BDA00031574468900000814
S32, encoding the forward viewpoint
Figure BDA00031574468900000812
and backward view-encoded representations
Figure BDA00031574468900000813
Perform a fusion operation, input it into the opinion classification network, and output the opinion labeling result
Figure BDA00031574468900000814

Figure BDA00031574468900000815
Figure BDA00031574468900000815

其中,

Figure BDA00031574468900000816
是观点分类网络,由一个权重为wcls_o的全连接网络组成;in,
Figure BDA00031574468900000816
is the opinion classification network, which consists of a fully connected network with weight w cls_o ;

S33、将前向的情感编码表示

Figure BDA00031574468900000817
和后向的情感编码表示
Figure BDA00031574468900000818
进行融合运算,输入到情感分类网络中,输出情感标注结果
Figure BDA00031574468900000819
S33. Express the forward emotion code
Figure BDA00031574468900000817
and backward emotion coding representation
Figure BDA00031574468900000818
Perform a fusion operation, input it into the sentiment classification network, and output the sentiment labeling result
Figure BDA00031574468900000819

Figure BDA00031574468900000820
Figure BDA00031574468900000820

其中,

Figure BDA00031574468900000821
是情感分类网络,由一个权重为wcls_s的全连接网络组成。in,
Figure BDA00031574468900000821
is the sentiment classification network, consisting of a fully connected network with weights w cls_s .

进一步地,所述用户话语文本数据包括中文数据和/或英文数据。Further, the user utterance text data includes Chinese data and/or English data.

本发明相对于现有技术具有如下的优点及效果:Compared with the prior art, the present invention has the following advantages and effects:

本发明可以考虑到细粒度情感分析任务中,抽取文本中情感分析的对象、抽取描述该分析对象情感的观点词和分析对象的情感倾向3个子任务之间的关系,前一个子任务可以为后一个子任务提供相关信息从而辅助后一个子任务,反过来,后一个子任务的信息也可以被前一个子任务利用,从而辅助前一个子任务。本发明考虑到了任务间的这种关系信息,利用来自其他子任务的信息帮助每个子任务更好的分类或标注,从而达到更好的效果。The present invention can take into account the relationship between three subtasks in the fine-grained sentiment analysis task, extracting the object of sentiment analysis in the text, extracting opinion words describing the sentiment of the analysis object, and analyzing the sentiment tendency of the object, and the former subtask can be the latter subtask. A subtask provides relevant information to assist the next subtask, and conversely, the information of the latter subtask can also be used by the previous subtask to assist the previous subtask. The present invention takes into account the relationship information between tasks, and utilizes information from other subtasks to help each subtask to better classify or label, thereby achieving better results.

附图说明Description of drawings

图1是本发明公开的一种基于双向协同网络的社交媒体文本细粒度情感分析方法的流程图;1 is a flowchart of a method for fine-grained sentiment analysis of social media text based on a two-way collaborative network disclosed in the present invention;

图2是本发明公开的一种基于双向协同网络的社交媒体文本细粒度情感分析方法的概要图,从图2中可以看出关系感知双向协同网络的整体结构和效果。FIG. 2 is a schematic diagram of a fine-grained sentiment analysis method for social media text based on a two-way collaborative network disclosed in the present invention, and the overall structure and effect of the relationship-aware two-way collaborative network can be seen from FIG. 2 .

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

实施例Example

本实施例公开了一种基于关系感知的双向协同网络的社交媒体文本细粒度情感分析方法,图1是本实施例方法的流程图,如图1所示,该情感分析方法包括以下步骤:This embodiment discloses a method for fine-grained sentiment analysis of social media text based on a relationship-aware two-way collaborative network. FIG. 1 is a flowchart of the method of this embodiment. As shown in FIG. 1 , the sentiment analysis method includes the following steps:

S1、将用户话语文本数据中的每个句子切分为词,如图2所示,句子被切分为词,表示如下:S1. Divide each sentence in the user utterance text data into words. As shown in Figure 2, the sentences are divided into words, which are expressed as follows:

w=(‘这’,‘家’,‘餐馆’,‘的’,‘菜品’,‘不错’,‘服务’,‘不太好’),并将词用词向量

Figure BDA0003157446890000101
表示,其中w是词序列,Ew是词向量序列,wi是第i个词,
Figure BDA0003157446890000102
是第i个词的词向量。1≤i≤N,N=8为词的个数,emb为词向量维度大小,这里为300,
Figure BDA0003157446890000103
为维度为emb的实数向量空间;w=('this', 'home', 'restaurant', 'of', 'dish', 'good', 'service', 'not so good'), and use the word vector
Figure BDA0003157446890000101
Representation, where w is the word sequence, E w is the word vector sequence, w i is the ith word,
Figure BDA0003157446890000102
is the word vector of the ith word. 1≤i≤N, N=8 is the number of words, emb is the dimension of word vector, here is 300,
Figure BDA0003157446890000103
is a real vector space of dimension emb;

S2、将词向量

Figure BDA0003157446890000104
分别输入前向协同网络和后向协同网络中得到前向和后向的分析对象编码表示
Figure BDA0003157446890000105
Figure BDA0003157446890000106
Figure BDA0003157446890000107
前向和后向的观点编码表示
Figure BDA0003157446890000108
Figure BDA0003157446890000109
前向和后向的情感编码表示
Figure BDA00031574468900001010
Figure BDA00031574468900001011
其中
Figure BDA00031574468900001012
是第i个词的前向分析对象编码表示,
Figure BDA00031574468900001013
是第i个词的前向观点编码表示,
Figure BDA00031574468900001014
是第i个词的前向情感编码表示,
Figure BDA00031574468900001015
是第i个词的后向分析对象编码表示,
Figure BDA00031574468900001016
是第i个词的后向观点编码表示,
Figure BDA00031574468900001017
是第i个词的后向情感编码表示,1≤i≤8,d为前向和后向分析对象,观点和情感编码表示的维度大小,这里是150,
Figure BDA00031574468900001018
为维度为d的实数向量空间。S2, the word vector
Figure BDA0003157446890000104
Input the forward collaborative network and the backward collaborative network respectively to obtain the forward and backward analysis object coding representation
Figure BDA0003157446890000105
Figure BDA0003157446890000106
and
Figure BDA0003157446890000107
Forward and backward view-encoded representations
Figure BDA0003157446890000108
and
Figure BDA0003157446890000109
Forward and Backward Sentiment Coding Representations
Figure BDA00031574468900001010
and
Figure BDA00031574468900001011
in
Figure BDA00031574468900001012
is the forward parsed object-encoded representation of the ith word,
Figure BDA00031574468900001013
is the forward view-encoded representation of the ith word,
Figure BDA00031574468900001014
is the forward sentiment encoding representation of the ith word,
Figure BDA00031574468900001015
is the backward-analyzed object-encoded representation of the ith word,
Figure BDA00031574468900001016
is the backward opinion-encoded representation of the ith word,
Figure BDA00031574468900001017
is the backward sentiment coding representation of the i-th word, 1≤i≤8, d is the forward and backward analysis object, the dimension size of opinion and sentiment coding representation, here is 150,
Figure BDA00031574468900001018
is a real vector space of dimension d.

本实施例中,步骤S2实施过程如下:In this embodiment, the implementation process of step S2 is as follows:

S21、将词向量

Figure BDA00031574468900001019
输入前向协同网络得到前向的分析对象编码表示
Figure BDA00031574468900001020
前向的观点编码表示
Figure BDA00031574468900001021
和前向的情感编码表示
Figure BDA00031574468900001022
过程如下:S21, the word vector
Figure BDA00031574468900001019
Enter the forward collaborative network to obtain a forward encoded representation of the analyzed object
Figure BDA00031574468900001020
Forward View Encoded Representation
Figure BDA00031574468900001021
and forward sentiment encoding representation
Figure BDA00031574468900001022
The process is as follows:

S211、将词向量

Figure BDA00031574468900001023
输入前向协同网络的第一卷积神经网络得到前向分析对象隐层单元
Figure BDA00031574468900001024
S211, the word vector
Figure BDA00031574468900001023
Input the first convolutional neural network of the forward collaborative network to obtain the hidden layer unit of the forward analysis object
Figure BDA00031574468900001024

Figure BDA00031574468900001025
Figure BDA00031574468900001025

再将前向分析对象隐层单元

Figure BDA0003157446890000111
输入前向协同网络的第一全连接网络得到前向的分析对象编码表示
Figure BDA0003157446890000112
Then the hidden layer unit of the forward analysis object
Figure BDA0003157446890000111
The first fully connected network input to the forward collaborative network obtains the forward parsed object encoding representation
Figure BDA0003157446890000112

Figure BDA0003157446890000113
Figure BDA0003157446890000113

其中,

Figure BDA0003157446890000114
是权重为wca的前向协同网络的第一卷积神经网络,
Figure BDA0003157446890000115
是权重为wa的前向协同网络的第一全连接网络。in,
Figure BDA0003157446890000114
is the first convolutional neural network of the forward synergistic network with weight w ca ,
Figure BDA0003157446890000115
is the first fully connected network of the forward cooperative network with weight wa .

S212、将词向量

Figure BDA00031574468900001119
输入前向协同网络的第二卷积神经网络得到前向观点隐层单元
Figure BDA0003157446890000116
S212, the word vector
Figure BDA00031574468900001119
The second convolutional neural network input to the forward synergistic network obtains the forward view hidden layer unit
Figure BDA0003157446890000116

Figure BDA0003157446890000117
Figure BDA0003157446890000117

其中,

Figure BDA0003157446890000118
是权重为wco的前向协同网络的第二卷积神经网络,将前向观点隐层单元
Figure BDA0003157446890000119
和前向分析对象隐层单元
Figure BDA00031574468900001110
进行关系计算得到观点对分析对象的关系隐层单元HO2A:in,
Figure BDA0003157446890000118
is the second convolutional neural network of the forward synergistic network with weight w co , which combines the forward view hidden layer unit
Figure BDA0003157446890000119
and forward analysis object hidden layer unit
Figure BDA00031574468900001110
Perform relational calculation to obtain the relational hidden layer unit H O2A of the viewpoint to the analysis object:

Figure BDA00031574468900001111
Figure BDA00031574468900001111

其中,softmax(·)是归一化指数函数,×代表矩阵乘法操作,

Figure BDA00031574468900001112
Figure BDA00031574468900001113
的转置,将观点对分析对象的关系隐层单元HO2A和前向观点隐层单元
Figure BDA00031574468900001114
输入前向协同网络的第二全连接网络得到前向的观点编码表示
Figure BDA00031574468900001115
Figure BDA00031574468900001116
where softmax( ) is the normalized exponential function, × represents the matrix multiplication operation,
Figure BDA00031574468900001112
Yes
Figure BDA00031574468900001113
The transpose of the view to the analysis object relation hidden layer unit H O2A and forward view hidden layer unit
Figure BDA00031574468900001114
The second fully-connected network that feeds the forward collaborative network obtains a forward opinion-encoded representation
Figure BDA00031574468900001115
Figure BDA00031574468900001116

其中,

Figure BDA00031574468900001117
是权重为wo的前向协同网络的第二全连接网络。在分词后的句子[‘这’,‘家’,‘餐馆’,‘的’,‘菜品’,‘不错’,‘服务’,‘不太好’]中,若已知分析对象‘菜品’,则网络可以更加容易提取到观点‘不错’,已知分析对象‘服务’,则网络可以更加容易提取到观点‘不太好’。由于在得到前向观点编码表示的过程中网络考虑了来自分析对象的信息,网络会更容易得到正确的观点标注结果。in,
Figure BDA00031574468900001117
is the second fully connected network of the forward cooperative network with weight wo . In the sentence after participle ['this', 'home', 'restaurant', 'of', 'dish', 'good', 'service', 'not so good'], if the analysis object 'dish' is known , the network can more easily extract the opinion 'good', and the analysis object 'service' is known, the network can more easily extract the opinion 'not good'. Since the network considers the information from the analyzed object in the process of obtaining the forward opinion encoded representation, it will be easier for the network to obtain the correct opinion labeling result.

S213、将词向量

Figure BDA00031574468900001118
输入前向协同网络的第三卷积神经网络得到前向情感隐层单元
Figure BDA0003157446890000121
S213, the word vector
Figure BDA00031574468900001118
The third convolutional neural network input to the forward synergistic network obtains the forward emotional hidden layer unit
Figure BDA0003157446890000121

Figure BDA0003157446890000122
Figure BDA0003157446890000122

其中,

Figure BDA0003157446890000123
是权重为wcs的前向协同网络的第三卷积神经网络。将前向情感隐层单元
Figure BDA0003157446890000124
和前向分析对象隐层单元
Figure BDA0003157446890000125
进行关系计算得到情感对分析对象的关系隐层单元HS2A:in,
Figure BDA0003157446890000123
is the third convolutional neural network of the forward synergistic network with weight w cs . The forward emotional hidden layer unit
Figure BDA0003157446890000124
and forward analysis object hidden layer unit
Figure BDA0003157446890000125
Perform relational calculation to obtain the relational hidden layer unit H S2A of the sentiment to the analysis object:

Figure BDA0003157446890000126
Figure BDA0003157446890000126

将前向情感隐层单元

Figure BDA0003157446890000127
和前向观点隐层单元
Figure BDA0003157446890000128
进行关系计算得到情感对观点的关系隐层单元HS2O:The forward emotional hidden layer unit
Figure BDA0003157446890000127
and forward view hidden units
Figure BDA0003157446890000128
Perform relational calculation to obtain the relational hidden layer unit H S2O of sentiment to opinion:

Figure BDA0003157446890000129
Figure BDA0003157446890000129

其中,

Figure BDA00031574468900001210
Figure BDA00031574468900001211
的转置。将情感对分析对象的关系隐层单元HS2A、情感对观点的关系隐层单元HS2O和前向情感隐层单元
Figure BDA00031574468900001212
输入前向协同网络的第三全连接网络得到前向的情感编码表示
Figure BDA00031574468900001213
in,
Figure BDA00031574468900001210
Yes
Figure BDA00031574468900001211
transposition of . The relational hidden layer unit H S2A of sentiment to analysis object, the relational hidden layer unit H S2O of sentiment to opinion and the forward sentiment hidden layer unit
Figure BDA00031574468900001212
The third fully-connected network that feeds the forward synergistic network obtains a forward emotion-encoded representation
Figure BDA00031574468900001213

Figure BDA00031574468900001214
Figure BDA00031574468900001214

其中,

Figure BDA00031574468900001215
是权重为ws的前向协同网络的第三全连接网络。在分词后的句子[‘这’,‘家’,‘餐馆’,‘的’,‘菜品’,‘不错’,‘服务’,‘不太好’]中,若已知分析对象‘菜品’和对应的观点‘不错’,则有助于网络学习到积极的情感信息。若已知分析对象‘服务’和观点‘不太好’,则有助于网络学习到消极的情感信息。由于在得到前向情感编码表示的过程中考虑了来自分析对象和观点的信息,网络会更容易得到正确的情感标注结果。in,
Figure BDA00031574468900001215
is the third fully connected network of the forward cooperative network with weight ws . In the sentence after participle ['this', 'home', 'restaurant', 'of', 'dish', 'good', 'service', 'not so good'], if the analysis object 'dish' is known and the corresponding opinion 'good', it helps the network to learn positive emotional information. If it is known that the analysis object 'service' and the opinion 'not so good', it will help the network to learn negative emotional information. Since the information from the analyzed objects and viewpoints is considered in the process of obtaining the forward sentiment coding representation, it is easier for the network to obtain the correct sentiment annotation results.

S22、将词向量

Figure BDA00031574468900001216
输入后向协同网络得到后向的分析对象编码表示
Figure BDA00031574468900001217
后向的观点编码表示
Figure BDA00031574468900001218
和后向的情感编码表示
Figure BDA00031574468900001219
过程如下:S22, the word vector
Figure BDA00031574468900001216
Input the backward collaborative network to obtain the backward encoded representation of the analyzed object
Figure BDA00031574468900001217
Backward View Encoding Representation
Figure BDA00031574468900001218
and backward emotion coding representation
Figure BDA00031574468900001219
The process is as follows:

S221、将词向量

Figure BDA00031574468900001220
输入后向协同网络的第一卷积神经网络得到后向情感隐层单元
Figure BDA0003157446890000131
S221. The word vector
Figure BDA00031574468900001220
The first convolutional neural network input to the backward collaborative network gets the backward emotional hidden layer unit
Figure BDA0003157446890000131

Figure BDA0003157446890000132
Figure BDA0003157446890000132

再将后向情感隐层单元

Figure BDA0003157446890000133
输入后向协同网络的第一全连接网络得到后向的情感编码表示
Figure BDA0003157446890000134
Then the backward emotional hidden layer unit
Figure BDA0003157446890000133
The first fully-connected network that feeds the backward collaborative network obtains a backward sentiment-encoded representation
Figure BDA0003157446890000134

Figure BDA0003157446890000135
Figure BDA0003157446890000135

其中,

Figure BDA0003157446890000136
是权重为wcs_的后向协同网络的第一卷积神经网络,
Figure BDA0003157446890000137
是权重为ws_的后向协同网络的第一全连接网络。in,
Figure BDA0003157446890000136
is the first convolutional neural network of the backward collaborative network with weight w cs_ ,
Figure BDA0003157446890000137
is the first fully connected network of the backward collaborative network with weight ws_ .

S222、将词向量

Figure BDA0003157446890000138
输入后向协同网络的第二卷积神经网络得到后向观点隐层单元
Figure BDA0003157446890000139
S222, the word vector
Figure BDA0003157446890000138
The second convolutional neural network input to the backward synergistic network obtains the backward view hidden layer unit
Figure BDA0003157446890000139

Figure BDA00031574468900001310
Figure BDA00031574468900001310

其中,

Figure BDA00031574468900001311
是权重为wco_的卷积神经网络。将后向观点隐层单元
Figure BDA00031574468900001312
和后向情感隐层单元
Figure BDA00031574468900001313
进行关系计算得到观点对情感的关系隐层单元HO2S:in,
Figure BDA00031574468900001311
is a convolutional neural network with weights w co_ . Backward view hidden unit
Figure BDA00031574468900001312
and the backward emotional hidden layer unit
Figure BDA00031574468900001313
Carry out relational calculation to obtain the relational hidden layer unit H O2S of opinion to emotion:

Figure BDA00031574468900001314
Figure BDA00031574468900001314

其中,softmax(·)是归一化指数函数,×代表矩阵乘法操作,

Figure BDA00031574468900001315
Figure BDA00031574468900001316
的转置。将观点对情感的关系隐层单元HO2S和后向观点隐层单元
Figure BDA00031574468900001317
输入后向协同网络的第二全连接网络得到后向的分析对象编码表示
Figure BDA00031574468900001318
where softmax( ) is the normalized exponential function, × represents the matrix multiplication operation,
Figure BDA00031574468900001315
Yes
Figure BDA00031574468900001316
transposition of . The view-to-sentiment relationship hidden layer unit H O2S and backward view hidden layer unit
Figure BDA00031574468900001317
The second fully connected network input to the backward collaborative network obtains the backward parsed object encoding representation
Figure BDA00031574468900001318

Figure BDA00031574468900001319
Figure BDA00031574468900001319

其中,

Figure BDA00031574468900001320
是权重为wo_的后向协同网络的第二全连接网络。在分词后的句子[‘这’,‘家’,‘餐馆’,‘的’,‘菜品’,‘不错’,‘服务’,‘不太好’]中,若已知情感为‘积极’和‘消极’,则有助于网络提取到情感对应的观点词,如‘不错’和‘不太好’。由于在得到后向观点编码表示的过程中考虑了来自情感的信息,网络会更容易得到正确的观点标注结果。in,
Figure BDA00031574468900001320
is the second fully connected network of the backward cooperative network with weight w o_ . In the sentence after participle ['this', 'home', 'restaurant', 'of', 'dish', 'good', 'service', 'not so good'], if the known sentiment is 'positive' and 'negative', it helps the network to extract sentiment-corresponding opinion words, such as 'good' and 'not so good'. Since the information from the sentiment is considered in the process of obtaining the backward opinion encoded representation, the network will more easily get the correct opinion labeling results.

S223、将词向量

Figure BDA0003157446890000141
输入后向协同网络的第三卷积神经网络得到后向分析对象隐层单元
Figure BDA0003157446890000142
S223, the word vector
Figure BDA0003157446890000141
The third convolutional neural network inputting the backward synergistic network obtains the hidden layer unit of the backward analysis object
Figure BDA0003157446890000142

Figure BDA0003157446890000143
Figure BDA0003157446890000143

其中,

Figure BDA0003157446890000144
是权重为wca_的后向协同网络的第三卷积神经网络。将后向分析对象隐层单元
Figure BDA0003157446890000145
和后向情感隐层单元
Figure BDA0003157446890000146
进行关系计算得到分析对象对情感的关系隐层单元HA2S:in,
Figure BDA0003157446890000144
is the third convolutional neural network of the backward collaborative network with weight w ca_ . The hidden layer unit of the backward analysis object
Figure BDA0003157446890000145
and the backward emotional hidden layer unit
Figure BDA0003157446890000146
The relationship calculation is performed to obtain the relationship hidden layer unit H A2S of the analysis object's emotion:

Figure BDA0003157446890000147
Figure BDA0003157446890000147

将后向分析对象隐层单元

Figure BDA0003157446890000148
和后向观点隐层单元
Figure BDA0003157446890000149
进行关系计算得到分析对象对观点的关系隐层单元HA2O:The hidden layer unit of the backward analysis object
Figure BDA0003157446890000148
and the backward view hidden unit
Figure BDA0003157446890000149
Perform relational calculation to obtain the relational hidden layer unit H A2O of the analysis object to the viewpoint:

Figure BDA00031574468900001410
Figure BDA00031574468900001410

其中,

Figure BDA00031574468900001411
Figure BDA00031574468900001412
的转置。将分析对象对情感的关系隐层单元HA2S、分析对象对观点的关系隐层单元HA2O和后向分析对象隐层单元
Figure BDA00031574468900001413
输入后向协同网络的第三全连接网络得到后向的分析对象表示
Figure BDA00031574468900001414
in,
Figure BDA00031574468900001411
Yes
Figure BDA00031574468900001412
transposition of . The hidden layer unit H A2S of the relationship between the analysis object and the sentiment, the hidden layer unit H A2O of the relationship between the analysis object and the opinion, and the hidden layer unit of the backward analysis object
Figure BDA00031574468900001413
The third fully connected network input to the backward collaborative network obtains the backward analytical object representation
Figure BDA00031574468900001414

Figure BDA00031574468900001415
Figure BDA00031574468900001415

其中,

Figure BDA00031574468900001416
是权重为wa_的后向协同网络的第三全连接网络。在分词后的句子[‘这’,‘家’,‘餐馆’,‘的’,‘菜品’,‘不错’,‘服务’,‘不太好’]中,若已知情感为‘积极’和观点词‘不错’,则网络更容易找出它们对应的分析对象是‘菜品’,若已知情感为‘消极’和观点词‘不太好’,则网络更容易找出它们对应的分析对象是‘服务’。由于在得到后向分析对象编码表示的过程中考虑了来自情感和观点的信息,网络会更容易得到正确的分析对象标注结果。in,
Figure BDA00031574468900001416
is the third fully connected network of the backward cooperative network with weight wa_ . In the sentence after participle ['this', 'home', 'restaurant', 'of', 'dish', 'good', 'service', 'not so good'], if the known sentiment is 'positive' and the opinion word 'good', it is easier for the network to find out that their corresponding analysis object is 'dishes', if the known sentiment is 'negative' and the opinion word 'not good', the network is easier to find their corresponding analysis Objects are 'Services'. Since the information from sentiment and opinion is considered in the process of obtaining the encoded representation of the backward analyzed object, it is easier for the network to obtain the correct annotation of the analyzed object.

S3、分别将前向和后向的分析对象编码表示

Figure BDA00031574468900001417
观点编码表示
Figure BDA00031574468900001418
Figure BDA0003157446890000151
情感编码表示
Figure BDA0003157446890000152
进行融合运算,输入到分析对象分类网络、观点分类网络、情感分类网络中,分别输出分析对象、观点、情感的标注结果Pa、Po、Ps。其中
Figure BDA0003157446890000153
分别为维度为8×3、8×4的实数向量空间。S3. Respectively encode the forward and backward analysis objects
Figure BDA00031574468900001417
opinion coding
Figure BDA00031574468900001418
Figure BDA0003157446890000151
emotion coding representation
Figure BDA0003157446890000152
Fusion operation is performed, input to the analysis object classification network, opinion classification network, and sentiment classification network, and output the labeling results Pa, P o , and P s of the analysis object, opinion, and emotion, respectively . in
Figure BDA0003157446890000153
are real vector spaces with dimensions of 8×3 and 8×4, respectively.

本实施例中,步骤S3过程如下:In this embodiment, the process of step S3 is as follows:

S31、将前向的分析对象编码表示

Figure BDA0003157446890000154
和后向的分析对象编码表示
Figure BDA0003157446890000155
融合,输入到分析对象分类网络中,输出分析对象标注结果
Figure BDA0003157446890000156
S31. Code the forward analysis object to represent
Figure BDA0003157446890000154
and the backward parsed object encoding representation
Figure BDA0003157446890000155
Fusion, input into the analysis object classification network, and output the analysis object annotation results
Figure BDA0003157446890000156

Figure BDA0003157446890000157
Figure BDA0003157446890000157

其中,分析对象标注结果对应标签为[0,0,0,0,1,0,1,0],“菜品”和“服务”被分配了非空标签,被标注为了分析对象。

Figure BDA0003157446890000158
是分析对象分类网络,由一个权重为wcls_a的全连接网络组成。Among them, the corresponding label of the analysis object labeling result is [0, 0, 0, 0, 1, 0, 1, 0], and “dishes” and “services” are assigned non-empty labels and are marked as analysis objects.
Figure BDA0003157446890000158
is the analysis object classification network, which consists of a fully connected network with weight w cls_a .

S32、将前向的观点编码表示

Figure BDA0003157446890000159
和后向的观点编码表示
Figure BDA00031574468900001510
融合,输入到观点分类网络中,输出观点标注结果
Figure BDA00031574468900001511
S32, encoding the forward viewpoint
Figure BDA0003157446890000159
and backward view-encoded representations
Figure BDA00031574468900001510
Fusion, input into the opinion classification network, and output the opinion labeling result
Figure BDA00031574468900001511

Figure BDA00031574468900001512
Figure BDA00031574468900001512

其中,观点标注结果对应标签为[0,0,0,0,0,1,0,1],“不错”和“不太好”被分配了非空标签,被标注为了观点。

Figure BDA00031574468900001513
是观点分类网络,由一个权重为wcls_o的全连接网络组成。Among them, the corresponding label of the opinion labeling result is [0, 0, 0, 0, 0, 1, 0, 1], "good" and "not good" are assigned non-empty labels and are marked as opinions.
Figure BDA00031574468900001513
is the opinion classification network, which consists of a fully connected network with weight w cls_o .

S33、将前向的情感编码表示

Figure BDA00031574468900001514
和后向的情感编码表示
Figure BDA00031574468900001515
融合,输入到情感分类网络中,输出情感标注结果
Figure BDA00031574468900001516
S33. Express the forward emotion code
Figure BDA00031574468900001514
and backward emotion coding representation
Figure BDA00031574468900001515
Fusion, input into the sentiment classification network, and output sentiment labeling results
Figure BDA00031574468900001516

Figure BDA00031574468900001517
Figure BDA00031574468900001517

其中,情感标注结果对应标签为[0,0,0,0,1,0,2,0],“菜品”被标注为标签1,代表积极的情感,“服务”被标注为标签2,代表消极的情感。

Figure BDA0003157446890000161
是情感分类网络,由一个权重为wcls_s的全连接网络组成。Among them, the corresponding label of the emotion labeling result is [0, 0, 0, 0, 1, 0, 2, 0], “dish” is labeled as label 1, representing positive emotion, and “service” is labeled as label 2, representing negative emotions.
Figure BDA0003157446890000161
is the sentiment classification network, consisting of a fully connected network with weights w cls_s .

S4、根据标注结果和真实结果,以最小化交叉熵损失函数为目标对前向协同网络、后向协同网络、分析对象分类网络、观点分类网络、情感分类网络迭代训练;S4. According to the labeled results and the real results, iteratively trains the forward collaborative network, the backward collaborative network, the analysis object classification network, the opinion classification network, and the sentiment classification network with the goal of minimizing the cross-entropy loss function;

S5、将待分类的社交媒体文本输入前向协同网络、后向协同网络、分析对象分类网络、观点分类网络、情感分类网络中得到细粒度情感分析结果。S5. Input the social media text to be classified into the forward collaborative network, the backward collaborative network, the analysis object classification network, the opinion classification network, and the sentiment classification network to obtain fine-grained sentiment analysis results.

综上所述,本实施例提出的基于关系感知双向协同网络的社交媒体文本细粒度情感分析方法,首先通过前向协同网络考虑前向的3个子任务间的关系,接着,使用后向协同网络考虑后向的3个子任务间的关系,接下来,将前向和后向的3个子任务的编码表示融合,分别进行抽取或分类。相对于传统的用于细粒度情感分析的模型来说,本发明可以考虑到该任务中3个子任务之间的关系信息,达到很好的分析效果,从而帮助社交媒体中进行用户情感的细粒度分析。To sum up, the fine-grained sentiment analysis method for social media text based on the relationship-aware bidirectional collaborative network proposed in this embodiment first considers the relationship between the three forward subtasks through the forward collaborative network, and then uses the backward collaborative network. Considering the relationship between the three backward subtasks, next, the encoded representations of the three forward and backward subtasks are fused to extract or classify respectively. Compared with the traditional model for fine-grained sentiment analysis, the present invention can take into account the relationship information between the three subtasks in the task, and achieve a good analysis effect, thereby helping the fine-grained user sentiment in social media. analyze.

上述实施例为本发明较佳的实施方式,但本发明的实施方式并不受上述实施例的限制,其他的任何未背离本发明的精神实质与原理下所作的改变、修饰、替代、组合、简化,均应为等效的置换方式,都包含在本发明的保护范围之内。The above-mentioned embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited by the above-mentioned embodiments, and any other changes, modifications, substitutions, combinations, The simplification should be equivalent replacement manners, which are all included in the protection scope of the present invention.

Claims (3)

1.一种基于双向协同网络的社交媒体文本细粒度情感分析方法,其特征在于,所述分析方法包括以下步骤:1. a kind of social media text fine-grained sentiment analysis method based on two-way collaborative network, is characterized in that, described analysis method comprises the following steps: S1、将用户话语文本数据中的每个句子切分为词w=(w1,w2,…,wi,…,wN),将词用词向量
Figure FDA0003707277250000011
表示,其中w是词序列,Ew是词向量序列,wi是第i个词,
Figure FDA0003707277250000012
是第i个词的词向量,1≤i≤N,N为词的个数,emb为词向量维度大小,
Figure FDA0003707277250000013
为维度为emb的实数向量空间;
S1. Divide each sentence in the user utterance text data into words w=(w 1 ,w 2 ,..., wi ,...,w N ), and use the word vector
Figure FDA0003707277250000011
Representation, where w is the word sequence, E w is the word vector sequence, w i is the ith word,
Figure FDA0003707277250000012
is the word vector of the i-th word, 1≤i≤N, N is the number of words, emb is the dimension of the word vector,
Figure FDA0003707277250000013
is a real vector space of dimension emb;
S2、将词向量
Figure FDA0003707277250000014
分别输入前向协同网络和后向协同网络中得到前向和后向的分析对象编码表示
Figure FDA0003707277250000015
Figure FDA0003707277250000016
Figure FDA00037072772500000125
前向和后向的观点编码表示
Figure FDA0003707277250000017
Figure FDA0003707277250000018
前向和后向的情感编码表示
Figure FDA0003707277250000019
Figure FDA00037072772500000110
其中
Figure FDA00037072772500000111
是第i个词的前向分析对象编码表示,
Figure FDA00037072772500000112
是第i个词的后向分析对象编码表示,
Figure FDA00037072772500000113
是第i个词的前向观点编码表示,
Figure FDA00037072772500000114
是第i个词的后向观点编码表示,
Figure FDA00037072772500000115
是第i个词的前向情感编码表示,
Figure FDA00037072772500000116
是第i个词的后向情感编码表示,1≤i≤N,d为前向和后向分析对象、观点和情感编码表示的维度大小,
Figure FDA00037072772500000117
为维度为d的实数向量空间;
S2, the word vector
Figure FDA0003707277250000014
Input the forward collaborative network and the backward collaborative network respectively to obtain the forward and backward analysis object coding representation
Figure FDA0003707277250000015
Figure FDA0003707277250000016
and
Figure FDA00037072772500000125
Forward and backward view-encoded representations
Figure FDA0003707277250000017
and
Figure FDA0003707277250000018
Forward and Backward Sentiment Coding Representations
Figure FDA0003707277250000019
and
Figure FDA00037072772500000110
in
Figure FDA00037072772500000111
is the forward parsed object-encoded representation of the ith word,
Figure FDA00037072772500000112
is the backward-analyzed object-encoded representation of the ith word,
Figure FDA00037072772500000113
is the forward view-encoded representation of the ith word,
Figure FDA00037072772500000114
is the backward opinion-encoded representation of the ith word,
Figure FDA00037072772500000115
is the forward sentiment encoding representation of the ith word,
Figure FDA00037072772500000116
is the backward sentiment coding representation of the i-th word, 1≤i≤N, d is the dimension size of the forward and backward analysis object, opinion and sentiment coding representation,
Figure FDA00037072772500000117
is a real vector space of dimension d;
S3、分别将前向和后向的分析对象编码表示
Figure FDA00037072772500000118
Figure FDA00037072772500000119
观点编码表示
Figure FDA00037072772500000120
Figure FDA00037072772500000121
情感编码表示
Figure FDA00037072772500000122
Figure FDA00037072772500000123
进行融合运算,输入到分析对象分类网络、观点分类网络、情感分类网络中,分别输出分析对象、观点、情感的标注结果Pa、Po、Ps,其中
Figure FDA00037072772500000124
ca、co和cs分别是分析对象标签个数、观点标签个数和情感标签个数,
Figure FDA0003707277250000021
Figure FDA0003707277250000022
分别为维度为N×ca、N×co和N×cs的实数向量空间;
S3. Respectively encode the forward and backward analysis objects
Figure FDA00037072772500000118
and
Figure FDA00037072772500000119
opinion coding
Figure FDA00037072772500000120
and
Figure FDA00037072772500000121
emotion coding representation
Figure FDA00037072772500000122
and
Figure FDA00037072772500000123
Perform fusion operation, input into the analysis object classification network, opinion classification network, and sentiment classification network, and output the labeling results Pa, P o , and P s of the analysis object, opinion, and emotion respectively , among which
Figure FDA00037072772500000124
c a , c o and c s are the number of object labels, opinion labels and sentiment labels, respectively,
Figure FDA0003707277250000021
and
Figure FDA0003707277250000022
are real vector spaces with dimensions N× ca , N×c o and N×c s , respectively;
S4、根据标注结果和真实结果,以最小化交叉熵损失函数为目标对前向协同网络、后向协同网络、分析对象分类网络、观点分类网络、情感分类网络迭代训练;S4. According to the labeled results and the real results, iteratively trains the forward collaborative network, the backward collaborative network, the analysis object classification network, the opinion classification network, and the sentiment classification network with the goal of minimizing the cross-entropy loss function; S5、将待分类的社交媒体文本输入前向协同网络、后向协同网络、分析对象分类网络、观点分类网络、情感分类网络中得到细粒度情感分析结果;S5, input the social media text to be classified into the forward collaborative network, the backward collaborative network, the analysis object classification network, the opinion classification network, and the sentiment classification network to obtain fine-grained sentiment analysis results; 其中,所述步骤S2中将词向量
Figure FDA0003707277250000023
分别输入前向和后向协同网络中得到前向和后向的分析对象编码表示
Figure FDA0003707277250000024
Figure FDA0003707277250000025
Figure FDA0003707277250000026
前向和后向的观点编码表示
Figure FDA0003707277250000027
Figure FDA0003707277250000028
前向和后向的情感编码表示
Figure FDA0003707277250000029
Figure FDA00037072772500000210
Figure FDA00037072772500000211
具体实施过程如下:
Wherein, in the step S2, the word vector
Figure FDA0003707277250000023
Enter the forward and backward collaborative network to obtain the forward and backward parsed object coding representations, respectively
Figure FDA0003707277250000024
Figure FDA0003707277250000025
and
Figure FDA0003707277250000026
Forward and backward view-encoded representations
Figure FDA0003707277250000027
and
Figure FDA0003707277250000028
Forward and Backward Sentiment Coding Representations
Figure FDA0003707277250000029
and
Figure FDA00037072772500000210
Figure FDA00037072772500000211
The specific implementation process is as follows:
S21、将词向量
Figure FDA00037072772500000212
输入前向协同网络得到前向的分析对象编码表示
Figure FDA00037072772500000213
前向的观点编码表示
Figure FDA00037072772500000214
和前向的情感编码表示
Figure FDA00037072772500000215
S21, the word vector
Figure FDA00037072772500000212
Enter the forward collaborative network to obtain a forward encoded representation of the analyzed object
Figure FDA00037072772500000213
Forward View Encoded Representation
Figure FDA00037072772500000214
and forward sentiment encoding representation
Figure FDA00037072772500000215
S22、将词向量
Figure FDA00037072772500000216
输入后向协同网络得到后向的分析对象编码表示
Figure FDA00037072772500000217
后向的观点编码表示
Figure FDA00037072772500000218
和后向的情感编码表示
Figure FDA00037072772500000219
S22, the word vector
Figure FDA00037072772500000216
Input the backward collaborative network to obtain the backward encoded representation of the analyzed object
Figure FDA00037072772500000217
Backward View Encoding Representation
Figure FDA00037072772500000218
and backward emotion coding representation
Figure FDA00037072772500000219
其中,所述步骤S21中将词向量
Figure FDA00037072772500000220
输入前向协同网络得到前向的分析对象编码表示
Figure FDA00037072772500000221
前向的观点编码表示
Figure FDA00037072772500000222
和前向的情感编码表示
Figure FDA00037072772500000223
具体实施过程如下:
Wherein, in the step S21, the word vector
Figure FDA00037072772500000220
Enter the forward collaborative network to obtain a forward encoded representation of the analyzed object
Figure FDA00037072772500000221
Forward View Encoded Representation
Figure FDA00037072772500000222
and forward sentiment encoding representation
Figure FDA00037072772500000223
The specific implementation process is as follows:
S211、将词向量
Figure FDA0003707277250000031
输入前向协同网络的第一卷积神经网络得到前向分析对象隐层单元
Figure FDA0003707277250000032
S211, the word vector
Figure FDA0003707277250000031
Input the first convolutional neural network of the forward collaborative network to obtain the hidden layer unit of the forward analysis object
Figure FDA0003707277250000032
Figure FDA0003707277250000033
Figure FDA0003707277250000033
其中,
Figure FDA0003707277250000034
是前向协同网络的第一卷积神经网络进行卷积运算后第i个词对应的前向分析对象隐层单元,再将前向分析对象隐层单元
Figure FDA0003707277250000035
输入前向协同网络的第一全连接网络得到前向的分析对象编码表示
Figure FDA0003707277250000036
in,
Figure FDA0003707277250000034
is the hidden layer unit of the forward analysis object corresponding to the i-th word after the first convolutional neural network of the forward collaborative network performs the convolution operation, and then the hidden layer unit of the forward analysis object is
Figure FDA0003707277250000035
The first fully connected network input to the forward collaborative network obtains the forward parsed object encoding representation
Figure FDA0003707277250000036
Figure FDA0003707277250000037
Figure FDA0003707277250000037
其中,
Figure FDA0003707277250000038
是权重为wca的前向协同网络的第一卷积神经网络,
Figure FDA0003707277250000039
是权重为wa的前向协同网络的第一全连接网络。
in,
Figure FDA0003707277250000038
is the first convolutional neural network of the forward synergistic network with weight w ca ,
Figure FDA0003707277250000039
is the first fully connected network of the forward cooperative network with weight wa .
S212、将词向量
Figure FDA00037072772500000310
输入前向协同网络的第二卷积神经网络得到前向观点隐层单元
Figure FDA00037072772500000311
S212, the word vector
Figure FDA00037072772500000310
The second convolutional neural network input to the forward synergistic network obtains the forward view hidden layer unit
Figure FDA00037072772500000311
Figure FDA00037072772500000312
Figure FDA00037072772500000312
其中,
Figure FDA00037072772500000313
是前向协同网络的第二卷积神经网络进行卷积运算后第i个词对应的前向观点隐层单元,
Figure FDA00037072772500000314
是权重为wco的前向协同网络的第二卷积神经网络,将前向观点隐层单元
Figure FDA00037072772500000315
和前向分析对象隐层单元
Figure FDA00037072772500000316
进行关系计算得到观点对分析对象的关系隐层单元HO2A
in,
Figure FDA00037072772500000313
is the forward view hidden layer unit corresponding to the i-th word after the second convolutional neural network of the forward collaborative network performs the convolution operation,
Figure FDA00037072772500000314
is the second convolutional neural network of the forward synergistic network with weight w co , which combines the forward view hidden layer unit
Figure FDA00037072772500000315
and forward analysis object hidden layer unit
Figure FDA00037072772500000316
Perform relational calculation to obtain the relational hidden layer unit H O2A of the viewpoint to the analysis object:
Figure FDA00037072772500000317
Figure FDA00037072772500000317
其中,softmax(·)是归一化指数函数,×代表矩阵乘法操作,
Figure FDA00037072772500000318
Figure FDA00037072772500000319
的转置,将观点对分析对象的关系隐层单元HO2A和前向观点隐层单元
Figure FDA00037072772500000320
输入前向协同网络的第二全连接网络得到前向的观点编码表示
Figure FDA00037072772500000321
where softmax( ) is the normalized exponential function, × represents the matrix multiplication operation,
Figure FDA00037072772500000318
Yes
Figure FDA00037072772500000319
The transpose of the view to the analysis object relation hidden layer unit H O2A and forward view hidden layer unit
Figure FDA00037072772500000320
The second fully-connected network that feeds the forward collaborative network obtains a forward opinion-encoded representation
Figure FDA00037072772500000321
Figure FDA0003707277250000041
Figure FDA0003707277250000041
其中,
Figure FDA0003707277250000042
是权重为wo的前向协同网络的第二全连接网络;
in,
Figure FDA0003707277250000042
is the second fully connected network of the forward cooperative network with weight wo ;
S213、将词向量
Figure FDA0003707277250000043
输入前向协同网络的第三卷积神经网络得到前向情感隐层单元
Figure FDA0003707277250000044
S213, the word vector
Figure FDA0003707277250000043
The third convolutional neural network input to the forward synergistic network obtains the forward emotional hidden layer unit
Figure FDA0003707277250000044
Figure FDA0003707277250000045
Figure FDA0003707277250000045
其中,
Figure FDA0003707277250000046
是前向协同网络的第三卷积神经网络进行卷积运算后第i个词对应的前向情感隐层单元,
Figure FDA0003707277250000047
是权重为wcs的卷积神经网络,将前向情感隐层单元
Figure FDA0003707277250000048
和前向分析对象隐层单元
Figure FDA0003707277250000049
进行关系计算得到情感对分析对象的关系隐层单元HS2A
in,
Figure FDA0003707277250000046
is the forward emotional hidden layer unit corresponding to the i-th word after the third convolutional neural network of the forward collaborative network performs the convolution operation,
Figure FDA0003707277250000047
is a convolutional neural network with a weight of w cs , which converts the forward emotional hidden layer unit
Figure FDA0003707277250000048
and forward analysis object hidden layer unit
Figure FDA0003707277250000049
Perform relational calculation to obtain the relational hidden layer unit H S2A of the sentiment to the analysis object:
Figure FDA00037072772500000410
Figure FDA00037072772500000410
将前向情感隐层单元
Figure FDA00037072772500000411
和前向观点隐层单元
Figure FDA00037072772500000412
进行关系计算得到情感对观点的关系隐层单元HS2O
The forward emotional hidden layer unit
Figure FDA00037072772500000411
and forward view hidden units
Figure FDA00037072772500000412
Perform relational calculation to obtain the relational hidden layer unit H S2O of sentiment to opinion:
Figure FDA00037072772500000413
Figure FDA00037072772500000413
其中,
Figure FDA00037072772500000414
Figure FDA00037072772500000415
的转置,将情感对分析对象的关系隐层单元HS2A,情感对观点的关系隐层单元HS2O和前向情感隐层单元
Figure FDA00037072772500000416
输入前向协同网络的第三全连接网络得到前向的情感编码表示
Figure FDA00037072772500000417
in,
Figure FDA00037072772500000414
Yes
Figure FDA00037072772500000415
The transposition of the sentiment-to-analysis object relational hidden layer unit H S2A , the sentiment-to-view relational hidden layer unit H S2O and the forward sentiment hidden layer unit
Figure FDA00037072772500000416
The third fully-connected network that feeds the forward synergistic network obtains a forward emotion-encoded representation
Figure FDA00037072772500000417
Figure FDA00037072772500000418
Figure FDA00037072772500000418
其中,
Figure FDA00037072772500000419
是权重为ws的前向协同网络的第三全连接网络;
in,
Figure FDA00037072772500000419
is the third fully connected network of the forward cooperative network with weight ws ;
其中,所述步骤S22中将词向量
Figure FDA00037072772500000420
输入后向协同网络得到后向的分析对象编码表示
Figure FDA00037072772500000421
后向的观点编码表示
Figure FDA00037072772500000422
和后向的情感编码表示
Figure FDA00037072772500000423
具体实施过程如下:
Wherein, in the step S22, the word vector
Figure FDA00037072772500000420
Input the backward collaborative network to obtain the backward encoded representation of the analyzed object
Figure FDA00037072772500000421
Backward View Encoding Representation
Figure FDA00037072772500000422
and backward emotion coding representation
Figure FDA00037072772500000423
The specific implementation process is as follows:
S221、将词向量
Figure FDA00037072772500000424
输入后向协同网络的第一卷积神经网络得到后向情感隐层单元
Figure FDA0003707277250000051
S221. The word vector
Figure FDA00037072772500000424
The first convolutional neural network input to the backward collaborative network gets the backward emotional hidden layer unit
Figure FDA0003707277250000051
Figure FDA0003707277250000052
Figure FDA0003707277250000052
其中,
Figure FDA0003707277250000053
是后向协同网络的第一卷积神经网络进行卷积运算后第i个词对应的后向情感隐层单元,再将后向情感隐层单元
Figure FDA0003707277250000054
输入后向协同网络的第一全连接网络得到后向的情感编码表示
Figure FDA0003707277250000055
in,
Figure FDA0003707277250000053
is the backward emotional hidden layer unit corresponding to the i-th word after the first convolutional neural network of the backward collaborative network performs the convolution operation, and then the backward emotional hidden layer unit is
Figure FDA0003707277250000054
The first fully-connected network that feeds the backward collaborative network obtains a backward sentiment-encoded representation
Figure FDA0003707277250000055
Figure FDA0003707277250000056
Figure FDA0003707277250000056
其中,
Figure FDA0003707277250000057
是权重为wcs_的后向协同网络的第一卷积神经网络,
Figure FDA0003707277250000058
是权重为ws_的后向协同网络的第一全连接网络;
in,
Figure FDA0003707277250000057
is the first convolutional neural network of the backward collaborative network with weight w cs_ ,
Figure FDA0003707277250000058
is the first fully connected network of the backward collaborative network with weight ws_ ;
S222、将词向量
Figure FDA0003707277250000059
输入后向协同网络的第二卷积神经网络得到后向观点隐层单元
Figure FDA00037072772500000510
S222, the word vector
Figure FDA0003707277250000059
The second convolutional neural network input to the backward synergistic network obtains the backward view hidden layer unit
Figure FDA00037072772500000510
Figure FDA00037072772500000511
Figure FDA00037072772500000511
其中,
Figure FDA00037072772500000512
是后向协同网络的第二卷积神经网络进行卷积运算后第i个词对应的后向观点隐层单元,
Figure FDA00037072772500000513
是权重为wco_的卷积神经网络,将后向观点隐层单元
Figure FDA00037072772500000514
和后向情感隐层单元
Figure FDA00037072772500000515
进行关系计算得到观点对情感的关系隐层单元HO2S
in,
Figure FDA00037072772500000512
is the backward view hidden layer unit corresponding to the i-th word after the second convolutional neural network of the backward collaborative network performs the convolution operation,
Figure FDA00037072772500000513
is a convolutional neural network with weight w co_ , which converts the backward view hidden layer unit
Figure FDA00037072772500000514
and the backward emotional hidden layer unit
Figure FDA00037072772500000515
Carry out relational calculation to obtain the relational hidden layer unit H O2S of opinion to emotion:
Figure FDA00037072772500000516
Figure FDA00037072772500000516
其中,softmax(·)是归一化指数函数,×代表矩阵乘法操作,
Figure FDA00037072772500000517
Figure FDA00037072772500000518
的转置,将观点对情感的关系隐层单元HO2S和后向观点隐层单元
Figure FDA00037072772500000519
输入后向协同网络的第二全连接网络得到后向的分析对象编码表示
Figure FDA00037072772500000520
where softmax( ) is the normalized exponential function, × represents the matrix multiplication operation,
Figure FDA00037072772500000517
Yes
Figure FDA00037072772500000518
The transpose of the view-to-sentiment relationship hidden unit H O2S and backward view hidden unit
Figure FDA00037072772500000519
The second fully connected network input to the backward collaborative network obtains the backward parsed object encoding representation
Figure FDA00037072772500000520
Figure FDA00037072772500000521
Figure FDA00037072772500000521
其中,
Figure FDA0003707277250000061
是权重为wo_的后向协同网络的第二全连接网络;
in,
Figure FDA0003707277250000061
is the second fully connected network of the backward collaborative network with weight w o_ ;
S223、将词向量
Figure FDA0003707277250000062
输入后向协同网络的第三卷积神经网络得到后向分析对象隐层单元
Figure FDA0003707277250000063
S223, the word vector
Figure FDA0003707277250000062
The third convolutional neural network inputting the backward synergistic network obtains the hidden layer unit of the backward analysis object
Figure FDA0003707277250000063
Figure FDA0003707277250000064
Figure FDA0003707277250000064
其中,
Figure FDA0003707277250000065
是后向协同网络的第三卷积神经网络进行卷积运算后第i个词对应的后向分析对象隐层单元,
Figure FDA0003707277250000066
是权重为wca_的后向协同网络的第三卷积神经网络,将后向分析对象隐层单元
Figure FDA0003707277250000067
和后向情感隐层单元
Figure FDA0003707277250000068
进行关系计算得到分析对象对情感的关系隐层单元HA2S
in,
Figure FDA0003707277250000065
is the hidden layer unit of the backward analysis object corresponding to the i-th word after the third convolutional neural network of the backward collaborative network performs the convolution operation,
Figure FDA0003707277250000066
is the third convolutional neural network of the backward collaborative network with weight w ca_ , which analyzes the hidden layer unit of the object backward
Figure FDA0003707277250000067
and the backward emotional hidden layer unit
Figure FDA0003707277250000068
The relationship calculation is performed to obtain the relationship hidden layer unit H A2S of the analysis object's emotion:
Figure FDA0003707277250000069
Figure FDA0003707277250000069
将后向分析对象隐层单元
Figure FDA00037072772500000610
和后向观点隐层单元
Figure FDA00037072772500000611
进行关系计算得到分析对象对观点的关系隐层单元HA2O
The hidden layer unit of the backward analysis object
Figure FDA00037072772500000610
and the backward view hidden unit
Figure FDA00037072772500000611
Perform relational calculation to obtain the relational hidden layer unit H A2O of the analysis object to the viewpoint:
Figure FDA00037072772500000612
Figure FDA00037072772500000612
其中,
Figure FDA00037072772500000613
Figure FDA00037072772500000614
的转置,将分析对象对情感的关系隐层单元HA2S、分析对象对观点的关系隐层单元HA2O和后向分析对象隐层单元
Figure FDA00037072772500000615
输入后向协同网络的第三全连接网络得到后向的分析对象表示
Figure FDA00037072772500000616
in,
Figure FDA00037072772500000613
Yes
Figure FDA00037072772500000614
The transposition of the hidden layer unit H A2S of the relationship between the analysis object and the sentiment, the hidden layer unit H A2O of the relationship between the analysis object and the opinion, and the hidden layer unit of the backward analysis object
Figure FDA00037072772500000615
The third fully connected network input to the backward collaborative network obtains the backward analytical object representation
Figure FDA00037072772500000616
Figure FDA00037072772500000617
Figure FDA00037072772500000617
其中,
Figure FDA00037072772500000618
是权重为wa_的后向协同网络的第三全连接网络。
in,
Figure FDA00037072772500000618
is the third fully connected network of the backward cooperative network with weight wa_ .
2.根据权利要求1所述的基于双向协同网络的社交媒体文本细粒度情感分析方法,其特征在于,所述步骤S3中分别将前向和后向的分析对象编码表示
Figure FDA00037072772500000619
Figure FDA00037072772500000620
观点编码表示
Figure FDA00037072772500000621
Figure FDA00037072772500000622
情感编码表示
Figure FDA00037072772500000623
Figure FDA00037072772500000624
进行融合运算,输入到分类网络中,分别输出分析对象、观点、情感的标注结果Pa、Po、Ps,具体实施过程如下:
2. The method for fine-grained sentiment analysis of social media text based on two-way collaborative network according to claim 1, characterized in that, in the step S3, the forward and backward analysis objects are coded and represented respectively
Figure FDA00037072772500000619
and
Figure FDA00037072772500000620
opinion coding
Figure FDA00037072772500000621
and
Figure FDA00037072772500000622
emotion coding representation
Figure FDA00037072772500000623
and
Figure FDA00037072772500000624
Perform fusion operation, input it into the classification network, and output the annotation results P a , P o , and P s of the analyzed object, opinion, and emotion, respectively. The specific implementation process is as follows:
S31、将前向的分析对象编码表示
Figure FDA0003707277250000071
和后向的分析对象编码表示
Figure FDA0003707277250000072
进行融合运算,输入到分析对象分类网络中,输出分析对象标注结果
Figure FDA0003707277250000073
S31. Code the forward analysis object to represent
Figure FDA0003707277250000071
and the backward parsed object encoding representation
Figure FDA0003707277250000072
Fusion operation is performed, input to the analysis object classification network, and output analysis object labeling results
Figure FDA0003707277250000073
Figure FDA0003707277250000074
Figure FDA0003707277250000074
其中,
Figure FDA0003707277250000075
是分析对象分类网络,由一个权重为wcls_a的全连接网络组成;
in,
Figure FDA0003707277250000075
is the analysis object classification network, which consists of a fully connected network with a weight of w cls_a ;
S32、将前向的观点编码表示
Figure FDA0003707277250000076
和后向的观点编码表示
Figure FDA0003707277250000077
进行融合运算,输入到观点分类网络中,输出观点标注结果
Figure FDA0003707277250000078
S32, encoding the forward viewpoint
Figure FDA0003707277250000076
and backward view-encoded representations
Figure FDA0003707277250000077
Perform a fusion operation, input it into the opinion classification network, and output the opinion labeling result
Figure FDA0003707277250000078
Figure FDA0003707277250000079
Figure FDA0003707277250000079
其中,
Figure FDA00037072772500000710
是观点分类网络,由一个权重为wcls_o的全连接网络组成;
in,
Figure FDA00037072772500000710
is the opinion classification network, which consists of a fully connected network with weight w cls_o ;
S33、将前向的情感编码表示
Figure FDA00037072772500000711
和后向的情感编码表示
Figure FDA00037072772500000712
进行融合运算,输入到情感分类网络中,输出情感标注结果
Figure FDA00037072772500000713
S33. Express the forward emotion code
Figure FDA00037072772500000711
and backward emotion coding representation
Figure FDA00037072772500000712
Perform a fusion operation, input it into the sentiment classification network, and output the sentiment labeling result
Figure FDA00037072772500000713
Figure FDA00037072772500000714
Figure FDA00037072772500000714
其中,
Figure FDA00037072772500000715
是情感分类网络,由一个权重为wcls_s的全连接网络组成。
in,
Figure FDA00037072772500000715
is the sentiment classification network, consisting of a fully connected network with weights w cls_s .
3.根据权利要求1或2所述的基于双向协同网络的社交媒体文本细粒度情感分析方法,其特征在于,所述用户话语文本数据包括中文数据和/或英文数据。3 . The fine-grained sentiment analysis method for social media text based on a two-way collaborative network according to claim 1 or 2 , wherein the user utterance text data includes Chinese data and/or English data. 4 .
CN202110782124.XA 2021-07-12 2021-07-12 A fine-grained sentiment analysis method for social media text based on two-way collaborative network Active CN113673222B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110782124.XA CN113673222B (en) 2021-07-12 2021-07-12 A fine-grained sentiment analysis method for social media text based on two-way collaborative network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110782124.XA CN113673222B (en) 2021-07-12 2021-07-12 A fine-grained sentiment analysis method for social media text based on two-way collaborative network

Publications (2)

Publication Number Publication Date
CN113673222A CN113673222A (en) 2021-11-19
CN113673222B true CN113673222B (en) 2022-09-20

Family

ID=78539296

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110782124.XA Active CN113673222B (en) 2021-07-12 2021-07-12 A fine-grained sentiment analysis method for social media text based on two-way collaborative network

Country Status (1)

Country Link
CN (1) CN113673222B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115563186A (en) * 2022-05-23 2023-01-03 谢发泽 User behavior intention output method and big data system based on big data analysis

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107168945A (en) * 2017-04-13 2017-09-15 广东工业大学 A kind of bidirectional circulating neutral net fine granularity opinion mining method for merging multiple features
CN110059188A (en) * 2019-04-11 2019-07-26 四川黑马数码科技有限公司 A kind of Chinese sentiment analysis method based on two-way time convolutional network
CN112528168A (en) * 2020-12-23 2021-03-19 华南理工大学 Social network text emotion analysis method based on deformable self-attention mechanism
CN112579778A (en) * 2020-12-23 2021-03-30 重庆邮电大学 Aspect-level emotion classification method based on multi-level feature attention

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107908635B (en) * 2017-09-26 2021-04-16 百度在线网络技术(北京)有限公司 Establishing text classification model and method and device for text classification

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107168945A (en) * 2017-04-13 2017-09-15 广东工业大学 A kind of bidirectional circulating neutral net fine granularity opinion mining method for merging multiple features
CN110059188A (en) * 2019-04-11 2019-07-26 四川黑马数码科技有限公司 A kind of Chinese sentiment analysis method based on two-way time convolutional network
CN112528168A (en) * 2020-12-23 2021-03-19 华南理工大学 Social network text emotion analysis method based on deformable self-attention mechanism
CN112579778A (en) * 2020-12-23 2021-03-30 重庆邮电大学 Aspect-level emotion classification method based on multi-level feature attention

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Spatial-temporal recurrent neural network for emotion recognition;Tong Zhang et al.;《IEEE Transactions on Cybernetics》;20180130;第49卷(第3期);1-3 *
基于双向时间深度卷积网络的中文文本情感分类;彭德中等;《计算机应用与软件》;20191212;225-231 *

Also Published As

Publication number Publication date
CN113673222A (en) 2021-11-19

Similar Documents

Publication Publication Date Title
CN112000791B (en) A motor fault knowledge extraction system and method
CN111144448B (en) Video barrage emotion analysis method based on multi-scale attention convolution coding network
CN111382565B (en) Method and system for extracting emotion-cause pairs based on multi-label
Xu et al. Sentiment analysis of social images via hierarchical deep fusion of content and links
CN111950296B (en) Comment target emotion analysis based on BERT fine tuning model
US20240126576A1 (en) Conversational Interface for Content Creation and Editing Using Large Language Models
CN111353042B (en) A fine-grained text opinion analysis method based on deep multi-task learning
CN111414476A (en) Attribute-level emotion analysis method based on multi-task learning
Biradar et al. Machine learning tool for exploring sentiment analysis on twitter data
CN108363743A (en) A kind of intelligence questions generation method, device and computer readable storage medium
CN117436438A (en) Emotion analysis method, training method and device for large language model
CN114764564B (en) Aspect-level sentiment polarity classification method based on linguistic knowledge integration
CN110472245A (en) A kind of multiple labeling emotional intensity prediction technique based on stratification convolutional neural networks
CN115329073A (en) Attention mechanism-based aspect level text emotion analysis method and system
CN117057352A (en) Cross-modal feature enhanced network-based multi-modal named entity recognition method and system
CN112434161B (en) Aspect-level emotion analysis method adopting bidirectional long-short term memory network
CN114927177A (en) Medical entity identification method and system fusing Chinese medical field characteristics
CN118296135A (en) Cross-domain migration-oriented aspect-level emotion triplet extraction method
CN111666385A (en) Customer service question-answering system based on deep learning and implementation method
CN113673222B (en) A fine-grained sentiment analysis method for social media text based on two-way collaborative network
Xiang et al. Aggregating local and global text features for linguistic steganalysis
CN118013045B (en) Sentence emotion detection method and device based on artificial intelligence
CN114064873A (en) Method and device for building FAQ knowledge base in insurance field and electronic equipment
CN113536808A (en) An automatic method for predicting the difficulty of reading comprehension test questions by introducing multiple textual relationships
CN114416917B (en) A dictionary-based text sentiment analysis method, system and storage medium in the power field

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
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载