A multi-feature fusion visual dialogue sentiment analysis method based on hybrid model architecture

The multi-feature fusion visual conversation sentiment analysis method through a hybrid model architecture combines text and video information to solve the shortcomings of traditional methods in short text and multi-modal data sets, improve the accuracy and robustness of conversation sentiment analysis, and capture to multi-modal emotional information, enhancing the effectiveness of sentiment analysis.

CN118228156BActive Publication Date: 2024-10-01BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410299072.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2024-10-01
Estimated Expiration
2044-03-15

AI Technical Summary

Technical Problem

Traditional vocabulary-based methods and deep learning methods perform poorly in conversational emotion recognition, especially when short text semantics are sparse and word polysemy issues arise. It is difficult to accurately analyze visual and textual emotions in multi-modal data sets, and is single. Modals may ignore emotional information.

Method used

A multi-feature fusion visual dialogue emotion analysis method using a hybrid model architecture is used to obtain and preprocess dialogue data containing text and video, extract text features and image features, and fuse them, using a cross-attention mechanism and a fully connected layer to perform emotion analysis. Classification,incorporating facial expressions from video messages to,complement textual sentiment analysis.

Benefits of technology

It improves the accuracy and robustness of emotion classification, captures emotional information that may be ignored by a single modality, enhances the effectiveness of conversational emotion analysis through multi-modal fusion, and improves the accuracy of emotion analysis and the robustness of the model. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118228156B_ABST
    Figure CN118228156B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of natural language processing, and provides a multi-feature fusion visual dialogue sentiment analysis method with a hybrid model architecture, comprising the following steps: acquiring dialogue data containing text information and video information, intercepting text information according to sentence length, collecting a facial image sequence in the video information, and acquiring preprocessed text data and image data; extracting text features of the preprocessed text data based on texts grouped in pairs in the preprocessed text data; extracting image features of the preprocessed image data based on the facial image sequence; fusing the text features and image features, performing sentiment classification, and acquiring sentiment categories; training the sentiment analysis model, and acquiring a trained sentiment analysis model; the present invention can improve the effectiveness of dialogue sentiment recognition and analysis tasks under a multimodal background.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to a multi-feature fusion visual dialogue sentiment analysis method with a hybrid model architecture. Background Art

[0002] Multimodal Fusion is also called Multi-source Information Fusion and Multi-sensor Fusion. Multimodal fusion refers to the process of combining information from two or more modalities for prediction. In the prediction process, a single modality usually cannot contain all the effective information required to produce accurate prediction results. The multimodal fusion process combines information from two or more modalities to achieve information supplementation, broaden the coverage of information contained in the input data, improve the accuracy of prediction results, and improve the robustness of the prediction model. Visual and text features are usually obtained by different models. The formats and structures of images and texts are heterogeneous, and different methods are required to process and extract discriminative features. Unlike ordinary sentence and discourse emotion recognition, dialogue emotion recognition (ERC) requires context modeling of a single discourse. Since dialogue emotion depends on the time series of discourse, the scene, context, context clues and other specific information (facial expressions, intonation, voice, video), etc., traditional vocabulary-based methods and modeling deep learning methods have poor performance in dialogue emotion recognition datasets, and the accuracy of sentiment analysis still has a lot of room for improvement.

[0003] At present, the most commonly used multimodal datasets are mainly represented by datasets such as MELD and Yelp, which include multiple modes such as (visual, text, audio, etc.) film and television dramas and e-commerce evaluation analysis. Taking the MELD dataset as an example, about 42% of the utterances in the dataset are less than 5 words. If only the text is considered, the accuracy of sentiment analysis will be troubled by problems such as sparse semantics of short texts and polysemy of a word. Video data is a kind of multimodal data, which needs to be decomposed into single modalities to solve the problem. Generally speaking, video data can be divided into multiple single modal data such as face images, voice and text. In conversations, people often observe each other's thoughts through facial expressions. Facial expression analysis is also an important part of video sentiment analysis. This requires making full use of the dataset to provide additional video and other information for each conversation, further improve the context representation and supplement the missing or misleading signals in other modes, help the model better identify and learn the emotions of the text, and continuously iterate to finally establish a model that is more in line with the dialogue emotion recognition and analysis based on visual clues, so as to improve the effectiveness of sentiment analysis tasks in the context of multimodality. Summary of the invention

[0004] In view of the above problems, the present invention provides a multi-feature fusion visual dialogue sentiment analysis method with a hybrid model architecture, which solves the problem that a single modality in the prior art may ignore sentiment information.

[0005] The present invention provides a multi-feature fusion visual dialogue sentiment analysis method based on a hybrid model architecture, which specifically includes the following steps:

[0006] Step S1, obtaining conversation data including text information and video information, and preprocessing the conversation data, wherein the preprocessing includes: intercepting text information and collecting face image sequences in video information according to sentence length, and obtaining preprocessed text data and image data;

[0007] Step S2, extracting text features of the preprocessed text data based on the texts grouped in pairs in the preprocessed text data;

[0008] Based on the facial image sequence, extracting image features of the preprocessed image data;

[0009] Fusing the text features and the image features to obtain fused features;

[0010] Step S3: training the sentiment analysis model to obtain a trained sentiment analysis model, wherein the sentiment analysis model performs sentiment classification based on the fusion features to obtain a sentiment category;

[0011] Step S4: Apply the trained sentiment analysis model to dialogue sentiment analysis.

[0012] Preferably, a dialogue segment in the dialogue data is obtained, all sentences in the dialogue segment are spliced ​​together in the dialogue order, and a spliced ​​sentence is obtained; if the length of the spliced ​​sentence is less than a preset threshold, the spliced ​​sentence is set as the context information of all sentences in the dialogue segment; otherwise, according to the position of the current sentence in the spliced ​​sentence, the spliced ​​sentence is truncated, and a part of the spliced ​​sentence is set as the context information of the current sentence;

[0013] The facial image sequence collected in the video information in step S1 includes:

[0014] Extract some frames from the video information, perform face detection and feature point alignment on each of the some frames, and obtain a face image sequence.

[0015] Preferably, the step S2 of extracting text features of the preprocessed text data based on the texts grouped in pairs in the preprocessed text data comprises: assigning tag numbers that appear in pairs to the texts grouped in pairs in the preprocessed text data; inputting the preprocessed text data and the tag numbers into a pre-trained language model to obtain a text feature sequence;

[0016] Extracting the image features of the preprocessed image data based on the facial image sequence in step S2 includes: truncating the length of the facial image sequence.

[0017] Preferably, the conversation data containing text information and video information specifically includes:

[0018] Conversation dataset C = {D 1 , D 2 , …, D n}, where n is the size of the data set, is the i-th dialogue in C, where m i D i The number of statements contained in U i,j ={T i,j , T i,j} is D i The jth statement in and Respectively represent U i,j The corresponding text information and video information, where w i,j,tk Indicates T i,j The tkth word in f i,j,vk Indicates V i,j In the vkth frame, tl i,j T i,j The number of words contained in vl i,j V i,j The number of frames contained in .

[0019] Preferably, the specific steps of preprocessing the text information in step S1 are:

[0020] The maximum context length is preset to N, and D is concatenated in order i All the sentence texts in where w i,tk Indicates AT i The tkth word in , if AT i If the length is not greater than N, then set context i,j =AT i , otherwise, according to T i,j The specific position of ATi in AT i Truncate, including: Note Ti,j The length is L,

[0021] If L>N, then context i,j ={w i,j,1 , w i,j,2 ,…,w i,j,N};

[0022] If in AT i In T i,j If the total length of the preceding statement is less than (NL) / 2, then context i,j ={w i,1 , w i,2 ,…,w i,N};

[0023] If in AT i In T i,j If the total length of the sentence text after is less than (NL) / 2, then

[0024] If none of the above three conditions are met, record T i,j At AT i The starting positions in are s and e respectively, then

[0025] Get context i,j After that, according to T i,j In which the actual starting position is determined (start, end) i,j , to get tags i,j , remember context i,j The length is L c , context i,j The tkth word in is cw i,j,tk ,but Where I(·) is used to convert context i,j Each word in is mapped to the sentence in which it is located in the context i,j The serial number in the range is [1, N c ], where N c context i,j The actual number of statements included, and the truncated statements are still counted as 1 statement;

[0026] Finally, T i,j Processed into the following form:

[0027]

[0028] in, Represents the processed text data, contexti,j Indicates T i,j The context of (start, end) i,j Indicates T i,j In context i,j The starting position in tags i,j Used to mark context i,j Different sentences in .

[0029] Preferably, the specific steps of preprocessing the video information in step S1 are:

[0030] The preset frame extraction interval M is for V i,j Starting from the first frame, retain one frame every M frames to obtain the video information V′ after frame extraction i,j ={f i,j,1 , f i,j,1+M , f i,j,1+2M , …}, for each frame, the FasterRCNN_ResNet50_FPN method is used to detect and crop the face in the image, and one face image is retained in each frame. The face is aligned based on the four-point facial method, where the four points are the left eye center and the right eye center and the left and right corners of the mouth; the intensity normalization method is used to process the brightness and contrast of the face alignment image;

[0031] Finally, V i,j Processed into the following form:

[0032]

[0033] in Indicates V i,j The face image sequence contained in face i,j,fk represents the fkth face image, fl i,j Indicates the length of the sequence.

[0034] Preferably, the step of extracting text features of the preprocessed text data in step S2 specifically includes:

[0035] (1) Based on Tags in i,j Information determines the tag number TagIDs required by the BERT model, record but in,

[0036]

[0037] Will and tag IDs are input into the BERT model and the entire context is output i,j The corresponding feature sequence Then according to (start, end) i,j Information obtained to be sentiment analysis sentence text T i,j The corresponding feature sequence

[0038] (2) Feature sequence Input into the BiGRU model and output T i,j Final text feature sequence

[0039] Preferably, the step of extracting the image features of the preprocessed image data in step S2 specifically includes:

[0040] (1) Preset the maximum length K of the face image sequence. If If the number of face images contained is greater than K, they will be truncated, that is, Then, each image is converted into a numerical matrix based on the RGB mode, and each image is input into the ResNet model to obtain the corresponding feature vector, and these feature vectors are arranged in order to obtain the image feature sequence.

[0041] (2) Image feature sequence Input into the LSTM model, output The final image feature sequence where K′=min{K,vl i,j}.

[0042] Preferably, the step S2 of fusing the text features and the image features to obtain the fused features specifically includes:

[0043] (1) Use the cross-attention mechanism to fuse S i,j and Get the initial fusion features The calculation formula is:

[0044]

[0045] Among them, CrossAtt(·,·) represents the cross attention calculation, Concat(·,·) represents the concatenation operation, represents the attention calculation, where Q, K, and V are three input placeholders, and W Q , W K and W V are three trainable matrix parameters, d K QW Q and KW K The number of columns;

[0046] (2) Calculate the final fusion features The calculation formula is:

[0047]

[0048] Among them, Mean(·) represents the average pooling operation, is a facial image feature sequence The last element in .

[0049] Preferably, the sentiment analysis model in step S3 performs sentiment classification based on the fusion features, and obtaining the sentiment category specifically includes:

[0050] Use a fully connected layer as a classifier, for each sentence U to be sentimentally analyzed i,j Perform sentiment classification, where the total number of categories is K s , indicating that there are a total of K s There are emotions to be classified, and their indexes are 1, 2, 3, ..., K s , the index corresponding to the final sentiment classification result o It can be obtained by the following formula:

[0051]

[0052] Among them, FCN(·) represents the fully connected layer, FCN(·)[q] represents the qth element of the output of the fully connected layer; the total number of categories K s =7, representing 7 emotions: neutral, happy, surprised, angry, sad, disgusted, and fearful, with corresponding indexes of 1-7;

[0053] The step S3 of training the sentiment analysis model to obtain the trained sentiment analysis model specifically includes:

[0054] Using the available labeled data C′ in the conversation dataset C 1 , label 1 ),…,(U n′ , label n′ )}, where n′ is the size of the labeled dataset, (U i′ , label i′ ) is the i′th sentence-label pair in C′, and the sentiment analysis model is trained. The cross entropy loss is used in the training process, and its expression is:

[0055]

[0056] Among them, N B Indicates the batch size in training, Represents the model's classifier for the i-thB The value of the qth element in the output of the statement, Indicates the i-th batch B The index of the correct label corresponding to the sentence.

[0057] Compared with the prior art, the present invention has at least the following beneficial effects:

[0058] (1) By combining text and visual information, the present invention utilizes multiple types of data. Facial expressions in video information can provide additional clues for understanding the speaker's emotional state. Therefore, the technical solution of the present invention can capture emotional information that may be ignored by a single modality.

[0059] (2) By concatenating all sentences in a conversation and truncating them according to their length, the contextual information of the sentences can be retained. Emotions often rely on context to be accurately interpreted, so it helps to understand the emotions in a conversation.

[0060] (3) In text and video information processing, data truncation is performed according to preset thresholds and context positions, which enables the model to process inputs of different lengths. By fusing text features and image features, information from multiple dimensions can be comprehensively considered to improve the accuracy and robustness of sentiment classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The drawings are only for the purpose of illustrating particular embodiments and are not to be construed as limiting the invention.

[0062] Figure 1 A flowchart of a method for analyzing conversational sentiment using a hybrid model architecture and multiple features fusion disclosed in an embodiment of the present invention;

[0063] Figure 2 A schematic diagram of a hybrid model architecture multi-feature fusion conversation sentiment analysis method disclosed in an embodiment of the present invention;

[0064] Figure 3 A schematic diagram of the structure of a text feature extraction module disclosed in an embodiment of the present invention;

[0065] Figure 4 This is a schematic diagram of the structure of an image feature extraction module disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0066] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. In addition, the present invention can also be implemented in other ways different from those described herein, and therefore, the protection scope of the present invention is not limited by the specific embodiments disclosed below.

[0067] A specific embodiment of the present invention, as Figure 1 As shown, a multi-feature fusion visual dialogue sentiment analysis method of a hybrid model architecture is disclosed, which specifically includes the following steps:

[0068] Step 1: Preprocessing of conversation data;

[0069] Given an unprocessed conversation dataset C containing both text and video modal information, 1 , D 2 , …, D n}, where n is the size of the data set, is the i-th dialogue in C, where m i D i The number of statements contained in U i,j ={T i,j , V i,j} is D i The jth statement in and Respectively represent U i,j The corresponding text and video information, where w i,j,tk Indicates T i,j The tkth word in f i,j,vk Indicates V i,j In the vkth frame, tl i,j T i,j The number of words contained in vl i,j V i,j The number of frames contained in T i,j and V i,j They are processed into the following forms:

[0070]

[0071]

[0072] in, Represents the processed text data, context i,j Indicates T i,j The context of (start, end) i,j Indicates T i,j In context i,j The starting position in tags i,j Used to mark context i,j Different sentences in ; Indicates V i,j The face image sequence contained in face i,j,fk represents the fkth face image, fl i,jIndicates the length of the sequence. The specific preprocessing steps of the two are as follows:

[0073] (1) Sentence text information T i,j Preprocessing: First, preset the maximum context length N and concatenate D in sequence i All the sentence texts in where w i,tk Indicates AT i The tkth word in , if AT i If the length of is not greater than N, then set context i,j =AT i , otherwise, according to T i,j At AT i The specific location of AT i Make appropriate cuts, record T i,j The length of is L, and the possible situations and truncation methods are as follows:

[0074] (1-1) If L>N, then context i,j ={w i,j,1 , w i,j,2 ,…,w i,j,N};

[0075] (1-2) If in AT i In T i,j If the total length of the preceding statement is less than (NL) / 2, then context i,j ={w i,1 , w i,2 ,…,w i,N};

[0076] (1-3) If in AT i In T i,j If the total length of the sentence text after is less than (NL) / 2, then

[0077] (1-4) If none of the above three conditions are met, record T i,j At AT i The starting positions in are s and e respectively, then

[0078] Get context i,j After that, according to T i,j In which the actual starting position is determined (start, end) i,j , in particular, for the situation given in step (1-1) above, (start, end) i,j =(1, N), to get tags i,j , remember context i,jThe length is L c , context i,j The tkth word in is cw i,j,tk ,but Where I(·) is used to convert context i,j Each word in is mapped to the sentence in which it is located in the context i,j The serial number in the range is [1, N c ], where N c context i,j The actual number of statements included, and the truncated statements are still counted as 1 statement. Optionally, the preset maximum context length N=512.

[0079] (2) Sentence video information V i,j Preprocessing: First, preset the frame extraction interval M, and i,j Starting from the first frame, retain one frame every M frames to obtain the video information V′ after frame extraction i,j ={f i,j,1 , f i,j,1+M , f i,j,1+2M , …}, for each frame, the more mature target and face detection method FasterRCNN_ResNet50_FPN is used to extract and crop the face in the image, and one face image is retained in each frame. In order to extract more effective facial features, after the face is detected, the face is aligned based on the four-point method. These four points are the center of the left eye and the center of the right eye and the left and right corners of the mouth. At the same time, the intensity normalization method is used to process the brightness and contrast of the image. V′ i,j After all the frames are processed as above, the final face image sequence can be obtained. Optionally, the preset frame extraction interval M=5.

[0080] Step 2: Text feature extraction;

[0081] The structure of the text feature extraction module is as follows: Figure 2 As shown, for each sentence U to be analyzed i,j Preprocessed text information First, we use the pre-trained language model BERT to initially model T i,j And the corresponding context i,j interaction, and then T i,j The corresponding output is input to the BiGRU model to further capture T i,j The interdependence between internal words, the final output T i,j The corresponding feature sequence, the detailed steps are as follows:

[0082] (1) Use the pre-trained language model BERT to initially model T i,j And the corresponding context i,j First, according to Tags in i,j Information determines the tag number TagIDs required by the BERT model, record but in,

[0083]

[0084] The context i,j and tag IDs are input into the BERT model and the entire context is output i,j The corresponding feature sequence Then according to (start, end) i,j Information obtained to be sentiment analysis sentence text T i,j The corresponding feature sequence Optionally, the pre-trained parameters of the BERT model use the bert-base-uncased version.

[0085] (2) Use the BiGRU model to further capture T i,j The interdependence between internal words. Input into the BiGRU model and output T i,j Final text feature sequence Optionally, the hidden layer vector dimension of BiGRU is 768.

[0086] Step 3: Image feature extraction;

[0087] The structure of the image feature extraction module is as follows: Figure 3 As shown, for each sentence U to be analyzed i,j The face image sequence is obtained by preprocessing the video information First, the ResNet model is used to extract features from each image, and then the obtained facial image feature sequence is input into the LSTM model. The model is used to model the change process of the face, capture the temporal information contained therein, and output The corresponding final feature sequence, the detailed steps are as follows:

[0088] (1) Use the ResNet model to train face image sequences We first preset the maximum length K of the face image sequence. If the number of face images contained is greater than K, they will be truncated, that is, Then, each image is converted into a numerical matrix based on the RGB mode, and each image is input into the ResNet model to obtain the corresponding feature vector, and these feature vectors are arranged in order to obtain the image feature sequence. Optionally, the preset maximum length of the face image sequence is K=20, and the version of the ResNet model uses ResNet101.

[0089] (2) Use the LSTM model to capture the temporal features in the facial image feature sequence. Input into the LSTM model, output The final image feature sequence where K′=min{K,vl i,j}. Optionally, the hidden layer vector dimension of LSTM is 768 and the number of layers is 2.

[0090] Step 4: Feature fusion;

[0091] For each sentence U to be analyzed i,j , based on the cross attention mechanism, the text feature sequence S extracted in step 2 and step 3 is fused i,j and facial image feature sequence The detailed steps are as follows:

[0092] (1) Use the cross-attention mechanism to fuse S i,j and Get the initial fusion features The calculation formula is:

[0093]

[0094] Among them, CrossAtt(·,·) represents the cross attention calculation, Concat(·,·) represents the concatenation operation, represents the attention calculation, where Q, K, and V are three input placeholders, and W Q , W K and W V are three trainable matrix parameters, d K QW Q and KW K The number of columns.

[0095] (2) Calculate the final fusion features The calculation formula is:

[0096]

[0097] Among them, Mean(·) represents the average pooling operation, is a facial image feature sequence The last element in .

[0098] Step 5: Sentiment classification;

[0099] Use a fully connected layer as a classifier, for each sentence Ui to be sentimentally analyzed, j Perform sentiment classification, where the total number of categories is K s , indicating that there are a total of K s There are emotions to be classified, and their indexes are 1, 2, 3, ..., K s , the index corresponding to the final sentiment classification result O It can be obtained by the following formula:

[0100]

[0101] Where FCN(·) represents the fully connected layer, and FCN(·)[q] represents the qth element of the output of the fully connected layer. Optionally, the total number of categories K s =7, representing 7 emotions: neutral, happy, surprised, angry, sad, disgusted and fearful, with corresponding indexes of 1-7.

[0102] Step 6: Model training and evaluation;

[0103] Using the available labeled data C′ in the conversation dataset C 1 , label 1 ),…,(U n′ , label n′ )}, where n′ is the size of the labeled dataset, (U i′ , label i′ ) is the i′th sentence-label pair in C′, and for any (U, label)∈C′, there exists D∈C such that U∈D. The sentiment analysis model described in steps 2-5 is trained, and the cross entropy loss is used in the training process, which is expressed as:

[0104]

[0105] Among them, N B Indicates the batch size in training, Represents the model's classifier for the i-th B The value of the qth element in the output of the statement, Indicates the i-th batch B The index of the correct label corresponding to the sentence.

[0106] In order to verify the sentiment analysis effect of the present invention, the training set, validation set and test set are divided into two sets according to the proportion on the MELD dataset, and it is ensured that each of the three sets contains the seven types of sentiment labels described in step 5 (i.e., neutral, happy, surprised, angry, sad, disgusted and fearful). The accuracy (Acc), weighted average F1 value (W-F1) and the individual F1 value under each sentiment classification are used to evaluate the M3F-ERC model proposed in the present invention, and compared with baselines such as TFN, LMF, MFN, bc-LSTM, DialogueRNN, DialogueCRN, DialogueGCN, MM GCN, MM-DFN, MVN, GA2MIF, DIMMN, Graphcfc and ChatGPT1-shot. The specific results are as follows:

[0107] Table 1 Experimental results of each model on the MELD dataset

[0108]

[0109]

[0110] The experimental results are shown in Table 1. The model provided by the present invention has the highest accuracy of 63.45% among all baseline methods. Compared with the classic method MM DFN proposed in 2022, the accuracy is improved by 1.5%. The weighted average F1 value is also the best, reaching 62.35%, which is 2.7% higher than the method proposed by Lu et al. in 2020. Compared with the baseline method, the method provided by the present invention has improved the classification of most emotion categories. Although the performance is lower than that of the MVN model in the recognition of neutral emotions, and the performance is slightly lower than that of the method proposed by Lu et al. in 2020 in the recognition of angry emotions, in general, the method provided by the present invention has a good balance between different emotions, proving the effectiveness of the method.

[0111] In addition, in order to more rigorously determine the effectiveness of the model, the present invention also conducted an ablation experiment. The specific schemes of each experiment are given in the following table:

[0112] Table 2 Specific plan of ablation experiment

[0113]

[0114] The data set and evaluation indicators used in the ablation experiment remain unchanged. The specific experimental results are shown in Table 3. It can be seen that although the accuracy of the M3F-ERC model proposed in the present invention is slightly lower than that of the w / o context experimental setting, its weighted average F1 value is more significantly improved, which is the best among all experimental settings. This shows that the use of the context of the conversation in which the sentence is located and the facial image sequence information can improve the overall performance of the model; in addition, in the recognition of a single emotion classification, although the M3F-ERC model is slightly lower than the w / o context and w / o faces experimental settings in neutral and angry emotions respectively, it performs best in more than half of the emotion classifications, further verifying the effectiveness of the method proposed in the present invention.

[0115] Table 3 Model ablation experiment results

[0116]

[0117] Although the specific embodiments of the present invention have been described in a specific order, each action or step should be understood to require that such action or step be performed in the specific order shown or in a sequential order, or require that all illustrated actions or steps should be performed to obtain the desired result. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Certain features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination.

[0118] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A multi-feature fusion visual dialogue sentiment analysis method based on a hybrid model architecture, characterized in that: The following steps are involved: Step S1, obtaining conversation data including text information and video information, and preprocessing the conversation data, wherein the preprocessing includes: intercepting text information and collecting face image sequences in video information according to sentence length, and obtaining preprocessed text data and image data; The conversation data containing text information and video information specifically includes: Conversation dataset C = {D1, D2, ..., D n }, where n is the size of the data set, is the i-th dialogue in C, where m i D i The number of statements contained in U i,j ={T i,j ,V i,j } is D i The jth statement in and Respectively represent U i,j The corresponding text information and video information, where w i,j,tk Indicates T i,j The tkth word in f i,j,vk Indicates V i,j In the vkth frame, tl i,j T i,j The number of words contained in vl i,j V i,j The number of frames contained in ; The specific steps of preprocessing the text information in step S1 are: The maximum context length is preset to N, and D is concatenated in order i All the sentence texts in AT i =T i,1 ∪ where w i,tk Indicates AT i The tkth word in , if AT i If the length is not greater than N, then set context i,j =AT i , otherwise, according to T i,j At AT i The specific location of AT i Truncate, including: Note T i,j The length is L, If L>N, then context i,j ={w i,j,1 ,w i,j,2 ,…,w i,j,N }; If in AT i In T i,j If the total length of the preceding statement is less than (NL) / 2, then context i,j ={w i,1 ,w i,2 ,…,w i,N }; If in AT i In T i,j If the total length of the sentence text after is less than (NL) / 2, then If none of the above three conditions are met, record T i,j At AT i The starting positions in are s and e respectively, then Get context i,j After that, according to T i,j In which the actual starting position is determined (start, end) i,j , to get tags i,j , remember context i,j The length is L c , context i,j The tkth word in is cw i,j,tk ,but Where I(·) is used to convert context i,j Each word in is mapped to the sentence in which it is located in the context i,j The serial number in the range is [1,N c ], where N c context i,j The actual number of statements included, and the truncated statements are still counted as 1 statement; Finally, T i,j Processed into the following form: in, Represents the processed text data, context i,j Indicates T i,j The context of (start, end) i,j Indicates T i,j In context i,j The starting position in tags i,j Used to mark context i,j Different sentences in ; The specific steps of preprocessing the video information in step S1 are: The preset frame extraction interval M is for V i,j Starting from the first frame, retain one frame every M frames to obtain the video information V′ after frame extraction i,j ={f i,j,1 ,f i,j,1+M ,f i,j,1+2M ,…}, for each frame, the FasterRCNN_ResNet50_FPN method is used to detect and crop the face in the image, and one face image is retained in each frame. The face is aligned based on the four-point facial method, where the four points are the center of the left eye and the center of the right eye and the left and right corners of the mouth; the intensity normalization method is used to process the brightness and contrast of the face alignment image; Finally, V i,j Processed into the following form: in Indicates V i,j The face image sequence contained in i,j,fk represents the fkth face image, fl i,j Indicates the length of the sequence; Step S2, extracting text features of the preprocessed text data based on the texts grouped in pairs in the preprocessed text data; Based on the facial image sequence, extracting image features of the preprocessed image data; Fusing the text features and the image features to obtain fused features; Step S3: training the sentiment analysis model to obtain a trained sentiment analysis model, wherein the sentiment analysis model performs sentiment classification based on the fusion features to obtain a sentiment category; Step S4: Apply the trained sentiment analysis model to dialogue sentiment analysis.

2. The multi-feature fusion visual dialogue sentiment analysis method based on the hybrid model architecture according to claim 1 is characterized by: The step S1 of intercepting text information according to the sentence length includes: Obtaining a dialogue segment in the dialogue data, splicing all sentences in the dialogue segment according to the dialogue order, and obtaining the spliced ​​sentences; If the length of the concatenated sentence is less than a preset threshold, the concatenated sentence is set as the context information of all sentences in the dialogue segment; Otherwise, for each sentence in the dialogue segment, the concatenated sentence is truncated according to the position of the current sentence in the concatenated sentence, and a part of the concatenated sentence is set as the context information of the current sentence; The facial image sequence collected in the video information in step S1 includes: Extract some frames from the video information, perform face detection and feature point alignment on each of the some frames, and obtain a face image sequence.

3. The multi-feature fusion visual dialogue sentiment analysis method based on the hybrid model architecture according to claim 2 is characterized by: Extracting text features of the preprocessed text data based on the texts grouped in pairs in the preprocessed text data in step S2 includes: Assigning paired label numbers to the texts grouped in pairs in the preprocessed text data; Inputting the preprocessed text data and the label number into a pre-trained language model to obtain a text feature sequence; Extracting the image features of the preprocessed image data based on the facial image sequence in step S2 includes: truncating the length of the facial image sequence.

4. The multi-feature fusion visual dialogue sentiment analysis method of the hybrid model architecture according to claim 1 is characterized by: The step S2 of extracting text features of the preprocessed text data specifically includes: (1) Based on Tags in i,j Information determines the tag number TagIDs required by the BERT model, record but in, The context i,j and tag IDs are input into the BERT model and the entire context is output i,j The corresponding feature sequence Then according to (start,end) i,j Information obtained to be sentiment analysis sentence text T i,j The corresponding feature sequence (2) Feature sequence Input into the BiGRU model and output T i,j Final text feature sequence 5. The multi-feature fusion visual dialogue sentiment analysis method based on the hybrid model architecture according to claim 4 is characterized by: The step S2 of extracting the image features of the preprocessed image data specifically includes: (1) Preset the maximum length K of the face image sequence. If If the number of face images contained is greater than K, they will be truncated, that is, Then, each image is converted into a numerical matrix based on the RGB mode, and each image is input into the ResNet model to obtain the corresponding feature vector, and these feature vectors are arranged in order to obtain the image feature sequence. (2) Image feature sequence Input into the LSTM model, output The final image feature sequence where K′=min{K,vl i,j }.

6. The multi-feature fusion visual dialogue sentiment analysis method based on the hybrid model architecture according to claim 5 is characterized by: In step S2, the text feature and the image feature are fused to obtain the fused feature, which specifically includes: (1) Use the cross-attention mechanism to fuse S i,j and Get the initial fusion features The calculation formula is: Among them, CrossAtt(·,·) represents the cross attention calculation, Concat(·,·) represents the concatenation operation, represents the attention calculation, where Q, K, and V are three input placeholders, and W Q , W K and W V are three trainable matrix parameters, d K QW Q and KW K The number of columns; (2) Calculate the final fusion features The calculation formula is: Among them, Mean(·) represents the average pooling operation, is a facial image feature sequence The last element in .

7. The multi-feature fusion visual dialogue sentiment analysis method of the hybrid model architecture according to claim 6 is characterized in that: The sentiment analysis model in step S3 performs sentiment classification based on the fusion features, and obtaining the sentiment category specifically includes: Use a fully connected layer as a classifier, for each sentence U to be sentimentally analyzed i,j Perform sentiment classification, where the total number of categories is K s , indicating that there are a total of K s There are emotions to be classified, and their indexes are 1, 2, 3, ..., K s , the index corresponding to the final sentiment classification result O It can be obtained by the following formula: Among them, FCN(·) represents the fully connected layer, FCN(·)[q] represents the qth element of the output of the fully connected layer; the total number of categories K s =7, representing 7 emotions: neutral, happy, surprised, angry, sad, disgusted, and fearful, with corresponding indexes of 1-7; The step S3 of training the sentiment analysis model to obtain the trained sentiment analysis model specifically includes: Using the available labeled data C′={(U1,label1),…,(U n′ ,label n′ )}, where n′ is the size of the labeled dataset, (U i′ ,label i′ ) is the i′th sentence-label pair in C′, and the sentiment analysis model is trained. The cross entropy loss is used in the training process, and its expression is: Among them, N B Indicates the batch size in training, Represents the model's classifier for the i-th B The value of the qth element in the output of the statement, Indicates the i-th batch B The index of the correct label corresponding to the sentence.