Social platform-based public opinion prediction method, device and electronic equipment
Patent Information
- Application Number
- CN202211167868.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2042-09-23
AI Technical Summary
[0006]本发明提供一种基于社交平台的舆情预测方法,用以解决现有技术中的预测不够准确的缺陷,实现对舆情的更为准确的预测
[0041] The present invention provides a social media-based public opinion prediction method and apparatus. This method acquires the target text to be predicted and extracts its time-series feature vector, text representation feature vector, and absolute time-representation feature vector. Based on a pre-built time-varying prediction model, the time-series feature vector, text representation feature vector, and absolute time-representation feature vector are fused to obtain a prediction result. The prediction result includes the residual value between the number of reposts at the next time step and the number of reposts at the current time step. The time-varying prediction model is constructed based on a deep distributed fusion network. Because the present invention adds text representation feature vectors and absolute time-representation feature vectors, it includes a richer set of vector samples, significantly improving the accuracy of the public opinion prediction method. Therefore, the method, apparatus, and electronic device provided by the present invention can utilize and flexibly fuse the rich information of the original text to achieve the effect of improving prediction accuracy.
Smart Images

Figure CN115545288B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information and data processing technology, and in particular to a method for predicting public opinion based on social media platforms. Background Technology
[0002] In the dissemination of information on social media, the framing effect is one of the most important factors. Framing refers to the process that enables people to form a specific concept about an issue or to reposition their thinking about certain issues. The media can provide an equivalent objective description of an objective fact or issue, but this is usually not conducive to the spread of the message. However, through the framing process, such as adding keywords, highlighting key points, and rephrasing, the message can become more easily spread.
[0003] Among existing technologies, there are many methods for describing public opinion, and different methods can be used on each social media platform. Taking Weibo as an example, the number of reposts can represent the public's response to a message, so using the time series of repost counts as a quantitative indicator for predicting public opinion is a reasonable approach.
[0004] The task of time series forecasting is defined as predicting the trend of one or more data points in the next time step or the next time period, given a sequence of one or more data points over a given period. Current research on time series forecasting typically involves two methods: recurrent neural networks (RNNs) and their derivative algorithms, and temporal convolutional networks (TCNs).
[0005] However, the prediction methods used in existing technologies do not make full use of text information, resulting in low prediction accuracy. Furthermore, due to the lack of sample size, existing prediction methods have difficulty predicting the number of reposts in the early stages of text publication, thus affecting prediction accuracy. Summary of the Invention
[0006] This invention provides a public opinion prediction method based on social platforms to address the shortcomings of inaccurate prediction in existing technologies and achieve more accurate prediction of public opinion.
[0007] This invention provides a method for predicting public opinion based on social media platforms, comprising:
[0008] Obtain the target text to be predicted, and extract the time series feature vector, text representation feature vector, and absolute time representation feature vector of the target text;
[0009] Based on a pre-built time-varying prediction model, the time series feature vector, the text representation feature vector, and the absolute time representation feature vector are fused to obtain a prediction result, which includes the residual value between the number of forwards at the next time step and the number of forwards at the current time step.
[0010] The time-varying prediction model is built on a deep distributed fusion network.
[0011] According to the present invention, a method for predicting public opinion based on social media platforms is provided.
[0012] Extracting the text representation feature vector of the target text specifically includes:
[0013] Extract the original text vector of the target text, the frame effect label vector obtained based on the pre-trained frame effect classification model, and the topic vector of the target text;
[0014] The framing effect classification model is trained using the label feature vector samples of the text samples.
[0015] According to the present invention, a method for predicting public opinion based on social media platforms is provided.
[0016] Extracting the time-series feature vector of the target text specifically includes:
[0017] Obtain the total number of forwards of the target text before time t, and denot them as r0, r1, ... r t-1 ;
[0018] The hidden state output is obtained based on the forwarding count, and the hidden state output is used as the historical change representation of the forwarding count, denoted as h(r0,r1,…r). t-1 );
[0019] With h(r0,r1,…r) t-1 ) is used as the feature vector of the time series.
[0020] According to the present invention, a method for predicting public opinion based on social media platforms is provided.
[0021] The time series feature vector, the text representation feature vector, and the absolute time representation feature vector are fused using a preset expression to obtain a prediction result; the preset expression is:
[0022]
[0023] Where h(r0,r1,…r) t-1 ) represents the time series feature vector, F represents the framing effect label vector, L represents the original text vector, T represents the topic vector, and A represents the original text vector. t The absolute time represents the eigenvector.
[0024] According to the present invention, a method for predicting public opinion based on social media platforms is provided.
[0025] The fusion of the time series feature vector, the text representation feature vector, and the absolute time representation feature vector specifically includes:
[0026] The time series feature vector is concatenated in pairs with the original text vector of the target text, the frame effect label vector, the topic vector of the target text, and the absolute time representation feature vector, and then all of them are concatenated at once to obtain 5 fused vectors.
[0027] Each of the aforementioned fusion vectors is input into a pre-stored fusion prediction model to obtain five predicted values;
[0028] The prediction results are obtained based on the predicted values.
[0029] According to the present invention, a method for predicting public opinion based on social media platforms is provided.
[0030] The prediction result is obtained based on each of the predicted values, and prior to this, the following steps are also included:
[0031] Determine the prediction time step;
[0032] If the predicted time step is determined to be greater than the time step threshold, then the number of forwards at the next time step after linearly transforming the predicted value obtained by concatenating the time series feature vector and the absolute time representation feature vector is used as the prediction result.
[0033] If the predicted time step is determined to be less than the time step threshold, then the number of forwards at the next moment, calculated by linearly transforming all the predicted values, is used as the prediction result.
[0034] The present invention also provides a public opinion prediction device based on a social platform, comprising:
[0035] The feature vector extraction unit is used to obtain the target text to be predicted and extract the time series feature vector, text representation feature vector and absolute time representation feature vector of the target text;
[0036] The result prediction unit is used to fuse the time series feature vector, the text representation feature vector, and the absolute time representation feature vector based on a pre-built time-varying prediction model to obtain a prediction result, which includes the residual value between the number of forwards at the next time step and the number of forwards at the current time step.
[0037] The time-varying prediction model is built on a deep distributed fusion network.
[0038] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the above-described methods for predicting public opinion based on a social platform.
[0039] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the public opinion prediction method based on a social platform as described above.
[0040] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the social media platform-based public opinion prediction method as described above.
[0041] The present invention provides a social media-based public opinion prediction method and apparatus. This method acquires the target text to be predicted and extracts its time-series feature vector, text representation feature vector, and absolute time-representation feature vector. Based on a pre-built time-varying prediction model, the time-series feature vector, text representation feature vector, and absolute time-representation feature vector are fused to obtain a prediction result. The prediction result includes the residual value between the number of reposts at the next time step and the number of reposts at the current time step. The time-varying prediction model is constructed based on a deep distributed fusion network. Because the present invention adds text representation feature vectors and absolute time-representation feature vectors, it includes a richer set of vector samples, significantly improving the accuracy of the public opinion prediction method. Therefore, the method, apparatus, and electronic device provided by the present invention can utilize and flexibly fuse the rich information of the original text to achieve the effect of improving prediction accuracy. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0043] Figure 1 This is one of the flowcharts illustrating the social media-based public opinion prediction method provided by the present invention;
[0044] Figure 2 This is the second flowchart of the social media-based public opinion prediction method provided by the present invention;
[0045] Figure 3 This is the third flowchart of the social media-based public opinion prediction method provided by the present invention;
[0046] Figure 4 This is the fourth flowchart of the social media-based public opinion prediction method provided by the present invention;
[0047] Figure 5A schematic diagram of the structure of the social media-based public opinion prediction device provided by the present invention;
[0048] Figure 6 This is a schematic diagram of the physical structure of an electronic device provided by the present invention.
[0049] Figure label:
[0050] 510: Feature vector extraction unit; 520: Result prediction unit;
[0051] 610: Processor; 620: Communication interface; 630: Memory; 640: Communication bus. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0053] The following is combined with Figures 1-4 This invention describes a public opinion prediction method based on a social platform. Figure 1 This is one of the flowcharts illustrating the social media-based public opinion prediction method provided by the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0054] Step 110: Obtain the target text to be predicted, and extract the time series feature vector, text representation feature vector, and absolute time representation feature vector of the target text.
[0055] In practical applications, the target text to be predicted can be text published on Weibo, WeChat official accounts, etc., based on text forwarding. This example uses the text to be predicted on Weibo (target blog post).
[0056] In order to overcome the problem of not fully utilizing the target text information or the difficulty in prediction in the early stage of text publication, this paper extracts the time series feature vector, text representation feature vector and absolute time representation feature vector of the target text, thereby making full use of the multi-dimensional features of the target text information. It can achieve high accuracy prediction regardless of the time period after the text is published.
[0057] Step 120: Based on the pre-built time-varying prediction model, the time series feature vector, the text representation feature vector, and the absolute time representation feature vector are fused to obtain the prediction result, which includes the residual value between the number of forwards at the next time step and the number of forwards at the current time step.
[0058] The time-varying prediction model is constructed based on a deep distributed fusion network. A deep distributed fusion network is a multi-source data vector fusion method proposed by Yi et al., suitable for problems involving one main feature and multiple auxiliary features.
[0059] In other words, the public opinion prediction method based on social media platforms provided by this invention is implemented based on a pre-built time-varying prediction model. Specifically, as... Figure 2 As shown, after constructing the time-series feature vector, text representation feature vector, and absolute time-representation feature vector of the target text, these vectors are simultaneously input into a pre-constructed time-varying prediction model. The time-varying prediction model fuses these vectors to obtain the prediction result. The overall time-varying prediction model uses Long Short-Term Memory (LSTM) units as the backbone network to perform a time-series prediction process similar to that of a recurrent neural network. LSTM units are one of the most commonly used unit structures in recurrent neural networks. By simulating the human memory process through gate structures, they can capture long-distance dependencies in sequences and are widely used in various time-series prediction tasks. The role of the LSTM unit is to obtain the hidden state output given all forwards before time t. This hidden state output is used as a representation of the historical changes in the forwards. This representation is then fused with the text representation and absolute time encoding in a vector representation manner to provide the predicted value of the residual at time t, which is the prediction result.
[0060] Based on the above embodiments, the method of extracting the text representation feature vector of the target text specifically includes:
[0061] Extract the original text vector of the target text, the frame effect label vector obtained based on the pre-trained frame effect classification model, and the topic vector of the target text;
[0062] The framing effect classification model is trained using the label feature vector samples of the text samples.
[0063] Specifically, such as Figure 3 As shown, input target text and extract original text vector, framing effect label vector, and topic vector.
[0064] The framing effect classification model extracts framing effect label vectors, denoted by F. In another embodiment of this invention, manually labeled results can also be used directly, denoted by F'. Framing is essentially a special form of textual expression, a purposeful text design method. Framing refers to the process that enables people to form a specific concept about a problem or to reposition their thinking about certain problems. The release of any information can actively influence the audience's reception through different expressions. Information expressions that elicit different reception effects are called framing effects, essentially a special form of textual expression, a purposeful text design method. In the dissemination of information on social media, framing is one of the most important factors. The media can provide an equivalent objective description of an objective fact or problem, but this is usually not conducive to the spread of the message. However, through framing processes, such as adding keywords, highlighting key points, and rephrasing, the message can become more easily spread. The framing effect classification model is a pre-trained model that needs to be pre-trained and inferred. The framing effect classification model consists of an independent BERT pre-trained model combined with a fully connected layer, and uses the Sigmoid function to transform the output into probability values within the range of 0-1. The model is trained using a mean squared error function and selected after 100 hyperparameter searches with accuracy as the evaluation metric on the test set. When deriving the predicted framing effect classification results, a threshold of 0.5 is used to convert them into 0-1 variables. The derived predicted framing effect classification results are only used for inference.
[0065] BERT (Bidirectional Encoder Representation from Transformers) is a pre-trained language model based on the Transformer architecture. Proposed by Google AI in October 2018, it is one of the representative pre-trained natural language models. Pre-trained language models are a general term for a class of models. These models utilize large-scale corpora and employ specific pre-training tasks to train their parameters. They are frequently used to extract semantically rich text vector representations. Mean Squared Error (MSE) is an algorithm that measures the error between predicted and true values by averaging the squared differences.
[0066] During the operation, the original text vector is extracted by the BERT pre-trained model, denoted by L. The BERT pre-trained model has learnable parameters. Taking Weibo repost prediction as an example, in order for the text model to adaptively learn the original text vector (sentence vector) representation of Weibo posts related to the trend of repost count, the public opinion prediction method based on social media platforms provided in this invention first utilizes the BERT pre-trained model to output a sequence of word vectors. Since Weibo posts are generally relatively long, but the public's interest in different words in Weibo posts varies, people often focus their attention on some key information. In order for the model to capture these words that have a key impact on the number of reposts, the public opinion prediction method based on social media platforms provided in this invention uses an attention mechanism to fuse the word vector sequence into a sentence vector (interest semantics).
[0067] The topic vectors are extracted by the BERT pre-trained model, denoted by T, and are used only for inference.
[0068] Based on the above embodiments, the method of extracting the time-series feature vector of the target text specifically includes:
[0069] Obtain the total number of forwards of the target text before time t, and denot them as r0, r1, ... r t-1 ;
[0070] The hidden state output is obtained based on the forwarding count, and the hidden state output is used as the historical change representation of the forwarding count, denoted as h(r0,r1,…r). t-1 );
[0071] With h(r0,r1,…r) t-1 ) is used as the feature vector of the time series.
[0072] Specifically, such as Figure 3 As shown, the time series feature vector is extracted by the Long Short-Term Memory (LSTM) unit in the time-varying prediction model. The time-varying prediction model uses the LSTM unit as the backbone network to perform a time series prediction process similar to a recurrent neural network. The role of the LSTM unit is to calculate all forwarding counts r0, r1, ... r before time t. t-1 The hidden state output is obtained, which represents the historical changes in the number of forwards, i.e., h(r0,r1,…r). t-1 ).
[0073] Based on the above embodiments, in this method, the time series feature vector, the text representation feature vector, and the absolute time representation feature vector are fused using a preset expression to obtain a prediction result; the preset expression is:
[0074]
[0075] Where h(r0,r1,…r) t-1 ) represents the time series feature vector, F represents the framing effect label vector, L represents the original text vector, T represents the topic vector, and A represents the original text vector. t The absolute time represents the eigenvector.
[0076] Specifically, such as Figure 3 As shown, after constructing the time-series feature vector, text representation feature vector, and absolute time representation feature vector of the target text, these vectors are input together into a pre-constructed time-varying prediction model. The time-varying prediction model fuses the time-series feature vector, the text representation feature vector, and the absolute time representation feature vector according to a preset expression to obtain the prediction result. The preset expression can be expressed as:
[0077]
[0078] This fusion corresponds to Figure 3 The "fusion and prediction" unit in the text is named the fusion prediction model, such as... Figure 4 As shown.
[0079] Where h(r0,r1,…r) t-1 ) represents the time series feature vector, F represents the frame effect label vector obtained based on the pre-trained frame effect classification model, L represents the original text vector of the target text, T represents the topic vector of the target text, and A t The absolute time feature vector is the absolute time encoding corresponding to time step t, specifically a vectorized representation of hours, minutes, and seconds.
[0080] Based on the above embodiments, the method involves fusing the time series feature vector, the text representation feature vector, and the absolute time representation feature vector, specifically including:
[0081] The time series feature vector is concatenated in pairs with the original text vector of the target text, the frame effect label vector, the topic vector of the target text, and the absolute time representation feature vector, and then all of them are concatenated at once to obtain 5 fused vectors.
[0082] Each of the aforementioned fusion vectors is input into a pre-stored fusion prediction model to obtain five predicted values, such as... Figure 4 As shown;
[0083] The prediction results are obtained based on the predicted values.
[0084] Specifically, such as Figure 3As shown, since the purpose of the algorithm is time series prediction, the historical representation of the forwarding count is h(r0,r1,…r). t-1 The time series feature vector, h(r0, r1, ... r), is the main feature vector of the deep distributed fusion, while the other four vectors are auxiliary feature vectors. During fusion, the main feature vector, i.e., the time series feature vector h(r0, r1, ... r), is... t-1 Other auxiliary feature vectors: frame effect label vector F, original text vector L, topic vector T, absolute time representation feature vector A t Pairwise concatenation and a full concatenation are performed to form 5 fused vectors. After passing through the FusionNet network, 5 predicted values are given, such as... Figure 4 As shown.
[0085] Based on the above embodiments, in this method, before obtaining the prediction result based on each of the predicted values, the method further includes:
[0086] Determine the prediction time step;
[0087] If the predicted time step is determined to be greater than the time step threshold, then the number of forwards at the next time step after linearly transforming the predicted value obtained by concatenating the time series feature vector and the absolute time representation feature vector is used as the prediction result.
[0088] If the predicted time step is determined to be less than the time step threshold, then the number of forwards at the next moment, calculated by linearly transforming all the predicted values, is used as the prediction result.
[0089] Specifically, the determined prediction time step is compared with a time step threshold. When the determined prediction time step is greater than the time step threshold, it is called a stable prediction. The model uses the time series feature vector h(r0,r1,…r) t-1 The predicted number of forwards at the next time step is predicted by linearly transforming the predicted value of the fusion vector of the feature vector At representing the absolute time step, and the forwarding number at the next time step is used as the prediction result. When the determined prediction time step is less than the time step threshold, the model uses the predicted value of all vectors to perform a linear transformation to predict the forwarding number at the next time step, and the forwarding number at the next time step is used as the prediction result.
[0090] Based on the above embodiments, taking Weibo text as an example, the present invention provides an example of using the above prediction method to complete a prediction.
[0091] Suppose the target text on Weibo is: "Today, most areas will be cloudy with showers. Temperatures will range from 18-25℃ within 24 hours. Upper-level moisture conditions are favorable, and some areas will experience showers and moderate rain." Using this as an example, the present invention is implemented through the technical solutions described in steps S1 to S5 below:
[0092] S1: Based on the target text of the Weibo post, the text representation feature vector of the target text is extracted as follows: Original text vector L: Today, most areas will be cloudy with showers, and the temperature will be 18-25℃; Framing effect label vector F: 1; Topic vector T: Today's weather.
[0093] S2: Obtain the total number of reposts of the target text in the Weibo post before time t, and denot them as r0, r1, ... r t-1 The above forwarding count is input into the LSTM unit in the time-varying prediction model to obtain the time series feature vector, denoted as h(r0,r1,…r). t-1 ).
[0094] S3: Obtain the time corresponding to the current time step, specifically in hours, minutes, and seconds, and vectorize it to obtain the absolute time representation feature vector, denoted as A. t .
[0095] S4: Combine the original text vector L, framing effect label vector F, topic vector T, and time series feature vector h(r0,r1,…r) t-1 The absolute time represents the eigenvector A. t The vectors are concatenated in pairs and then concatenated all at once to form five fused vectors. After passing through the FusionNet network, five predicted values are given.
[0096] S5: Compare the determined prediction time step with the time step threshold. When the determined prediction time step is greater than the time step threshold, the model uses the time series feature vector h(r0,r1,…r) t-1 The predicted number of forwards at the next time step is predicted by linearly transforming the predicted value of the fusion vector of the feature vector At representing the absolute time step, and the forwarding number at the next time step is used as the prediction result. When the determined prediction time step is less than the time step threshold, the model uses the predicted value of all vectors to perform a linear transformation to predict the forwarding number at the next time step, and the forwarding number at the next time step is used as the prediction result.
[0097] After obtaining the prediction results, the cumulative number of reposts of the Weibo post is recorded at fixed time intervals Δt to form a sequence (up to the 24th hour after the Weibo post is published). Different "observation times" are set, that is, the cumulative number of reposts within the observation time after the Weibo post is published is given as the known sequence. The main evaluation index of this invention is the mean square error of the predicted number of reposts sequence outside the observation time. According to the actual experimental results, the mean square error is calculated under four different observation times (0, 1, 2, 3, and 6 hours). When the observation time is greater than 3 hours, the mean square error is already very small and decays slowly. Only the result of the observation time of 6 hours is selected as the representative of the prediction effect under a longer observation time. The mean square errors of these observation times are summed as the comprehensive evaluation index of the model. The calculation method of the evaluation index of the number of reposts sequence prediction task is as follows, observation time t o The unit is hours:
[0098]
[0099] MSE all =MSE(0)+MSE(1)+MSE(2)+MSE(3)+MSE(6)
[0100] in and These refer to the actual cumulative number of reposts at time t for the i-th Weibo sample and the model-predicted number of reposts at time t, respectively.
[0101] Meanwhile, the mean square error of the cumulative number of reposts (representing the popularity of Weibo) predicted up to 24 hours after the Weibo post (the upper limit of the statistical time) under different observation times is presented as a secondary evaluation indicator, as shown in the following formula.
[0102]
[0103] Based on the above evaluation indicators, the prediction results of this invention and their comparison with the effects of other methods are shown in the following two tables. The sampling time interval Δt = 30 minutes.
[0104] Table 1. Prediction results of Weibo repost count sequence
[0105]
[0106] Table 2. Weibo Popularity (Total Retweets in 24 Hours) Prediction Results
[0107]
[0108] In Tables 1 and 2, the first two rows show the results of the baseline model on the test set, the middle two rows show the results of the present invention trained using manually labeled frame effect encoding (MF) on the test set and the difference between the results and the best performance of the two baseline models, respectively, and the last two rows show the results trained using the frame effect encoding (AF) output by the classification model and the difference between the results and the best performance of the two baseline models, respectively.
[0109] As shown in Table 1, the comprehensive evaluation index MSE in this study... all In the above studies, models trained using both framing effects encoding methods showed some improvement over the baseline model, reducing the MSE. all The values were 0.158 and 0.118, respectively, representing 10.3% and 7.7% as percentages. Further analysis of the constituent MSE... all Observations were made on various aspects, and the results showed that MSE all The improvement primarily stems from the reduction in mean squared error when the observation time is 0 hours, i.e., without any prior information on the number of reposts. This result demonstrates that incorporating relevant information from the Weibo text itself leads to more accurate time-series predictions of the number of reposts, especially when the initial known repost count is limited. Overall, the experimental results show that this invention outperforms the baseline model in predicting the number of Weibo reposts over time series, and the integration of textual information plays a crucial role.
[0110] Table 2 shows the model's prediction performance on Weibo popularity. In the experiment, Weibo popularity was represented by the total number of reposts within 24 hours, i.e., the last data point in the repost count sequence. The overall trend of the popularity prediction performance is basically consistent with the overall trend of the repost count sequence prediction performance. When the observation time is 0 or 1 hour, the present invention shows relatively greater improvement in the results. However, since TCN's popularity prediction results are relatively better when the observation time is 0 hours, the results of the present invention (AF) model are slightly biased when the observation time is 0 hours. The present invention (MF) model achieves improvements on the four popularity prediction evaluation indicators, indicating that the present invention outperforms the baseline model to some extent in the popularity prediction task.
[0111] Furthermore, to demonstrate the effectiveness of the design of each part of the model of this invention, ablation experiments were conducted on it. Three ablation models were developed after the ablation design, as follows:
[0112] 1. Model without framing input. This model is constructed by removing the portion of the time-varying prediction model that encodes the framing effect input.
[0113] 2. Model without language input (w / o language). This model does not provide a set of microblog text vector representations; all elements involved in the time-varying prediction model are removed, retaining only the representation h(r0, r1, ... r) of the sequence historical information. t-1 The ablation model is formed by the fusion prediction part of the absolute time representation At.
[0114] 3. Model without any additional information input (LSTM). The model degenerates into a time series prediction model using only the target sequence data. This invention degenerates into an LSTM, and the results are shown in the first row of Tables 1 and 2.
[0115] The results of the ablation experiments are shown in Table 3. The first row lists the experimental results of the (MF) model of the present invention shown in Table 1 as a benchmark.
[0116] Table 3 Ablation Experiment Results
[0117]
[0118] Rows 2 and 3 of the table show the results of ablation model (1) on the test set and the decrease in performance relative to the baseline model, i.e., the mean squared error increment. Rows 4 and 5 of the table show the results of ablation model (2) on the test set and the decrease in performance relative to the baseline model, respectively.
[0119] Ablation experiments showed that removing frame effect data reduced the model performance by 0.037, approximately 2.7%; removing all text components reduced it by 0.135, approximately 9.8%; and further removing absolute time information, based on existing LSTM experiments, reduced performance by 0.197, approximately 14.3%. Individual evaluations of the mean squared errors also showed varying degrees of performance degradation after ablation. However, it's noteworthy that at a 6-hour observation period, the ablated models consistently showed slight performance improvements over the baseline model. This might be because, with longer observation periods, text and other information provide less support and act as noise that interferes with the model.
[0120] The results of the ablation experiments demonstrate that adding absolute time information, linguistic information, and framing effect information to the LSTM model improves the model's prediction performance to varying degrees, indicating that the design of the corresponding model components is effective.
[0121] Furthermore, supplementary experiments show that the prediction performance of this invention remains largely stable under different sampling intervals. This invention maintains an advantage over the baseline model in the main task of predicting the number of reposts. In summary, the algorithm proposed in this invention achieves better prediction results in the task of predicting the time series of Weibo reposts.
[0122] In the above specific embodiments, the public opinion prediction method based on social media platforms provided by the present invention obtains the target text to be predicted and extracts the time-series feature vector, text representation feature vector, and absolute time representation feature vector of the target text; based on a pre-constructed time-varying prediction model, the time-series feature vector, the text representation feature vector, and the absolute time representation feature vector are fused to obtain the prediction result, which includes the residual value between the number of reposts at the next time moment and the number of reposts at the current time moment; the time-varying prediction model is constructed based on a deep distributed fusion network. Because the present invention adds text representation feature vectors and absolute time representation feature vectors, the vector samples are richer, and the accuracy of the public opinion prediction method is significantly improved. Therefore, the public opinion prediction method provided by the present invention can utilize the rich information of the original text and flexibly fuse it, achieving the effect of improving prediction accuracy.
[0123] The following describes the public opinion prediction device based on a social platform provided by the present invention. The public opinion prediction device based on a social platform described below can be referred to in correspondence with the public opinion prediction method based on a social platform described above.
[0124] Figure 5 This is a schematic diagram of the structure of the social media-based public opinion prediction device provided by the present invention, as shown below. Figure 5 As shown, it includes a feature vector extraction unit 510 and a result prediction unit 520.
[0125] in:
[0126] The feature vector extraction unit 510 is used to obtain the target text to be predicted and extract the time series feature vector, text representation feature vector and absolute time representation feature vector of the target text.
[0127] The result prediction unit 520 is used to fuse the time series feature vector, the text representation feature vector and the absolute time representation feature vector based on a pre-built time-varying prediction model to obtain a prediction result, which includes the residual value between the number of forwards at the next time step and the number of forwards at the current time step.
[0128] The time-varying prediction model is built on a deep distributed fusion network.
[0129] Based on the above embodiments, in this device,
[0130] Extracting the text representation feature vector of the target text specifically includes:
[0131] Extract the original text vector of the target text, the frame effect label vector obtained based on the pre-trained frame effect classification model, and the topic vector of the target text;
[0132] The framing effect classification model is trained using the label feature vector samples of the text samples.
[0133] Based on the above embodiments, in this device,
[0134] Extracting the time-series feature vector of the target text specifically includes:
[0135] Obtain the total number of forwards of the target text before time t, and denot them as r0, r1, ... r t-1 ;
[0136] The hidden state output is obtained based on the forwarding count, and the hidden state output is used as the historical change representation of the forwarding count, denoted as h(r0,r1,…r). t-1 );
[0137] With h(r0,r1,…r) t-1 ) is used as the feature vector of the time series.
[0138] Based on the above embodiments, in this device,
[0139] The time series feature vector, the text representation feature vector, and the absolute time representation feature vector are fused using a preset expression to obtain a prediction result; the preset expression is:
[0140]
[0141] Where h(r0,r1,…r) t-1 ) represents the time series feature vector, F represents the framing effect label vector, L represents the original text vector, T represents the topic vector, and A represents the original text vector. t The absolute time represents the eigenvector.
[0142] Based on the above embodiments, in this device,
[0143] The fusion of the time series feature vector, the text representation feature vector, and the absolute time representation feature vector specifically includes:
[0144] The time series feature vector is concatenated in pairs with the original text vector of the target text, the frame effect label vector, the topic vector of the target text, and the absolute time representation feature vector, and then all of them are concatenated at once to obtain 5 fused vectors.
[0145] Each of the aforementioned fusion vectors is input into a pre-stored fusion prediction model to obtain five predicted values;
[0146] The prediction results are obtained based on the predicted values.
[0147] Based on the above embodiments, in this device,
[0148] The prediction result is obtained based on each of the predicted values, and prior to this, the following steps are also included:
[0149] Determine the prediction time step;
[0150] If the predicted time step is determined to be greater than the time step threshold, then the number of forwards at the next time step after linearly transforming the predicted value obtained by concatenating the time series feature vector and the absolute time representation feature vector is used as the prediction result.
[0151] If the predicted time step is determined to be less than the time step threshold, then the number of forwards at the next moment, calculated by linearly transforming all the predicted values, is used as the prediction result.
[0152] In the above specific embodiments, the public opinion prediction device based on a social platform provided by the present invention acquires the target text to be predicted and extracts the time-series feature vector, text representation feature vector, and absolute time representation feature vector of the target text; based on a pre-built time-varying prediction model, the time-series feature vector, the text representation feature vector, and the absolute time representation feature vector are fused to obtain a prediction result, which includes the residual value between the number of reposts at the next time moment and the number of reposts at the current time moment; the time-varying prediction model is constructed based on a deep distributed fusion network. Because the present invention adds text representation feature vectors and absolute time representation feature vectors, the included vector samples are rich, and the accuracy of the public opinion prediction method is significantly improved. Therefore, the public opinion prediction device provided by the present invention can utilize the rich information of the original text and flexibly fuse it, achieving the effect of improving prediction accuracy.
[0153] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6As shown, the electronic device may include a processor 610, a communications interface 620, a memory 630, and a communication bus 640. The processor 610, communications interface 620, and memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a social media-based public opinion prediction method. This method includes: acquiring the target text to be predicted and extracting the time-series feature vector, text representation feature vector, and absolute time-representation feature vector of the target text; fusing the time-series feature vector, text representation feature vector, and absolute time-representation feature vector based on a pre-built time-varying prediction model to obtain a prediction result, the prediction result including the residual value between the number of reposts at the next time step and the number of reposts at the current time step; the time-varying prediction model is constructed based on a deep distributed fusion network.
[0154] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0155] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the social media-based public opinion prediction method provided by the above methods. The method includes: acquiring the target text to be predicted, and extracting the time-series feature vector, text representation feature vector, and absolute time-representation feature vector of the target text; fusing the time-series feature vector, the text representation feature vector, and the absolute time-representation feature vector based on a pre-built time-varying prediction model to obtain a prediction result, wherein the prediction result includes the residual value of the number of reposts at the next time step and the number of reposts at the current time step; the time-varying prediction model is constructed based on a deep distributed fusion network.
[0156] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program is implemented to perform the aforementioned social media platform-based public opinion prediction method. The method includes: acquiring target text to be predicted, and extracting time-series feature vectors, text representation feature vectors, and absolute time-representation feature vectors of the target text; fusing the time-series feature vectors, text representation feature vectors, and absolute time-representation feature vectors based on a pre-built time-varying prediction model to obtain a prediction result, wherein the prediction result includes the residual value between the number of reposts at the next time step and the number of reposts at the current time step; the time-varying prediction model is constructed based on a deep distributed fusion network.
[0157] 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.
[0158] 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.
[0159] 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 method for predicting public opinion based on social media platforms, characterized in that, include: Obtain the target text to be predicted, and extract the time series feature vector, text representation feature vector, and absolute time representation feature vector of the target text; Based on a pre-built time-varying prediction model, the time series feature vector, the text representation feature vector, and the absolute time representation feature vector are fused to obtain a prediction result, which includes the residual value between the number of forwards at the next time step and the number of forwards at the current time step. The time-varying prediction model is built on a deep distributed fusion network; Specifically, extracting the time-series feature vector of the target text includes: obtaining all forwarding counts of the target text before time t, and denoting them as follows: The hidden state output is obtained based on the forwarding count, and the hidden state output is used as a representation of the historical changes in the forwarding count, denoted as... ;by The time-series feature vector is used as the time-varying prediction model. The time-varying prediction model uses a long short-term memory (LSTM) unit as the backbone network. The LSTM unit is used to obtain the hidden state output based on all forwarding counts before time t. Using a preset expression, the time series feature vector, the text representation feature vector, and the absolute time representation feature vector are fused to obtain a prediction result; the prediction result is the predicted value of the residual at time t, and the preset expression is: ; in, This represents the time series feature vector. Represents the framing effect label vector. Represents the original text vector. Represents the topic vector. The absolute time represents the eigenvector; Determine the prediction time step; if the prediction time step is greater than the time step threshold, then the number of forwards at the next time step after linearly transforming the predicted value obtained by concatenating the time series feature vector and the absolute time representation feature vector is used as the prediction result; if the prediction time step is less than the time step threshold, then the number of forwards at the next time step after linearly transforming all the predicted values is used as the prediction result.
2. The method for predicting public opinion based on social media platforms according to claim 1, characterized in that, Extracting the text representation feature vector of the target text specifically includes: Extract the original text vector of the target text, the frame effect label vector obtained based on the pre-trained frame effect classification model, and the topic vector of the target text; The framing effect classification model is trained using the label feature vector samples of the text samples.
3. The public opinion prediction method based on social platforms according to claim 1, characterized in that, The fusion of the time series feature vector, the text representation feature vector, and the absolute time representation feature vector specifically includes: The time series feature vector is concatenated in pairs with the original text vector of the target text, the frame effect label vector, the topic vector of the target text, and the absolute time representation feature vector, and then all of them are concatenated at once to obtain 5 fused vectors. Each of the aforementioned fusion vectors is input into a pre-stored fusion prediction model to obtain five predicted values; The prediction results are obtained based on the predicted values.
4. A public opinion prediction device based on a social platform, characterized in that, include: The feature vector extraction unit is used to obtain the target text to be predicted and extract the time series feature vector, text representation feature vector and absolute time representation feature vector of the target text; The result prediction unit is used to fuse the time series feature vector, the text representation feature vector and the absolute time representation feature vector based on a pre-built time-varying prediction model to obtain a prediction result, which includes the residual value between the number of forwards at the next time step and the number of forwards at the current time step. The time-varying prediction model is built on a deep distributed fusion network; Specifically, the feature vector extraction unit, when extracting the time-series feature vector of the target text, is used to: obtain all forwarding counts of the target text before time t, and record them as follows: The hidden state output is obtained based on the forwarding count, and the hidden state output is used as a representation of the historical changes in the forwarding count, denoted as... ;by As the time series feature vector; the time-varying prediction model uses a Long Short-Term Memory (LSTM) unit as the backbone network to perform a time series prediction process similar to a recurrent neural network. The LSTM unit is used to obtain the hidden state output given all forwards before time t. Using a preset expression, the time series feature vector, the text representation feature vector, and the absolute time representation feature vector are fused to obtain a prediction result; the prediction result is the predicted value of the residual at time t, and the preset expression is: ; in, This represents the time series feature vector. Represents the framing effect label vector. Represents the original text vector. Represents the topic vector. The absolute time represents the eigenvector; Determine the prediction time step; if the prediction time step is greater than the time step threshold, then the number of forwards at the next time step after linearly transforming the predicted value obtained by concatenating the time series feature vector and the absolute time representation feature vector is used as the prediction result; if the prediction time step is less than the time step threshold, then the number of forwards at the next time step after linearly transforming all the predicted values is used as the prediction result.
5. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the public opinion prediction method based on a social platform as described in any one of claims 1 to 3.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the social media-based public opinion prediction method as described in any one of claims 1 to 3.
7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the social media-based public opinion prediction method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Time sequence prediction method based on news public opinions
CN110222149A
Method for predicting social attention hotspots in network public opinion events based on group analysis
CN111581983A
Prediction method and prediction system for video public opinions
CN111582587A
Public opinion evolution trajectory determination method and system based on function type data analysis
CN115017391A
Network public opinion analysis method and apparatus, and computer-readable storage medium
WO2019227710A1