Joint target entity sentiment analysis method and model based on multi-modal feature fine-grained learning

Through the multi-modal feature fine-grained learning method, the multi-head cross-modal attention mechanism and the image gating mechanism are used, combined with the graph convolution network and adjective-noun pairs, to solve the problem of insufficient feature learning and improve the target entity extraction and Accuracy of sentiment analysis,better than existing methods.

CN118657155APending Publication Date: 2024-09-17Chinese People's Liberation Army Cyberspace Force Information Engineering University
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410681653.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Existing multi-modal target entity emotion analysis models suffer from insufficient feature learning, resulting in low target entity extraction accuracy and poor emotion prediction capabilities, and the feature fusion strategy between text and image modalities affects model performance.

Method used

A joint target entity sentiment analysis method based on fine-grained learning of multi-modal features is adopted, single-modal features are obtained through pre-trained text and image encoders, a multi-head cross-modal attention mechanism layer and an image gating mechanism are constructed, combined with graph convolution Network and adjective-noun pairs, perform fine-grained analysis and fusion of text and image features to prevent image interference that is irrelevant to text semantics.

Benefits of technology

It improves the fusion quality of text and image information, enhances text internal feature learning and image semantic expression, improves the accuracy of target entity extraction and sentiment analysis, and is superior to existing single-modal and multi-modal methods on competitive tasks. performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657155A
    Figure CN118657155A
Patent Text Reader

Abstract

The invention discloses a joint target entity sentiment analysis method and model based on multi-modal feature fine-grained learning, and solves the problem of context interference in recognition of different target entities in a text by constructing an enhanced adjacency matrix of a word dependency relationship for the text and learning text syntactic structure features by adopting a graph convolutional network. Meanwhile, adjective-noun pair information extracted from the image is introduced, so that image semantics are expressed more visually, the problem that semantic extraction is not clear in the image feature learning process is solved, and the performance of the model on target entity extraction and sentiment analysis tasks is further improved. Experimental results show that a competitive result is obtained on two Twitter-based data sets, so that the effectiveness of the method and the model provided by the invention is verified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of entity sentiment analysis, and in particular to a joint target entity sentiment analysis method and model based on multimodal feature fine-grained learning. Background Art

[0002] With the widespread use of smart mobile terminals around the world, more and more people prefer to publish information using multiple modalities such as text and images to express their opinions and emotions on different events and topics. Multimodal sentiment analysis (MSA) has received widespread attention in the academic community in recent years. Multimodal target entity sentiment analysis (MABSA) is a research task that performs sentiment analysis on specific target entities in a sample. At present, researchers have further proposed the multimodal joint target entity sentiment analysis (JMASA) task based on the MABSA task. This task combines the two subtasks of multimodal target entity extraction (MATE) and multimodal target entity sentiment analysis (MASC) to meet the needs of real-world application tasks.

[0003] As an important multimodal fine-grained sentiment analysis task, JMASA research has received widespread attention from the academic community in the past two years, and many models for this task have been proposed. For example, JML (Ju X, Zhang D, Xiao R, et al. Joint multi-modal aspect-sentiment analysis with auxiliary cross-modal relation detection [C] / / Proceedings of the 2021 conference on empirical methods in natural language processing. 2021: 4395-4405.) uses the relationship detection method between text and image to control the rational use of visual information, and CMMT (Yang L, Na JC, Yu J. Cross-modal multitask transformer for end-to-end multimodal aspect-based sentiment analysis [J]. Information Processing & Management, 2022, 59 (5): 103038.) sets auxiliary supervision for text and image respectively to enable the model to better complete the target task. However, current models usually only implement feature encoding of text and images at the basic level, often ignoring further analysis of the internal features of a single modality, which may lead to low accuracy in target entity extraction and poor sentiment prediction due to insufficient learning of the internal features of the modality. In addition, JMASA uses text as the dominant modality for this task, and images as another modality of information that assists in the semantic expression of text, which may provide important clues for the text to a certain extent. At the same time, there may also be areas that are not related to the semantics of the text, which bring additional interference to the model. Therefore, the feature fusion strategy between modalities is also a key factor affecting model performance. Summary of the invention

[0004] Aiming at the problem of low target entity extraction accuracy and poor sentiment prediction ability due to insufficient feature learning, the present invention proposes a joint target entity sentiment analysis (TIFFL) method and model based on multimodal feature fine-grained learning. Specifically, for a sample in a given multimodal dataset, the present invention firstly adopts pre-trained text and image encoders to obtain feature representations of text and image respectively, and then constructs a gating mechanism to prevent visual features irrelevant to text semantics from interfering with the model. Then, a graph convolutional network (GCN) and adjective-noun pairs (ANPs) are used to better learn and represent the internal features of text and image modalities respectively. Finally, an effective inter-modal fusion strategy is designed to obtain the final representation of text and image features, so as to further complete the extraction and sentiment analysis of target entities in text.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] On the one hand, the present invention proposes a joint target entity sentiment analysis method based on multimodal feature fine-grained learning, comprising:

[0007] Step 1: Use two types of pre-trained models, language and vision, to extract the unimodal feature representations of text and images in the input multimodal samples respectively;

[0008] Step 2: Construct a multi-head cross-modal attention mechanism layer, obtain image-aware text feature representation and text-aware image feature representation based on the constructed multi-head cross-modal attention mechanism layer, and set an image gating mechanism for visual features to discriminate the correlation between text and image features;

[0009] Step 3: For the text modality, construct text auxiliary information based on sentiment-enhanced graph convolutional network to learn the deep syntactic structure features in the text; for the image modality, use adjective-noun pairs to construct image auxiliary information to assist the image in semantic expression from the text level;

[0010] Step 4: The obtained text feature representation, text-aware image feature representation, text auxiliary information, and image auxiliary information are fused through the image gating mechanism set in step 2 to generate an inter-modal fusion representation of text and image features. Based on the obtained inter-modal fusion representation, conditional random fields are used to complete the target entity extraction and sentiment analysis tasks.

[0011] Furthermore, in step 1, the pre-trained language model RoBERTa is used as the text encoder of the model, and the residual network is used as the image encoder of the model.

[0012] Furthermore, in step 2, the image-aware text feature representation and text-aware image feature representation obtained based on the constructed multi-head cross-modal attention mechanism layer include:

[0013] The image feature is represented by H V As the query vector, the text feature representation H S As the key vector and value vector, it is then normalized through two layers and a feed-forward network to obtain the image-aware text feature representation H V→S ;

[0014] H S As the query vector, H V→S As the key vector and value vector, it then goes through two layers of normalization and a feed-forward network to generate the final image-aware text feature representation H' V→S ;

[0015] H S As the query vector, H V As the key vector and value vector, it then goes through two layers of normalization and a feed-forward network to generate a text-aware image feature representation H S→V .

[0016] Furthermore, in step 2, the image gating mechanism is expressed as:

[0017] g=σ(W g [H' V→S ;H S→V ]+b g )

[0018] in, and is the learnable linear transformation parameter, d represents the total number of input multimodal samples, and σ is a nonlinear activation function using dot multiplication, which is used to control the output g of the gating mechanism within the range of [0,1].

[0019] Furthermore, in step 3, text auxiliary information based on the emotion enhanced graph convolutional network is constructed in the following manner:

[0020] First, we use the natural language processing tool Spacy to extract noun phrases in the dataset text as candidates for the target entity. Then we continue to use Spacy to build a syntactic dependency tree for the text and obtain the corresponding adjacency matrix based on the dependency relationship between each node word. m represents the number of words contained in each multimodal sample, where

[0021]

[0022] w i and w j are the i-th and j-th words respectively, D i,j Represents the value corresponding to the dependency relationship between the i-th and j-th words in the adjacency matrix D;

[0023] Then, the sentiment score S between each adjacent node is obtained by introducing the SenticNet sentiment dictionary, thereby enhancing the representation of the adjacency matrix, where

[0024] S i,j =SenticNet(w i )+SenticNet(w j )

[0025] S i,j represents the sentiment score between the i-th and j-th words, SenticNet(w i )∈[-1,1] is the word w i The sentiment score in the SenticNet dictionary, -1 represents negative sentiment and 1 represents positive sentiment. i )=0 indicates that w i The sentiment is neutral or the word does not exist in the dictionary;

[0026] Continue to build an enhanced matrix T for each noun phrase, where

[0027]

[0028] k∈n is the kth noun phrase, n is the number of noun phrases in each text, and finally the sentiment-enhanced text adjacency matrix A is constructed, where

[0029]

[0030] After obtaining the adjacency matrix A, the graph convolutional neural network GCN is introduced based on the syntactic dependency tree to learn the syntactic structure features and sentiment dependencies of the above noun phrases.

[0031]

[0032]

[0033] i is the current node, is the representation of the current node based on emotion enhancement generated by the lth GCN layer, j is the neighboring node of node i, is the representation of node j in layer l and is generated by the previous GCN layer, is the degree of node i, W l and b l In order to learn the linear transformation parameters, the output of the last GCN layer is used as the text representation H based on sentiment enhancement G

[0034]

[0035] Furthermore, in step 3, the image auxiliary information is constructed in the following manner:

[0036] Using the visual concept detector DeepSentiBank, we first generate a set of multiple adjective-noun pairs for the images in the sample and concatenate them, then feed them into the text encoder to obtain the adjective-noun pair representation H. A ;

[0037] The text feature representation H is obtained through a multi-head cross-modal attention mechanism layer. S With the obtained H A Interact to obtain text-aware adjective-noun pair representations H S→A As image auxiliary information, it can filter out image content information that is irrelevant to text semantics.

[0038] Furthermore, in step 4, the inter-modal fusion representation H of text and image features is generated in the following manner:

[0039] H=(1-g)(H S ; αH G )+g(H S→V βH S→A )

[0040] Where g represents the output of the image gating mechanism, H S represents the text feature, H G For text representation based on sentiment enhancement, H S→V is the text-aware image feature representation, H S→A is the text-aware adjective-noun pair representation, α and β represent H G and H S→A The weight of .

[0041] On the other hand, the present invention proposes a joint target entity sentiment analysis model based on multimodal feature fine-grained learning, comprising:

[0042] The unimodal feature encoding module is used to extract unimodal feature representations of text and images in the input multimodal samples using two types of pre-trained models: language and vision;

[0043] A multimodal feature correlation discrimination module is used to construct a multi-head cross-modal attention mechanism layer, obtain image-aware text feature representation and text-aware image feature representation based on the constructed multi-head cross-modal attention mechanism layer, and set an image gating mechanism for visual features to discriminate the correlation between text and image features;

[0044] The intra-modal feature fine-grained analysis module is used to construct text auxiliary information based on sentiment-enhanced graph convolutional networks for text modalities to learn deep syntactic structure features in texts; for image modalities, adjective-noun pairs are used to construct image auxiliary information to assist in semantic expression of images from the text level;

[0045] The inter-modal feature fusion and output module is used to fuse the obtained text feature representation, text-aware image feature representation, text auxiliary information, and image auxiliary information through the image gating mechanism set by the multi-modal feature correlation discrimination module to generate an inter-modal fusion representation of text and image features. Based on the obtained inter-modal fusion representation, the conditional random field is used to complete the target entity extraction and sentiment analysis tasks.

[0046] Compared with the prior art, the present invention has the following beneficial effects:

[0047] (1) In order to better achieve the fusion of text and image information, a multimodal feature relevance discrimination module (MFCR) is designed. This module sets up an image gating mechanism for dynamic input of visual features by judging the relevance of text and image semantics, thus preventing image information that is irrelevant to text semantics from bringing additional interference to the model.

[0048] (2) In order to better learn and represent the internal features of text and image modalities, GCN is used to obtain the syntactic structure features of the text. By increasing the attention of noun phrases in the text and calculating the sentiment scores between dependent words, the problem of context interference in identifying different target entities in the text is solved. At the same time, adjective-noun pairs extracted from images are introduced to obtain more intuitive image semantic information, solving the problem of unclear image semantics extraction.

[0049] (3) A series of experiments conducted on two Twitter-based datasets show that the TIFFL method (model) outperforms many of the most advanced single-modal and multi-modal methods, and achieves competitive results on the JMASA task and the MATE and MASC sub-tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 This is a flow chart of a joint target entity sentiment analysis method based on fine-grained learning of multimodal features according to an embodiment of the present invention;

[0051] Figure 2 A schematic diagram of the overall network architecture used in a joint target entity sentiment analysis method based on multimodal feature fine-grained learning according to an embodiment of the present invention;

[0052] Figure 3 Schematic diagram of the internal structure of the MFRI module according to an embodiment of the present invention;

[0053] Figure 4 Schematic diagram of the process of generating text auxiliary information based on emotion enhancement GCN in an embodiment of the present invention;

[0054] Figure 5 This is a schematic diagram of the structure of a joint target entity sentiment analysis model based on fine-grained learning of multimodal features according to an embodiment of the present invention;

[0055] Figure 6 The impact of the value of α on the model performance;

[0056] Figure 7 The impact of β value on model performance;

[0057] Figure 8 The impact of K value on model performance;

[0058] Fig. 9 Sample analysis for three models (TIFFL, RoBERTa, CMMT) for the MATE task;

[0059] Fig.10 Sample analysis of three models (TIFFL, RoBERTa, CMMT) for the JMASA task. DETAILED DESCRIPTION

[0060] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments:

[0061] like Figure 1 As shown, a joint target entity sentiment analysis method based on fine-grained learning of multimodal features includes:

[0062] S1: Two types of pre-trained models, language and vision, are used to extract unimodal feature representations of text and images in input multimodal samples respectively;

[0063] S2: Construct a multi-head cross-modal attention mechanism layer, obtain image-aware text feature representation and text-aware image feature representation based on the constructed multi-head cross-modal attention mechanism layer, and set an image gating mechanism for visual features to discriminate the correlation between text and image features;

[0064] S3: For the text modality, we construct text auxiliary information based on sentiment-enhanced graph convolutional networks to learn deep syntactic structure features in the text; for the image modality, we use adjective-noun pairs to construct image auxiliary information to assist the semantic expression of images from the text level;

[0065] S4: The obtained text feature representation, text-aware image feature representation, text auxiliary information, and image auxiliary information are fused through the image gating mechanism set in S2 to generate an inter-modal fusion representation of text and image features. Based on the obtained inter-modal fusion representation, the conditional random field is used to complete the target entity extraction and sentiment analysis tasks.

[0066] The method is described in detail as follows:

[0067] The present invention describes the JMASA task as a text sequence labeling problem, which uses the BIO2 labeling system as the target entity extractor to classify each word in the dataset text into seven labels. Specifically, given a set of multimodal samples D = (x1, x2, ..., x d ) is used as the input of the model, each sample x i ∈D contains a text S=(w1,w2,…,w m ) and a corresponding image I. The goal of the task of the present invention is to obtain the corresponding text label sequence y∈(y1,y2,…,y m ), where y i ∈{O,B-POS,I-POS,B-NEG,I-NEG,B-NEU,I-NEU}, O represents the word label of the non-target entity, B represents the starting word label of the target entity, I represents the remaining word labels of the target entity, POS, NEG and NEU represent the positive, negative and neutral sentiment labels of the target entity, respectively.

[0068] This paper proposes a TIFFL method for JMASA task. The overall network architecture adopted by the method is as follows: Figure 2 As shown in the figure, it consists of four parts: (1) unimodal feature encoding; (2) multimodal feature correlation discrimination; (3) intra-modal feature fine-grained analysis; (4) inter-modal feature fusion and output.

[0069] 1. Unimodal feature encoding

[0070] This section will use two types of pre-trained models: language and vision to extract unimodal feature representations of input text and images respectively.

[0071] 1.1 Text Feature Encoding

[0072] To extract the features of the input text, the present invention uses the pre-trained language model RoBERTa as the text encoder of the model. As an extension of the BERT model, it has good performance in various NLP tasks. Specifically, two special tags are added to each input text S (i.e., " <s> ", add " at the end< / s>”) and sent to the text encoder for encoding to obtain the text representation that integrates the context information

[0073] H S =RoBERTa(S),

[0074] in d is the hidden dimension of each word vector, and m is the number of words contained in S.

[0075] 1.2 Image feature encoding

[0076] For the extraction of input image features, this paper will use the residual network (ResNet) as the image encoder of the model. Compared with the previous VGG network, it solves the gradient vanishing problem caused by the increase of layers by using residual connections, and can extract deeper semantic information in image recognition tasks. Specifically, for a given input image I, it is first resized to 224×224 pixels I', and then the output of the last convolutional layer of I' in the pre-trained 152-layer ResNet is used as the visual representation of the image.

[0077] H I =ResNet(I'),

[0078] in 49 is the number of 7×7 visual blocks of the same size into which I' is divided, and 2048 is the vector dimension of each visual block. In order to map the image representation to the same semantic space as the text representation for subsequent cross-modal interaction, this part acts on H by linear transformation I Get the final image representation

[0079] H V =W V H I +b V ,

[0080] in and are learnable linear transformation parameters.

[0081] 2 Multimodal feature correlation discrimination

[0082] Although the input image can provide the model with information other than text, the purpose of this invention is to extract the target entity in the text and predict the sentiment polarity through the image. Image information that is not related to the text semantics not only fails to assist the text in completing the target task, but also may bring additional interference to the model. This section will build a multimodal feature relevance identification (MFRI) module, which can better complete the fusion of text and image information by setting an image gating mechanism (IGM) for visual features. The internal structure of this module is as follows: Figure 3 As shown in the figure, it consists of two parts: (1) cross-modal interaction between text and image; (2) construction of image gating mechanism.

[0083] 2.1 Cross-modal interaction between text and images

[0084] In order to better learn the feature representation of text on images, this part first constructs a multi-head cross-modal attention mechanism (MC-ATT) layer to represent the image H V As the query vector (Query), the text is represented by H S As the key vector (Key) and the value vector (Value), it then goes through two layers of normalization (LN) and a feed-forward network (FFN) to obtain the image-aware text representation H V→S ,Right now

[0085] Z V→S =LN(H V +MC-ATT(H V ,H S )),

[0086] H V→S =LN(Z V→S +FFN(Z V→S )),

[0087] in However, the MC-ATT layer will H V Used as Query, the generated H V→S Each vector in is represented as a visual block. Considering the subsequent construction of the gating mechanism, it is necessary to convert H V→S Each vector in is converted into a representation in the form of a word in the text. Therefore, this section introduces another MC-ATT layer by S As Query, H V→S As Key and Value, generate the final image-aware text feature representation H' V→S ,in

[0088] In order to obtain the image feature representation of each word in the text, the same method as the above MC-ATT layer is used for cross-modal interaction. S As Query, H V As Key and Value, the text-aware image feature representation H is generated S→V ,in

[0089] 2.2 Image gating mechanism construction

[0090] This section constructs a gating mechanism for the input of image information. The function of this gating mechanism is to assign correlation weights between image features and the corresponding text in the range of [0,1] to dynamically control the contribution of image information in the model (i.e., assign a larger weight to image information with a high degree of correlation with the text and retain it, and assign a smaller weight to image information with a low degree of correlation or no correlation and filter it out). Specifically, first, the above H' V→S With H S→V Then, a gating mechanism based on the weight of text and image correlation is constructed through linear transformation and nonlinear activation function.

[0091] g=σ(W g [H' V→S ;H S→V ]+b g ),

[0092] in and is a learnable linear transformation parameter and σ is a nonlinear activation function using dot multiplication, which is used to control the output of the gating mechanism to the range of [0,1].

[0093] 3 Fine-grained analysis of intra-modal features

[0094] In previous JMASA research, most models usually only use pre-trained language and visual encoders to implement text and image feature encoding at the basic level. These models can only ensure coarse-grained learning and representation of single modality features, but are not enough to deeply understand the internal structure of text and the semantic information of images, which may have a certain degree of impact on model performance. In response to the above problems, this section will conduct a more in-depth analysis of the internal features of a single modality, including: (1) constructing a text auxiliary information (TAI) based on sentiment-enhanced graph convolutional network (GCN) for text modality to learn deeper syntactic structure features in text; (2) constructing an image auxiliary information (IAI) for image modality using adjective-noun pairs (ANPs) to assist images in semantic expression from the text level.

[0095] 3.1 Text Auxiliary Information Based on Sentiment Enhanced Graph Convolutional Network

[0096] Figure 4The generation process of text auxiliary information based on sentiment-enhanced GCN is demonstrated. For the text in the sample, it may contain one or more target entities, but the effective context information involved in different target entities is different. For example, given an input text "Hosted the@MLBPDP event today with Mother Nature onour side!Dayton Moore was in the house.#TBones#FunWellDone", the effective context information of the target entity "DaytonMoore" is "was in the house" instead of "on our side" and other context information before it. Only coarse-grained learning of the text may introduce irrelevant context information for the target entity. Therefore, this section uses GCN to learn the syntactic structure features within the text to filter out irrelevant context information that may interfere with target entity extraction and sentiment analysis.

[0097] Considering that the target entity is usually composed of noun phrases in the text, we first use the natural language processing tool Spacy to extract noun phrases in the dataset text as candidates for the target entity. Then we continue to use the tool to build a syntactic dependency tree of the text and obtain the corresponding adjacency matrix based on the dependency relationship between each node word. in

[0098]

[0099] w i and w j are the i-th and j-th words respectively, D i,j represents the value corresponding to the dependency relationship between the i-th and j-th words in the adjacency matrix D; then the sentiment score S between each adjacent node is obtained by introducing the SenticNet sentiment dictionary, thereby enhancing the representation of the adjacency matrix, where

[0100] S i,j =SenticNet(w i )+SenticNet(w j ),

[0101] S i,j represents the sentiment score between the i-th and j-th words, SenticNet(w i )∈[-1,1] is the word w i The sentiment score in the SenticNet dictionary, -1 represents negative sentiment and 1 represents positive sentiment. i )=0 indicates that w iThe sentiment is neutral or the word does not exist in the dictionary. In addition, we hope that the noun phrases as target entity candidates will get more attention in the adjacency matrix, so we continue to build an enhanced matrix T for each noun phrase, where

[0102]

[0103] k∈n is the kth noun phrase, n is the number of noun phrases in each text, and finally the sentiment-enhanced text adjacency matrix A is constructed, where

[0104]

[0105] After obtaining the adjacency matrix A, GCN is introduced on the basis of the syntactic dependency tree to learn the syntactic structure features and sentiment dependencies of the above noun phrases.

[0106]

[0107]

[0108] i is the current node, is the representation of the current node based on emotion enhancement generated by the lth GCN layer, j is the neighboring node of node i, is the representation of node j in layer l and is generated by the previous GCN layer. is the initial node representation in GCN, is the degree of node i, W l and b l In order to learn the linear transformation parameters, the output of the last GCN layer is used as the text representation based on sentiment enhancement

[0109]

[0110] 3.2 Image Auxiliary Information Based on Adjective-Noun Pairs

[0111] In order to enhance the expression of emotional information in the visual features of the image, this section will use the visual concept detector DeepSentiBank to extract ANPs from the image to generate a semantic representation of the image from another level. Different from the above image representation, ANPs extract nouns such as people or objects shown in the image and the adjective information that modifies them, so that the model can understand the image content from the text semantic level. Specifically, DeepSentiBank first generates a set of 2089 ANPs for the images in the sample. Here, the top K ANPs (Top-K ANPs) with high confidence rankings are selected for splicing, and then sent to the text encoder to obtain the ANPs representation.

[0112] H A=RoBERTa(ANPs1;ANPs2;…;ANPs a ).

[0113] However, ANPs may contain image region content that is irrelevant to text semantics or vocabulary information that causes image recognition errors. Directly using these ANPs as image auxiliary information will greatly bring additional interference to the model. Therefore, MC-ATT is used here to represent the text feature H S With the obtained H A Interact with each other to further obtain the text-aware ANPs representation H S→A As image auxiliary information, it can filter out image content information that is irrelevant to text semantics as much as possible, that is,

[0114] Z S→A =LN(H S +MC-ATT(H S ,H A )),

[0115] H S→A =LN(Z S→A +FFN(Z S→A )),

[0116] in

[0117] 4 Inter-modal feature fusion and output

[0118] This section will use the image gating mechanism constructed in Section 2.2 to represent the text H obtained above. S , text-aware image representation H S→V , Text Representation Based on Sentiment Enhancement G and text-aware ANPs representing H S→A Feature fusion is performed through an effective strategy to generate inter-modal fused representations of text and image features.

[0119] Since the present invention uses images as another modal information to assist in the semantic expression of text, the generated value of the gating mechanism is multiplied by the corresponding elements of the image representation, so that the text dynamically controls the input of image information at the word level, thereby filtering the image information that is not related to the text semantics to prevent additional interference for subsequent work. In addition, H G and H S→A As auxiliary text and image enhancement information and H S and H S→V are not in the same order of magnitude. Here, by G and H S→AThe weights α and β are set respectively to control the contribution of text and image auxiliary information to the inter-modal fusion representation. Finally, all relevant representations of text and images are added together through the above gating mechanism to obtain the inter-modal fusion representation of text and image features.

[0120] H=(1-g)(H S ; αH G )+g(H S→V βH S→A ).

[0121] Conditional random field (CRF) is a discriminative undirected graph model that can effectively model the constraint relationship between sequence labels. In this section, CRF will be used to complete the task of extracting target entities and sentiment analysis in text. Specifically, the above inter-modal fusion representation H is fed into CRF to predict the text label sequence, that is,

[0122]

[0123]

[0124] in For label y i and i+1 The transfer score (i.e., label y i and i+1 co-occurrence probability), For label y i The emission fraction (i.e. the input is h i The output label is y i probability of ).

[0125] In order to further optimize all parameters in the model, the cross entropy loss constructed by the predicted text label sequence and the real text label sequence is used as the training loss function of the model on the JMASA task, that is,

[0126]

[0127] Based on the above embodiments, Figure 5 As shown, the present invention also proposes a joint target entity sentiment analysis model based on multimodal feature fine-grained learning, including:

[0128] The unimodal feature encoding module is used to extract unimodal feature representations of text and images in the input multimodal samples using two types of pre-trained models: language and vision;

[0129] A multimodal feature correlation discrimination module is used to construct a multi-head cross-modal attention mechanism layer, obtain image-aware text feature representation and text-aware image feature representation based on the constructed multi-head cross-modal attention mechanism layer, and set an image gating mechanism for visual features to discriminate the correlation between text and image features;

[0130] The intra-modal feature fine-grained analysis module is used to construct text auxiliary information based on sentiment-enhanced graph convolutional networks for text modalities to learn deep syntactic structure features in texts; for image modalities, adjective-noun pairs are used to construct image auxiliary information to assist in semantic expression of images from the text level;

[0131] The inter-modal feature fusion and output module is used to fuse the obtained text feature representation, text-aware image feature representation, text auxiliary information, and image auxiliary information through the image gating mechanism set by the multi-modal feature correlation discrimination module to generate an inter-modal fusion representation of text and image features. Based on the obtained inter-modal fusion representation, the conditional random field is used to complete the target entity extraction and sentiment analysis tasks.

[0132] To verify the effect of the present invention, the following experiment was performed:

[0133] This section will conduct a series of experiments using two Twitter datasets for the JMASA task to demonstrate the effectiveness of the joint target entity sentiment analysis (TIFFL) model based on multimodal feature fine-grained learning, and compare its model performance with representative methods in recent years.

[0134] 5.1 Experimental Setup

[0135] Dataset

[0136] This section will use two datasets Twitter-2015 and Twitter-2017 proposed by Lu et al. for the JMASA task for experiments. These two datasets are sampled from tweets containing text and images published on the Twitter platform in 2014-2015 and 2016-2017. The relevant statistical information is shown in Table 1 (where Pos represents positive, Neg represents negative, Neu represents neutral, Total represents the number of target entities, and Sentence represents the number of text items).

[0137] Table 1. Relevant statistics of the two Twitter datasets

[0138]

[0139] Implementation details

[0140] In the experiment, the TIFFL model uses the pre-trained RoBERTa-base model as the text encoder and ResNet-152 as the image encoder. In addition, AdamW is used as the learner to optimize the parameters in the alternating optimization process. For the hyperparameters of the TIFFL model, the batch size value is set to 32 in the training stage, 16 in the validation and testing stages, the training epoch value is set to 25, and the value is set to 0.6 and 0.5 and 0.7 and 0.4 on the Twitter-2015 and Twitter-2017 datasets, respectively, the value is set to 5, and the learning rate is set to 3e-5. The model uses the average result of 3 independent trainings as the final experimental result. All experiments are implemented based on PyTorch and NVIDIA TeslaV100 graphics card.

[0141] 5.2 Comparison with Baseline

[0142] Considering that the JMASA task contains two subtasks, MATE and MASC, this section will compare the TIFFL model with many existing methods on the three tasks of JMASA, MATE and MASC to evaluate its performance. Table 2, Table 3 and Table 4 show the single-modal and multi-modal comparison baselines selected for the above three tasks.

[0143] Table 2 Comparison baselines for the JMASA task

[0144]

[0145]

[0146] Table 3 Comparison baselines for MATE tasks

[0147]

[0148] Table 4 Comparison baselines for MASC tasks

[0149]

[0150] 5.3 Experimental Results and Analysis

[0151] This section will complete the experiments of the TIFFL model and the corresponding comparison baselines through the three tasks of JMASA, MATE and MASC and analyze their results.

[0152] 5.3.1 Experiments on the JMASA Task

[0153] Table 5 shows the experimental results of the TIFFL model and the baseline on the Twitter-2015 and Twitter-2017 datasets for the JMASA task. This section uses Precision, Recall, and Macro-F1 as evaluation indicators of model performance. TIFFL achieved competitive experimental results on both datasets. Compared with the proposed CMMT model, its Precision on the Twitter-2015 dataset is about 0.4% higher, and its Precision, Recall, and Macro-F1 on the Twitter-2017 dataset are about 0.9%, 0.6%, and 0.8% higher, respectively.

[0154] Table 5 Experimental results of TIFFL model and baseline for JMASA task

[0155]

[0156] Based on the above experimental results, we can draw the following conclusions: (1) Since the RoBERTa model optimizes the training strategy and uses a larger corpus for pre-training based on BERT, its performance is much better than that of the SPAN and D-GCN models; (2) UMT+TomBERT and OSCGA+TomBERT are both pipeline methods that combine the MATE and MASC tasks, and their performance is worse than that of UMT-collapse and OSCGA-collapse. The possible reason is that there is a propagation of false information between the two tasks; (3) The performance of UMT-RoBERTa is better than that of UMT-collapse, which also proves that RoBERTa is more powerful than BERT; (4) The CMMT model performs best among all the above comparison baselines, which shows that setting auxiliary supervision for text and image separately helps to improve the model performance to a certain extent. .

[0157] However, the performance of the TIFFL model on the Twitter-2015 dataset is worse than that on the Twitter-2017 dataset. The reasons are speculated as follows: the CMMT model uses all 2089 ANPs extracted from the sample images as visual auxiliary supervision, which can guarantee the accurate recognition of the image content from a quantitative level. Since the present invention only selects the top K ANPs with high confidence, and these ANPs may contain a certain amount of erroneous information, focusing on these vocabulary-assisted image representations may bring additional interference to the model, thereby limiting the performance improvement accordingly. This view is also verified to have a certain degree of reliability in the ablation experiment in Section 5.4 and the parameter setting in Section 5.5. However, it can be seen from the content of Section 5.3.2 that TIFFL has achieved better performance on the Twitter-2017 dataset for the MATE task, which is also a key factor in the performance improvement of the model on this dataset.

[0158] In addition, the CMMT model also introduces another set of label sequences as text auxiliary supervision. The model constructs auxiliary supervision modules for both modalities to achieve overall performance improvement. However, excessive space resource occupation and manual labeling costs are also its main problems. The TIFFL model effectively avoids the above problems by selecting a more cost-effective method, which is also the advantage of the present invention.

[0159] 5.3.2 Experiments on MATE tasks

[0160] Table 6 shows the experimental results of the TIFFL model and the baseline for the MATE task, and also uses Precision, Recall and Macro-F1 as the evaluation indicators of model performance. TIFFL achieved the best experimental results on the two datasets. Compared with the CMMT model, its Precision, Recall and Macro-F1 on the Twitter-2015 dataset are about 0.8%, 0.9% and 0.9% higher, respectively, and its Precision, Recall and Macro-F1 on the Twitter-2017 dataset are about 2.3%, 1.6% and 1.9% higher, respectively. This also proves that the intra-modal feature learning and inter-modal feature fusion methods proposed in this invention can effectively complete the extraction of target entities in text, so as to further improve the overall performance of the model.

[0161] Table 6 Experimental results of TIFFL model and baseline for MATE task

[0162]

[0163] 5.3.3 Experiments on the MASC Task

[0164] Table 7 shows the experimental results of the TIFFL model and the baseline for the MASC task. This section uses Accuracy and Macro-F1 as the evaluation indicators of model performance. The experimental results of TIFFL on the two datasets are not as good as those of the JML and CMMT models. The possible reason here is the same as that in Section 5.3.1, which is that the use of ANPs containing a certain amount of error information brings additional interference to the model. However, the model has a good performance on both datasets for the MATE task, and to some extent makes up for its shortcomings in the MASC task, so the overall performance of the model has also been improved accordingly.

[0165] Table 7 Experimental results of TIFFL model and baseline for MASC task

[0166]

[0167] 5.4 Ablation Experiment

[0168] To further demonstrate the effectiveness of each method in the TIFFL model, this section will perform ablation analysis on three important units in the model on the Twitter-2015 and Twitter-2017 datasets: (1) Image Gating Mechanism (IGM); (2) Text Auxiliary Information (TAI); (3) Image Auxiliary Information (IAI). Here, we first remove the above three units separately, and then remove all of them, so as to more comprehensively verify the contribution of each unit to the improvement of model performance. The ablation experiment results are shown in Table 8.

[0169] Table 8 Ablation test results of TIFFL model

[0170]

[0171] First, after removing the image gating mechanism, the Macro-F1 on the two datasets decreased by about 2.4% and 2.1%, respectively, which indicates that the inter-modal fusion strategy used by the model can effectively filter image information that is not relevant to text semantics; secondly, after removing the text auxiliary information, the Macro-F1 on the two datasets decreased by about 2.2% and 2.1%, respectively, which indicates that the model can deeply learn the syntactic structure features within the text by adopting the GCN based on sentiment enhancement; then, after removing the image auxiliary information, the Macro-F1 on the two datasets decreased by about 1.5% and 1.3%, respectively, which indicates that the model can better assist the image in semantic expression from the text level by adopting ANPs; finally, after removing all the above units, the Macro-F1 on the two datasets decreased by about 3.0%, which also shows that the methods used in the present invention have a certain degree of contribution to the improvement of model performance.

[0172] However, the degree of decrease in Macro-F1 after removing IAI is significantly lower than that of IGM and TAI, which also indirectly verifies the view in Section 5.3.1 that the performance improvement of the model using Top-K ANPs may be limited to a certain extent due to the interference of erroneous information.

[0173] 5.5 Parameter settings

[0174] All the above experiments were conducted in the TIFFL model after completing the hyperparameter tuning. This section will explain in detail the process of evaluating the optimal hyperparameters.

[0175] 5.5.1α Value

[0176] In order to test the impact of the text auxiliary information weight α on the model performance in the inter-modal feature fusion stage, this section will analyze the value of α in the range of [0,1] with an interval of 0.1. Figure 6 (a) and (b) show the impact of the value of α on the model performance on two datasets respectively.

[0177] From the test results, we can see that the model performs poorly on both datasets without text-auxiliary information enhancement, which indicates that text-auxiliary information contributes to the improvement of model performance to a certain extent. As the value of α increases, the model performance shows a fluctuating upward trend. When α is 0.6 and 0.7 on the Twitter-2015 and Twitter-2017 datasets, respectively, the performance is optimal. However, as α continues to increase, the model performance begins to gradually decline. The reasons are speculated as follows: in the process of constructing text-auxiliary information, since image information is not combined, the extracted noun phrases can only be used as references for target entities to be determined. Therefore, as α increases, the model will allocate a larger proportion to text-auxiliary information, so that the noun phrases of non-target entities may also bring additional interference to the model due to excessive attention.

[0178] 5.5.2β Value

[0179] In order to analyze the value of the image auxiliary information weight β in the inter-modal feature fusion stage, this section will also take a decimal with an interval of 0.1 in the range of [0,1] to complete the test task. Figure 7 (a) and (b) show the impact of the value of β on the model performance on two datasets respectively.

[0180] From the test results, we can see that with the increase of β value, the model performance shows a fluctuating upward trend on the two datasets. The best performance was achieved when β was 0.5 and 0.4 on the Twitter-2015 and Twitter-2017 datasets, respectively. However, as the β value continued to increase, the model performance began to gradually decline. The reasons are speculated as follows: the image auxiliary information may contain a certain amount of erroneous information that is irrelevant to the image content. When β exceeds a certain range, the model will pay more attention to the image auxiliary information and weaken the dominance of the original image features. As a result, these erroneous information will also be amplified, resulting in a continuous decline in model performance.

[0181] 5.5.3K Value

[0182] In order to explore the optimal value of the number of ANPs K in image auxiliary information, this section will test and analyze K as each integer in the range of [0,10]. Figure 8 (a) and (b) show the impact of the value of K on the model performance on two datasets respectively.

[0183] According to the test results, when K is equal to 0, the model performs poorly on both datasets, which indicates that using ANPs as image auxiliary information helps improve the performance of the model. As the number of ANPs increases, the model performance fluctuates and rises. When K is equal to 5, the best performance is achieved on both datasets. However, when K is greater than 5, the model performance decreases to a certain extent. The reasons are speculated as follows: the number of target entities involved in each text in the dataset does not exceed 5. Unlike the CMMT model that uses all ANPs to supervise the visual representation, the present invention uses ANPs as candidates for target entities in the image. When K is greater than the number of target entities in the text, the image auxiliary information may bring additional interference to the model due to the introduction of too much image content or erroneous vocabulary information that is irrelevant to the text semantics.

[0184] In addition, by comparing the test results of the three parts of this section, we can see that tuning text auxiliary information is better than image auxiliary information in improving model performance, which also indirectly verifies the point of view in Section 5.3.1.

[0185] 5.6 Sample Analysis

[0186] In order to better demonstrate the superiority of the TIFFL model on the two datasets, this section will select four representative examples to compare TIFFL with RoBERTa and CMMT models on the MATE and JMASA tasks. The sample information and prediction results are shown in the figure. Fig. 9 and Fig.10 shown.

[0187] first, Fig. 9 Two examples are shown where the TIFFL model has an advantage on the MATE task. Fig. 9 In the example (a), RoBERTa and CMMT extracted an additional incorrect target entity "#Cubs" on top of the correct target entity, while TIFFL achieved accurate target entity extraction and sentiment analysis. The reasons are speculated as follows: the inter-modal fusion strategy in TIFFL can effectively combine text and image features to carry out the MATE task. Although "#Cubs" is a description of the target entity "JasonMotte", it is not reflected in the image. However, CMMT dynamically controls the intervention of image information by predicting the confidence of words in the text. It regards text information as the dominant factor in this task and underestimates the role of image information. Therefore, CMMT, which prioritizes the extraction of target entities in text, and RoBERTa, which only extracts target entities from text, both make incorrect predictions. Fig. 9 In example (b), RoBERTa and CMMT both extracted an incorrect target entity "Poland" on top of the correct target entity. The reason is the same as above: "Poland" is a noun phrase but it is not reflected in the image. Therefore, TIFFL achieves accurate extraction and sentiment analysis of the target entity by combining text and image features.

[0188] Then, Fig.10 Two examples are shown where the TIFFL model has an advantage on the JMASA task. Fig. 9 In the example (a), RoBERTa, CMMT and TIFFL all extract the correct target entity, but only RoBERTa makes an incorrect sentiment prediction for the target entity "JeanMarmoreo". The reasons are speculated as follows: RoBERTa only analyzes the text modality and cannot recognize the facial expression features of the person in the image. Although Top-K ANPs contain more incorrect vocabulary information, CMMT and TIFFL combine the facial expression of the person's smile in the image representation to predict the correct sentiment; Fig.10In example (b), the three models all extracted the correct target entity, but RoBERTa and CMMT both made incorrect sentiment predictions for the target entity. The reason is speculated here that first, the noun phrase extracted by TIFFL contains the real target entities "Wes Morgan" and "premier league", which helps the model to better complete the MATE task. Then, the model avoids the influence of the word "bonkers" in the second sentence on the first sentence by introducing text auxiliary information to learn the syntactic structure features within the text. However, RoBERTa and CMMT cannot learn their internal features at a deeper level when implementing text encoding. Therefore, "bonkers" may cause a certain degree of interference to the target entity "Wes Morgan", causing the model to predict it as a negative sentiment.

[0189] In summary, the present invention proposes a joint target entity sentiment analysis (TIFFL) method and model based on multimodal feature fine-grained learning. In the text feature learning stage, the model first constructs an enhanced adjacency matrix of word dependencies, and then learns the syntactic structure features of the text by using a graph convolutional network, which solves the problem of context interference in identifying different target entities in the text. In the image feature learning stage, the image semantic information can be expressed more intuitively by introducing adjective-noun pairs, thereby solving the problem of unclear image semantic extraction and further enhancing the performance of target entity extraction and sentiment prediction tasks. Experimental results show that TIFFL outperforms most of the existing most advanced models on the Twitter-2015 dataset and outperforms all the baseline models on the Twitter-2017 dataset, thereby verifying the superiority of the model proposed in the present invention and the effectiveness of the method.

[0190] The above is only a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A joint target entity sentiment analysis method based on fine-grained learning of multimodal features, characterized in that: include: Step 1: Use two types of pre-trained models, language and vision, to extract the unimodal feature representations of text and images in the input multimodal samples respectively; Step 2: Construct a multi-head cross-modal attention mechanism layer, obtain image-aware text feature representation and text-aware image feature representation based on the constructed multi-head cross-modal attention mechanism layer, and set an image gating mechanism for visual features to discriminate the correlation between text and image features; Step 3: For the text modality, construct text auxiliary information based on sentiment-enhanced graph convolutional network to learn the deep syntactic structure features in the text; for the image modality, use adjective-noun pairs to construct image auxiliary information to assist the image in semantic expression from the text level; Step 4: The obtained text feature representation, text-aware image feature representation, text auxiliary information, and image auxiliary information are fused through the image gating mechanism set in step 2 to generate an inter-modal fusion representation of text and image features. Based on the obtained inter-modal fusion representation, conditional random fields are used to complete the target entity extraction and sentiment analysis tasks.

2. The joint target entity sentiment analysis method based on multimodal feature fine-grained learning according to claim 1 is characterized in that: In step 1, the pre-trained language model RoBERTa is used as the text encoder of the model, and the residual network is used as the image encoder of the model.

3. The joint target entity sentiment analysis method based on multimodal feature fine-grained learning according to claim 1 is characterized in that: In the step 2, the image-aware text feature representation and text-aware image feature representation obtained based on the constructed multi-head cross-modal attention mechanism layer include: The image feature is represented by H V As the query vector, the text feature representation H S As the key vector and value vector, it is then normalized through two layers and a feed-forward network to obtain the image-aware text feature representation H V→S ; H S As the query vector, H V→S As the key vector and value vector, it then goes through two layers of normalization and a feed-forward network to generate the final image-aware text feature representation H' V→S ; H S As the query vector, H V As the key vector and value vector, it then goes through two layers of normalization and a feed-forward network to generate a text-aware image feature representation H S→V .

4. The joint target entity sentiment analysis method based on multimodal feature fine-grained learning according to claim 1 is characterized in that: In step 2, the image gating mechanism is expressed as: g=σ(W g [H' V→S ;H S→V ]+b g ) in, and is the learnable linear transformation parameter, d represents the total number of input multimodal samples, and σ is a nonlinear activation function using dot multiplication, which is used to control the output g of the gating mechanism within the range of [0,1].

5. The joint target entity sentiment analysis method based on multimodal feature fine-grained learning according to claim 1 is characterized in that: In step 3, text auxiliary information based on the sentiment enhanced graph convolutional network is constructed in the following manner: First, we use the natural language processing tool Spacy to extract noun phrases in the dataset text as candidates for the target entity. Then we continue to use Spacy to build a syntactic dependency tree for the text and obtain the corresponding adjacency matrix based on the dependency relationship between each node word. m represents the number of words contained in each multimodal sample, where w i and w j are the i-th and j-th words respectively, D i,j Represents the value corresponding to the dependency relationship between the i-th and j-th words in the adjacency matrix D; Then, the sentiment score S between each adjacent node is obtained by introducing the SenticNet sentiment dictionary, thereby enhancing the representation of the adjacency matrix, where S i,j =SenticNet(in i )+SenticNet(in j ) S i,j represents the sentiment score between the i-th and j-th words, SenticNet(w i )∈[-1,1] is the word w i The sentiment score in the SenticNet dictionary, -1 represents negative sentiment and 1 represents positive sentiment. i )=0 indicates that w i The sentiment is neutral or the word does not exist in the dictionary; Continue to build an enhanced matrix T for each noun phrase, where k∈n is the kth noun phrase, n is the number of noun phrases in each text, and finally the sentiment-enhanced text adjacency matrix A is constructed, where After obtaining the adjacency matrix A, the graph convolutional neural network GCN is introduced based on the syntactic dependency tree to learn the syntactic structure features and sentiment dependencies of the above noun phrases. i is the current node, is the representation of the current node based on emotion enhancement generated by the lth GCN layer, j is the neighboring node of node i, is the representation of node j in layer l and is generated by the previous GCN layer, is the degree of node i, W l and b l In order to learn the linear transformation parameters, the output of the last GCN layer is used as the text representation H based on sentiment enhancement G 6. The joint target entity sentiment analysis method based on multimodal feature fine-grained learning according to claim 1 is characterized in that: In step 3, the image auxiliary information is constructed in the following manner: Using the visual concept detector DeepSentiBank, we first generate a set of multiple adjective-noun pairs for the images in the sample and concatenate them, then feed them into the text encoder to obtain the adjective-noun pair representation H. A ; The text feature representation H is obtained through a multi-head cross-modal attention mechanism layer. S With the obtained H A Interact to obtain text-aware adjective-noun pair representations H S→A As image auxiliary information, it can filter out image content information that is irrelevant to text semantics.

7. The joint target entity sentiment analysis method based on multimodal feature fine-grained learning according to claim 1 is characterized in that: In step 4, the inter-modal fusion representation H of text and image features is generated in the following manner: H=(1-g)(H S ;αH G )+g(H S→V ;βH S→A ) Where g represents the output of the image gating mechanism, H S represents the text feature, H G For text representation based on sentiment enhancement, H S→V is the text-aware image feature representation, H S→A is the text-aware adjective-noun pair representation, α and β represent H G and H S→A The weight of .

8. A joint target entity sentiment analysis model based on fine-grained learning of multimodal features, characterized in that: include: The unimodal feature encoding module is used to extract unimodal feature representations of text and images in the input multimodal samples using two types of pre-trained models: language and vision; A multimodal feature correlation discrimination module is used to construct a multi-head cross-modal attention mechanism layer, obtain image-aware text feature representation and text-aware image feature representation based on the constructed multi-head cross-modal attention mechanism layer, and set an image gating mechanism for visual features to discriminate the correlation between text and image features; The intra-modal feature fine-grained analysis module is used to construct text auxiliary information based on sentiment-enhanced graph convolutional networks for text modalities to learn deep syntactic structure features in texts; for image modalities, adjective-noun pairs are used to construct image auxiliary information to assist in semantic expression of images from the text level; The inter-modal feature fusion and output module is used to fuse the obtained text feature representation, text-aware image feature representation, text auxiliary information, and image auxiliary information through the image gating mechanism set by the multi-modal feature correlation discrimination module to generate an inter-modal fusion representation of text and image features. Based on the obtained inter-modal fusion representation, the conditional random field is used to complete the target entity extraction and sentiment analysis tasks.