Public opinion trend prediction method based on multi-mode RoBERTa-BiLSTM
By employing a multimodal RoBERTa-BiLSTM-based method in predicting online public opinion trends, this method constructs a multimodal dataset, introduces a location-aware attention mechanism and a cross-modal gating fusion mechanism, and combines an LSTM-Transformer-TCN joint temporal modeling structure to dynamically weight and fuse multimodal features for public opinion trend prediction. This solves the problem of missing user interaction behavior and sentiment tendencies in single-text modality analysis, and achieves comprehensive feature capture and accurate prediction of public opinion.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-03-13
AI Technical Summary
In predicting online public opinion trends, existing technologies rely on single-text modal analysis to ignore user interaction behavior and sentiment, resulting in an incomplete portrayal of the spread of public opinion and the evolution of sentiment. Furthermore, multimodal data fusion lacks dynamic weight adjustment and information integration is insufficient.
We employ a multimodal RoBERTa-BiLSTM-based approach, constructing a multimodal public opinion dataset, introducing a location-aware attention mechanism and a cross-modal gating fusion mechanism, and combining it with an LSTM-Transformer-TCN joint temporal modeling structure to dynamically weight and fuse multimodal features for public opinion trend prediction.
It has achieved comprehensive feature capture of public opinion, improved the accuracy of sentiment classification, accurately depicted the complex state of public opinion, fully captured the evolutionary patterns at all times, and realized the prediction of public opinion trends.
Smart Images

Figure CN121658653A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of public opinion technology, and more specifically, to a public opinion trend prediction method based on multimodal RoBERTa-BiLSTM. Background Technology
[0002] In the field of online public opinion trend prediction, early public opinion analysis often relied on single text modalities, focusing solely on semantic mining and neglecting the impact of user interaction behavior and sentiment on public opinion trends. This resulted in an incomplete portrayal of the spread and evolution of public opinion. While traditional recurrent neural networks (such as LSTM) can capture temporal information, they suffer from insufficient semantic understanding and loss of positional information when processing long texts or complex semantics. Conversely, while the Transformer model excels at global dependency modeling, it falls short in capturing short-term temporal fluctuations. Multimodal data fusion often employs simple concatenation or weighting methods, lacking dynamic modality weight adjustment mechanisms. This leads to insufficient multimodal information fusion, resulting in information redundancy or modal imbalance. Summary of the Invention
[0003] In view of the shortcomings of existing technologies, the purpose of this invention is to provide a public opinion trend prediction method based on multimodal RoBERTa-BiLSTM.
[0004] To achieve the above objectives, the present invention provides the following technical solution: A public opinion trend prediction method based on multimodal RoBERTa-BiLSTM includes the following steps: Construct a multimodal public opinion dataset; wherein, the multimodal public opinion dataset includes text semantic information, user interaction behavior data, and sentiment pre-labeled tags; An improved RoBERTa-BiLSTM model was used to perform sentiment classification on a multimodal public opinion dataset to obtain sentiment classification results. The improved RoBERTa-BiLSTM model includes the introduction of a location-aware attention mechanism after the RoBERTa encoding layer. The sentiment classification results and user interaction behavior features are dynamically weighted and fused through a cross-modal gating fusion mechanism to generate multimodal features; By inputting the multimodal joint features into the LSTM-Transformer-TCN joint temporal modeling structure, the public opinion trend prediction results are obtained.
[0005] Preferably, the computation process of the location-aware attention mechanism includes: The input sequence after augmenting the location information is represented as follows: ; in, It is the input sequence after enhancing the location information, incorporating the location code P into the initial input sequence x, where R represents the set of real numbers, L represents the sequence length, and d represents the feature dimension; Query Matrix Key matrix Sum matrix The formula for generating it is: in, It is the query weight moment. It is the key weight matrix. It is a value weight matrix. The input sequence represents the position encoding; The formula for calculating attention weights is: ; The final output is obtained by multiplying the Top-k sparsification result with the value matrix: Output is the context vector generated by the dot product of the sparsified attention weight matrix and the value matrix. This represents the sparsification operation function. This represents the attention weight matrix.
[0006] Preferably, the specific implementation of the cross-modal gating fusion mechanism includes: The feature projection formula is: in, , , The fused text contains semantic features, numerical trends, and sentiment information. , , It is a learnable linear projection matrix. , , For bias terms; The formula for calculating the gating weight is: in, For gating weights, For bias terms, For activation function, , These represent the weights and biases, respectively. semantic features of the projected text Numerical trend characteristics after projection Projected emotional tendencies; The final fusion feature is represented as: Where F is the final fused feature vector, This represents element-wise multiplication. , This indicates multiple heads of attention.
[0007] Preferably, the LSTM-Transformer-TCN joint timing modeling structure includes the following calculation formula: The calculation formulas for the input gate, forget gate, and output gate in an LSTM unit are as follows: ; ; ; ; ; in, , , , These represent the forget gate, input gate, output gate, and cell state of the LSTM, respectively. This represents the weight matrix of the input gate. The weight matrix representing the candidate cell state. This represents the weight matrix of the output gate. This represents the bias term of the input gate. Bias terms representing the candidate cell state This represents the bias term of the output gate. and This represents the input at time t and the hidden state at the previous time. Indicates the state of candidate cells. This indicates the current state of the cell. Represents the Gate of Oblivion Indicates the output gate. Indicates the current hidden state; The formula for calculating the dilated convolution of the TCN layer is: ;in, It is the first The output of the layer, It is the first The weights of the convolutional kernels in the layer, where k is the kernel size. It is the first The expansion rate of the layer, It is the first The stride of the layer, No. Layer in time step Feature input at the location.
[0008] Preferably, it further includes: The model training uses the Huber loss function: , It is a smooth transition point. Represents the residual.
[0009] Preferably, the multi-head attention calculation of the Transformer module includes: Single-head attention calculation formula ; Multi-head attention calculation formula ; Softmax is used to normalize the attention weights into a probability distribution. It is an enhanced temporal feature representation sequence. It is the output weight matrix. This represents the output of the i-th attention head. For query vector, Input features representing multi-head attention, This represents the weight matrix in the i-th attention head. This represents the final output of multi-head attention, and Concat represents the concatenation operation.
[0010] Compared with the prior art, the present invention has the following beneficial effects: This invention constructs a multimodal public opinion dataset that includes textual semantic information, user interaction behavior data, and sentiment pre-labeled tags, enabling a comprehensive capture of the rich characteristics of public opinion. Textual semantic information provides a deeper understanding of the content and meaning of public opinion events; user interaction behavior data reflects the spread and user participation of public opinion, such as the high number of reposts of a popular Weibo post reflecting its breadth of dissemination; and sentiment pre-labeled tags characterize the emotional tendency of public opinion, such as distinguishing between positive, neutral, and negative emotions. The fusion of multimodal data lays a solid foundation for subsequent accurate analysis, avoiding the limitations of a single data dimension. The improved RoBERTa-BiLSTM model introduces a position-aware attention mechanism after the RoBERTa encoding layer, leveraging RoBERTa's powerful semantic encoding capabilities while strengthening attention to key positional information in the text through the position-aware attention mechanism. This significantly improves the accuracy of sentiment classification, providing reliable sentiment dimension support for subsequent public opinion trend analysis. At the feature fusion level, a cross-modal gating fusion mechanism dynamically weights and fuses sentiment classification results with user interaction behavior features, adaptively adjusting the weights of each modality feature according to different stages of public opinion development. This dynamic fusion approach effectively integrates multimodal information, avoiding information redundancy and modal imbalance. The generated multimodal features can more comprehensively and accurately reflect the complex state of public opinion. The LSTM-Transformer-TCN joint temporal modeling structure fully leverages the advantages of each module. LSTM excels at capturing short-term temporal fluctuations and grasping changes in sentiment or popularity of public opinion within a short period; Transformer can model long-distance dependencies and uncover potential correlations between public opinion at different time periods; TCN can extract multi-scale local features, simultaneously focusing on the changing characteristics of public opinion at the hourly and daily levels. It comprehensively depicts the complex temporal evolution of public opinion, accurately capturing key nodes such as peaks and inflection points, thereby achieving high-precision prediction of public opinion trends and providing timely basis for public opinion management and emergency decision-making. Attached Figure Description
[0011] Figure 1 This is a diagram of the BiLSTM network structure in this embodiment; Figure 2 This is a diagram of the LSTM network structure in this embodiment; Figure 3 This is the structure of the online public opinion trend prediction model in this embodiment. Detailed Implementation
[0012] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0013] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0014] Secondly, the term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places throughout this specification does not necessarily refer to the same embodiment, nor is it a single embodiment or an embodiment selectively excluded from other embodiments.
[0015] Reference Figures 1-3 As shown.
[0016] The embodiments further illustrate the public opinion trend prediction method based on multimodal RoBERTa-BiLSTM proposed in this invention.
[0017] A public opinion trend prediction method based on multimodal RoBERTa-BiLSTM includes the following steps: Construct a multimodal public opinion dataset; the multimodal public opinion dataset includes text semantic information, user interaction behavior data, and sentiment pre-labeled tags; An improved RoBERTa-BiLSTM model was used to perform sentiment classification on a multimodal public opinion dataset to obtain sentiment classification results. The improved RoBERTa-BiLSTM model includes the introduction of a location-aware attention mechanism after the RoBERTa encoding layer. The sentiment classification results and user interaction behavior features are dynamically weighted and fused through a cross-modal gating fusion mechanism to generate multimodal features; By inputting the multimodal joint features into the LSTM-Transformer-TCN joint temporal modeling structure, the public opinion trend prediction results are obtained.
[0018] First, a multimodal public opinion dataset needs to be constructed. This dataset contains rich information dimensions. Textual semantic information involves semantic analysis of textual content related to public opinion events; user interaction data covers the number of comments, likes, and reposts on Weibo; for example, a Weibo post about Blizzard might have thousands of comments and tens of thousands of reposts, reflecting the spread and intensity of public opinion; and sentiment pre-labeling labels annotate the text's sentiment orientation, such as categorizing text as positive, neutral, or negative. The accuracy of the labels is ensured through a combination of automatic labeling and manual review. Finally, this information is integrated to form a multimodal dataset, providing a foundation for subsequent analysis.
[0019] An improved RoBERTa-BiLSTM model is used for sentiment classification. The RoBERTa encoding layer has powerful semantic understanding capabilities, enabling deep text encoding. A position-aware attention mechanism is introduced on top of this, strengthening the focus on key positional information in the text, thereby improving the accuracy of capturing key sentiment information. The BiLSTM model can model the bidirectional temporal information of the text. Combined with the RoBERTa encoding results, the sentiment classification result is output.
[0020] Sentiment classification results and user interaction behavior features are dynamically weighted and fused using a cross-modal gating fusion mechanism to generate multimodal features. Sentiment classification results are a quantitative representation of text sentiment, such as the probability value of positive sentiment. In user interaction behavior features, the number of comments reflects user participation in public opinion, the number of likes reflects user approval of the content, and the number of reposts represents the scope of public opinion dissemination. The cross-modal gating fusion mechanism first maps these features from different modalities to a unified dimension, and then dynamically adjusts the weights of each modal feature through a gating network. For example, in the early stages of a public opinion event, the number of reposts in user interaction behavior data may have a higher weight because the spread of the information is a key factor influencing the trend of public opinion at this time. As the public opinion develops, if the proportion of negative sentiment in the sentiment classification results gradually increases, its weight will also increase accordingly, ultimately fusion generating features that comprehensively reflect multimodal information.
[0021] The multimodal joint features are input into the LSTM-Transformer-TCN joint temporal modeling structure. The LSTM model excels at capturing short-term temporal fluctuations, such as rapid changes in public opinion sentiment within a single day; the Transformer model can model long-distance dependencies, capturing even long time intervals; and the TCN model can extract multi-scale local features. These three modules work collaboratively: the LSTM first performs preliminary modeling of short-term changes in multimodal features, the Transformer then mines long-term correlation patterns, and the TCN extracts local features from multiple time scales. Ultimately, they jointly characterize the complex temporal evolution of public opinion and output public opinion trend prediction results, such as predicting the popularity trend and sentiment changes of a public opinion event in the next few days.
[0022] The computational process of the position-aware attention mechanism includes: The input sequence after augmenting the location information is represented as follows: ; in, It is the input sequence after enhancing the location information, incorporating the location code P into the initial input sequence x, where R represents the set of real numbers, L represents the sequence length, and d represents the feature dimension; Query Matrix Key matrix Sum matrix The formula for generating it is: in, It is the query weight moment. It is the key weight matrix. It is a value weight matrix. The input sequence represents the position encoding; The formula for calculating attention weights is: ; The final output is obtained by multiplying the Top-k sparsification result with the value matrix: Output is the context vector generated by the dot product of the sparsified attention weight matrix and the value matrix. This represents the sparsification operation function. This represents the attention weight matrix.
[0023] First, positional information enhancement is applied to the input sequence. The positional code P is incorporated into the initial input sequence x to obtain the input sequence with enhanced positional information. The positional encoding P is a real matrix of dimension L×d (L is the sequence length, and d is the feature dimension). It can assign positional features to each element in the input sequence, allowing the model to perceive the order information of the sequence elements. For example, when processing text sequences, it can distinguish the positional differences between the words in "I like movies" and "Movies like me".
[0024] Generate query matrix Key matrix Sum matrix By querying the weight matrix respectively Key weight matrix Value weight matrix Input sequence with enhanced location information A linear transformation yields these three matrices. These three matrices respectively serve as the query requirement, the matching basis, and the information carrier. For example, when processing public opinion texts, the query matrix can be understood as the "point of interest" of each word in the text, the key matrix is the feature of each word used to match the point of interest, and the value matrix is the semantic information carried by each word.
[0025] Then, the attention weights are calculated using the formula. The calculation, where dividing by d, is to avoid the inner product result becoming too large due to an excessively large feature dimension d, which would cause the gradient of the softmax function to vanish. The softmax function converts the calculation result into a probability distribution between 0 and 1, thereby reflecting the degree of attention each position gives to other positions. For example, in public opinion texts, a keyword expressing emotion will have a higher attention weight to other related words.
[0026] Finally, Top-k sparsification is performed to generate the final output. Top-k sparsification is applied to the attention weight matrix Attn, where k=10, meaning only the top 10 attention values with the highest weights are retained, and the rest are set to 0. This filters out secondary attention relationships and focuses on key information. Then, the sparsified attention weight matrix and value matrix are compared... Multiplying these together yields the final output, which is a context vector that integrates key location information and semantic information. This provides more accurate feature support for subsequent tasks such as sentiment classification and trend prediction. For example, in public opinion trend prediction, it can highlight text fragments and location features that play a key role in the direction of public opinion.
[0027] The specific implementation of the cross-modal gating fusion mechanism includes: The feature projection formula is: Among them, among them, , , The fused text contains semantic features, numerical trends, and sentiment information. , , It is a learnable linear projection matrix. , , For bias terms, , , For bias terms; The formula for calculating the gating weight is: in, For gating weights, For bias terms, For activation function, , These represent the weights and biases, respectively. semantic features of the projected text Numerical trend characteristics after projection Projected emotional tendencies; The final fusion feature is represented as: Where F is the final fused feature vector, This represents element-wise multiplication. , This indicates multiple heads of attention.
[0028] For text semantic features T, numerical trend features N, and sentiment features Each is achieved through a learnable linear projection matrix. , , and bias terms , , Perform a linear transformation to obtain the projected text semantic features. Numerical trend characteristics and emotional tendencies The purpose of this step is to map features of different modalities and potentially different dimensions to a unified dimensional space, laying the foundation for subsequent fusion operations. For example, text semantic features may be word vector representations extracted from public opinion texts, numerical trend features may be statistical features of user interaction behavior data, and sentiment tendency features may be probability outputs of sentiment classification. After projection, they are consistent in dimension, which facilitates subsequent calculations.
[0029] Next, the gating weights are calculated for the projected text semantic features. Numerical trend characteristics and emotional tendencies Each through the gating weight matrix and bias terms A linear transformation is performed, followed by processing with an activation function σ (usually the sigmoid function) to obtain the gated weights. , , The gating weights, ranging from 0 to 1, are used to measure the importance of the corresponding modal features in the final fusion. For example, when the sentiment of public opinion has a significant impact on the trend at a certain moment, The value will be closer to 1, thus giving higher weight to the sentiment tendency feature.
[0030] Then, the semantic features of the projected text Numerical trend characteristics and emotional tendencies Multi-head attention processing is performed to obtain AT. The multi-head attention mechanism can mine the correlation information between these three modal features and capture their interaction relationships, such as the semantic correlation between text semantics and sentiment tendency, and the propagation correlation between numerical trends and text semantics.
[0031] Finally, the final fused features are generated. The gating weights are then... , , Compare with the corresponding multi-head attention results AT and the numerical trend features after projection, respectively. Post-projection emotional tendency characteristics Element-wise multiplication is performed, and then the three products are summed to obtain the final fused feature vector F. The element-wise multiplication operation dynamically weights the features of different modalities, allowing the final fused feature to adaptively integrate key information from each modality based on the gating weights. For example, when public opinion is in a rapid propagation phase, the gating weights of the numerical trend features... The larger the feature size, the more the fused features will reflect changes in user interaction behavior, thus providing accurate multimodal joint features for subsequent public opinion trend prediction.
[0032] The LSTM-Transformer-TCN joint timing modeling structure includes the following calculation formulas: The calculation formulas for the input gate, forget gate, and output gate in an LSTM unit are as follows: ; ; ; ; ; in, , , , These represent the forget gate, input gate, output gate, and cell state of the LSTM, respectively. This represents the weight matrix of the input gate. The weight matrix representing the candidate cell state. This represents the weight matrix of the output gate. This represents the bias term of the input gate. Bias terms representing the candidate cell state This represents the bias term of the output gate. and This represents the input at time t and the hidden state at the previous time. Indicates the state of candidate cells. This indicates the current state of the cell. Represents the Gate of Oblivion Indicates the output gate. Indicates the current hidden state; The formula for calculating the dilated convolution of the TCN layer is: ;in, It is the first The output of the layer, It is the first The weights of the convolutional kernels in the layer, where k is the kernel size. It is the first The expansion rate of the layer, It is the first The stride of the layer, No. Layer in time step Feature input at the location.
[0033] The LSTM part captures short-term dependencies in time-series data through input gates, forget gates, output gates, and cell states. Input gates... From the weight matrix Hidden state from the previous moment Input at the current time After undergoing a linear transformation, the result is calculated using the sigmoid activation function and used to control the current input information. How much can flow into the cellular state? Candidate cell status It is a weight matrix right and After a linear transformation, the result obtained via the tanh activation function is a non-linear transformation of the current input and the previous hidden state. (Forget gate) Used to control the cell state at the previous moment. How much of it can be retained to the current moment? Current cell state. Based on the cell state at the previous moment Passing through the Gate of Oblivion After filtering, add an input gate. Candidate cell status after screening Element-wise multiplication yields the result. Output gate. From the weight matrix right and The result, obtained after linear transformation and activation by the sigmoid function, is used to control the current cell state. How many can be output to the current hidden state? Current hidden state It is the output gate. Screening cell status The value obtained by multiplying the elements after the tanh transformation is the short-term temporal feature representation of the LSTM output.
[0034] TCN partially dilated convolution works by setting different dilation rates. This expands the receptive field, thereby capturing long-range temporal dependencies. For the l-th layer, the output... By adjusting the l-1 layer at time step Feature input at the location Weights of the l-th convolutional kernel The weighted sum is obtained. Here, K is the kernel length. is the inflation rate of the l-th layer, and the stride d(0) controls the time span during feature extraction. This design enables TCN to extract local temporal features at multiple scales simultaneously without increasing the number of parameters. For example, it can focus on short-term fluctuations between adjacent time steps as well as capture long-term correlations between time steps with a greater distance between them.
[0035] When LSTM, Transformer, and TCN are combined, LSTM first captures the short-term dynamic dependencies of time-series data, and the output hidden state serves as the input for subsequent modules; TCN extracts multi-scale long-distance time-series features through dilated convolution; and Transformer (although the formula is not shown in the figure, it is part of the joint structure) models the global dependencies between different time steps using a self-attention mechanism. The three work collaboratively, with LSTM focusing on the short term, TCN covering multi-scale long-distance dependencies, and Transformer characterizing global relationships. Ultimately, this achieves comprehensive modeling of complex time-series data (such as the temporal evolution of public opinion trends), accurately capturing its short-term fluctuations, long-term trends, and multi-scale feature relationships.
[0036] Also includes: The model training uses the Huber loss function: ; It is a smooth transition point. Represents the residual.
[0037] The Huber loss function is a loss function used for regression tasks. It combines the advantages of mean squared error and mean absolute error, and has good robustness to outliers (data points with large residuals). The residuals... Hyperparameters represent the difference between the model's predicted values and the actual values. This is a smooth transition point used to divide the loss function into two segmented intervals. When the absolute value of the residual is | | Less than or equal to At that time, the Huber loss function takes the form of a quadratic function. This part is consistent with the form of mean squared error, and can finely penalize the case of small residuals, so that the model can converge quickly and obtain high accuracy when the residuals are small.
[0038] When the absolute value of the residual |a| is greater than δ, the Huber loss function takes the form of a linear function. This part avoids the problem of outliers causing a sharp increase in loss value, effectively reduces the interference of outliers on model training, and improves the robustness of the model to outliers.
[0039] Through this segmented design, the Huber loss function can effectively deal with outliers in the data while ensuring the model's accuracy in fitting normal data, thereby making the model more stable during training and ultimately achieving better generalization ability.
[0040] The multi-head attention calculation in the Transformer module includes: Single-head attention calculation formula ; Multi-head attention calculation formula ; Softmax is used to normalize the attention weights into a probability distribution. It is an enhanced temporal feature representation sequence. It is the output weight matrix. This represents the output of the i-th attention head. For query vector, Input features representing multi-head attention, This represents the weight matrix in the i-th attention head. This represents the final output of multi-head attention, and Concat represents the concatenation operation.
[0041] For each attention head, use the query vector and input features Based on this, through the weight matrix For input features Perform a linear transformation, then combine the result with the query vector. The matching calculation is performed, and then the attention weights are normalized to a probability distribution using the Softmax activation function to obtain the output of the i-th attention head. The purpose of Softmax is to make the attention weights present a probability distribution between 0 and 1, thereby reflecting the importance of information at different locations. For example, when processing the time-series features of public opinion, features at a certain key time point will receive higher attention weights.
[0042] Next, multi-head attention calculation is performed. The outputs of multiple attention heads, head1, ..., headn, are combined through a concatenation operation, and then the output weight matrix is used. A linear transformation is performed on the concatenated features to obtain the final output of the multi-head attention. The concatenation operation can fuse feature information captured from different perspectives by multiple attention heads, and output a weight matrix. It is used to map the spliced multi-dimensional features to new dimensions, thereby generating more expressive feature representations and providing rich feature support for subsequent tasks such as time series modeling. For example, in public opinion trend prediction, it can integrate different key information focused on by multiple attention heads to improve the accuracy of prediction.
[0043] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0044] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0045] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A public opinion trend prediction method based on multimodal RoBERTa-BiLSTM, characterized in that, The method includes the following steps: Construct a multimodal public opinion dataset; wherein, the multimodal public opinion dataset includes text semantic information, user interaction behavior data, and sentiment pre-labeled tags; An improved RoBERTa-BiLSTM model was used to perform sentiment classification on a multimodal public opinion dataset to obtain sentiment classification results. The improved RoBERTa-BiLSTM model includes the introduction of a location-aware attention mechanism after the RoBERTa encoding layer. The sentiment classification results and user interaction behavior features are dynamically weighted and fused through a cross-modal gating fusion mechanism to generate multimodal features; By inputting the multimodal joint features into the LSTM-Transformer-TCN joint temporal modeling structure, the public opinion trend prediction results are obtained.
2. The public opinion trend prediction method based on multimodal RoBERTa-BiLSTM according to claim 1, characterized in that, The computational process of the location-aware attention mechanism includes: The input sequence after augmenting the location information is represented as follows: ; in, It is the input sequence after enhancing the location information, incorporating the location code P into the initial input sequence x, where R represents the set of real numbers, L represents the sequence length, and d represents the feature dimension; Query Matrix Key matrix Sum matrix The formula for generating it is: in, It is the query weight moment. It is the key weight matrix. It is a value weight matrix. The input sequence represents the position encoding; The formula for calculating attention weights is: ; The final output is obtained by multiplying the Top-k sparsification result with the value matrix: Output is the context vector generated by the dot product of the sparsified attention weight matrix and the value matrix. This represents the sparsification operation function. This represents the attention weight matrix.
3. The public opinion trend prediction method based on multimodal RoBERTa-BiLSTM according to claim 2, characterized in that, The specific implementation of the cross-modal gating fusion mechanism includes: The feature projection formula is: in, , , The fused text contains semantic features, numerical trends, and sentiment information. , , It is a learnable linear projection matrix. , , For bias terms; The formula for calculating the gating weight is: in, For gating weights, For bias terms, For activation function, , These represent the weights and biases, respectively. semantic features of the projected text Numerical trend characteristics after projection Projected emotional tendencies; The final fusion feature is represented as: Where F is the final fused feature vector, This represents element-wise multiplication. , This indicates multiple heads of attention.
4. The public opinion trend prediction method based on multimodal RoBERTa-BiLSTM according to claim 3, characterized in that, The LSTM-Transformer-TCN joint temporal modeling structure includes the following calculation formulas: The calculation formulas for the input gate, forget gate, and output gate in an LSTM unit are as follows: ; ; ; ; ; in, , , , These represent the forget gate, input gate, output gate, and cell state of the LSTM, respectively. This represents the weight matrix of the input gate. The weight matrix representing the candidate cell state. This represents the weight matrix of the output gate. This represents the bias term of the input gate. Bias terms representing the candidate cell state This represents the bias term of the output gate. and This represents the input at time t and the hidden state at the previous time. Indicates the state of candidate cells. This indicates the current state of the cell. Represents the Gate of Oblivion Indicates the output gate. Indicates the current hidden state; The formula for calculating the dilated convolution of the TCN layer is: ;in, It is the first The output of the layer, It is the first The weights of the convolutional kernels in the layer, where k is the kernel size. It is the first The expansion rate of the layer, It is the first The stride of the layer, No. Layer in time step Feature input at the location.
5. The public opinion trend prediction method based on multimodal RoBERTa-BiLSTM according to claim 4, characterized in that, Also includes: The model training uses the Huber loss function: , It is a smooth transition point. Represents the residual.
6. The public opinion trend prediction method based on multimodal RoBERTa-BiLSTM according to claim 5, characterized in that, The multi-head attention calculation in the Transformer module includes: Single-head attention calculation formula ; Multi-head attention calculation formula ; Softmax is used to normalize the attention weights into a probability distribution. It is an enhanced temporal feature representation sequence. It is the output weight matrix. This represents the output of the i-th attention head. For query vector, Input features representing multi-head attention, This represents the weight matrix in the i-th attention head. This represents the final output of multi-head attention, and Concat represents the concatenation operation.