Financial public opinion similarity probability prediction method, system and device
By constructing multiple financial public opinion similarity pre-training models and similarity probability prediction models, and combining real labels and pseudo-similar labels for training, it solves the difficulty of financial public opinion similarity prediction in the existing technology to capture deep semantic information and model robustness. The best problem achieves more efficient prediction of financial public opinion similarity.
Patent Information
- Application Number
- CN202411238440.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-09-05
AI Technical Summary
The prior art is difficult to effectively capture deep semantic information in financial public opinion similarity prediction, and due to the diversification of data forms and limited labeling samples, the model performs poorly in terms of robustness and generalization capabilities.
By constructing multiple first similarity pre-trained models, using the data sample set for training and verification, the initial similarity model is obtained, and then a similarity probability prediction model is built, combining real labels and pseudo-similar labels for training, and finally passing the similarity probability Predictive models make predictions.
Without the need for a large number of manually labeled samples, deep learning can maximize the sample feature information, optimize the division rules of label sets during training, and improve the learning effect and prediction accuracy of the model.
Smart Images

Figure CN118760908B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, system and device for predicting the probability of financial public opinion similarity. Background Art
[0002] Internet public opinion refers to the public's opinions and views on certain hot and focal issues in real life that are spread through the Internet. Financial public opinion specifically refers to the financial direction. Due to the characteristics of the Internet, such as virtuality, concealment, divergence, penetration and randomness, more and more people are willing to express their opinions and spread their ideas through this channel. Internet public opinion is a powerful force of public opinion, which will react to hot events and have a certain impact on social development and the course of events. If it is not guided well, negative Internet public opinion will pose a greater threat to social public security. If a large public opinion event is formed, it may be spread to multiple channels to have a greater impact. Therefore, public opinion monitoring and analysis of public opinion events is a key link in public opinion management. After a public opinion event occurs, it often attracts heated discussions in public opinion, and then generates a large amount of public opinion information. After this kind of information is generated, it often increases the influence of the public opinion event, and then forms a public opinion crisis. Therefore, public opinion monitoring and analysis of public opinion events is also a key link in public opinion control. And the judgment of public opinion similarity is the key among the keys.
[0003] In the existing technology, public opinion similarity models are mainly trained through traditional machine learning, deep learning or language pre-training models. These training methods currently have the following problems:
[0004] Traditional machine learning usually converts text into vectors through methods such as TF-IDF and bag-of-words model, and then obtains the similarity between texts based on methods such as cosine similarity and Euclidean distance. It is currently unable to accurately capture the deep semantic information of the text, and has poor processing effects on words with multiple meanings, synonyms, or words with different semantics due to different contexts.
[0005] Deep learning uses neural networks to automatically learn the deep representation of text, such as using convolutional neural networks (CNN), recurrent neural networks (RNN) or Transformer models to extract text features, and then calculate the similarity between features. Language pre-training models use pre-training models such as BERT and RoBERTa to encode text, obtain deep semantic representation of text, and then measure the similarity of text by calculating the similarity between representations. Although deep learning and language pre-training model methods can capture the deep structure and semantic information of text, they require a lot of computing resources and training data. In the financial field, public opinion-related data is mostly unstructured text information, which not only involves professional terms and concepts, but also has complex features and a wide range of sources, such as news reports, analyst reports, social media, forums, blogs, etc., which makes the data form diversified. At present, due to the limited samples provided by manual annotation, it is difficult to fully learn the feature representation of public opinion text. Even through some data enhancement methods, it is difficult to improve robustness and generalization ability. Summary of the invention
[0006] In view of the shortcomings of the prior art, the present invention provides a method, system and device for predicting the probability of financial public opinion similarity.
[0007] In order to solve the above technical problems, the present invention is solved by the following technical solutions:
[0008] A method for predicting the probability of financial public opinion similarity includes the following steps:
[0009] Obtain public opinion-related data, and construct a data sample set from the public opinion-related data that meets preset conditions, wherein each sample in the data sample set is marked with a real label;
[0010] Constructing a plurality of first similarity pre-training models, and training and verifying the plurality of first similarity pre-training models through a data sample set to obtain a plurality of first similarity models;
[0011] Predicting the public opinion related data to be tested by the first similarity model to obtain a prediction result, obtaining the optimal weight of each first similarity model by the prediction result, and integrating each first similarity model based on the optimal weight to obtain an initial similarity model;
[0012] The unlabeled public opinion data to be tested is predicted through the initial similarity model to obtain pseudo-similar labels;
[0013] Construct a similarity probability prediction pre-training model, divide the real labels and pseudo-similar labels into training sets and verification sets, train and verify the similarity probability prediction pre-training model based on the training set and verification set, and then obtain a similarity probability prediction model;
[0014] The similarity probability prediction model is used to predict the similarity probability of public opinion related data and obtain the prediction result.
[0015] As an implementable method, the following steps are also included:
[0016] If the prediction result is greater than the preset threshold, the language model is used to extract abnormal sample features from the public opinion related data;
[0017] Based on the characteristics of abnormal samples, the label set formed by the real label and the pseudo-similar label is re-divided to re-form the training set and the verification set.
[0018] As an implementable method, obtaining public opinion related data and constructing a data sample set from public opinion related data that meets preset conditions includes the following steps:
[0019] Obtain and analyze two consecutive sets of public opinion related data to obtain the first event characteristics and the second event characteristics respectively;
[0020] Based on the first event feature and the second event feature, a feature overlap rate is obtained, and it is determined whether the feature overlap rate is greater than a preset feature threshold. If so, it is used as a public opinion-related data sample;
[0021] If not, calculate the event time difference to determine whether the event time difference does not exceed the time threshold. If so, use it as a public opinion-related data sample;
[0022] If not, compare whether the types of the two events are the same. If they are the same, use them as samples of public opinion-related data;
[0023] If none of the conditions are met, it cannot be used as a public opinion-related data sample.
[0024] As an implementation method, the method further includes dividing the data sample set into a training sample set and a verification sample set, specifically:
[0025] Based on the data sample set, the types, features, quantities and distribution of true labels in the data sample set are counted to obtain statistical results;
[0026] The division ratio is obtained based on the statistical results, and the data sample set is divided into a training sample set and a validation sample set according to the division ratio.
[0027] As an implementable method, integrating each first similarity model based on the optimal weight to obtain an initial similarity model includes the following steps:
[0028] Construct a loss function about weights so that the loss function reaches the minimum value and then obtains the optimal weights;
[0029] Integrate each first similarity model based on the optimal weight to obtain an initial similarity model;
[0030] The loss function is expressed as follows:
[0031]
[0032] The optimal weight is expressed as follows:
[0033]
[0034] The initial similarity model is expressed as follows:
[0035]
[0036] in, Indicates that the input is The optimal weight of each first similarity model output The initial similarity model, , represents the prediction result of the initial similarity model for the actual label, Indicates the event type The actual label of the real result, Represents each first similarity model for event type The output result is, Indicates the event type within each first similarity model The weights to be calculated, Represents the initial similarity model The optimal weight of the first similarity model output, Indicates The first similarity model, Indicates the event type gather , Indicates that the event type has Different event types, , .
[0037] As an implementable method, the following steps are also included:
[0038] The difference between the prediction result of the first similarity model and the real label of the public opinion related data to be tested is calculated based on the binary cross entropy model. If the difference reaches the preset condition, the first similarity probability prediction is trained;
[0039] The binary cross entropy model is expressed as follows:
[0040]
[0041] represents the prediction result of each first similarity model, represents the true label; Represents the true label When the category weight is 1, Represents the true label The class weight is 0.
[0042] A financial public opinion similarity probability prediction system, comprising a data acquisition module, a first construction training module, a prediction integration module, a second prediction module, a second construction training module and a prediction result module;
[0043] The data acquisition module is used to acquire public opinion related data, and construct a data sample set from the public opinion related data that meets the preset conditions, wherein each sample in the data sample set is marked with a real label;
[0044] The first training module is used to construct a plurality of first similarity pre-training models, and train and verify the plurality of first similarity pre-training models through a data sample set to obtain a plurality of first similarity models;
[0045] The prediction integration module is used to predict the public opinion related data to be tested by using the first similarity model to obtain a prediction result, obtain the optimal weight of each first similarity model by using the prediction result, and integrate each first similarity model based on the optimal weight to obtain an initial similarity model;
[0046] The second prediction module is used to predict the unlabeled public opinion related data to be tested through the initial similarity model to obtain a pseudo-similar label;
[0047] The second training module is used to construct a similarity probability prediction pre-training model, divide the real labels and pseudo-similar labels into a training set and a verification set, train and verify the similarity probability prediction pre-training model based on the training set and the verification set, and then obtain a similarity probability prediction model;
[0048] The prediction result module is used to predict the similarity probability of the public opinion related data through the similarity probability prediction model to obtain the prediction result.
[0049] As an implementation method, it also includes a feature extraction feedback module, which is configured as follows:
[0050] If the prediction result is greater than the preset threshold, the language model is used to extract abnormal sample features from the public opinion related data;
[0051] Based on the characteristics of abnormal samples, the label set formed by the real label and the pseudo-similar label is re-divided to re-form the training set and the verification set.
[0052] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following method is implemented:
[0053] Obtain public opinion-related data, and construct a data sample set from the public opinion-related data that meets preset conditions, wherein each sample in the data sample set is marked with a real label;
[0054] Constructing a plurality of first similarity pre-training models, and training and verifying the plurality of first similarity pre-training models through a data sample set to obtain a plurality of first similarity models;
[0055] Predicting the public opinion related data to be tested by the first similarity model to obtain a prediction result, obtaining the optimal weight of each first similarity model by the prediction result, and integrating each first similarity model based on the optimal weight to obtain an initial similarity model;
[0056] The unlabeled public opinion data to be tested is predicted through the initial similarity model to obtain pseudo-similar labels;
[0057] Construct a similarity probability prediction pre-training model, divide the real labels and pseudo-similar labels into training sets and verification sets, train and verify the similarity probability prediction pre-training model based on the training set and verification set, and then obtain a similarity probability prediction model;
[0058] The similarity probability prediction model is used to predict the similarity probability of public opinion related data and obtain the prediction result.
[0059] A financial public opinion similarity probability prediction device includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the following method when executing the computer program:
[0060] Obtain public opinion-related data, and construct a data sample set from the public opinion-related data that meets preset conditions, wherein each sample in the data sample set is marked with a real label;
[0061] Constructing a plurality of first similarity pre-training models, and training and verifying the plurality of first similarity pre-training models through a data sample set to obtain a plurality of first similarity models;
[0062] Predicting the public opinion related data to be tested by the first similarity model to obtain a prediction result, obtaining the optimal weight of each first similarity model by the prediction result, and integrating each first similarity model based on the optimal weight to obtain an initial similarity model;
[0063] The unlabeled public opinion data to be tested is predicted through the initial similarity model to obtain pseudo-similar labels;
[0064] Construct a similarity probability prediction pre-training model, divide the real labels and pseudo-similar labels into training sets and verification sets, train and verify the similarity probability prediction pre-training model based on the training set and verification set, and then obtain a similarity probability prediction model;
[0065] The similarity probability prediction model is used to predict the similarity probability of public opinion related data and obtain the prediction result.
[0066] The present invention has significant technical effects due to the adoption of the above technical solution:
[0067] This application divides the training samples by identifying and extracting the key features of public opinion-related data. Without the need for a large number of manually labeled samples, deep learning is used to allow the model to learn all the feature information in the sample set to the greatest extent possible.
[0068] This application enables the extraction and identification of features of samples corresponding to abnormal prediction results to obtain abnormal sample features when feature information is lost due to random division of training sets and validation sets for small-scale samples. This enables the optimization of the division rules of the label set during the training process, retaining feature information to the greatest extent, and improving the learning effect of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0070] Figure 1 It is a schematic diagram of the overall process of the method of the present invention;
[0071] Figure 2 It is a schematic diagram of the overall process of a specific embodiment of the present invention;
[0072] Figure 3 is a schematic diagram of the overall process of another embodiment of the present invention;
[0073] Figure 4 It is a schematic diagram of the overall structure of the system of the present invention. DETAILED DESCRIPTION
[0074] The present invention is further described in detail below in conjunction with embodiments. The following embodiments are for explanation of the present invention but the present invention is not limited to the following embodiments.
[0075] Embodiment 1:
[0076] A financial public opinion similarity probability prediction method, such as Figure 1 As shown, the following steps are included:
[0077] S100, obtaining public opinion-related data, and constructing a data sample set from the public opinion-related data that meets preset conditions, wherein each sample in the data sample set is marked with a real label;
[0078] S200, constructing a plurality of first similarity pre-training models, and training and verifying the plurality of first similarity pre-training models through a data sample set to obtain a plurality of first similarity models;
[0079] S300, predicting the public opinion related data to be tested by using the first similarity model to obtain a prediction result, obtaining the optimal weight of each first similarity model by using the prediction result, and integrating each first similarity model based on the optimal weight to obtain an initial similarity model;
[0080] S400, predicting the unlabeled public opinion related data to be tested through the initial similarity model to obtain a pseudo-similar label;
[0081] S500, constructing a similarity probability prediction pre-training model, dividing the real labels and the pseudo-similar labels into a training set and a verification set, training and verifying the similarity probability prediction pre-training model based on the training set and the verification set, and thus obtaining a similarity probability prediction model;
[0082] S600, predicting the similarity probability of the public opinion related data by using a similarity probability prediction model to obtain a prediction result.
[0083] In one embodiment, the following steps are also included:
[0084] S710: If the prediction result is greater than a preset threshold, extract abnormal sample features from the public opinion related data through a language model;
[0085] S720: Re-divide the label set formed by the real label and the pseudo-similar label based on the abnormal sample characteristics to re-form the divided training set and the verification set.
[0086] Therefore, please refer to the attached Figure 2 As shown, attached Figure 2It is a detailed process in an embodiment, specifically: obtaining public opinion-related data, constructing a data sample set with the public opinion-related data that meets the preset conditions, wherein each sample in the data sample set is marked with a real label; constructing multiple first similarity pre-training models, training and verifying the multiple first similarity pre-training models through the data sample set, and obtaining multiple first similarity models; predicting the public opinion-related data to be tested through the first similarity model to obtain a prediction result, obtaining the optimal weight of each first similarity model through the prediction result, and integrating each first similarity model based on the optimal weight to obtain an initial similarity model; predicting the unlabeled public opinion-related data to be tested through the initial similarity model to obtain a pseudo-similar label; constructing a similarity probability prediction pre-training model, dividing the real label and the pseudo-similar label into a training set and a verification set, training and verifying the similarity probability prediction pre-training model based on the training set and the verification set, and then obtaining a similarity probability prediction model; predicting the similarity probability of the public opinion-related data to be tested through the similarity probability prediction model to obtain a prediction result. If the prediction result is greater than the preset threshold, the language model is used to extract abnormal sample features from the public opinion-related data; based on the abnormal sample features, the label set formed by the real label and the pseudo-similar label is re-divided to re-form the training set and the verification set. In other words, if the probability obtained by the prediction result is still less than the preset threshold, the abnormal sample features are extracted through the fine-tuned LLM large model, a real-time feedback mechanism is formulated, and the parameters of the similarity probability prediction model are updated.
[0087] During the whole process, the unlabeled public opinion-related data will be preprocessed to obtain the relevant data set, and then the language pre-training model will be trained and fine-tuned to obtain a language model suitable for this application. This language model uses LLM (Large Language Models), which usually contains billions or even tens of billions of parameters, enabling it to capture and learn the nuances in the language; it can be self-supervised learning: many LLMs are pre-trained using self-supervised learning methods, such as BERT (Bidirectional Encoder Representations from Transformers) and GPT (Generative Pre-trained Transformer) series, which are trained on a large amount of text data to understand the context and structure of the language; it can achieve fine-tuning: after pre-training, LLM is fine-tuned on specific tasks to improve performance on the corresponding tasks. Here, it is said that the model can be further trained on limited labeled data. In addition, it is also capable of multi-task learning and contextual understanding: LLM is designed to handle multiple language tasks such as text classification, sentiment analysis, machine translation, summary generation, etc. LLM can understand long-distance dependencies and contextual information, which makes them perform well in understanding complex sentences and paragraphs.
[0088] In other words, the whole process can not only extract and identify the features of samples corresponding to abnormal prediction results when small-scale samples lose feature information due to random division of training sets and validation sets, but also obtain the features of abnormal samples, and then optimize the division rules of label sets in the training process, retain feature information to the greatest extent, and improve the learning effect of the model.
[0089] In step S100, the public opinion related data is obtained, and the public opinion related data that meets the preset conditions is used to construct a data sample set, such as Figure 3 As shown, the following steps are included:
[0090] S110, obtaining two consecutive sets of public opinion related data and analyzing them to obtain first event characteristics and second event characteristics respectively;
[0091] S120, obtaining a feature overlap rate based on the first event feature and the second event feature, and determining whether the feature overlap rate is greater than a preset feature threshold, and if so, taking it as a public opinion-related data sample;
[0092] S130, if not, calculate the event time difference, and determine whether the event time difference does not exceed the time threshold. If so, use it as a public opinion-related data sample;
[0093] S140, if not, compare whether the types of the two events are the same, and if they are the same, use them as public opinion related data samples;
[0094] S150. If none of the conditions are met, it cannot be used as a public opinion-related data sample.
[0095] In this embodiment, in order to make the sample set of public opinion-related data more accurate, the sample set will be judged according to the preset relevant screening conditions when constructing the sample set, and then the public opinion-related data that meets the preset conditions will be obtained. The public opinion-related data can be two consecutive sets of public opinion event data of the same enterprise or two consecutive sets of public opinion-related data in a certain time period. In the screening process, the feature overlap rate, time threshold and type of the two events will be used for step-by-step judgment, and those that meet the conditions will be used as public opinion-related data samples, thereby forming a sample set of public opinion-related data.
[0096] Here, the feature overlap rate obtained based on the first event feature and the second event feature can be used as the overlap rate through the IOU value, that is, the calculation formula of the overlap rate is expressed as follows:
[0097]
[0098] A and B are two event feature sets, represents the number of features shared by sets A and B, Represents the total number of all features of two sets, removing duplicate elements. Of course, this calculation method is only one of the methods for calculating the overlap rate, and other calculation methods can also be selected for calculation.
[0099] After step S100, the method further includes dividing the data sample set into a training sample set and a verification sample set, specifically:
[0100] Based on the data sample set, the types, features, quantities and distribution of true labels in the data sample set are counted to obtain statistical results;
[0101] Based on the statistical results, the data sample set is divided into a training sample set and a validation sample set according to the division ratio. Before dividing the sample set, each sample in the data sample set will be marked with a true label, that is, each sample will carry its own true label, and then the data sample set will be divided into a training sample set and a validation sample set according to the type, characteristics, quantity and distribution of the true label of the sample set.
[0102] Here, features will be identified during statistics, that is, all features in the data set will be identified, such as numerical, categorical, textual, etc., and then relevant information about the features will be counted. Different types of features can be summarized and the number of each type can be counted. Subsequently, the training sample set and the verification sample set will be divided according to the number.
[0103] Count the number of all event types in the data set. For example, if the data set is a multi-category problem, count the number of samples in each category. For example, for numerical features, you can calculate statistical indicators such as mean, median, standard deviation, minimum, and maximum; for categorical features, you can count the number of samples or frequency in each category. In addition, since each sample carries its own true label, count the number of samples for each label to analyze whether the label distribution is balanced.
[0104] In step S300, the step of integrating each first similarity model based on the optimal weight to obtain an initial similarity model includes the following steps:
[0105] Construct a loss function about weights so that the loss function reaches the minimum value and then obtains the optimal weights;
[0106] Integrate each first similarity model based on the optimal weight to obtain an initial similarity model;
[0107] The loss function is expressed as follows:
[0108]
[0109] The optimal weight is expressed as follows:
[0110]
[0111] The initial similarity model is expressed as follows:
[0112]
[0113] in, Indicates that the input is The optimal weight of each first similarity model output The initial similarity model, , represents the prediction result of the initial similarity model for the actual label, Indicates the event type The actual label of the real result, Represents each first similarity model for event type The output result is, Indicates the event type within each first similarity model The weights to be calculated, Represents the initial similarity model The optimal weight of the first similarity model output, Indicates The first similarity model, Indicates the event type gather , Indicates that the event type has Different event types, , .
[0114] In this embodiment, the Transformer model is selected. The Transformer model is widely used in the field of natural language processing (NLP). The main features of the Transformer model include: the self-attention mechanism, which allows the model to calculate the relationship between each element in the sequence and all other elements when processing the sequence; due to the self-attention mechanism, the Transformer can process all elements in the sequence in parallel, which is in contrast to the element-by-element processing of the RNN; in tasks such as machine translation, the Transformer usually adopts an encoder-decoder structure, where the encoder processes the input sequence and the decoder generates the output sequence; in order to maintain the order information of the elements in the sequence, the Transformer usually adds position encoding to the input sequence; the Transformer model can use multiple attention heads at the same time to capture sequence information from different angles; in addition, it also enables layer normalization and residual connection to prevent the gradient disappearance problem in deep network training. Currently, three first similarity models are used. Since the training effect of each model on the three types of events is different, and considering that the training effect of each first similarity model on different types of events may be good or bad, a loss function about the weight is constructed to minimize the loss function and obtain the optimal weight; then, based on the optimal weight, each first similarity model is integrated to obtain the initial similarity model. This initial similarity model can be understood as a linear model, that is, the optimal weight of each first similarity model is solved based on its performance on different types of events, and then each first similarity model is integrated to obtain the initial similarity model.
[0115] When training a model, the more times you train, the better. At this time, a loss function is needed to constrain and guide the optimization of the model. The loss function compares the model behavior with the training data, and the ultimate goal is to train a model with higher accuracy than the original data. In this embodiment, in the process of training each first similarity model, the difference between the predicted result and the true label of the public opinion-related data to be tested is measured based on the binary cross entropy model. In this embodiment, considering the imbalance problem of positive and negative samples, the binary cross entropy is weighted, and the category weight of the true label in the loss function is adjusted to 0 or 1 to avoid the poor prediction accuracy of the first similarity model in a few categories due to a serious imbalance in the sample ratio. Until the difference value reaches the preset condition, the first similarity probability prediction is completed. The loss function applied here is the binary cross entropy model, which is expressed as follows:
[0116]
[0117] represents the prediction result of each first similarity model, represents the true label; Represents the true label When the category weight is 1, Represents the true label The class weight is 0.
[0118] Embodiment 2:
[0119] A financial public opinion similarity probability prediction system, such as Figure 4 As shown, it includes a data acquisition module 100, a first construction training module 200, a prediction integration module 300, a second prediction module 400, a second construction training module 500 and a prediction result module 600;
[0120] The data acquisition module 100 is used to acquire public opinion related data, and construct a data sample set from the public opinion related data that meets the preset conditions, wherein each sample in the data sample set is marked with a real label;
[0121] The first training module 200 is used to construct a plurality of first similarity pre-training models, and train and verify the plurality of first similarity pre-training models through a data sample set to obtain a plurality of first similarity models;
[0122] The prediction integration module 300 is used to predict the public opinion related data to be tested by using the first similarity model to obtain a prediction result, obtain the optimal weight of each first similarity model by using the prediction result, and integrate each first similarity model based on the optimal weight to obtain an initial similarity model;
[0123] The second prediction module 400 is used to predict the unlabeled public opinion related data to be tested by using the initial similarity model to obtain a pseudo-similar label;
[0124] The second training module 500 is used to construct a similarity probability prediction pre-training model, divide the real labels and pseudo-similar labels into a training set and a verification set, train and verify the similarity probability prediction pre-training model based on the training set and the verification set, and then obtain a similarity probability prediction model;
[0125] The prediction result module 600 is used to predict the similarity probability of the public opinion related data through a similarity probability prediction model to obtain a prediction result.
[0126] In one embodiment, a feature extraction feedback module 700 is further included, which is configured as follows:
[0127] If the prediction result is greater than the preset threshold, the language model is used to extract abnormal sample features from the public opinion related data;
[0128] Based on the characteristics of abnormal samples, the label set formed by the real label and the pseudo-similar label is re-divided to re-form the training set and the verification set.
[0129] Various changes and modifications can be made without departing from the spirit and scope of the present invention, and all equivalent technical solutions also belong to the scope of the present invention.
[0130] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0131] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0132] The present invention is described with reference to the flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0133] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0135] It should be noted that:
[0136] The "one embodiment" or "embodiment" mentioned in the specification means that the specific features, structures or characteristics described in conjunction with the embodiment are included in at least one embodiment of the present invention. Therefore, the phrases "one embodiment" or "embodiment" appearing in various places throughout the specification do not necessarily refer to the same embodiment.
[0137] In addition, it should be noted that the shapes and names of the parts and components of the specific embodiments described in this specification may be different. Any equivalent or simple changes made based on the structure, features and principles described in the patent concept of the present invention are included in the protection scope of the patent of the present invention. The technicians in the technical field of the present invention can make various modifications or supplements to the specific embodiments described or replace them in a similar manner, as long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.
Claims
1. A method for predicting the probability of financial public opinion similarity, characterized in that: The following steps are involved: Obtain public opinion-related data, and construct a data sample set from the public opinion-related data that meets preset conditions, wherein each sample in the data sample set is marked with a real label; Constructing a plurality of first similarity pre-training models, and training and verifying the plurality of first similarity pre-training models through a data sample set to obtain a plurality of first similarity models; Predicting the public opinion related data to be tested by the first similarity model to obtain a prediction result, obtaining the optimal weight of each first similarity model by the prediction result, and integrating each first similarity model based on the optimal weight to obtain an initial similarity model; The unlabeled public opinion data to be tested is predicted through the initial similarity model to obtain pseudo-similar labels; Construct a similarity probability prediction pre-training model, divide the real labels and pseudo-similar labels into training sets and verification sets, train and verify the similarity probability prediction pre-training model based on the training set and verification set, and then obtain a similarity probability prediction model; The similarity probability prediction model is used to predict the similarity probability of the public opinion related data and obtain the prediction result; The step of integrating each first similarity model based on the optimal weight to obtain an initial similarity model comprises the following steps: Construct a loss function about weights so that the loss function reaches the minimum value and then obtains the optimal weights; Integrate each first similarity model based on the optimal weight to obtain an initial similarity model; The loss function is expressed as follows: The optimal weight is expressed as follows: The initial similarity model is expressed as follows: in, Indicates that the input is The optimal weight of each first similarity model output The initial similarity model, , represents the prediction result of the initial similarity model for the actual label, Indicates the event type The actual label of the real result, Represents each first similarity model for event type The output result is, Indicates the event type within each first similarity model The weights to be calculated, Represents the initial similarity model The optimal weight of the first similarity model output, Indicates The first similarity model, Indicates the event type gather , Indicates that the event type has Different event types, , .
2. The financial public opinion similarity probability prediction method according to claim 1 is characterized in that: The following steps are also included: If the prediction result is greater than the preset threshold, the language model is used to extract abnormal sample features from the public opinion related data; Based on the characteristics of abnormal samples, the label set formed by the real label and the pseudo-similar label is re-divided to re-form the training set and the verification set.
3. The financial public opinion similarity probability prediction method according to claim 1 is characterized in that: The step of obtaining public opinion related data and constructing a data sample set from the public opinion related data that meets preset conditions includes the following steps: Obtain and analyze two consecutive sets of public opinion related data to obtain the first event characteristics and the second event characteristics respectively; Based on the first event feature and the second event feature, a feature overlap rate is obtained, and it is determined whether the feature overlap rate is greater than a preset feature threshold. If so, it is used as a public opinion-related data sample; If not, calculate the event time difference to determine whether the event time difference does not exceed the time threshold. If so, use it as a public opinion-related data sample; If not, compare whether the types of the two events are the same. If they are the same, use them as samples of public opinion-related data; If none of the conditions are met, it cannot be used as a public opinion-related data sample.
4. The financial public opinion similarity probability prediction method according to claim 1 is characterized in that: The step of dividing the data sample set into a training sample set and a verification sample set is also included, specifically: Based on the data sample set, the types, features, quantities and distribution of true labels in the data sample set are counted to obtain statistical results; The division ratio is obtained based on the statistical results, and the data sample set is divided into a training sample set and a validation sample set according to the division ratio.
5. The financial public opinion similarity probability prediction method according to claim 1 is characterized in that: The following steps are also included: The difference between the prediction result of the first similarity model and the real label of the public opinion-related data to be tested is calculated based on the binary cross entropy model. If the difference reaches the preset condition, the first similarity probability prediction is trained. The binary cross entropy model is expressed as follows: represents the prediction result of each first similarity model, represents the true label; Represents the true label When the category weight is 1, Represents the true label The class weight is 0.
6. A financial public opinion similarity probability prediction system, characterized by: It includes a data acquisition module, a first construction training module, a prediction integration module, a second prediction module, a second construction training module and a prediction result module; The data acquisition module is used to acquire public opinion related data, and construct a data sample set from the public opinion related data that meets the preset conditions, wherein each sample in the data sample set is marked with a real label; The first training module is used to construct a plurality of first similarity pre-training models, and train and verify the plurality of first similarity pre-training models through a data sample set to obtain a plurality of first similarity models; The prediction integration module is used to predict the public opinion related data to be tested by using the first similarity model to obtain a prediction result, obtain the optimal weight of each first similarity model by using the prediction result, and integrate each first similarity model based on the optimal weight to obtain an initial similarity model; The second prediction module is used to predict the unlabeled public opinion related data to be tested through the initial similarity model to obtain a pseudo-similar label; The second training module is used to construct a similarity probability prediction pre-training model, divide the real labels and pseudo-similar labels into a training set and a verification set, train and verify the similarity probability prediction pre-training model based on the training set and the verification set, and then obtain a similarity probability prediction model; The prediction result module is used to predict the similarity probability of the public opinion related data through the similarity probability prediction model to obtain the prediction result; The step of integrating each first similarity model based on the optimal weight to obtain an initial similarity model comprises the following steps: Construct a loss function about weights so that the loss function reaches the minimum value and then obtains the optimal weights; Integrate each first similarity model based on the optimal weight to obtain an initial similarity model; The loss function is expressed as follows: The optimal weight is expressed as follows: The initial similarity model is expressed as follows: in, Indicates that the input is The optimal weight of each first similarity model output The initial similarity model, , represents the prediction result of the initial similarity model for the actual label, Indicates the event type The actual label of the real result, Represents each first similarity model for event type The output result is, Indicates the event type within each first similarity model The weights to be calculated, Represents the initial similarity model The optimal weight of the first similarity model output, Indicates The first similarity model, Indicates the event type gather , Indicates that the event type has Different event types, , .
7. The financial public opinion similarity probability prediction system according to claim 6, characterized in that: It also includes a feature extraction feedback module, which is set up as: If the prediction result is greater than the preset threshold, the language model is used to extract abnormal sample features from the public opinion related data; Based on the characteristics of abnormal samples, the label set formed by the real label and the pseudo-similar label is re-divided to re-form the training set and the verification set.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
9. A financial public opinion similarity probability prediction device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Density self-adaption conceptual semantic similarity calculation method based on ontology
CN108256030A
Public opinion text matching system and method based on twin structure
CN116522165A