Network public opinion perception prediction method and system based on neural network and genetic algorithm

By combining LSTM and MLP-GA models, preprocessing and feature selection of financial public opinion data is solved, and the prediction deviation problem of traditional methods in massive unstructured data is achieved, and efficient and accurate financial risk prediction and sentiment analysis are achieved.

CN120408318APending Publication Date: 2025-08-01SOUTHEAST UNIV
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510639175.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

Traditional financial public opinion analysis methods are difficult to accurately capture emotional changes and dynamic fluctuations when facing massive and unstructured data, especially when there are large prediction deviations in sudden financial crises and severe market fluctuations.

Method used

The network public sentiment perception prediction method based on neural networks and genetic algorithms is adopted, and data preprocessing, feature extraction and emotion classification is carried out through the combination of LSTM model and MLP-GA model. The time series prediction label is captured using sliding window technology, and the feature selection and hyperparameters are optimized through genetic algorithms to build a network public sentiment perception prediction system.

Benefits of technology

It significantly improves the accuracy of financial risk prediction and the generalization ability of the model, reduces the computational complexity and time cost, and improves the prediction accuracy and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120408318A_ABST
    Figure CN120408318A_ABST
Patent Text Reader

Abstract

The invention discloses a network public opinion perception prediction method and system based on a neural network and a genetic algorithm, and relates to the technical field of artificial intelligence, and the method comprises the steps: receiving financial network public opinion data, carrying out the preprocessing of the financial network public opinion data, and obtaining the processed financial network public opinion data, converting unstructured texts in the processed financial network public opinion data into structured features to obtain structured financial network public opinion data; inputting the structured financial network public opinion data into a pre-established LSTM model to obtain time sequence prediction label data, inputting the time sequence prediction label data into a pre-established MLP-GA model, and outputting to obtain a financial network public opinion perception prediction result; and the accuracy of financial risk prediction and the generalization ability of the model are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and system for predicting network public opinion perception based on a neural network and a genetic algorithm. Background Art

[0002] With the rapid development of financial markets and the diversification of information dissemination methods, the importance of financial online public opinion in market fluctuations, investment decisions, and financial risk management has become increasingly prominent. In modern financial markets, public opinion information reflects the changing emotions of market participants, and these emotional fluctuations may have an impact on financial market stability. Traditional financial public opinion analysis methods have significant limitations when dealing with massive amounts of unstructured data. Specifically, traditional models struggle to accurately capture the emotional changes and dynamic fluctuations in public opinion, especially in the face of sudden financial crises and drastic market fluctuations, often resulting in significant forecasting errors. Therefore, improving the accuracy, stability, and generalization of financial online public opinion analysis has become a key issue that needs to be urgently addressed in financial risk prediction and management. Summary of the Invention

[0003] In order to solve the deficiencies mentioned in the above background technology, the purpose of the present invention is to provide a network public opinion perception prediction method and system based on neural network and genetic algorithm.

[0004] In a first aspect, the purpose of the present invention can be achieved by the following technical solution: a network public opinion perception prediction method based on a neural network and a genetic algorithm, the method comprising the following steps:

[0005] Receiving financial network public opinion data, preprocessing the financial network public opinion data to obtain processed financial network public opinion data, and converting unstructured text in the processed financial network public opinion data into structured features to obtain structured financial network public opinion data;

[0006] The structured financial network public opinion data is input into the pre-established LSTM model to obtain time series prediction label data, and the time series prediction label data is input into the pre-established MLP-GA model to output the financial network public opinion perception prediction results.

[0007] In conjunction with the first aspect, in certain implementations of the first aspect, the method further includes: the process of preprocessing the financial network public opinion data includes:

[0008] Data filtering and data cleaning are performed on the financial network public opinion data. Data cleaning includes removing noise and redundant information, processing data missing, and then performing text processing, including word segmentation and part-of-speech tagging of the financial network public opinion data, and then performing feature extraction, including reducing the dimensionality, and converting the processed text data through TF-IDF to obtain the processed financial network public opinion data.

[0009] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: The inputting of the structured financial network public opinion data into the pre-established LSTM model includes:

[0010] Represent the input structured financial network public opinion data as a matrix: X = {x1, x2, …, x T}, t = 1, 2, …, T, where T represents the length of the text, and x t represents the embedding vector of the t-th word. The input layer of the LSTM network model receives sequence data. The hidden layer of the LSTM adopts a multi-layer stacked structure. Each layer of LSTM units captures different levels of temporal dependencies in the text sequence. The output of the hidden layer is mapped to sentiment classification labels through a fully connected layer. The output layer completes sentiment classification through the softmax activation function and obtains the probability value of each sentiment category: z j represents the linear combination of the output layer. K represents the total number of sentiment categories. Through the softmax function, the sentiment distribution of the text is converted into probability values, and the final sentiment label is selected according to the maximum probability.

[0011] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: In the pre-established LSTM model, for multi-classification tasks, the formula of the cross-entropy loss function is: N represents the number of samples, K represents the number of sentiment categories, and y ij represents the actual label of the i-th sample;

[0012] Use the backpropagation algorithm to calculate the gradient of the loss function, update the parameters through the gradient descent method and combine with the weighted mean square error WMSE, and use the weighted mean square error WMSE to adjust the loss function weights;

[0013] When the pre-established LSTM model extracts time series prediction label data, the sliding window technique is adopted, which is expressed as follows:

[0014] Window(t) = {x t , x t+1 , …, x t+29}.

[0015] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: The MLP network of the pre-established MLP-GA model includes multiple hidden layers. Each hidden layer consists of multiple neurons. The ReLU function is used between the hidden layers. When training the MLP network, the loss function used is MSE, and the calculation formula of the loss function is: y i represents the actual financial risk label, represents the predicted value, n represents the number of samples, and the stochastic gradient descent method is used as the optimization algorithm. By randomly sampling small batches of samples, the gradient of the loss function is calculated and the network weights are updated. The gradient update formula is: is the gradient of the parameter θ.

[0016] Combined with the first aspect, in some implementation manners of the first aspect, the method further includes: the MLP network applies L2 regularization to penalize the sum of squares of the weight parameters. The loss function of the L2 regularization term is: is the L2 norm of the weight matrix of the th layer, and λ is the regularization strength hyperparameter. The final loss function includes the original MSE and the regularization term:

[0017] Combined with the first aspect, in some implementation manners of the first aspect, the method further includes: the stability of the MLP network is maintained by the batch normalization technique. The calculation process is as follows: μ and σ 2 are the mean and variance of the current data respectively; γ and β are learnable parameters, ∈ is a constant. In the batch normalization process, the mean μ and variance σ are calculated according to the current batch of data 2 , and through the normalization operation the initially normalized result is obtained

[0018] Combined with the first aspect, in some implementation manners of the first aspect, the method further includes: within the pre-established MLP-GA model, the data output from the MLP to the GA will be fed back from the GA to the MLP. The GA network effectively screens from the preliminary feature set. The core operations include selection, crossover, and mutation.

[0019] In a second aspect, in order to achieve the above object, the present invention discloses a network public opinion sentiment prediction system based on a neural network and a genetic algorithm, including:

[0020] A data processing module, configured to receive financial network public opinion data, preprocess the financial network public opinion data to obtain processed financial network public opinion data, and convert the unstructured text in the processed financial network public opinion data into structured features to obtain structured financial network public opinion data;

[0021] A perception prediction module, configured to input the structured financial network public opinion data into a pre-established LSTM model to obtain time series prediction label data, and input the time series prediction label data into a pre-established MLP-GA model to output a financial network public opinion sentiment prediction result.

[0022] In another aspect of the present invention, in order to achieve the above object, a terminal device is disclosed, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. The memory stores a computer program capable of running on the processor. When the processor loads and executes the computer program, the network public opinion perception prediction method based on neural network and genetic algorithm as described above is adopted.

[0023] Advantages of the present invention:

[0024] The present invention uses deep learning technology to perform sentiment analysis on unstructured financial public opinion data, and combines genetic algorithm for feature selection and hyperparameter optimization, effectively improving the accuracy of financial risk prediction and the generalization ability of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings;

[0026] Figure 1 It is a schematic flowchart of the method of the present invention;

[0027] Figure 2 It is a schematic data processing flowchart of the present invention;

[0028] Figure 3 It is a schematic comparison diagram of the prediction accuracy of the present invention;

[0029] Figure 4 It is a schematic comparison diagram of the evaluation results of the risk warning effect of the present invention;

[0030] Figure 5 It is a schematic comparison diagram of the calculation efficiency and risk warning timeliness of each method of the present invention;

[0031] Figure 6 It is a schematic system structure diagram of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0032] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0033] Embodiment 1:

[0034] As Figure 1 shown, a network public opinion perception prediction method based on a neural network and a genetic algorithm, the method comprising the following steps:

[0035] S101: Receive financial network public opinion data, preprocess the financial network public opinion data to obtain processed financial network public opinion data, and convert the unstructured text in the processed financial network public opinion data into structured features to obtain structured financial network public opinion data;

[0036] Among them, the financial network public opinion data is crawled daily at regular intervals using the Scrapy crawler tool. The crawling time is 1 hour before the opening of the trading day, during the trading day, and 1 hour after the close. The first 20 pages of the latest content of news websites are crawled, and all tweets and discussion content related to financial keywords published on the social media platform on the same day are captured. The text information related to the financial market is screened, and irrelevant data is removed during the collection process. The collected data set is divided into a training set, a validation set, and a test set in a ratio of 8:1:1.

[0037] In the data preprocessing stage, first remove the HTML (HyperText Markup Language) tags in the original data, and then remove advertisements, non-text content, and other irrelevant information. Use regular expressions to process special characters in the text data to remove meaningless symbols and noise. For missing data, numerical data is filled with the mean value, and text data is filled with the interpolation method. At the same time, redundant information in the data is removed, especially duplicate records and nearly duplicate public opinion events. In the word segmentation and processing of text data, Chinese text is segmented using the Jieba word segmentation tool, and English text is segmented using NLTK (Natural Language Toolkit). All texts are first segmented into words or phrases by a tokenizer, and common stop words are removed. In the part-of-speech tagging link, a part-of-speech tagger is used to tag each word segmentation result, so as to assign different semantic weights to different words in subsequent sentiment analysis and feature extraction. For words that are difficult to identify, a Word2Vec word embedding model is used for vectorization processing to map the words to a high-dimensional vector space. In the feature extraction stage, the TF-IDF (Term Frequency-Inverse Document Frequency) algorithm is used to transform the processed text. The TF-IDF algorithm evaluates the importance of words according to the frequency of each word's occurrence and its inverse document frequency in the entire corpus. The words in each text segment are weighted by the TF-IDF value to generate a feature vector. At the same time, the TF-IDF results are standardized to reduce the influence of high-frequency irrelevant words. Combine the bag-of-words model with TF-IDF for feature vectorization, and finally obtain the vector representation corresponding to each public opinion data. In addition, the principal component analysis method is also used to extract the main features in the data, retain the first 80% of the variance information, reduce the feature dimension, and relieve the computational pressure.

[0038] S102: Input the structured financial network public opinion data into a pre-established LSTM model to obtain time series prediction label data, and then input the time series prediction label data into a pre-established MLP-GA model to output the financial network public opinion perception prediction result.

[0039] Use the LSTM iterative model to classify the sentiment of financial network public opinion data and capture the sentiment fluctuation. The data output by LSTM to MLP will be fed back to LSTM by MLP. The iterative system formed by the two performs inferiority iteration with data volumes of 100%, 80%, 60%, 40%, and 20%. Due to the reduction of the data volume, the accuracy will decrease and the error will increase, finally obtaining the worst index. This is meant to be the lower limit prediction boundary. If the worst case can meet the standard, it can naturally be upward compatible.

[0040] The step of inputting the structured financial network public opinion data into a pre-established LSTM model includes:

[0041] Extract sentiment information from the original text data to provide reliable sentiment input for subsequent risk prediction and decision-making. The preprocessed text feature vectors are used as the input of the model. The feature vector of each text is represented as a word embedding sequence. The word embedding dimension is set to 300, and the sequence length is fixed at 300 words. If the text is much less than 300 words, zero padding is used to increase the sequence length; if the text exceeds 300 words, key information is extracted according to TF-IDF weights and redundant parts are deleted, giving priority to retaining high-frequency keywords and words with higher sentiment weights. Formally, the input data is represented as a matrix: X = {x1, x2, …, x T}, t = 1, 2, …, T, where T represents the length of the text, and x t represents the embedding vector of the t-th word. The input layer of the LSTM network receives the sequence data. The hidden layer of LSTM adopts a multi-layer stacked structure, enabling the model to process sequence data with long-term dependencies. Each layer of LSTM units can capture different levels of temporal dependencies in the text sequence. The output of the hidden layer is mapped to sentiment classification labels through a fully connected layer. The output layer completes sentiment classification through the softmax activation function and obtains the probability value of each sentiment category: z j represents the linear combination of the output layer, and K represents the total number of sentiment categories. Through the softmax function, the model converts the sentiment distribution of the text into probability values and selects the final sentiment label according to the maximum probability.

[0042] The text samples in the training set are preprocessed and then input into the LSTM model. The model aims to discover the mapping relationship between sentiment labels and text attributes. For multi-classification tasks, the formula for the cross-entropy loss function is: N represents the number of samples, K represents the number of emotion categories, and y ij represents the actual label of the i-th sample, and represents the model's predicted probability. During training, the backpropagation algorithm is used to calculate the gradient of the loss function, and the parameters are updated using gradient descent. Dropout is used during model training to prevent overfitting, and the dropout rate is set to 0.3 to improve the model's generalization ability. Furthermore, the batch size is set to 64, and the training set samples are fed into the model in small batches. The model is trained for multiple rounds until the training error is minimized. After model training is complete, the sentiment extraction component extracts sentiment fluctuation information from the trained LSTM. Sentiment fluctuation information is generated by the output layer of the LSTM model, which calculates the probability of each sentiment category. The sentiment label of each public opinion event is obtained by sorting the probability values, and its changing trend is recorded. Sentiment fluctuation information reflects the sentiment trend of public opinion events over time. This feature serves as input to the subsequent neural network model and is further used for market risk prediction and sentiment change analysis. To extract sentiment fluctuation information, the model uses a sliding window technique. Each window contains 30 time steps, representing a public opinion data sample, and the window sliding step is 1. Whenever a new data sample is added, the model will re-evaluate and update the sentiment fluctuation information. The sliding window can be expressed as: Window(t) = {x t ,x t+1 ,...,x t+29}.

[0043] The LSTM output is a sequence of sentiment labels, representing the emotional trend of the public opinion event. This sentiment information is integrated into fluctuation features, providing input for the subsequent neural network risk prediction task. Assuming this is the first generated result, the value output to the MLP is compared again with the LSTM result from the same 100% data set, retaining the worst result. At this point, the second iteration begins, randomly selecting 80% of the data for further processing by the LSTM, and the worst result is selected. Similarly, iterative comparisons are repeated for 60%, 40%, and 20% of the data sets. Finally, the worst value is input into the MLP model for subsequent risk assessment and prediction.

[0044] When designing the MLP model of the MLP network of the pre-established MLP-GA model, the number of nodes in the input layer is set according to the characteristic vector of the public opinion data. The characteristic data provided by the sentiment analysis module is preprocessed and converted into a numerical vector form as the input of the neural network. The input data contains emotional fluctuations, market trends and other relevant financial information. The MLP network contains multiple hidden layers, each hidden layer consists of a number of neurons, and the number of neurons is determined by experimental tuning. The ReLU function is used between the hidden layers to ensure that nonlinear features can be captured and the gradient disappearance problem can be avoided. When training the neural network model, the backpropagation algorithm is used to update the weights, and the loss function used is MSE. The calculation formula of the loss function is: y i Indicates the actual financial risk label, Denotes the predicted value, and n denotes the number of samples. Stochastic gradient descent is used as the optimization algorithm to improve training efficiency. By randomly sampling small batches of samples, the gradient of the loss function is calculated and the network weights are updated. The gradient update formula is: is the gradient of the parameters θ.

[0045] A grid search method is used to adjust the learning rate, and a learning rate decay strategy is combined to enhance stability. A grid search is performed on the initial learning rate in the range of 0.0001 to 0.1 to find the optimal initial learning rate. During training, a learning rate decay strategy is used. As the number of training rounds increases, the learning rate gradually decreases, and the final learning rate stabilizes between 0.001 and 0.0001. The MLP model applies L2 regularization to prevent overfitting. This is done by penalizing the sum of the squares of the weight parameters to avoid model overfitting. The loss function of the L2 regularization term is: is the L2 norm of the layer weight matrix, and λ is the regularization strength hyperparameter. The final loss function contains the original MSE and the regularization term: In addition, to further improve the stability of the model, batch normalization technology is used to ensure the stability of the gradient. The purpose of batch normalization is to keep the mean of each layer input to 0 and the variance to 1 during each update, thereby avoiding the gradient explosion or gradient vanishing problem. Batch normalization is performed on the input of each layer. The calculation process is as follows: μ and σ 2 are the mean and variance of the current batch of data. γ and β are learnable parameters. □ is a small constant. In the batch normalization process, we first calculate the mean μ and variance σ based on the current batch of data. 2 , through the normalization operation Get the initial normalized results The small constant □ is added to prevent the denominator from being zero. Then, the learnable parameters y are used to perform scaling and offset to obtain the final output y. This operation can stabilize the distribution of input data across neural network layers, alleviate vanishing or exploding gradient problems, accelerate model convergence, and improve model stability and generalization.

[0046] Feature selection in this scheme is a key step in this research. Its purpose is to select the most predictive features from a large initial feature set and remove redundant and irrelevant features, thereby improving model training efficiency and predictive accuracy. A general algorithm (GA) optimizes this process. The MPL-GA iterative system is similar to the above iterations. The data output by the MLP to the GA is fed back by the GA to the MLP. The resulting iterative system performs inferior iterations at 100%, 80%, 60%, 40%, and 20% of the data. The final result is the worst-case metric produced by both iterative systems.

[0047] The generation of the feature set is based on the text processing and sentiment analysis results of the previous stage. After processes such as word segmentation, stop word removal, and part-of-speech tagging, the extracted features include word frequency, TF-IDF value, sentiment fluctuation features, etc. These features cover text information, as well as numerical indicators such as sentiment intensity and sentiment polarity extracted from sentiment analysis, forming a preliminary feature set. This set contains various features that may affect public opinion fluctuation prediction and has multi-dimensional information from multiple data sources. The key to feature selection lies in the application of GA. GA effectively screens from the preliminary feature set to improve the prediction ability of the model. Before applying GA, a population of feature subsets is first generated. Each individual in the population represents a feature subset, and the genes of the individual are defined by binary encoding in the feature subset. For a feature subset, if a certain feature is selected, its corresponding position is 1, otherwise it is 0. The initial individuals in the population are randomly generated, and each individual contains several features. The number of individuals is set according to experimental requirements. The fitness function evaluates the quality of the feature subset based on the performance of the trained model on the validation set, ensuring that GA screens out the feature subset that can improve the prediction accuracy. The higher the fitness value, the better the prediction result. Subsets with low fitness values will be eliminated. This paper adopts a 5-fold cross-validation strategy to prevent the fitness function from falling into a local optimum. In each round of iteration, 4 subsets are used for training and evaluation, and 1 subset is selected for validation. Each feature subset is trained under different data partitions and the prediction accuracy is calculated. The final fitness value is determined by the average of 5 evaluation results, avoiding the bias caused by a single data partition and improving the generalization ability of the model. The core operations of GA include selection, crossover, and mutation. In this study, the selection operation is based on the evaluation of the impact of each feature subset on the prediction accuracy of financial public opinion data. The fitness value is determined by calculating the prediction error of the feature subset on the validation set. The roulette wheel algorithm is used for selection, and the feature subsets that perform excellently in financial risk prediction are preferentially retained. The crossover operation selects two individuals with high fitness and combines high-quality feature combinations of different individuals by exchanging the selection status in the feature subset. The crossover operation aims to combine high-quality feature combinations in different individuals to improve the prediction ability of the offspring individuals. The mutation operation randomly selects a feature in the feature subset and changes its selection status. In this study, the mutation probability is set relatively low to ensure that the mutation operation does not cause the search process to be too random, while ensuring the diversity of the feature subset and not destroying the discovered effective feature combinations.

[0048] Furthermore, in the method, GA continuously evolves the population during the iteration process. Eventually, the optimal feature subset is obtained after multiple generations of alternation. This feature subset contains the features that contribute the most to the prediction of public opinion events, while excluding redundant and irrelevant features. After each generation of iteration, the performance of the current population is evaluated through a fitness function and compared with the previous generation to ensure that the quality of the feature subset is gradually improved. Assuming that this is the first time to generate results, the numerical values of the MLP need to be processed again with the same data volume of 100%, and the obtained results are compared with the existing GA index results, and the worst results of the two are retained; at this time, the second iteration is entered, and 80% of the data volume is randomly selected and continued to be processed by the MLP. The generated results continue to take the worse. Similarly, the iterations and comparisons are carried out for data volumes of 60%, 40%, and 20%. Finally, the worst iteration value is input into the GA model for subsequent risk assessment and prediction. After multiple generations of evolution, the final feature set obtained by GA contains the features that contribute the most to the prediction accuracy of the model. The final feature subset has a smaller dimension, but can maintain a high prediction accuracy, reducing the computational complexity and time cost of model training.

[0049] The present invention aims to construct a financial public opinion security perception and prediction framework based on LSTM and GA. By analyzing the emotional fluctuations in public opinion data through LSTM, extracting temporal change information, and using the sliding window technology to capture the temporal emotional fluctuation rules, it provides support for subsequent financial risk prediction. As Figure 3 shown, based on the emotional features extracted by LSTM, MLP is used to capture the complex non-linear relationship between market trends and public opinion data. Combining with the GA global feature selection mechanism to screen the most predictive features and eliminate redundant information, significantly improving the model training efficiency and prediction accuracy (MSE is reduced by 32%, R 2 reaches 0.91 - 0.95). Using GA to optimize the neural network hyperparameters, by defining the hyperparameter search space (the number of network layers is 1 - 5, the number of neurons is 64 - 512, the learning rate is 0.0001 - 0.1, etc.), combined with tournament selection, single-point crossover and mutation operations, the fitness function is optimized through multiple generations of iteration. As Figure 4 shown, the framework based on this method has significant advantages in prediction accuracy (MAE < 0.1); risk warning timeliness (5.5 - 6 seconds / time), computational efficiency (38.44 samples / second) and model stability (generalization ability score 0.84 - 0.94). As Figure 5 shown, it improves the prediction robustness in cross-market scenarios, providing an accurate and efficient analysis tool for financial risk management.

[0050] Embodiment 2: Second aspect, as Figure 6 shown, in order to achieve the above object, the present invention discloses a network public opinion perception and prediction system based on a neural network and a genetic algorithm, including:

[0051] A data processing module 11, configured to receive financial network public opinion data, preprocess the financial network public opinion data to obtain processed financial network public opinion data, and convert unstructured text in the processed financial network public opinion data into structured features to obtain structured financial network public opinion data;

[0052] A perception prediction module 12, configured to input the structured financial network public opinion data into a pre-established LSTM model to obtain time series prediction label data, and input the time series prediction label data into a pre-established MLP-GA model, and output a financial network public opinion perception prediction result.

[0053] Based on the same inventive concept, the present invention further provides a computer device, which includes: one or more processors, and a memory for storing one or more computer programs; the program includes program instructions, and the processor is configured to execute the program instructions stored in the memory. The processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, and is used to implement one or more instructions. Specifically, it is used to load and execute one or more instructions in the computer storage medium to implement the above method.

[0054] It should be further noted that, based on the same inventive concept, the present invention also provides a computer storage medium, on which a computer program is stored. When the computer program is run by a processor, the above-mentioned method is executed. The storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electrical, magnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or combined with an instruction execution system, apparatus, or device.

[0055] In the description of this specification, the description with reference to terms such as "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.

[0056] The above shows and describes the basic principles, main features, and advantages of the present disclosure. Those skilled in the art of this industry should understand that the present disclosure is not limited by the above embodiments. The above embodiments and the descriptions in the specification only illustrate the principles of the present disclosure. Without departing from the spirit and scope of the present disclosure, the present disclosure will have various changes and improvements, and these changes and improvements all fall within the scope of the present disclosure claimed.

Claims

1. A method for predicting online public opinion perception based on neural network and genetic algorithm, characterized in that, The method includes the following steps: Receiving financial network public opinion data, preprocessing the financial network public opinion data to obtain processed financial network public opinion data, and converting the unstructured text in the processed financial network public opinion data into structured features to obtain structured financial network public opinion data; Inputting the structured financial network public opinion data into a pre-established LSTM model to obtain time series prediction label data, and inputting the time series prediction label data into a pre-established MLP-GA model to output a financial network public opinion perception prediction result.

2. The network public opinion perception prediction method based on neural network and genetic algorithm according to claim 1, wherein The process of preprocessing the financial network public opinion data includes: Performing data elimination and data cleaning on the financial network public opinion data. Data cleaning includes removing noise and redundant information, handling data missingness, and then performing text processing, including word segmentation and part-of-speech tagging on the financial network public opinion data, and then performing feature extraction, including dimensionality reduction, and converting the processed text data through TF-IDF to obtain processed financial network public opinion data.

3. The network public opinion perception prediction method based on neural network and genetic algorithm according to claim 1, characterized in that The inputting the structured financial network public opinion data into a pre-established LSTM model includes: The input structured financial network public opinion data is represented as a matrix: X = {x1, x2, …, x T}, T represents the length of the text, and x t represents the embedding vector of the t-th word. The input layer of the LSTM network model receives sequence data. The hidden layer of the LSTM adopts a multi-layer stacked structure. Each layer of LSTM units captures different levels of temporal dependencies in the text sequence. The output of the hidden layer is mapped to the sentiment classification label through a fully connected layer. The output layer completes sentiment classification through the softmax activation function and obtains the probability value of each sentiment category: z j represents the linear combination of the output layer. K represents the total number of sentiment categories. Through the softmax function, the sentiment distribution of the text is converted into probability values, and the final sentiment label is selected according to the maximum probability.

4. The network public opinion perception prediction method based on neural network and genetic algorithm according to claim 3, characterized in that In the pre-established LSTM model, for a multi-classification task, the formula of the cross-entropy loss function is as follows: N represents the number of samples, K represents the number of sentiment categories, and y ij represents the actual label of the i-th sample; Calculating the gradient of the loss function using the backpropagation algorithm, updating parameters through the gradient descent method and combining with the weighted mean square error WMSE, and adjusting the loss function weight using the weighted mean square error WMSE; When the pre-established LSTM model extracts time series prediction label data, a sliding window technique is adopted, which is expressed as follows: Window(t) = {x t , x t+1 ,..., x t+29}.

5. The network public opinion perception prediction method based on neural network and genetic algorithm according to claim 1, characterized in that The MLP network of the pre-established MLP-GA model includes multiple hidden layers, each hidden layer consists of multiple neurons, the ReLU function is used between the hidden layers, and when training the MLP network, the loss function used is MSE, and the calculation formula of the loss function is: y i represents the actual financial risk label, represents the predicted value, n represents the number of samples, the stochastic gradient descent method is used as the optimization algorithm, by randomly sampling small batches of samples, calculating the gradient of the loss function and updating the network weights, and the gradient update formula is: is the gradient of the parameter θ.

6. The network public opinion perception prediction method based on neural network and genetic algorithm according to claim 5, characterized in that The MLP network applies L2 regularization by penalizing the sum of the squares of the weight parameters. The loss function of the L2 regularization term is as follows: is the L2 norm of the weight matrix of the layer, and λ is the regularization strength hyperparameter; the final loss function includes the original MSE and the regularization term:

7. The network public opinion perception prediction method based on neural network and genetic algorithm according to claim 6, characterized in that The stability of the MLP network is maintained by the batch normalization technique, and the calculation process is as follows: μ and σ 2 are the mean and variance of the current data respectively; γ and β are learnable parameters, ∈ is a constant. In the batch normalization process, the mean μ and variance σ are calculated based on the current batch of data 2 , and through the normalization operation the preliminary normalized result is obtained 8. The network public opinion perception prediction method based on neural network and genetic algorithm according to claim 7, characterized in that, In the pre-established MLP-GA model, the data output from the MLP to the GA will be fed back from the GA to the MLP. The GA network effectively screens from the preliminary feature set, and the core operations include selection, crossover, and mutation.

9. A network public opinion perception prediction system based on a neural network and a genetic algorithm, characterized in that It includes: A data processing module for receiving financial network public opinion data, preprocessing the financial network public opinion data to obtain processed financial network public opinion data, and converting the unstructured text in the processed financial network public opinion data into structured features to obtain structured financial network public opinion data; A perception prediction module for inputting the structured financial network public opinion data into a pre-established LSTM model to obtain time series prediction label data, and inputting the time series prediction label data into a pre-established MLP-GA model to output a financial network public opinion perception prediction result.

10. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that A computer program capable of running on a processor is stored in the memory. When the processor loads and executes the computer program, the network public opinion perception prediction method based on a neural network and a genetic algorithm according to any one of claims 1 to 8 is adopted.

Citation Information

Patent Citations

  • Text sentiment analysis method based on hybrid supervision model

    CN110321563A

  • Deep neural network structure optimization method based on fusion of prediction mechanism and genetic algorithm

    CN110490320A

  • Credit risk prediction method for optimizing MLP neural network based on locust algorithm

    CN112581264A

  • Financial product investment strategy determination method and device, processor and electronic equipment

    CN116883179A

  • Generative AI emotion propagation prediction and guidance large model construction method and system

    CN119047512A