A sentiment analysis method, system and device based on cross-modal automatic alignment and pre-trained language model

Through cross-modal automatic alignment and pre-training language models, the problem of high cost of manual alignment annotation in multi-modal sentiment analysis is solved, automatic alignment and efficient sentiment analysis are achieved, which is suitable for large-scale data volume scenarios and can be used in large-scale data volume scenarios. It shows excellent classification performance on public data sets.

CN113704552BActive Publication Date: 2024-09-24HARBIN INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111012714.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-31
Publication Date
2024-09-24
Estimated Expiration
2041-08-31

AI Technical Summary

Technical Problem

Existing multi-modal sentiment analysis technology requires manual alignment and annotation of each modal sequence, resulting in high manpower and time costs, making it difficult to apply to large-scale data volumes, affecting practicality.

Method used

Using a method based on cross-modal automatic alignment and pre-trained language models, emotional prediction is achieved by extracting emotional features of audio and visual modalities, using the pre-trained BERT model for automatic alignment, and modifying the word vector sequence through adaptive gate functions. .

Benefits of technology

It does not require manual alignment annotation, is suitable for multi-modal sequence scenarios with large amounts of data, significantly improves practicality, and has better classification performance on public data sets than baseline systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113704552B
    Figure CN113704552B
Patent Text Reader

Abstract

A sentiment analysis method, system and device based on cross-modal automatic alignment and pre-trained language model, which belongs to the field of multimodal perception technology of machines. The present invention solves the problem that existing sentiment analysis technology requires manual alignment and annotation of each modal sequence. The present invention improves the existing multimodal sentiment analysis method of large-scale pre-trained language model, so that the method of the present invention does not require manual alignment and annotation, and is therefore suitable for the current scenarios of large-scale data volume and unaligned multimodal sequence scenarios, greatly improving its practicality. Moreover, the method proposed in the present invention is verified on the two most commonly used data sets of multimodal sentiment analysis, and the results show that its classification performance is greatly improved compared with the baseline system. The present invention can be applied to sentiment analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of multimodal perception of machines, and specifically relates to a sentiment analysis method, system and device based on cross-modal automatic alignment and pre-trained language model. Background Art

[0002] Multimodal sentiment analysis refers to the process of analyzing and processing speech, text, and facial expressions from video files to identify the emotional tendencies of people in the video. Multimodal sentiment analysis has broad application prospects in human-computer interaction, health care, and product recommendations. Due to the inherent sampling rate differences of each modality and the different lengths of semantic primitives in each modality, the sequences of each modality cannot usually be aligned one by one in chronological order.

[0003] Existing sentiment analysis technologies that use large-scale text pre-training models are all based on manual alignment and annotation. However, manual alignment and annotation requires a lot of manpower and time costs, which makes existing technologies difficult to apply to current large-scale data situations and also affects the practicality of existing technologies. Summary of the invention

[0004] The purpose of the present invention is to solve the problem that the existing sentiment analysis technology requires manual alignment and annotation of each modal sequence, and proposes a sentiment analysis method, system and device based on cross-modal automatic alignment and pre-trained language model.

[0005] The technical solution adopted by the present invention to solve the above technical problems is:

[0006] A sentiment analysis method based on cross-modal automatic alignment and pre-trained language model, the method specifically comprising the following steps:

[0007] Step 1: Extract audio modality emotion features from the input video;

[0008] use represents the emotional features of the i-th frame audio, The emotional features of each frame of audio extracted are represented as an audio emotional feature sequence T a Represents the length of the audio sequence, represents the field of real numbers;

[0009] Extract visual modality emotion features from input videos;

[0010] use represents the emotional features of the j-th frame image, The emotional features of each frame image extracted are represented as a visual emotional feature sequence T v is the number of image frames;

[0011] Step 2: Use the pre-trained BERT model to extract the word vector sequence of the input video, and automatically align the extracted word vector sequence with the audio emotion feature sequence and the visual emotion feature sequence;

[0012] Step 3: Correct the word vector sequence

[0013] Use the adaptive gate function and the automatic alignment result of step 2 to correct the word vector sequence to obtain the corrected word vector sequence;

[0014] Step 4: Sentiment Prediction

[0015] The corrected word vector sequence is used as the input of the second layer of the pre-trained BERT model. The corrected word vector sequence passes through the subsequent structure of the pre-trained BERT model in turn to obtain the emotional tendency of the input video.

[0016] A sentiment analysis system based on cross-modal automatic alignment and pre-trained language model, wherein the system is used to perform a sentiment analysis method based on cross-modal automatic alignment and pre-trained language model.

[0017] A device comprises a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement a sentiment analysis method based on cross-modal automatic alignment and a pre-trained language model.

[0018] The beneficial effect of the present invention is that the present invention improves the existing multimodal sentiment analysis method of large-scale pre-trained language models, so that the method of the present invention does not require manual alignment and annotation, and is therefore suitable for the current large-scale data volume and unaligned multimodal sequence scenarios, greatly improving its practicality.

[0019] Moreover, the method proposed in the present invention is verified on two of the most commonly used public multimodal sentiment analysis datasets, and the results show that its classification performance is greatly improved compared with the baseline system. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 Schematic diagram of word vector offset;

[0021] Non-linguistic behavior will affect the semantics of words, causing the position of the word vector in the semantic space to change. The new word vector is equal to the old word vector plus a displacement vector obtained by non-linguistic information.

[0022] Figure 2 A flowchart of a sentiment analysis method based on automatic alignment and large-scale pre-trained language model of the present invention;

[0023] Among them, ×12 means that the module on the left is stacked 12 times;

[0024] Figure 3 for Figure 2 Schematic diagram of the detailed configuration of the encoder layer;

[0025] Figure 4 Schematic diagram of the cross-modal automatic alignment method. DETAILED DESCRIPTION

[0026] Specific implementation method 1. Combination Figure 2 and Figure 3 The present embodiment is described in the present embodiment. A sentiment analysis method based on cross-modal automatic alignment and pre-trained language model is described. Assuming that in the data set, the input video contains three modes: language, audio, and vision, i.e., the "multi-modality" of the present invention, the method specifically includes the following steps:

[0027] Step 1: Extract audio modality emotion features from the input video;

[0028] use represents the emotional features of the i-th frame audio, The emotional features of each frame of audio extracted are represented as an audio emotional feature sequence T a Represents the length of the audio sequence, represents the field of real numbers;

[0029] Extract visual modality emotion features from input videos;

[0030] use represents the emotional features of the j-th frame image, The emotional features of each frame image extracted are represented as a visual emotional feature sequence T v is the number of image frames;

[0031] Step 2: Use the pre-trained BERT model to extract the high-order word vector sequence of the input video, and automatically align the extracted word vector sequence with the audio emotion feature sequence and the visual emotion feature sequence;

[0032] Step 3: Correct the word vector sequence

[0033] Use the adaptive gate function and the automatic alignment result of step 2 to correct the word vector sequence to obtain the corrected word vector sequence;

[0034] Step 4: Sentiment Prediction

[0035] The corrected word vector sequence is used as the input of the second layer of the pre-trained BERT model. The corrected word vector sequence passes through the subsequent structure of the pre-trained BERT model in turn to obtain the emotional tendency of the input video.

[0036] After obtaining the corrected word vector w k ′After that, in order to obtain the emotional tendency of the entire video, the modified word vector w k ′ is input into the subsequent pre-training model and passed through the classifier to obtain the emotional tendency of the video.

[0037]

[0038] Among them, y represents the emotion category of the input video.

[0039] Specific implementation method 2: This implementation method is different from specific implementation method 1 in that the audio modality emotion features are extracted using the COVAREP toolkit.

[0040] The other steps and parameters are the same as those in the first embodiment.

[0041] Specific implementation method three: This implementation method is different from specific implementation methods one or two in that the visual modality emotion features are extracted using the Facet library.

[0042] The other steps and parameters are the same as those in the first or second embodiment.

[0043] Specific implementation method four: This implementation method is different from any one of specific implementation methods one to three in that the emotional characteristics of the audio are a vector formed by Mel-Frequency Cepstral Coefficients (MFCC), pitch parameters (Pitch), glottal parameters, peak slope parameters and maximum dispersion quotient parameters.

[0044] The emotional features of each frame of audio extracted by the present invention are 74-dimensional features.

[0045] The other steps and parameters are the same as those in Specific Embodiments 1 to 3.

[0046] Specific implementation method five: This implementation method is different from any one of specific implementation methods one to four in that the emotional features of the image are vectors formed by facial motion unit parameters, facial feature point parameters, head posture parameters and line of sight tracking parameters.

[0047] The emotional features of each frame of image extracted by the present invention are all 35-dimensional features.

[0048] The other steps and parameters are the same as those in Specific Embodiments 1 to 4.

[0049] Specific implementation method six: Combination Figure 4 This embodiment is different from the first to fifth embodiments in that the specific process of step 2 is as follows:

[0050] The first layer output of the pre-trained BERT model is used as the word vector sequence of the input video Among them, w k Represents the kth word vector in the sequence, T l Represents the length of the word vector sequence;

[0051]

[0052] in, represents the index of the kth word in the dictionary, represents a natural number, is the obtained high-order word vector, and d is the word vector dimension;

[0053] Audio emotion feature sequence Map to the semantic space where the word vector sequence is located to obtain the mapped feature sequence

[0054]

[0055] Among them, f a (·) is the audio emotion feature sequence The corresponding mapping function is, for The corresponding mapped sentiment features;

[0056] Calculate the word vector w separately k Mapped emotional features corresponding to each frame of audio The semantic similarity is calculated, and then the calculated semantic similarity is normalized, and the obtained normalized result is used as the weight of the corresponding frame audio emotional feature;

[0057] The emotional features of each frame of audio extracted are weighted and summed according to the weights to obtain the word vector w k Corresponding audio emotion features

[0058]

[0059] in, Represents the weight of the emotional feature of the first frame of audio, that is, the word vector w k Mapped emotional features corresponding to the first frame of audio The normalized processing result corresponding to the semantic similarity of ;

[0060] Spanning the entire time range, we can obtain the word vector sequence Aligned audio emotion feature sequences

[0061] Visual emotion feature sequence Map to the semantic space where the word vector sequence is located to obtain the mapped feature sequence

[0062]

[0063] Among them, f v (·) is the feature sequence The corresponding mapping function is, for The corresponding mapped sentiment features;

[0064] Calculate the word vector w separately k Mapped emotional features corresponding to each frame image The semantic similarity is calculated, and then the calculated semantic similarity is normalized, and the obtained normalized result is used as the weight of the emotional feature of the corresponding frame image;

[0065] The emotional features of each frame image extracted are weighted and summed according to the weights to obtain the word vector w k Corresponding visual emotion features

[0066]

[0067] in, Represents the weight of the emotional feature of the first frame of the image, that is, the word vector w k Mapped emotional features corresponding to the first frame image The normalized processing result corresponding to the semantic similarity of ;

[0068] Spanning the entire time range, we can obtain the word vector sequence Aligned visual sentiment feature sequences

[0069] Will As the result of automatic alignment of word vector sequence, audio emotion feature sequence and visual emotion feature sequence.

[0070] This implementation can capture the long-term dependencies between cross-modal elements and help obtain a more comprehensive and accurate alignment representation for unaligned multimodal sequences.

[0071] The other steps and parameters are the same as those in Specific Implementation Methods 1 to 5.

[0072] Specific implementation method seven: This implementation method is different from any one of specific implementation methods one to six in that the normalization process of the calculated semantic similarity is performed through a softmax function.

[0073] The other steps and parameters are the same as those in Specific Embodiments 1 to 6.

[0074] Specific implementation method eight: Combination Figure 1 This embodiment is different from the first to seventh embodiments in that the specific process of step 3 is as follows:

[0075] Will and Through the adaptive gate function, we get the word vector w k The corresponding displacement vector h k ;

[0076]

[0077] Where h(·) is the adaptive gate function;

[0078] According to the displacement vector h k For word vector w k Make corrections to obtain the corrected word vector w k ′:

[0079] w′ k =w k +αh k (7)

[0080] Among them, α is a hyperparameter, α≤1;

[0081] Similarly, each word vector in the word vector sequence is processed to obtain the corrected word vector corresponding to each word vector in the word vector sequence.

[0082] The basic semantics of each word is determined by its position in the semantic space. In the absence of other modalities, all word vectors are located on the language manifold. But in fact, non-language behavior will affect the semantics of the word, causing the position of the word vector in the semantic space to change. The new position vector obtained is the sum of the original position vector and the displacement vector obtained by non-language information. Modeling such a process can obtain a more refined word representation that incorporates non-language information, which in turn helps the final sentiment prediction.

[0083] The other steps and parameters are the same as those in Specific Embodiments 1 to 7.

[0084] Specific implementation method nine: This implementation method is a sentiment analysis system based on cross-modal automatic alignment and pre-trained language model, and the system is used to perform a sentiment analysis method based on cross-modal automatic alignment and pre-trained language model.

[0085] Specific implementation ten: This implementation is a device, which includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement a sentiment analysis method based on cross-modal automatic alignment and a pre-trained language model.

[0086] To verify the effectiveness of the method proposed in the present invention, it is verified on the two most commonly used datasets currently disclosed, CMU-MOSI and CMU-MOSEI. As shown in Table 1, the method proposed in the present invention is superior to the results of the baseline system under all metric criteria of the two datasets. Therefore, the experimental results fully verify the effectiveness of the method of the present invention.

[0087] Table 1 Comparison of classification performance between the proposed method and the baseline system on public datasets

[0088]

[0089] The above calculation examples of the present invention are only used to explain the calculation model and calculation process of the present invention in detail, and are not intended to limit the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the scope of protection of the present invention.

Claims

1. A sentiment analysis method based on cross-modal automatic alignment and pre-trained language model, characterized in that: The method specifically comprises the following steps: Step 1: Extract audio modality emotion features from the input video; use represents the emotional features of the i-th frame audio, The emotional features of each frame of audio extracted are represented as an audio emotional feature sequence T a Represents the length of the audio sequence, represents the field of real numbers; Extract visual modality emotion features from input videos; use represents the emotional features of the j-th frame image, The emotional features of each frame image extracted are represented as a visual emotional feature sequence T v is the number of image frames; Step 2: Use the pre-trained BERT model to extract the word vector sequence of the input video, and automatically align the extracted word vector sequence with the audio emotion feature sequence and the visual emotion feature sequence; The specific process of step 2 is: The first layer output of the pre-trained BERT model is used as the word vector sequence of the input video Among them, w k represents the kth word vector in the sequence, T l Represents the length of the word vector sequence; Audio emotion feature sequence Map to the semantic space where the word vector sequence is located to obtain the mapped feature sequence Among them, f a (·) is the audio emotion feature sequence The corresponding mapping function is, for The corresponding mapped sentiment features; Calculate the word vector w separately k Mapped emotional features corresponding to each frame of audio The semantic similarity is calculated, and then the calculated semantic similarity is normalized, and the obtained normalized result is used as the weight of the corresponding frame audio emotional feature; The emotional features of each frame of audio extracted are weighted and summed according to the weights to obtain the word vector w k Corresponding audio emotion features in, Represents the weight of the emotional feature of the first frame of audio; Then we get the word vector sequence Aligned audio emotion feature sequences Visual emotion feature sequence Map to the semantic space where the word vector sequence is located to obtain the mapped feature sequence Among them, f v (·) is the feature sequence The corresponding mapping function is, for The corresponding mapped sentiment features; Calculate the word vector w separately k Mapped emotional features corresponding to each frame image The semantic similarity is calculated, and then the calculated semantic similarity is normalized, and the obtained normalized result is used as the weight of the emotional feature of the corresponding frame image; The emotional features of each frame image extracted are weighted and summed according to the weights to obtain the word vector w k Corresponding visual emotion features in, Represents the weight of the emotional feature of the first frame image; Then we get the word vector sequence Aligned visual sentiment feature sequences Will As the result of automatic alignment between word vector sequence, audio emotion feature sequence, and visual emotion feature sequence; Step 3: Correct the word vector sequence Use the adaptive gate function and the automatic alignment result of step 2 to correct the word vector sequence to obtain the corrected word vector sequence; Step 4: Sentiment Prediction The corrected word vector sequence is used as the input of the second layer of the pre-trained BERT model. The corrected word vector sequence passes through the subsequent structure of the pre-trained BERT model in turn to obtain the emotional tendency of the input video.

2. The sentiment analysis method based on cross-modal automatic alignment and pre-trained language model according to claim 1, characterized in that: The audio modality emotion features are extracted using the COVAREP toolkit.

3. The sentiment analysis method based on cross-modal automatic alignment and pre-trained language model according to claim 2, characterized in that: The visual modality emotion features are extracted using the Facet library.

4. The sentiment analysis method based on cross-modal automatic alignment and pre-trained language model according to claim 3, characterized in that: The emotional feature of the audio is a vector formed by Mel-frequency cepstral coefficients, pitch parameters, glottal parameters, peak slope parameters and maximum dispersion quotient parameters.

5. The sentiment analysis method based on cross-modal automatic alignment and pre-trained language model according to claim 4, characterized in that: The emotional feature of the image is a vector formed by facial motion unit parameters, facial feature point parameters, head posture parameters and gaze tracking parameters.

6. The sentiment analysis method based on cross-modal automatic alignment and pre-trained language model according to claim 5, characterized in that: The normalization process of the calculated semantic similarity is performed through a softmax function.

7. The sentiment analysis method based on cross-modal automatic alignment and pre-trained language model according to claim 6, characterized in that: The specific process of step 3 is as follows: Will and Through the adaptive gate function, we get the word vector w k The corresponding displacement vector h k ; Where h(·) is the adaptive gate function; According to the displacement vector h k For word vector w k Make corrections to obtain the corrected word vector w k ′: In' k =in k +αh k (7) Among them, α is a hyperparameter, α≤1; Similarly, each word vector in the word vector sequence is processed to obtain the corrected word vector corresponding to each word vector in the word vector sequence.

8. A sentiment analysis system based on cross-modal automatic alignment and pre-trained language model, characterized in that: The system is used to execute a sentiment analysis method based on cross-modal automatic alignment and pre-trained language model as described in one of claims 1 to 7.