Emotion analysis method and system based on multi-modal feature fusion and SVM classification

By combining BERT, TF-IDF, and Word2Vec models for multimodal feature fusion and using support vector machines for sentiment classification, this approach addresses the shortcomings of existing sentiment analysis methods in terms of accuracy in complex texts and multi-category sentiment classification, achieving efficient and accurate sentiment analysis.

CN119312813AInactive Publication Date: 2025-01-14HUAQIAO UNIVERSITY

Patent Information

Application Number
CN202411837843.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-01-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing sentiment analysis methods are not accurate enough when dealing with complex texts and multi-category sentiment classification, and they consume a lot of computational resources, especially when the data is imbalanced.

Method used

A sentiment analysis method based on multimodal feature fusion and support vector machine (SVM) classification is adopted. By constructing a data preprocessing module, a feature extraction module, and a classification module, feature extraction is performed by combining BERT, TF-IDF and Word2Vec models, and sentiment classification is performed by using support vector machine.

Benefits of technology

It significantly improves the accuracy and robustness of sentiment analysis, especially in sentiment classification tasks involving long texts and semantically complex data. It can better capture the deep semantic information of the text, adapt to different categories of data, and maintain high accuracy and recall.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119312813A_ABST
    Figure CN119312813A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of natural language processing, and discloses an emotion analysis method and system based on multi-modal feature fusion and SVM classification, and the method comprises the steps: constructing a data preprocessing module, a feature extraction module and a classification module; the data preprocessing module is used for preprocessing a to-be-tested text to obtain model input data meeting input requirements; the feature extraction module performs feature extraction and fusion on model input data by adopting multiple methods to obtain multi-modal fusion features; training a support vector machine model by using the multi-modal fusion features to perform an emotion classification task to obtain a classification module; an emotion analysis model is constructed based on the data preprocessing module, the feature extraction module and the classification module, and emotion analysis of the to-be-tested text is achieved. According to the method, a plurality of feature extraction methods are fused, so that all-around representation of text emotion is realized; and the SVM is adopted as a classifier, so that the classification precision of sentiment analysis is effectively improved, and the performance is excellent when large-scale and multi-category data is processed.
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 sentiment analysis method and system based on multimodal feature fusion and SVM classification. Background Art

[0002] In the current field of natural language processing (NLP), sentiment analysis, as an important research direction, has made significant progress. Traditional sentiment analysis methods mainly rely on dictionary-based sentiment vocabulary and simple machine learning models such as Naive Bayes and Support Vector Machine (SVM). These methods usually use TF-IDF (term frequency-inverse document frequency) as a feature extraction method to evaluate the importance of vocabulary by counting word frequency. However, these methods have limitations in processing complex semantics and long texts, especially for multi-category sentiment classification and large-scale data sets.

[0003] With the development of deep learning technology, word embedding technologies such as Word2Vec and GloVe (global vector representation) have been introduced into sentiment analysis. These methods generate word vectors through contextual information and can capture the semantic relationship between words. Although Word2Vec and GloVe have improved the quality of feature representation to a certain extent, they still face the problem of being unable to handle long-distance dependencies and complex semantic relationships.

[0004] In recent years, the emergence of pre-trained language models such as BERT (Bidirectional Encoder Representations from Transformers) has significantly improved this deficiency. BERT captures contextual information through a bidirectional encoder, can handle complex sentence structures and long-distance dependencies, and significantly improves semantic understanding capabilities. However, BERT consumes a lot of computing resources and may not be suitable for resource-constrained environments. In addition, there is a data imbalance problem in sentiment analysis tasks, and the number of samples in some sentiment categories is far less than that of other categories, which further affects the classification performance of the model. Existing solutions include data augmentation and resampling, but these methods have limited effects in specific application scenarios.

[0005] In summary, existing sentiment analysis technologies still face challenges in processing complex texts and multi-category sentiment classification. In order to solve these problems, combining different feature extraction methods with advanced classification models becomes the key to improving sentiment analysis performance. Summary of the invention

[0006] The purpose of the present invention is to solve the problems in the prior art.

[0007] The technical solution adopted by the present invention to solve the technical problem is: to provide a sentiment analysis method based on multimodal feature fusion and SVM classification, comprising the following steps:

[0008] The data preprocessing module, feature extraction module and classification module are constructed respectively; the data preprocessing module preprocesses the text to be tested to obtain the model input data that meets the input requirements; the feature extraction module uses a variety of methods to extract and fuse the features of the model input data to obtain multimodal fusion features; the classification module is obtained by training the support vector machine model using the multimodal fusion features to perform sentiment classification tasks, and the trained support vector machine model is used as the classification module;

[0009] Connect the data preprocessing module, feature extraction module and classification module in sequence to build a sentiment analysis model;

[0010] Use the sentiment analysis model to perform sentiment analysis on the text to be tested.

[0011] Preferably, the pretreatment comprises:

[0012] Data cleaning, removing noise information from the original text, including HTML tags, special symbols and URL links;

[0013] Word segmentation: Split the cleaned text into independent words using a word segmentation tool, which includes a dictionary-based forward maximum matching algorithm, a hidden Markov model, or a word segmenter provided by BERT;

[0014] Preferably, the feature extraction module uses a BERT model, a TF-IDF model and a Word2Vec model to extract features from the model input data respectively, and obtains feature vectors of three modalities; and fuses the feature vectors of the three modalities to obtain multimodal fusion features.

[0015] Preferably, the BERT model captures the semantics of words in context through a pre-trained bidirectional Transformer structure and generates a feature vector for each word. ;

[0016] The pre-training is performed by predicting The true value is used to train the model, expressed as: ;

[0017] The feature vector The generation process is as follows: the BERT model consists of multiple transformer layers connected in sequence. Each transformer layer uses a self-attention mechanism to calculate the context representation of each word, and then passes the context representation to a fully connected feedforward neural network, and is processed by an activation function, and then layer normalization is performed to finally generate a set of word vectors, which are input to the next transformer layer. The output of the last transformer layer is used as the final feature vector .

[0018] Preferably, the TF-IDF model calculates the frequency of each word in the document as a feature vector, expressed as:

[0019] ;

[0020] ;

[0021] ;

[0022] in, Expressive words In the documentation The number of occurrences in Represents the total number of words in document d; is the total number of document collections, Indicates that it contains words The number of documents; log represents the logarithmic function.

[0023] Preferably, the Word2Vec model obtains a context representation by averaging the vectors of multiple words in the context, and then uses the context representation to predict the central word, specifically comprising the following steps:

[0024] Given a central word and its context words , where k is the window size, first all the context words in the window Sum and average to get a context vector ,in It is a representation of context;

[0025] Use this context vector To predict the central word , the goal of prediction is to find a word Maximize the dot product between the average vector of the context words and the word vector of the center word, and calculate the The predicted probability of: ,in Yes word The word vector of It's a vocabulary.

[0026] Preferably, the fusion of the feature vectors of the three modes to obtain the multimodal fusion feature adopts splicing fusion or weighted fusion;

[0027] The multimodal fusion features obtained by splicing and fusion are expressed as:

[0028] ;

[0029] The multimodal fusion feature obtained by weighted fusion is expressed as:

[0030] ;

[0031] in, Refers to the feature vector generated by the BERT model , the dimension is ; Refers to the feature vector generated by the TF-IDF method , the dimension is ; Refers to the feature vector generated by the Word2Vec method , the dimension is ; , and All are weighted and satisfy .

[0032] Preferably, the classification module is obtained by training a support vector machine model using multimodal fusion features to perform sentiment classification tasks, and the training includes adjusting the penalty parameter Optimization and kernel function parameters Optimization;

[0033] The optimization adopts a method of cross-validation combined with grid search, specifically: in the parameter search process, the model performance under each group of parameter combinations is evaluated through K-fold cross-validation, and the parameter combination with the best model performance is selected; the indicators for evaluating model performance include accuracy, recall rate and F1-score.

[0034] Preferably, the sentiment analysis of the text to be tested using the sentiment analysis model comprises the following steps:

[0035] The data preprocessing module preprocesses the text to be tested to obtain model input data that meets the input requirements;

[0036] The feature extraction module uses a variety of methods to extract and fuse features of the model input data to obtain multimodal fusion features;

[0037] The classification module performs sentiment analysis based on multimodal fusion features and outputs sentiment prediction labels.

[0038] The present invention also provides a sentiment analysis system based on multimodal feature fusion and SVM classification, comprising:

[0039] The module construction unit constructs a data preprocessing module, a feature extraction module and a classification module respectively; the data preprocessing module preprocesses the text to be tested to obtain model input data that meets the input requirements; the feature extraction module uses a variety of methods to extract and fuse features of the model input data to obtain multimodal fusion features; the classification module is obtained by training the support vector machine model using multimodal fusion features to perform sentiment classification tasks, and the trained support vector machine model is used as the classification module;

[0040] The model building unit sequentially connects the data preprocessing module, the feature extraction module and the classification module to build a sentiment analysis model;

[0041] The sentiment prediction unit uses the sentiment analysis model to perform sentiment analysis on the text to be tested.

[0042] The present invention has the following beneficial effects: the present invention improves the performance of the sentiment analysis model by integrating the three feature extraction methods of BERT, TF-IDF and Word2Vec. Specifically, BERT, as a pre-trained language model, can capture contextual semantics and complex syntactic structures; TF-IDF focuses on word frequency features and can retain keywords that appear in the text; and Word2Vec maps words to a high-dimensional space by vectorization, which helps to capture the relationship between words; by combining these three features, the model will better capture the multi-dimensional information of the text, thereby improving the accuracy and robustness of classification. When dealing with sentiment classification tasks with long texts and complex semantics, it can better capture the deep semantic information of the text than a single feature extraction method, and will show better adaptability when processing data of different categories, especially in the case of data imbalance, and is expected to maintain higher accuracy and recall rates.

[0043] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments, but the present invention is not limited to the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A method step diagram of an embodiment of the present invention;

[0045] Figure 2 It is a schematic diagram of the framework of an embodiment of the present invention;

[0046] Figure 3 4 is a system structure diagram of an embodiment of the present invention. DETAILED DESCRIPTION

[0047] The present invention aims to solve the problems of insufficient accuracy and high computing resource consumption of existing sentiment analysis methods when processing complex texts and large-scale data. By combining the three feature extraction methods of BERT, Word2Vec and TF-IDF, and using support vector machine (SVM) as a classifier, an efficient and accurate sentiment analysis solution is provided, which can significantly improve the performance and robustness of sentiment classification.

[0048] See also Figure 1 and Figure 2 The method step diagram and framework diagram of an embodiment of the present invention are shown, which include the following steps:

[0049] S101, constructing a data preprocessing module, a feature extraction module and a classification module respectively;

[0050] S102, sequentially connecting the data preprocessing module, the feature extraction module and the classification module to build a sentiment analysis model;

[0051] S103, using the sentiment analysis model to perform sentiment analysis on the text to be tested.

[0052] Among them, the data preprocessing module preprocesses the text to be tested to obtain model input data that meets the input requirements; the feature extraction module uses a variety of methods to extract and fuse features of the model input data to obtain multimodal fusion features; the classification module uses the multimodal fusion features to train the support vector machine model for sentiment classification tasks, and uses the trained support vector machine model as the classification module;

[0053] (1) Data preprocessing and word segmentation. Data preprocessing is a key step to ensure that text data can be effectively input into the model and improve the accuracy of analysis. First, the original text is thoroughly cleaned to remove noise information such as HTML tags, special symbols, URL links, and simplify the data structure. Then, the sentence is split into independent words using a word segmentation tool. In order to ensure the quality of word segmentation and the effectiveness of subsequent feature extraction, commonly used word segmentation algorithms include the dictionary-based forward maximum matching (MM) algorithm, the hidden Markov model (HMM), or the tokenizer provided by BERT. The embodiment of the present invention uses a hidden Markov model (HMM) for word segmentation. HMM is a sequence modeling tool based on statistical probability, which is widely used in natural language processing tasks, especially in Chinese word segmentation.

[0054] The HMM represents parts of speech or word boundaries through hidden states, and predicts the most likely word segmentation results by the probability relationship between the observation sequence (i.e., the character sequence in the text) and the state sequence. The key of the HMM model lies in its ability to process unlabeled sequence data, and generate the optimal word segmentation path through state transition probabilities and emission probabilities, thereby ensuring accurate word segmentation for complex texts. Especially when facing languages such as Chinese with fuzzy word boundaries and many ambiguous words, the HMM effectively solves the word segmentation ambiguity problem by calculating the optimal path. Immediately after word segmentation, stop words (such as meaningless words like "de", "le", etc.) are removed to reduce redundant data and increase the proportion of effective information learned by the model. To maintain the consistency of the data format, case conversion, character encoding unification processing are performed on the text, and the text length is standardized. Long texts are truncated, and short texts are padded to meet the input requirements of the model.

[0055] The following gives the expression of the HMM word segmentation model. The hidden Markov model can be used for the word segmentation process of sequence labeling problems. The basic elements of the model include:

[0056] State set , where represents the start of a word, represents the middle of a word, represents the end of a word, represents a single-character word.

[0057] Observation set , representing the input text sequence.

[0058] Initial state probability , representing the probabilities of each state at the start.

[0059] State transition probability matrix , representing the probability of transitioning from state to state .

[0060] Emission probability matrix , representing the probability that state generates the observation symbol .

[0061] The goal of the HMM is to solve the optimal state sequence through the Viterbi algorithm, so that the word sequence corresponding to the state sequence most conforms to the natural language word segmentation habit. After word segmentation, the text data will be converted into a sequence of words, which serves as the input for the feature extraction stage.

[0062] (2) Feature extraction and fusion. In the sentiment analysis of the embodiment of the present invention, feature extraction and feature fusion are the core parts of the entire process, aiming to improve the accuracy of the classifier by extracting the deep semantic information of the text through a combination of multiple methods. To this end, the embodiment of the present invention adopts three feature extraction methods - BERT, TF-IDF and Word2Vec, which process the text from different angles respectively, and finally fuse various features to form a comprehensive and accurate feature representation.

[0063] First, the BERT (Bidirectional Encoder Representations from Transformers) model captures the semantics of words in context through a pre-trained bidirectional Transformer structure. It not only considers the local information of words, but also combines the contextual information of the entire sentence or paragraph to generate word vectors. Using BERT, you can generate high-dimensional context-sensitive word vectors for each word, which is especially suitable for processing complex language structures and words with multiple meanings, so that the model can better understand the specific meaning of words in different contexts. By inputting the text into the BERT model, the generated word vector can not only retain the semantic information of the vocabulary, but also reflect the dependency relationship between sentences. The core idea of ​​BERT is to pre-train through Masked Language Model (MLM) and Next Sentence Prediction (NSP) tasks, so that the model can capture contextual information. Given an input text sequence ,in is the masked word, BERT predicts The true value is used to train the model:

[0064] ;

[0065] BERT uses a self-attention mechanism to compute the contextual representation of each word:

[0066] ;

[0067] in, represents the normalized exponential function, They are query matrix, key matrix and value matrix respectively. is the dimension of the key vector.

[0068] Finally, after the Transformer layer, BERT generates a vector representation for each word. , and context features can be extracted from this vector for sentiment classification tasks.

[0069] Secondly, the TF-IDF (Term Frequency-Inverse Document Frequency) method mainly analyzes text from the perspective of word frequency and distinctiveness. This method calculates the frequency of each word in a document and measures its importance in the entire document collection. Unlike BERT, TF-IDF is a relatively shallow statistical method that converts text into sparse feature vectors, mainly used to capture high-frequency or low-frequency words with distinguishing meanings in the text. Although this method cannot reflect the contextual meaning of words, it has a good effect on processing long texts and structured language data, and is a fast and effective text representation method.

[0070] TF-IDF calculates the feature vector of each word in a document. The TF-IDF value consists of two parts: term frequency (TF) and inverse document frequency (IDF), expressed as:

[0071] ;

[0072] ;

[0073] ;

[0074] in, It's a word. It's a document. Expressive words In the documentation The number of occurrences in ; is the total number of document collections, Indicates that it contains words The number of documents.

[0075] Finally, Word2Vec is a word embedding model based on neural networks, which aims to map each word into a vector space of fixed dimension and capture the potential semantic relationship between words. Word2Vec uses Skip-gram and CBOW algorithms to learn word vectors from a large-scale corpus, so that semantically similar words are closer in the vector space. Compared with TF-IDF, Word2Vec can capture richer semantic relationships between words, especially when the corpus is large, which can significantly improve the quality of text representation. The two commonly used models of Word2Vec are Skip-gram and CBOW (Continuous Bag of Words); Skip-gram uses a given central word , predict context words :

[0076] ;

[0077] in and The words The input and output vectors of .

[0078] The embodiment of the present invention adopts CBOW to predict the central word through the context words:

[0079] ;

[0080] Finally, by training the Word2Vec model, each word can be mapped to a word vector of fixed dimension for feature representation.

[0081] In terms of feature fusion, the embodiment of the present invention adopts a weighted fusion method to integrate the feature vectors extracted by BERT, TF-IDF and Word2Vec. The feature vectors are first concatenated, and for each text sample, the feature vectors of BERT, TF-IDF and Word2Vec are generated respectively. Assume is the feature vector generated by the BERT model, with dimension ; is the feature vector generated by the TF-IDF method, with dimension ; is the feature vector generated by the Word2Vec method, with dimension ; Concatenate these three feature vectors to generate a new feature vector , whose dimensions are , expressed as:

[0082] ;

[0083] On this basis, each feature can be weighted and different features can be assigned importance weights. Assume that the weights are , and , and satisfies , then the fused feature vector can be expressed as:

[0084] ;

[0085] By adjusting the weight , and Strengthen the contribution of a certain feature to the classification task, thereby optimizing the classification performance of the model.

[0086] Specifically, the feature extraction and fusion of the embodiment of the present invention first standardizes the features of different methods through a specific strategy to ensure that they are comparable at the same scale. Then, the final comprehensive feature vector is generated by weighted summation of various feature vectors. The advantage of this method is that BERT provides context-sensitive deep semantic information, TF-IDF provides efficient word frequency information, and Word2Vec captures the potential semantic relationship between words. By integrating the features of these three, a more comprehensive and accurate text representation can be formed, thereby improving the accuracy of sentiment classification.

[0087] (3) Model training and optimization. After feature extraction and fusion, the fused feature vector is used As input data, a support vector machine (SVM) model is trained to perform sentiment classification tasks. SVM effectively classifies samples of different categories by finding the maximum margin hyperplane.

[0088] First, the fused feature vectors are divided into training sets and test sets. In order to ensure the generalization ability of the model, the cross-validation method is used. During the training process, SVM uses weighted multimodal features to construct classification boundaries through defined kernel functions (such as linear kernel functions or radial basis function kernels RBF). The objective function of the SVM model is:

[0089] ;

[0090] Among them, sign represents the sign function; is the Lagrange multiplier; is the label of the training sample; is the kernel function used to calculate the similarity between input feature vectors; is the bias term. By selecting a suitable kernel function (such as RBF kernel or linear kernel) and adjusting the hyperparameters of SVM, the classification effect can be further optimized, thereby improving the accuracy of sentiment analysis. The selection of kernel function is crucial to the performance of the model. In the experiment, the linear kernel and RBF kernel were tested according to the characteristics of data distribution, and finally a suitable kernel function was selected to optimize the model performance. In order to improve the classification effect, the hyperparameters of the model were also adjusted, mainly including the penalty parameter and kernel function parameters . The optimal hyperparameter combination was determined by using Grid Search combined with cross-validation. Reasonable hyperparameter selection plays an important role in improving classification accuracy, balancing bias and variance, and avoiding overfitting. , which maximizes the classification accuracy of the model in different categories and reduces the risk of overfitting. After the model training, the classification effect of the model was evaluated based on the test set, and the performance of the model was comprehensively evaluated using multiple indicators such as accuracy, recall rate and F1-score. The experimental results show that the SVM model integrating multimodal features performs well in the sentiment classification task, which is significantly improved compared with the single feature extraction method.

[0091] Penalty Parameters Controls the relaxation of the classification hyperplane and determines the tolerance to misclassified samples. The value allows more samples to be on the wrong side, and the classifier interval is larger, thereby reducing the complexity of the model and preventing overfitting; while larger The value will reduce misclassification, but may lead to overfitting. In the optimization process, the grid search method is used to Parameters were fine-grainedly tuned and a series of different Finally, the optimal parameters are selected.

[0092] For the SVM model using the radial basis kernel function (RBF), the kernel function parameters Controls the impact of a single sample on the decision boundary. The value will make the model smoother, but HENFACANSHU may not be able to capture the complex patterns in the data; larger A large value will make the model more sensitive to small fluctuations in the training data, which may lead to overfitting. The best value that can balance the classification accuracy and model generalization ability is finally selected. value.

[0093] In order to ensure that the optimization effect of the model has good generalization ability, a cross-validation combined with grid search method is adopted. In the parameter search process, K-fold cross-validation is used to evaluate the performance of each parameter combination to ensure that the model not only has a good performance on the training set, but also can obtain a high classification accuracy on the test set. The final selected parameter combination makes the model's accuracy, recall rate and F1-score reach an ideal level.

[0094] (4) Theoretical analysis and expected results

[0095] The present invention aims to improve the performance of sentiment analysis models by integrating three feature extraction methods: BERT, TF-IDF and Word2Vec. Based on the complementarity of these feature extraction methods, it can be inferred that this method will show obvious advantages in processing complex sentiment classification tasks. It is expected that the model will have significant improvements in various evaluation indicators (such as accuracy, recall, and F1-score) compared with existing single methods. BERT, as a pre-trained language model, can capture contextual semantics and complex syntactic structures; TF-IDF focuses on word frequency features and can retain keywords that appear in the text; and Word2Vec maps words to high-dimensional space by vectorization, which helps to capture the relationship between words. By combining these three features, the model will better capture the multi-dimensional information of the text, thereby improving the accuracy and robustness of classification. The SVM model after hyperparameter optimization further improves the accuracy and stability of classification on the basis of integrating multimodal features. Through a reasonable combination of hyperparameters, the model performs well in dealing with uneven data distribution and significantly reduces the misclassification rate. In addition, the optimized model reduces the sensitivity to abnormal data and improves the robustness of processing different categories.

[0096] It is expected that this multimodal feature fusion model will be able to better capture the deep semantic information of the text than a single feature extraction method when dealing with sentiment classification tasks with long texts and complex semantics. Compared with traditional methods, the fused model will show better adaptability when processing data of different categories, especially in the case of data imbalance, and is expected to maintain higher accuracy and recall. Compared with the existing single feature extraction method, it can be theoretically speculated that the fused feature model will show obvious advantages in various indicators. Especially in sentiment classification tasks, the introduction of multimodal features helps to improve the model's ability to recognize complex emotional expressions and further improve the classification effect.

[0097] For details, see Figure 3 FIG. 1 is a system structure diagram of an embodiment of the present invention, including:

[0098] The module construction unit 301 constructs a data preprocessing module, a feature extraction module and a classification module respectively; wherein the data preprocessing module preprocesses the text to be tested to obtain model input data that meets the input requirements; the feature extraction module uses a variety of methods to extract and fuse features of the model input data to obtain multimodal fusion features; the classification module is obtained by training a support vector machine model using multimodal fusion features to perform sentiment classification tasks, and the trained support vector machine model is used as the classification module;

[0099] The model building unit 302 connects the data preprocessing module, the feature extraction module and the classification module in sequence to build a sentiment analysis model;

[0100] The sentiment prediction unit 303 uses the sentiment analysis model to implement sentiment analysis on the text to be tested.

[0101] It can be seen that the present invention can capture the deep semantic information of the text better than a single feature extraction method when dealing with long texts and semantically complex sentiment classification tasks. Compared with traditional methods, the model of the present invention will show better adaptability when processing data of different categories, especially in the case of data imbalance, it is expected to maintain higher accuracy and recall rates. Compared with the existing single feature extraction method, the present invention shows obvious advantages in various indicators, especially in sentiment classification tasks, the introduction of multimodal features helps to enhance the model's recognition ability for complex emotional expressions and further improve the classification effect. The innovation of the present invention lies not only in multimodal feature fusion, but also in model optimization and tuning, which makes it superior to existing traditional methods in terms of accuracy and efficiency, and is suitable for a variety of application scenarios such as social media comments and e-commerce platform evaluations.

[0102] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A sentiment analysis method based on multimodal feature fusion and SVM classification, characterized in that: The following steps are involved: The data preprocessing module, feature extraction module and classification module are constructed respectively; the data preprocessing module preprocesses the text to be tested to obtain the model input data that meets the input requirements; the feature extraction module uses a variety of methods to extract and fuse the features of the model input data to obtain multimodal fusion features; The classification module is obtained by training the support vector machine model using multimodal fusion features to perform sentiment classification tasks, and the trained support vector machine model is used as the classification module; Connect the data preprocessing module, feature extraction module and classification module in sequence to build a sentiment analysis model; Use the sentiment analysis model to perform sentiment analysis on the text to be tested.

2. The sentiment analysis method based on multimodal feature fusion and SVM classification according to claim 1 is characterized in that: The pre-processing comprises: Data cleaning, removing noise information from the original text, including HTML tags, special symbols and URL links; Word segmentation: The text after data cleaning is split into independent words using a word segmentation tool. The word segmentation tool includes a dictionary-based forward maximum matching algorithm, a hidden Markov model, or a word segmenter provided by BERT.

3. The sentiment analysis method based on multimodal feature fusion and SVM classification according to claim 1, characterized in that: The feature extraction module uses the BERT model, the TF-IDF model and the Word2Vec model to extract features from the model input data respectively, and obtains feature vectors of the three modalities; and fuses the feature vectors of the three modalities to obtain multimodal fusion features.

4. The sentiment analysis method based on multimodal feature fusion and SVM classification according to claim 3 is characterized in that: The BERT model captures the semantics of words in context through a pre-trained bidirectional Transformer structure and generates a feature vector for each word. ; The pre-training is performed by predicting The true value is used to train the model, expressed as: ; The feature vector The generation process is as follows: the BERT model consists of multiple transformer layers connected in sequence. Each transformer layer uses a self-attention mechanism to calculate the context representation of each word, and then passes the context representation to a fully connected feedforward neural network, and is processed by an activation function, and then layer normalization is performed to finally generate a set of word vectors, which are input to the next transformer layer. The output of the last transformer layer is used as the final feature vector .

5. The sentiment analysis method based on multimodal feature fusion and SVM classification according to claim 3 is characterized in that: The TF-IDF model calculates the frequency of each word in a document as a feature vector, expressed as: ; ; ; in, Expressive words In the documentation The number of occurrences in Represents the total number of words in document d; is the total number of document collections, Indicates that it contains words The number of documents; log represents the logarithmic function.

6. The sentiment analysis method based on multimodal feature fusion and SVM classification according to claim 3 is characterized in that: The Word2Vec model obtains a context representation by averaging the vectors of multiple words in the context, and then uses this context representation to predict the central word, specifically including the following steps: Given a central word and its context words , where k is the window size, first all the context words in the window Sum and average to get a context vector ,in It is a representation of context; Use this context vector To predict the central word , the goal of prediction is to find a word Maximize the dot product between the average vector of the context words and the word vector of the center word, and calculate the The predicted probability of: ,in Yes word The word vector of It's a vocabulary.

7. The sentiment analysis method based on multimodal feature fusion and SVM classification according to claim 3 is characterized in that: The feature vectors of the three modes are fused to obtain multi-modal fusion features, using splicing fusion or weighted fusion; The multimodal fusion features obtained by splicing and fusion are expressed as: ; The multimodal fusion feature obtained by weighted fusion is expressed as: ; in, Refers to the feature vector generated by the BERT model , the dimension is ; Refers to the feature vector generated by the TF-IDF method , the dimension is ; Refers to the feature vector generated by the Word2Vec method , the dimension is ; , and All are weighted and satisfy .

8. The sentiment analysis method based on multimodal feature fusion and SVM classification according to claim 1, characterized in that: The classification module is obtained by training the support vector machine model using multimodal fusion features to perform sentiment classification tasks. The training includes the penalty parameter Optimization and kernel function parameters Optimization; The optimization adopts a method of cross-validation combined with grid search, specifically: in the parameter search process, the model performance under each group of parameter combinations is evaluated through K-fold cross-validation, and the parameter combination with the best model performance is selected; the indicators for evaluating model performance include accuracy, recall rate and F1-score.

9. The sentiment analysis method based on multimodal feature fusion and SVM classification according to claim 1, characterized in that: The method of using the sentiment analysis model to implement sentiment analysis of the text to be tested includes the following steps: The data preprocessing module preprocesses the text to be tested to obtain model input data that meets the input requirements; The feature extraction module uses a variety of methods to extract and fuse features of the model input data to obtain multimodal fusion features; The classification module performs sentiment analysis based on multimodal fusion features and outputs sentiment prediction labels.

10. A sentiment analysis system based on multimodal feature fusion and SVM classification, characterized in that: include: The module construction unit constructs a data preprocessing module, a feature extraction module and a classification module respectively; the data preprocessing module preprocesses the text to be tested to obtain model input data that meets the input requirements; the feature extraction module uses a variety of methods to extract and fuse features of the model input data to obtain multimodal fusion features; the classification module is obtained by training the support vector machine model using multimodal fusion features to perform sentiment classification tasks, and the trained support vector machine model is used as the classification module; The model building unit sequentially connects the data preprocessing module, the feature extraction module and the classification module to build a sentiment analysis model; The sentiment prediction unit uses the sentiment analysis model to perform sentiment analysis on the text to be tested.

Citation Information

Patent Citations

  • Supply chain ecological region image-text fusion emotion recognition method based on interactive attention

    CN115146057A

  • Sentiment classification model and text sentiment analysis method applied by same

    CN117708328A

  • Emotion analysis method based on multi-modal resources

    CN118070809A

  • Multi-modal fusion method and system, terminal equipment and medium

    CN118349946A

  • Knowledge question-answering method based on natural language processing

    CN118673109A

Cited By

  • Method, device and equipment for promoting retention through interactive scene prediction and storage medium

    CN120744855A