Multi-modal sentiment analysis method based on word level interaction and word-by-word sentiment quantity weighting

By adopting word-level interaction and word-by-word sentiment weighting methods in multi-modal sentiment analysis, the problems of feature loss and noise vocabulary influence in traditional methods are solved, and more accurate sentiment prediction and stronger modal complementarity are achieved. .

CN118734240AActive Publication Date: 2024-10-01BEIJING UNIV OF TECH

Patent Information

Application Number
CN202410724664.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-10-01
Estimated Expiration
2044-06-05

AI Technical Summary

Technical Problem

Traditional multi-modal sentiment analysis methods lead to feature loss in single-granularity feature learning, and using the average as a feature vector in sentence-level multi-modal fusion will reduce the accuracy of sentiment prediction, and noise words have different expressive capabilities between different modalities. , single modal standard elimination will affect the modal complementarity ability.

Method used

A multi-modal sentiment analysis method based on word-level interaction and word-by-word sentiment weighting is used to extract text-speech bimodal word-level features through Wav2vec 2.0 and BERT, and Transformer and Bi-LSTM are used for multi-modal time alignment and word-by-word sentiment. Content-weighted, multi-granularity sentence-level feature vectors are generated, and fully connected networks are used for sentiment analysis.

Benefits of technology

It effectively avoids feature loss, improves the accuracy of emotion prediction, reduces the impact of noise words, enhances the complementary capabilities between multi-modalities, and improves the accuracy of sentence-level feature vectors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734240A_ABST
    Figure CN118734240A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-modal sentiment analysis method based on word-level interaction and word-by-word sentiment quantity weighting, and belongs to the technical field of deep learning. The method comprises the following steps of: firstly, realizing extraction of word level feature vectors of a text mode and a voice mode by utilizing BERT and Wav2vec 2.0 pre-training models; using a Transform encoder and a linear layer to obtain a statement-level feature vector of text-speech bimodal word-level interaction; and weighting the word-level feature vector according to word-by-word sentiment content by using a Bi-LSTM model to obtain a text-speech bimodal statement-level feature vector with weighted word-by-word sentiment content. And finally, fusing the statement-level feature vector of the text-speech dual-mode word-level interaction and the text-speech dual-mode statement-level feature vector weighted by word-by-word emotion content to obtain a multi-mode statement-level feature vector containing multi-granularity information, and performing statement emotion recognition by using a full-connection network. Emotional information loss caused by granularity difference is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Based on deep learning technology, a multi-modal emotion recognition method with multi-granularity feature fusion is designed. First, the BERT and Wav2vec 2.0 pre-training models are used to extract word-level feature vectors of text and speech modalities; the Transformer encoder and linear layer are used to obtain the sentence-level feature vector of the text-speech bimodal word-level interaction; the Bi-LSTM model is used to weight the word-level feature vector according to the word-by-word emotional content to obtain the text-speech bimodal sentence-level feature vector weighted by the word-by-word emotional content. Finally, the sentence-level feature vector of the text-speech bimodal word-level interaction and the text-speech bimodal sentence-level feature vector weighted by the word-by-word emotional content are fused to obtain a multi-modal sentence-level feature vector containing multi-granularity information, and the sentence emotion is recognized using a fully connected network. The present invention relates to the field of emotion analysis, and specifically to technologies such as deep learning, multi-modal fusion, and multi-granularity feature fusion. Background Art

[0002] Sentiment analysis is an important part of the NLP field. It aims to transform human emotions into machine-recognizable features through algorithms, so that machines can recognize and distinguish human emotions. With the development of artificial intelligence, the demand for human emotion prediction has gradually increased. There is a high demand for emotion recognition and analysis technology in many fields such as chat customer service, large language model construction, and big data recommendation. Human emotions have multiple modal expressions, such as language expression, text expression, body expression, and facial expression, and different modalities have the ability to complement each other's emotional features. Multimodal fusion sentiment analysis is a method of analyzing human emotions using multiple modal features at the same time, using the complementarity between modalities to improve the accuracy of emotion prediction and reduce the impact of the limitations of a single modality. There are differences in the information expressed by human emotion expression at different granularities. The emotions expressed word by word are both related to and different from the emotions expressed in the complete sentence. The use of word-level and sentence-level feature complementarity can improve the accuracy of human emotion prediction.

[0003] Traditional multimodal fusion sentiment analysis methods include sentence-level multimodal fusion and word-level multimodal fusion. Sentence-level multimodal fusion requires extracting word-level feature vectors from each modality, and calculating sentence-level feature vectors based on word-level feature vectors. The sentence-level feature vectors of the same sentence in multiple modalities are concatenated to obtain sentence-level feature vectors of multimodal fusion. The sentence-level feature vectors of multimodal fusion are trained by deep learning, and sentiment recognition is performed with the trained model. Word-level multimodal fusion requires concatenating word-level feature vectors of different modalities, and training the model by deep learning, and sentiment recognition is performed with the trained model. The traditional sentence-level feature vector construction method is to average the word-level feature vectors, and use the average value as the sentence-level feature vector. For the feature vector construction of word-level multimodal fusion, it is necessary to align different modalities, and concatenate the word-level feature vectors of different modalities by time alignment or semantic alignment to obtain the feature vector of word-level multimodal fusion.

[0004] Traditional methods use sentence-level features and word-level features as the basis for sentiment analysis, but do not study the correlation between the two. However, there is a connection between word-level features and sentence-level features. Taking a single granularity as the basis for sentiment recognition will result in the loss of some features. In the traditional sentence-level feature vector construction method, the word-level feature vector in a sentence is averaged. However, human emotions are complex, and the amount of emotion contained in each word in a sentence varies. The calculation using the mean method will increase the erroneous impact of words with small emotional content on the complete sentence, and reduce the ability of features of words with high emotional content to represent the emotion of the complete sentence, making it impossible to obtain a high-accuracy model. When performing sentence-level multimodal fusion, for noise words with poor emotional expression ability, the traditional solution is to build a low-frequency vocabulary dictionary, remove the noise words from the data set, and then perform feature extraction and model training. However, in multimodal fusion sentiment analysis, the ability of noise data to express emotions varies between different modalities. For example, the emotional content of the word in the text modality is lower, while the emotional content of the word in the speech modality is higher. Therefore, eliminating the same words in other modalities according to the noise vocabulary standard of a single modality will affect the complementary ability between multiple modalities. Summary of the invention

[0005] In order to solve the problem of feature loss caused by learning single granularity features in traditional multimodal sentiment analysis methods and the problem of using the average value as the sentence-level feature vector in sentence-level multimodal fusion methods, this paper proposes a multimodal sentiment analysis method based on word-level interaction and word-by-word sentiment weighting. The method proposed in this paper is divided into four parts: Figure 1): Text-speech bimodal word-level feature extraction, multimodal time alignment and word-level granularity multimodal fusion, word-by-word sentiment content weighting and sentence-level granularity multimodal fusion, and multimodal multi-granularity sentiment analysis model training. The text-speech bimodal word-level feature extraction uses a pre-trained model to extract feature vectors, uses Wav2vec 2.0 to extract speech modality word-level feature vectors, and BERT to extract text modality word-level feature vectors. The multimodal time alignment and word-level granularity multimodal fusion part concatenates the word-level feature vectors of the same word in different modalities to obtain the text-speech bimodal word-level feature vector, inputs the text-speech bimodal word-level feature vector into the Transformer encoder for encoding, and reduces the dimension of the encoder output through a linear layer to obtain the sentence-level feature vector of the text-speech bimodal word-level interaction of this sentence. The word-by-word sentiment content weighting and sentence-level granularity multimodal fusion part inputs the word-by-word feature vectors of the two modalities into the Bi-LSTM network for training, and obtains the Bi-LSTM models of the two modalities respectively. Then, the word-by-word feature vectors obtained by BERT and Wav2vec2.0 are input into the Bi-LSTM model of the corresponding modality. The model outputs the prediction probability of each emotion corresponding to each word. The variance is calculated based on this probability as the weight of the proportion of the emotion contained in the word. The word-by-word feature vectors of the corresponding modality are weighted by the word-by-word weights in different modalities, and the sentence-level feature vectors weighted by the word-by-word emotion content of the two modalities of speech and text are obtained respectively. The sentence-level feature vectors weighted by the word-by-word emotion content of the same discourse in the two modalities are spliced ​​to obtain the text-speech bimodal sentence-level feature vector weighted by the word-by-word emotion content. The multimodal multi-granularity sentiment analysis model training uses a fully connected network as the classification model structure, and splices the sentence-level feature vector of the speech-text bimodal word-level interaction of the same sentence and the text-speech bimodal sentence-level feature vector weighted by the word-by-word emotion content to obtain the text-speech bimodal sentence-level feature vector containing multi-granularity information. This feature vector is input into the fully connected network for training to obtain a sentiment prediction multi-classification model, and this model is used to implement sentence sentiment analysis.

[0006] In order to achieve the above object, the multimodal sentiment analysis method based on word-level interaction and word-by-word sentiment weighting of the present invention comprises the following steps:

[0007] Preparation stage:

[0008] 1. Text-speech bimodal word-level feature extraction

[0009] (1-1) Extracting speech modal word-level feature vectors: Mark the starting time point and ending time point of each word in a sentence. When reading the audio waveform, read the starting and ending time points of the words contained in the audio. The calculation formulas for the audio starting frame SFrm and ending frame EFrm are as follows:

[0010] t=N÷fs (1)

[0011] SFrm=ST÷t (2)

[0012] EFrm=ET÷t (3)

[0013] The t obtained by formula (1) is the audio frame length, which means the duration of a frame. N is the number of sampling points of an audio frame, fs is the audio sampling rate, ST is the start time of a word, and ET is the end time of the same word. Formulas (1)(2)(3) can be used to calculate the start frame SFrm and the end frame EFrm of this word, and then the accurate frame range occupied by each word in a sentence in the audio can be obtained. The words in all sentences in the data set are calculated, and the above steps are performed on all sentences in the data set to obtain the word-level audio data of all sentences in the data set. The audio waveform within the range corresponding to each word in a sentence is input into the Wav2vec2.0 pre-trained model to extract features and obtain the word-by-word feature vector in the sentence. For example, if a sentence contains M words, and the feature vector extracted by Wav2vec 2.0 is L1-dimensional, then this sentence will eventually obtain a feature matrix with a shape of L1×M, where each column of the matrix is ​​a speech modality word-level feature vector, the number of columns M is the number of words contained in the sentence, and the number of rows L1 is the length of the feature vector. The above operations are performed on all sentences in the dataset to obtain the speech modality word-level feature vector of the complete dataset and the speech modality feature matrix of each sentence.

[0014] (1-2) Extracting text modality word-level feature vectors: Text feature extraction uses word-level feature extraction. The sentence to be trained is input into the BERT pre-training model, and the word-level feature vector output by BERT is used as the word-by-word feature vector. For example, if a sentence contains M words, BERT outputs a feature matrix of shape L2×M, where each column of the matrix is ​​a text modality word-level feature vector, the number of columns M is the number of words contained in the sentence, and the number of rows L2 is the length of the feature vector. Perform the above operation on all sentences in the dataset to obtain the text modality word-level feature vector of the complete dataset and the text modality feature matrix of each sentence.

[0015] 2. Multimodal time alignment and word-level granularity multimodal fusion

[0016] (2-1) Multimodal time alignment: The word-level feature vectors of the speech modality and text modality obtained in steps (1-1) and (1-2) correspond to each other. Figure 2The speech modality word-level feature vector (box 1) and the text modality word-level feature vector (box 2) in the data set are concatenated to obtain the text-speech bimodal word-level feature vector, and then the text-speech bimodal word-level feature matrix of each sentence is obtained. A sentence containing M words obtains a speech modality word-level feature matrix of shape L1×M in step (1-1), and each column is the speech modality feature vector of a word. In step (1-2), a text modality word-level feature matrix of shape L2×M is obtained, and each column is the text modality feature vector of a word. The two feature matrices are concatenated to obtain a time-aligned speech-text bimodal word-level feature matrix of shape (L1+L2)×M, and each column of the matrix is ​​a time-aligned text-speech bimodal word-level feature vector. The feature matrices of all sentences in the data set are concatenated to obtain a time-aligned text-speech bimodal word-level feature matrix for each sentence ( Figure 2 Box 3).

[0017] (2-2) Configure the Transformer network: The Transformer network structure is as follows Figure 3 As shown, the network input is the time-aligned text-speech bimodal word-level feature matrix of shape L×M obtained in step (2-1), where L=L1+L2. The model network consists of S Transformer encoders, each with an input and output of L×M. The last encoder layer is connected to a linear layer. The linear layer inputs a feature matrix of shape L×M and outputs an L-dimensional feature vector, which is Figure 2 Sentence-level feature vector of the text-speech bimodal word-level interaction in Box 5.

[0018] 3. Word-by-word sentiment weighting and sentence-level granularity multimodal fusion

[0019] (3-1) Configure Bi-LSTM network: For the audio and text modalities, define two Bi-LSTM networks with the same structure (boxes 3 and 4 in Figure 4). The specific structure of the Bi-LSTM network is as follows: Figure 5As shown, the speech modality feature matrix with a shape of L1×M extracted in step (1-1) is input into the speech modality Bi-LSTM network, and the text modality feature matrix with a shape of L2×M extracted in step (1-2) is input into the text modality Bi-LSTM network. The feature matrices are respectively input into the encoders of the corresponding modality networks, and the number of RNN layers in the network is the set value. Dropout is performed on the output of the encoder, and neurons are randomly pruned with probability p, where p is a specific value. More than 10 training adjustments are performed during the subsequent network training process, and the probability p that makes the test set accuracy the highest is selected as the Dropout probability. The pruned data is input into the linear layer, and the output of the linear layer is the emotion probability of each predicted feature vector, which is used as the output of the Bi-LSTM network. For example, if a sentence contains M words and N emotions are predicted, the network output is an N×M emotion probability matrix, where each column of the matrix is ​​the predicted N emotion probability vector, the number of matrix columns M is the number of words contained in the sentence, and the number of matrix rows N is the number of predicted emotions.

[0020] (3-2) The speech modality feature matrix and the text modality feature matrix are respectively input into the Bi-LSTM network of the corresponding modality in step (3-1) for training, and the cross entropy loss function is used as the model loss calculation function. During the training process, the model is back-propagated according to the loss until the accuracy of the training set increases and the accuracy of the test set reaches the optimal value and no longer increases. The training is stopped when the accuracy of the training set increases. By training the two modalities separately, the text modality Bi-LSTM model (Figure 4 Box 3A, 3B) and the speech modality Bi-LSTM model (Figure 4 Box 4A, 4B) are obtained.

[0021] (3-3) Input the speech modality feature matrix into the speech modality Bi-LSTM model for inference, and obtain Figure 4B The speech modality word-by-word sentiment prediction probability matrix in Box 6. The text modality feature matrix is ​​input into the text modality Bi-LSTM model for inference, and we get Figure 4B The probability matrix of sentiment prediction for each word in the text modality in Box 5. The probability matrix obtained by the two modalities is as follows Figure 6 As shown in the figure, the number of columns M of the matrix is ​​the number of words in the predicted sentence, the number of rows N of the matrix is ​​the number of predicted emotions, and the columns of the matrix are composed of word-by-word emotion prediction probability vectors. Each element in each column of the matrix corresponds to the probability of a predicted emotion. The complete matrix indicates that this sentence contains M words, and each word contains the probability of N emotions. The two modes of each sentence in all the sentences in the data set are respectively passed through the Bi-LSTM model of the corresponding mode, and each sentence obtains a word-by-word emotion prediction probability matrix of the corresponding mode.

[0022] (3-4) In the present invention, the variance of each row of the word-by-word sentiment prediction probability vector in the word-by-word sentiment prediction probability matrix obtained in step (3-3) is used as a measure for evaluating the word-by-word sentiment content. The specific calculation formula of the variance is as follows:

[0023]

[0024] Formula (4) is used to calculate the average value of the predicted probability of a modal sentiment of a word: where each x in the numerator i is the predicted probability of each emotion in the same modality of a word, and a total of N emotions are predicted. Formula (5) is used to calculate the variance of the predicted probability of emotion in a modality of a word, is the average value of the same modality of the same word calculated in formula (4), S 2 is the emotion prediction probability variance of the word in this mode. All emotion prediction probability variances of the same mode in a sentence are combined into a set of emotion prediction probability variances. All variances in the set are normalized so that the sum of the variances of all words is equal to 1, and the weight of the emotion contained in each word in the corresponding mode in this sentence is obtained. The weights obtained for each mode are sorted according to the order of the corresponding words and formed into a vector of length M of emotion content weight, recorded as vector A. The emotion content weight vectors are calculated for the text and speech modes of all sentences in the dataset.

[0025] (3-5) Multiply the emotion content weight vector A obtained in step (3-4) by the feature matrix of the corresponding sentence in the same modality in steps (1-1) (1-2) to obtain the sentence-level feature vector of the sentence weighted by the word-by-word emotion content in one modality. For example, in the speech modality, a sentence has M words, the speech modality feature matrix is ​​B, the shape of matrix B is L1×M, matrix B has L1 rows and M columns, the emotion content weight vector is A, the shape of vector A is M×1, and vector A has M rows and 1 column. The feature vector C of this sentence weighted by emotion content is B×A, the shape of vector C is L1×1, and vector C has L1 rows and 1 column. The sentence-level feature vectors weighted by word-by-word emotion content are calculated for the text modality and speech modality of all the sentences in the dataset, and the results are obtained respectively. Figure 4B In blocks 9 and 10, the sentence-level feature vectors weighted by the word-by-word sentiment content of the speech mode and text mode of the same sentence are concatenated to obtain Figure 4B The L-dimensional text-speech bimodal sentence-level feature vector weighted by word-by-word sentiment content in box 11, L=L1+L2, where L1 is the length of the speech modality word-by-word feature vector, and L2 is the length of the text modality word-by-word feature vector.

[0026] 4. Multimodal and multi-granular sentiment analysis model training

[0027] (4-1) Fully connected network construction: The specific structure of the fully connected network is as follows: Figure 7 As shown, it contains two linear layers and one ReLU activation function. The L-dimensional text-speech bimodal word-level interaction sentence-level feature vector obtained in step (2-2) and the L-dimensional text-speech bimodal sentence-level feature vector weighted by word-by-word sentiment content obtained in step (3-5) are concatenated to obtain a 2L-dimensional multimodal sentence-level feature vector containing multi-granularity information as the input of the fully connected network ( Figure 7 Box 1), Figure 7 The input length of the linear layer in Box 2 is the length of the sentence-level feature vector containing multi-modal and multi-granular information, and the output length is the same as the input length. Figure 7 The output of the linear layer in box 2 is input into the Rectified Linear Unit (ReLU) activation function, and the ReLU output is input into Figure 7 The linear layer in box 3 has an input length of Figure 7 The same as box 2, the output length is the number of predicted emotions N. The network output emotion prediction probability vector is input into the softmax function:

[0028]

[0029] The Softmax function is shown in formula (6), α i (α j ) is the i(j)th element of the emotion prediction probability vector, and the position where the maximum value of the function output result is located is the number of the predicted emotion.

[0030] (4-2) Multi-network training: The networks involved in the training include the Transformer encoder and linear layer in the Transformer network configured in step (2-2) and the fully connected network configured in step (4-1). All data in the dataset are divided into training set and test set. The training set is used to train the networks involved in the training, and the test set is used to evaluate the network training. The network training loss function uses the cross entropy loss function, which is shown in formula (7):

[0031]

[0032] N is the length of the network output emotion prediction probability vector, that is, the number of predicted emotions, β i is the emotion numbered i in the emotion prediction probability vector, p(β i ) is the true probability of the emotion numbered i, expressed in one-hot form, q(β i) is the predicted probability of the emotion numbered i. The smaller the cross entropy H(p,q) value is, the better the prediction result is. According to the calculated Loss, reverse transmission is performed, and the fully connected network and the Transformer network are optimized in turn until the accuracy of the training set increases and the accuracy of the test set reaches the optimal value and no longer increases. The training is stopped, and a complete model network with multi-modal and multi-granularity sentiment analysis capabilities is obtained.

[0033] Prediction stage:

[0034] The complete model network with multimodal and multi-granularity sentiment analysis capabilities obtained through the above steps is the final result obtained by the method proposed in the present invention. A new sentence is subjected to steps (1-1)(1-2) to obtain a speech modality word-level feature matrix and a text modality word-level feature matrix, and a sentence-level feature vector of text-speech bimodal word-level interaction is obtained through steps (2-1)(2-2). A text-speech bimodal sentence-level feature vector weighted by word-by-word sentiment content is obtained through steps (3-3)(3-4)(3-5), and the predicted sentiment label is finally obtained through step (4-1).

[0035] Beneficial effects:

[0036] The multimodal sentiment analysis method based on word-level interaction and word-by-word sentiment weighting proposed in the present invention aims to perform sentiment recognition at two different granularity levels, namely, word-level features and sentence-level features. The present invention realizes obtaining two different sentence-level feature vectors. The sentence-level feature vector extracted by the multimodal time alignment and word-level granularity multimodal fusion parts contains the context information of each word in a single sentence, which is a multimodal sentence-level feature vector containing word-level granularity information. The sentence-level feature vector extracted by the word-by-word sentiment content weighting and sentence-level granularity multimodal fusion parts is a text-speech bimodal sentence-level feature vector weighted by word-by-word sentiment content. The sentence-level feature vector is calculated using the word-level feature vector by the weighted summation method, which is a sentence-level feature vector of multimodal sentence-level granularity information. Splicing sentence-level feature vectors of multiple granularity information can avoid losing the sentiment information contained in the sentence, obtain the relationship between the sentiment information contained in different granularities, and analyze the sentiment expressed by the sentence more comprehensively.

[0037] The weighted word-by-word sentiment content and sentence-level granularity multimodal fusion part of the present invention utilizes the variance of the sentiment probability of the model's inference result for the word feature vector as a standard for evaluating the sentiment content of the word, which can effectively improve the rationality of the calculation method from the word-level feature vector to the sentence-level feature vector. The weighted method of this part can reduce the sentiment guidance of words with low sentiment content on the complete sentence, and improve the sentiment guidance of words with high sentiment content on the complete sentence. Vocabulary with low sentiment content can be used as noise signals during the training process. The method proposed in the present invention can reduce the weight of noise signals in the sentence-level feature vector, while reducing the impact of noise on model training and reasoning, and increasing the weight of words with high sentiment content in the sentence-level feature vector. This part can improve the complementary ability between modalities during multimodal fusion, and reduce the negative impact of traditional noise data removal on modal complementary ability.

[0038] Compared with the existing methods, the present invention has the following advantages:

[0039] Traditional sentiment analysis methods use single granularity features as the standard for sentiment analysis, but different granularities contain different sentiment information, and using a single granularity will lead to loss of sentiment information. The expression of sentiment information is complex, and the sentiment expressed word by word is different from the sentiment expressed by the complete sentence, and at the same time has complementary capabilities. The multimodal sentence-level feature vector containing multi-granularity information proposed in the present invention contains both word-level sentiment information and sentence-level sentiment information, reducing the loss of sentiment information caused by granularity differences. The word-by-word sentiment content weighting and sentence-level granularity multimodal fusion method proposed in the present invention can reduce the weight of words with low sentiment content in the sentence-level feature vector and reduce the noise formed by useless data. In the traditional method, when calculating the sentence-level feature vector, it is necessary to average the word-level feature vector as the feature vector representing the sentence. In the process of calculating the average, the distinction between the feature vector of words with high sentiment content and the feature vector of words with low sentiment content will be reduced, thereby aggravating the influence of noise vocabulary on the characteristics of the entire sentence and reducing the ability of important words with high sentiment content to represent the characteristics of the complete sentence. The sentence-level feature vector with weighted word-by-word sentiment content processed by the method of the present invention solves the above-mentioned problem. The weight of noise words is low, and the weight of important words is high, thereby improving the accuracy of sentence-level feature vectors. This method can improve the ability of traditional methods to reduce inter-modal complementarity when removing noise data. Since different modalities express emotions differently, noise words in one modality cannot be determined as noise words in another modality. Therefore, splicing multiple modalities after weighting can avoid the reduction of inter-modal complementarity caused by directly removing noise words in a single modality. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 This is the complete process of the present invention and the operations performed in each part.

[0041] Figure 2 This is the specific operation process of the multimodal time alignment and word-level granularity multimodal fusion part of the present invention, as well as the input and output data of this part.

[0042] Figure 3 The specific structure of the Transformer network configured for the present invention and the input and output data of the network.

[0043] Figure 4A This is the complete process of the word-by-word sentiment content weighting and sentence-level granularity multimodal fusion of the present invention. Figure 4B Input and output data for this part.

[0044] Figure 5 The present invention provides the specific structure of the network and the input and output data in the step of configuring the Bi-LSTM network.

[0045] Figure 6 This is the specific shape of the output data of the two-modal Bi-LSTM network when calculating the probability matrix shape in the present invention.

[0046] Figure 7 It is the specific structure of the network and the specific input and output data in the step of configuring a fully connected network of the present invention. DETAILED DESCRIPTION

[0047] This example uses a dataset containing voice and text bimodal data as an example. The dataset contains 10 sentences, the number of predicted emotions is 4, and sentence K is a sentence in the dataset, containing two words. This example shows the complete process from dataset preparation to emotion prediction. Figure 1 For a complete process, including Figure 1 Specific examples of all box processes and all operations in it.

[0048] Preparation stage:

[0049] 1. Text-speech bimodal word-level feature extraction

[0050] (1-1) Extract the speech modality word-by-word feature vector: Segment the speech modality sentences in the dataset and mark the start and end frames of each word. For example, sentence K contains two words, the start time ST of the first word is the 0th second, the end time ET is the 2nd second, the audio sampling rate fs is 16000Hz, and the number of sampling points N in one audio frame is 1152. The audio frame length t is calculated to be 0.072 seconds by formula (1), and the start frame of this word is calculated to be the 0th frame and the end frame is the 28th frame by formula (2) and formula (3), respectively, and the frame range is 0 to 28 frames. Repeat the operations in formulas (1), (2), and (3) for all words in this sentence to obtain the frame range of all words in the sentence. Calculate the frame range of all 10 speech modality data in the dataset to obtain the word-level audio data of the complete dataset.

[0051] The data within the frame range of all words are input into the Wav2vec 2.0 pre-trained model to extract the speech modality word-by-word feature vector. Here, sentence K is taken as an example, and the processing of other sentences is exactly the same as that of this sentence. Sentence K contains two words, and the frame range of the first word is 0 to 28 frames. The data of frames 0 to 28 of the audio of this sentence are input into the Wav2vec2.0 pre-trained model, and the model output is a 512-dimensional feature vector. The data within the frame range of all words of this sentence are input into the Wav2Vec2.0 pre-trained model in sequence, and finally a speech modality feature matrix with a shape of 512×2 is obtained. Each column of the matrix is ​​a 512-dimensional speech modality word-by-word feature vector. There are 2 words in the sentence, and each word corresponds to a column of 512-dimensional speech modality word-level feature vectors. The same feature extraction operation is performed on the audio of all 10 sentences in the dataset, and finally all 10 audio matrices with a shape of 512×M are obtained. i The characteristic matrix, M i is the number of words in each sentence, i is the sentence number, and each speech modality word-level feature matrix is ​​composed of speech modality word-level feature vectors, that is, Figure 2 Box 1 and Box 2 of Figure 4 .

[0052] (1-2) Extracting text modality word-by-word feature vectors: Text modality feature extraction uses word-level feature extraction and uses BERT pre-training to implement word-level feature extraction. Take sentence K as an example. Sentence K contains two words. Sentence K is input into the BERT pre-training model and BERT's word-level feature vector is used as the output. Then, a text modality feature matrix with a shape of 768×2 can be obtained, where each column of the matrix is ​​a 768-dimensional text modality word-by-word feature vector. There are 2 words in sentence K, and each word corresponds to a 768-dimensional text modality word-by-word feature vector. Text modality word-level feature extraction is performed on all text modality data in the dataset, and a total of 768×M text modality feature vectors of all 10 text modality sentences are obtained. i The text modality feature matrix, Mi is the number of words in each sentence, and i is the sentence number. Each text modality feature matrix consists of the text modality word-by-word feature vectors, that is, Figure 2 Box 2 and Box 1 of Figure 4 .

[0053] 2. Multimodal time alignment and word-level granularity multimodal fusion

[0054] (2-1) Multimodal time alignment: Concatenate the word-level feature vectors of the same vocabulary obtained in step (1-1) and step (1-2) to obtain a text-speech bimodal word-level feature vector, and then obtain a text-speech bimodal word-level feature matrix for each sentence. Taking sentence K as an example, sentence K contains two words, then a speech modality feature matrix with a shape of 512×2 is obtained in step (1-1), and a text modality feature matrix with a shape of 768×2 is obtained in step (1-2), and each column of the matrix is ​​a word-level feature matrix of one modality. Concatenate the two matrices, that is, concatenate the word-level feature vectors of each column of the two matrices, to obtain a time-aligned text-speech bimodal word-level feature matrix with a shape of 1280×2, and each column of the matrix is ​​a 1280-dimensional time-aligned text-speech bimodal word-level feature matrix, which contains a total of 2 words. Extract features for all sentences in the data set using the same method as sentence K to obtain a time-aligned text-speech bimodal word-level feature matrix for each sentence ( Figure 2 Box 3).

[0055] (2-2) Configure the Transformer network: The Transformer network structure is as follows Figure 3 As shown, the network input is the time-aligned text-speech bimodal word-level feature matrix obtained in step (2-1). Taking sentence K as an example, the Transformer network input obtains a time-aligned text-speech bimodal word-level feature matrix with a shape of 1280×2 in step (2-1). The number of Transformer encoder layers is set to S=2, and the input and output of each encoder layer are both feature matrices with a shape of 1280×2. The linear layer input is a 1280×2 feature matrix, and the output is a 1280-dimensional feature vector, which is used as the output of the Transformer network. The network output is a sentence-level feature vector of text-speech bimodal word-level interaction ( Figure 2 Box 5).

[0056] 3. Word-by-word sentiment weighting and sentence-level granularity multimodal fusion

[0057] (3-1) Configure Bi-LSTM network: define two Bi-LSTM networks with the same structure for audio and text modalities respectively, such as Figure 5 As shown. The input of the speech modality network is L1×M i The speech modality feature matrix is ​​L1 and Mi Column, where M i is the number of words in a sentence, i is the sentence number, and L1 is the length of the word-by-word feature vector of the speech modality. The input of the text modality network is L2×M i The text modality feature matrix of i Column, where M i is the number of words in a sentence, i is the sentence number, and L2 is the length of the word-by-word feature vector of the text modality. Taking sentence K as an example, the processing of other sentences in the dataset is exactly the same as that of this sentence. Sentence K contains two words, so the speech modality feature matrix of sentence K input into the speech modality Bi-LSTM network is a 512-row, 2-column matrix with a shape of 512×2, and the text modality feature matrix input into the text modality Bi-LSTM network is a 768-row, 2-column matrix with a shape of 768×2. The number of RNNs in the Bi-LSTM encoder in the network is set to 2, and the number of hidden layers is set to 4. The encoder output data is subjected to the Dropout operation, and neurons are randomly pruned with a probability p equal to 0.4, so 40% of the data is replaced by 0 as the pruned part. The pruned data is input into the linear layer. The input feature size of this layer is 8, corresponding to twice the number of hidden layers of the Bi-LSTM, and the number of output features is 4, corresponding to the 4 predicted emotions.

[0058] (3-2) All sentences in the data set are divided into training set and test set in a ratio of 4:1. The speech modality feature matrix and text modality feature matrix in the training set are input into the corresponding modality Bi-LSTM network according to the method of sentence K in step (3-1), and the cross entropy loss function is used as the loss calculation function of the model. During the training process, the model is back-propagated according to the loss, and the accuracy of the training set and the test set are calculated respectively. The training is stopped until the accuracy of the training set increases and the accuracy of the test set reaches the optimal value and no longer increases. The speech modality data is trained to obtain the Bi-LSTM model corresponding to the speech modality, and the text modality data is trained to obtain the Bi-LSTM model corresponding to the text modality.

[0059] (3-3) Input the speech modality feature matrix and the text modality feature matrix into the corresponding modality Bi-LSTM model trained in step (3-2) for inference, and obtain the word-by-word sentiment prediction probability matrix of the two modalities. Input the speech modality feature matrix of sentence K with a shape of 512×2 into the Bi-LSTM network corresponding to the speech modality for inference, and obtain the speech modality word-by-word sentiment prediction probability matrix of shape 4×2, with 4 rows and 2 columns. Input the text modality feature matrix of sentence K with a shape of 768×2 into the Bi-LSTM network corresponding to the text modality for inference, and obtain the text modality word-by-word sentiment prediction probability matrix of shape 4×2, with 4 rows and 2 columns. In the word-by-word sentiment prediction probability matrix of each modality, each row is the sentiment prediction probability vector of the modality corresponding to a word in sentence K, and the number of columns is the number of words in sentence K. Perform the same operation as sentence K on all sentences in the dataset, and obtain a total of 10 word-by-word sentiment prediction probability matrices for each modality, each with a shape of 4×M i , M i is the number of words in the sentence, and i is the sentence number.

[0060] (3-4) Taking sentence K as an example, the emotion prediction probability vector of the speech mode obtained by the first word of sentence K in step (3-3) is (0.1, 0.1, 0.1, 0.7) T , then according to formula (4), the average value of the speech modality emotion prediction probability of this word is 0.25, and according to formula (5), the speech modality emotion prediction variance is 0.0675. The emotion prediction probability vector of the speech modality of the second word obtained in step (3-3) is (0.2, 0.2, 0.2, 0.4) T , then according to formula (4), the average value of the speech modality emotion prediction probability of this word is 0.25, and according to formula (5), the speech modality emotion prediction variance is 0.0075. Therefore, the vector of the emotion prediction probability variance of sentence K is (0.0675, 0.0075) T , after normalization, the speech modality emotion content weight vector is (0.9, 0.1) T , the weight of the first word is 0.9, the weight of the second word is 0.1, and the sum of the weights of all words is 1. The sentiment content weight vectors are calculated for the text and speech modes of all sentences in the dataset in the same way as sentence K, and a total of 10 sentiment content weight vectors are obtained for each mode, with a vector shape of M i ×1,M i The number of words in the sentence, i is the sentence number.

[0061] (3-5) Multiply the emotional content weight vector obtained in step (3-4) by the feature matrix of the corresponding modal sentence in steps (1-1) and (1-2) to obtain the sentence-level feature vector of the sentence with weighted emotional content word by word in each modality. Taking sentence K as an example, in step (1-1), the speech modality word-level feature matrix with a shape of 512×2 is obtained, denoted as B K , in step (3-4), the emotional content weight vector of the speech mode is (0.9, 0.1) T , then the sentence-level emotional feature vector weighted by the emotional content of sentence K in speech mode is B K ×(0.9,0.1) T , and a vector with a shape of 512×1 is obtained. Similarly, the sentence-level feature vector of the text modality word-by-word sentiment content weight of sentence K is the text modality word-by-word sentiment content weight vector multiplied by the text modality feature matrix with a shape of 768×2 in step (1-2), and a vector with a shape of 768×1 column is obtained. All data in the data set are weighted to obtain a sentence-level feature vector of 768-dimensional text modality word-by-word sentiment content weight and a sentence-level feature vector of 512-dimensional speech modality word-by-word sentiment content weight for all 10 sentences. The sentence-level feature vector of the speech modality word-by-word sentiment content weight of the same sentence and the sentence-level feature vector of the text modality word-by-word sentiment content weight are concatenated according to the order of speech modality first and text modality second, and finally a 1280-dimensional text-speech bimodal sentence-level feature vector with word-by-word sentiment content weight is obtained. For example, the sentence-level feature vector of sentence K obtained by weighting the word-by-word sentiment content of speech modality is a 512-dimensional vector, and the sentence-level feature vector of sentence K obtained by weighting the word-by-word sentiment content of text modality is a 768-dimensional vector. After concatenation, a 1280-dimensional text-speech bimodal sentence-level feature vector weighted by word-by-word sentiment content is obtained.

[0062] 4. Multimodal and multi-granular sentiment analysis model training

[0063] (4-1) Fully connected network construction: The specific structure of the fully connected network is as follows: Figure 7 As shown, the network input is a multi-modal sentence-level feature vector containing multi-granular information. Taking sentence K as an example, the 1280-dimensional text-speech bimodal word-level interaction sentence-level feature vector obtained in step (2-1) and the 1280-dimensional text-speech bimodal sentence-level feature vector weighted by word-by-word sentiment content obtained in step (3-5) are concatenated to obtain a 2560-dimensional multi-modal sentence-level feature vector containing multi-granular information as the input of the fully connected network ( Figure 7 Box 1). Figure 7 The linear layer of box 2 has a 2560-dimensional input and a 2560-dimensional feature vector as output. Figure 7 The linear layer output of box 2 is input into the ReLU activation function, and the ReLU output is input into Figure 7The linear layer of box 3 has a 2560-dimensional feature vector as input and a 4-dimensional feature vector as output. The network outputs the emotion prediction probability vector and inputs the softmax function of formula (6). The position where the maximum value of the function output is located is the number of the predicted emotion.

[0064] (4-2) Multi-network training: The networks involved in the training include the Transformer encoder and linear layer in the Transformer network configured in step (2-2) and the fully connected network configured in step (4-1). The 10 sentences in the data set are divided into training set and test set according to a 4:1 ratio, so the training set contains 8 sentences and the test set contains 2 sentences. The network uses the cross entropy loss function of formula (7) as the training loss function. The cross entropy loss is calculated for the predicted emotion number and the target emotion number obtained in step (4-1), and the fully connected network configured in step (4-1) and the Transformer network configured in step (2-2) are optimized according to the loss backpropagation until the accuracy of the training set increases and the accuracy of the test set reaches the optimal value and no longer increases. The training is stopped to obtain a trained fully connected network model.

[0065] Prediction stage:

[0066] In this example, for the new sentences that are not in the predicted data set, there are a total of 3 words and the number of predicted emotions is 4. Perform step (1-1) on the speech modality data to obtain a speech modality feature matrix with a shape of 512×3. Perform step (1-2) on the text modality data to obtain a text modality feature matrix with a shape of 768×3. Input the speech modality and text modality feature matrices into the Transformer network trained in steps (2-1) and (2-2) respectively to obtain the sentence-level feature vector of the text-speech bimodal word-level interaction. Input the speech modality and text modality feature matrices into the Bi-LSTM network of the corresponding modality in step (3-2) respectively to obtain a 4×3 word-by-word emotion prediction probability matrix for the speech modality and a 4×3 word-by-word emotion prediction probability matrix for the text modality. The matrix has 4 rows and 3 columns, and each column of the matrix is ​​an emotion prediction probability vector. The word-by-word sentiment prediction probability matrices of the two modalities are weighted in steps (3-4) and (3-5) respectively to obtain a 512-dimensional sentence-level feature vector of the speech modality weighted by the word-by-word sentiment content and a 768-dimensional sentence-level feature vector of the text modality weighted by the word-by-word sentiment content. The sentence-level feature vectors of the two modalities weighted by the word-by-word sentiment content are concatenated in step (3-5) to obtain a 1280-dimensional text-speech bimodal sentence-level feature vector weighted by the word-by-word sentiment content. A 2560-dimensional multimodal sentence-level feature vector containing multi-granularity information is obtained through step (4-1). This vector is input into the fully connected network trained in step (4-1) to obtain the predicted sentiment number.

Claims

1. A multimodal sentiment analysis method based on word-level interaction and word-by-word sentiment weighting, Features: Preparation stage: 1). Text-speech bimodal word-level feature extraction (1-1) Extracting speech modal word-level feature vectors: Mark the starting time point and ending time point of each word in a sentence. When reading the audio waveform, read the starting and ending time points of the words contained in the audio. The calculation formulas for the audio starting frame SFrm and ending frame EFrm are as follows: t=N÷fs (1) SFrm=ST÷t (2) EFrm=ET÷t (3) The t obtained by formula (1) is the audio frame length, which means the duration of a frame, N is the number of sampling points of an audio frame, fs is the audio sampling rate, ST is the start time of a word, and ET is the end time of the same word; the start frame SFrm and the end frame EFrm of the word are calculated by formula (1)(2)(3), and then the accurate frame range occupied by each word in a sentence in the audio is obtained; the words in all sentences in the data set are calculated, and the above steps are performed on all sentences in the data set to obtain the word-level audio data of all sentences in the data set; Input the audio waveform within the range corresponding to each word of a sentence into the Wav2vec 2.0 pre-trained model to extract features and obtain the word-by-word feature vector of the sentence; a sentence contains M words, and the feature vector extracted by Wav2vec 2.0 is L 1 dimension, then this statement finally gets a shape of L 1 ×M feature matrix, each column of the matrix is ​​a speech modal word-level feature vector, the number of columns M is the number of words contained in the sentence, and the number of rows L is 1 is the feature vector length; perform the above operation on all sentences in the data set to obtain the speech modality word-level feature vector of the complete data set and the speech modality feature matrix of each sentence; (1-2) Extracting word-level feature vectors of text modality: Text feature extraction uses word-level feature extraction; the trained sentence is input into the BERT pre-training model, and the word-level feature vector output by BERT is used as the word-by-word feature vector; a sentence contains M words, and the BERT output shape is L 2 ×M feature matrix, where each column of the matrix is ​​a text modal word-level feature vector, the number of columns M is the number of words contained in the sentence, and the number of rows L is 2 is the feature vector length; perform the above operation on all the sentences in the data set to obtain the text modality word-level feature vector of the complete data set and the text modality feature matrix of each sentence; 2) Multimodal time alignment and word-level granularity multimodal fusion (2-1) Multimodal time alignment: The speech modality and text modality word-level feature vectors obtained in steps (1-1) and (1-2) are concatenated to obtain a text-speech bimodal word-level feature vector, and then a text-speech bimodal word-level feature matrix is ​​obtained for each sentence; a sentence containing M words is obtained in step (1-1) with a shape of L 1 ×M speech modality word-level feature matrix, each column is a speech modality feature vector of a word, and the shape is L obtained in step (1-2) 2 ×M text modality word-level feature matrix, each column is a text modality feature vector of a word, and the two feature matrices are concatenated to obtain a shape of (L 1 +L 2 )×M time-aligned speech-text bimodal word-level feature matrix, each column of which is a time-aligned text-speech bimodal word-level feature vector; performing a text-speech bimodal concatenation operation on the feature matrices of all sentences in the data set to obtain a time-aligned text-speech bimodal word-level feature matrix for each sentence; (2-2) Configure the Transformer network: The network input is the time-aligned text-speech bimodal word-level feature matrix of shape L×M obtained in step (2-1), where L = L 1 +L 2 ; The model network consists of S Transformer encoders, each with an input and output of L×M. The last encoder layer is connected to a linear layer. The linear layer inputs a feature matrix of shape L×M and outputs an L-dimensional feature vector, which is a sentence-level feature vector of the bimodal word-level interaction of text and speech. 3). Word-by-word sentiment weighting and sentence-level granularity multimodal fusion (3-1) Configure Bi-LSTM network: define two Bi-LSTM networks with the same structure for audio and text modalities respectively, and transform the speech modal shape extracted in step (1-1) into L 1 The speech modality feature matrix of ×M is input into the speech modality Bi-LSTM network, and the text modality shape extracted in step (1-2) is L 2 ×M text modality feature matrix is ​​input into the text modality Bi-LSTM network; the feature matrix is ​​respectively passed into the encoder of the corresponding modality network, and the number of RNN layers in the network is the set value; the output of the encoder is Dropout, and neurons are randomly pruned with probability p. More than 10 training adjustments are performed in the subsequent network training process, and the probability p that makes the test set accuracy reach the highest is selected as the Dropout probability; the pruned data is input into the linear layer, and the linear layer outputs the emotion probabilities of the predicted feature vectors, which are used as the output of the Bi-LSTM network; a sentence contains M words, and N emotions are predicted, then the network output is an N×M emotion probability matrix, each column of the matrix is ​​the predicted N emotion probability vector, the number of matrix columns M is the number of words contained in the sentence, and the number of matrix rows N is the number of predicted emotions; (3-2) The speech modality feature matrix and the text modality feature matrix are respectively input into the Bi-LSTM network of the corresponding modality in step (3-1) for training, and the cross entropy loss function is used as the model loss calculation function; during the training process, the model is back-propagated according to the loss until the accuracy of the training set increases and the accuracy of the test set reaches the optimal value and no longer increases, and the training is stopped; by training the two modalities separately, a text modality Bi-LSTM model and a speech modality Bi-LSTM model are obtained; (3-3) Input the speech modality feature matrix into the speech modality Bi-LSTM model for inference to obtain the speech modality word-by-word emotion prediction probability matrix; input the text modality feature matrix into the text modality Bi-LSTM model for inference to obtain the text modality word-by-word emotion prediction probability matrix; the probability matrix shape obtained by the two modalities has the number of columns M representing the number of words in the predicted sentence, the number of rows N representing the number of predicted emotions, and the columns of the matrix are composed of word-by-word emotion prediction probability vectors. Each element in each column of the matrix corresponds to the probability of a predicted emotion. The complete matrix represents the probability of M words in this sentence and N emotions in each word; the two modalities of each sentence in all the sentences in the data set are respectively passed through the Bi-LSTM model of the corresponding modality, and each sentence obtains a word-by-word emotion prediction probability matrix of the corresponding modality; (3-4) The variance of each row of the word-by-word sentiment prediction probability vector in the word-by-word sentiment prediction probability matrix obtained in step (3-3) is used as a measure to evaluate the word-by-word sentiment content. The specific calculation formula of the variance is as follows: Formula (4) is used to calculate the average value of the predicted probability of a modal sentiment of a word: where each x in the numerator i is the predicted probability of each emotion in the same modality of a word, and a total of N emotions are predicted; Formula (5) is used to calculate the variance of the predicted emotion probability in a modality of a word, is the average value of the same modality of the same word calculated in formula (4), S 2 is the predicted probability variance of the sentiment of the word in this modality; All emotion prediction probability variances of the same modality in a sentence are combined into a set of emotion prediction probability variances. All variances in the set are normalized so that the sum of variances of all words is equal to 1, and the weights of the emotion contained in each word in the corresponding modality in this sentence are obtained; the weights obtained for each modality are sorted according to the order of the corresponding words and formed into a vector of length M of emotion content weight, recorded as vector A; the emotion content weight vectors are calculated for the text and speech modalities of all sentences in the data set respectively; (3-5) Multiply the emotional content weight vector A obtained in step (3-4) by the feature matrix of the sentence with the same modality in steps (1-1) and (1-2) to obtain the sentence-level feature vector of the sentence with the weighted word-by-word emotional content in one modality; in the speech modality, a sentence has M words, the speech modality feature matrix is ​​B, and the shape of matrix B is L 1 ×M, matrix B has L 1 The emotional content weight vector is A, the shape of vector A is M×1, and vector A has M rows and 1 column; the feature vector C of this sentence weighted by emotional content is B×A, and the shape of vector C is L 1 ×1, vector C has L 1 Row 1 column; Calculate the sentence-level feature vectors weighted by word-by-word sentiment content for the text mode and speech mode of all sentences in the data set, concatenate the sentence-level feature vectors weighted by word-by-word sentiment content of the speech mode and text mode of the same sentence, and finally obtain the L-dimensional text-speech bimodal sentence-level feature vector weighted by word-by-word sentiment content, L = L 1 +L 2 , where L 1 is the length of the speech modality word-by-word feature vector, L 2 is the length of the word-by-word feature vector of the text modality; 4). Multimodal and multi-granular sentiment analysis model training (4-1) Construction of a fully connected network: The fully connected network contains two linear layers and one ReLU activation function. The L-dimensional text-speech bimodal word-level interaction sentence-level feature vector obtained in step (2-2) and the L-dimensional text-speech bimodal sentence-level feature vector weighted by word-by-word sentiment content obtained in step (3-5) are concatenated to obtain a 2L-dimensional multimodal sentence-level feature vector containing multi-granularity information as the input of the fully connected network. The input length of the linear layer is the length of the multimodal sentence-level feature vector containing multi-granularity information, and the output length is the same as the input length. The output result of the linear layer is input into the linear rectified unit activation function, and the ReLU output result is input into the linear layer. The output length is the number of predicted emotions N. The network output sentiment prediction probability vector is input into the softmax function: The Softmax function is shown in formula (6), a i or α j is the i-th or j-th element of the emotion prediction probability vector, and the position where the maximum value of the function output result is located is the number of the predicted emotion; (4-2) Multi-network training: The networks involved in the training include the Transformer encoder and linear layer in the Transformer network configured in step (2-2) and the fully connected network configured in step (4-1); all the data in the dataset are divided into a training set and a test set. The training set is used to train the networks involved in the training, and the test set is used to evaluate the network training situation; the network training loss function uses the cross entropy loss function, and the cross entropy loss function is shown in formula (7): N is the length of the network output emotion prediction probability vector, that is, the number of predicted emotions, β i is the emotion numbered i in the emotion prediction probability vector, p(β i ) is the true probability of the emotion numbered i, expressed in one-hot form, q(β i ) is the predicted probability of the emotion numbered i. The smaller the cross entropy H(p,q) value is, the better the prediction result is. According to the calculated Loss, reverse transmission is performed, and the fully connected network and the Transformer network are optimized in turn until the accuracy of the training set increases and the accuracy of the test set reaches the optimal value and no longer increases. The training is stopped, and a complete model network with multi-modal and multi-granularity emotion analysis capabilities is obtained. Prediction stage: The complete model network with multimodal and multi-granularity sentiment analysis capabilities obtained through the above steps is used to obtain a new sentence through steps (1-1)(1-2) to obtain the speech modality word-level feature matrix and the text modality word-level feature matrix, and through steps (2-1)(2-2) to obtain the sentence-level feature vector of the text-speech bimodal word-level interaction, and through steps (3-3)(3-4)(3-5) to obtain the text-speech bimodal sentence-level feature vector weighted by the word-by-word sentiment content, and finally the predicted sentiment label is obtained through step (4-1).

Citation Information

Patent Citations

  • Financial report emotion analysis method and device based on deep learning and terminal

    CN112307760A

  • Multi-level fusion multi-mode emotion recognition method and system based on Wav2vec2.0 and BERT

    CN115223585A

  • Bi-LSTM-CNN-based multi-modal speech emotion recognition method

    CN116226372A

  • Multi-modal emotion recognition method and system

    CN116682463A

  • Conversation sentiment analysis method and apparatus, and computer-readable storage medium

    WO2023078370A1

Cited By

  • Cognitive diagnosis method and model based on emotional state

    CN121148609A