Power market anti-noise public opinion monitoring method and system

By using technical means such as preheating division, alternating freezing training and remarking in power market public opinion monitoring, the problems of scarcity and noise impact in power market public opinion monitoring are solved, and more efficient and accurate public opinion monitoring is achieved.

CN119693027APending Publication Date: 2025-03-25GUIZHOU ELECTRIC POWER TRADING CENT CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411762477.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The prior art relies on a large amount of high-quality labeled data in the power market public opinion monitoring, and these data are usually very scarce in practical application scenarios, resulting in the limitation of the accuracy and efficiency of public opinion monitoring.

Method used

The anti-noise public opinion model of the power market is trained by preheating division, alternating freezing training and re-labeling. By combining multiple sub-models, alternating freezing of natural language encoder and task classifier, and re-labeling of noise-free data, an anti-noise public opinion monitoring model is generated.

Benefits of technology

It effectively reduces the negative impact of noise samples on the model, improves the robustness and accuracy of the model, reduces the dependence on high-confidence labeling samples, and adapts to the complex public opinion environment of the power market.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693027A_ABST
    Figure CN119693027A_ABST
Patent Text Reader

Abstract

The invention discloses an electricity market anti-noise public opinion monitoring method and system, and the method comprises the steps: training a plurality of sub-models, combining the sub-models into an integrated model, inputting an original data set into the integrated model, and obtaining an integrated label data set; constructing a preheating model, inputting the integrated label data set into the preheating model, and dividing a clean instance and a noise instance; a natural language task classifier and a natural language data set classifier are respectively connected to the downstream of the pre-training natural language encoder to construct a natural language model, and the pre-training natural language encoder, the natural language task classifier and the natural language data set classifier are alternately frozen; positive training and negative training are carried out on the clean examples and the noise examples obtained through preheating division to generate a natural language model; and re-marking the noisy data set after preheating division to obtain a re-marked sample set, performing positive training on the natural language model by using the re-marked sample set to obtain an anti-noise public opinion monitoring model of the electricity market, and monitoring the public opinion data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power systems, and more specifically, to a method and system for anti-noise public opinion monitoring in a power market. Background Art

[0002] Public opinion monitoring is a process of automated analysis of Internet data through technical means, aiming to timely understand and grasp the dynamic changes of public opinion. In the public opinion monitoring of the power market, the public opinion monitoring system needs to classify a large amount of data into different categories, such as positive, negative, and neutral based on sentiment characteristics, or discussion in a specific field based on topic content. Text classification technology can not only help the system improve the efficiency of information screening and organization, but also provide basic support for subsequent sentiment analysis and topic identification, and improve the accuracy of public opinion monitoring.

[0003] Conventional machine learning methods use deep memory or attention mechanisms to understand the semantic representation of text in text classification tasks. Fine-tuned cross-domain pre-trained language models have also achieved state-of-the-art performance on text classification tasks (Zhao Chuanjun, Wang Suge, Li Deyu. Research Progress on Cross-Domain Text Sentiment Classification. Journal of Software, 2020, 31(6): 1723-1746).

[0004] However, conventional methods achieve better results in text classification tasks by fine-tuning pre-trained language models. This method relies on a large amount of high-quality labeled data, while in actual application scenarios, such data is usually very scarce.

[0005] In view of the above problems, there is an urgent need for a noise-resistant public opinion monitoring method and system for the power market. Summary of the invention

[0006] In order to solve the deficiencies in the prior art, the present invention provides a method and system for monitoring the anti-noise public opinion in the power market, which trains the anti-noise public opinion model in the power market by comprehensive preheating division, alternating freezing training, and re-labeling to obtain a public opinion monitoring method.

[0007] The present invention adopts the following technical solution.

[0008] The first aspect of the present invention relates to a method for anti-noise public opinion monitoring in an electric power market, the method comprising the following steps: respectively inputting a randomly masked original data set into a plurality of sub-models obtained by connecting a pre-trained encoder to a pre-trained task classifier, and training the plurality of sub-models; combining the trained plurality of sub-models into an integrated model, inputting the original data set into the integrated model to obtain a cross entropy integrated label of the original data set, and obtaining an integrated label data set; constructing a pre-heating model that receives input from a pre-trained pre-heating encoder and takes the output of a pre-heating task classifier as a classification label, inputting the integrated label data set into the pre-trained pre-heating model, and pre-heating the clean instances to obtain a clean instance. and noise instances; a natural language task classifier and a natural language dataset classifier are respectively connected to the downstream of the pre-trained natural language encoder to construct a natural language model, and the pre-trained natural language encoder, the natural language task classifier and the natural language dataset classifier are alternately frozen. In each alternation process, positive training and negative training are performed on the clean instances and noise instances preheated and divided to generate a natural language model; the noisy dataset after the preheating division is relabeled to obtain a relabeled sample set, and the natural language model is positively trained using the relabeled sample set to obtain a noise-resistant public opinion monitoring model for the power market; and the public opinion data is monitored using the noise-resistant public opinion model for the power market.

[0009] Preferably, the randomly masked original data set is respectively input into multiple sub-models obtained by connecting the pre-trained encoder to the pre-trained task classifier, and the multiple sub-models are trained, including: freezing the task classifiers in the multiple sub-models, using the randomly masked original data set to fine-tune the pre-trained encoders in the multiple sub-models respectively, and obtaining the fine-tuning labels of the original data set; using the fine-tuned parameters to freeze the pre-trained encoders in the multiple sub-models, using the positive training combined with the negative training loss to minimize the loss, and using the original data set with fine-tuning labels to fine-tune the task classifiers of the multiple sub-models again; the training results of the multiple sub-models are the fine-tuned pre-trained encoder and the fine-tuned task classifier connected downstream of the pre-trained encoder.

[0010] Preferably, the trained multiple sub-models are combined into an integrated model, the original data set is input into the integrated model to obtain the cross entropy integrated label of the original data set, and the integrated label data set is obtained, including: the integrated model is composed of M sub-models, then the integrated label y of the integrated model assemble for:

[0011]

[0012] in, The label y output by the mth sub-model m With the classification label yk The cross entropy loss between the mth sub-model outputs the label y m With the classification label y k are K-dimensional vectors, where K is equal to the total number of classification labels; obtain the integrated label y for each instance i assemble,i , and generate an integrated labeled dataset.

[0013] Preferably, a preheating model is constructed that receives input from a pretrained preheating encoder and uses the output of a preheating task classifier as a classification label, and the integrated label data set is input into the preheating model after pretraining, and clean instances and noise instances are preheated and divided, including: inputting the unlabeled original data set into the preheating encoder for training to obtain a pretrained preheating encoder; connecting a preheating task classifier downstream of the pretrained preheating encoder, and training the preheating task classifier by combining positive training with negative training; constructing a preheating model using the trained preheating encoder and preheating task classifier, and inputting the integrated label data set into the preheating model to perform preheating division to obtain clean instances and noise instances.

[0014] Preferably, a preheating model is constructed using a trained preheating encoder and a preheating task classifier, and the integrated label data set is input into the preheating model to implement preheating division to obtain clean instances and noise instances, including: inputting the integrated label data set into the preheating model to obtain the preheating probability distribution of each instance in the data set through the preheating model; assigning the instance to a clean data set or a noise data set according to the preheating probability distribution of the instance and the integrated label corresponding to the instance; the assignment is:

[0015]

[0016] x i For instance i,

[0017] D c and D n They are clean data set and noisy data set respectively.

[0018] p i is the integrated classification label y corresponding to instance i k The probability of

[0019] K is the number of classification labels.

[0020] Preferably, a natural language task classifier and a natural language dataset classifier are respectively connected downstream of the pre-trained natural language encoder to construct a natural language model, and the pre-trained natural language encoder, the natural language task classifier and the natural language dataset classifier are alternately frozen. In each alternating process, positive training and negative training are performed on the clean instances and noise instances divided by preheating to generate a natural language model and a preliminary classified dataset, including: pre-training is performed using a natural language encoder to obtain a pre-trained natural language encoder; the natural language dataset classifier is frozen, and positive training and negative training are performed on the clean instances and noise instances divided by preheating to update the parameters of the pre-trained natural language encoder and the natural language task classifier; the pre-trained natural language encoder and the natural language task classifier are frozen, and the natural language task classifier is fine-tuned using the clean instances and noise instances divided by preheating; the above steps are iterated multiple times until the iteration end condition is met to obtain a natural language model and a preliminary classified dataset.

[0021] Preferably, the natural language dataset classifier is frozen, and positive training and negative training are performed on the clean instances and noise instances divided by preheating, respectively, to update the parameters of the pretrained natural language encoder and the natural language task classifier, including: constructing a regularized loss function for:

[0022]

[0023] In the formula, θ f ,θ y and θ d They are the parameters of the natural language encoder, natural language task classifier, and natural language dataset classifier respectively; are the frozen natural language encoder parameters, and are respectively the loss of positive training, the loss of negative training and the loss of the natural language dataset classifier under different model parameters; with the goal of minimizing the regularized loss function, the parameters of the natural language task classifier and the natural language dataset classifier are updated after the kth iteration as follows:

[0024]

[0025] Preferably, freezing the pre-trained natural language encoder and the natural language task classifier, and fine-tuning the natural language task classifier using the clean instances and noise instances divided by pre-heating, including: constructing a natural language dataset classifier loss function for:

[0026]

[0027] With the goal of minimizing the loss of the natural language dataset classifier, the parameters of the natural language dataset classifier are updated after the kth iteration as follows:

[0028]

[0029] Preferably, relabeling the preheated divided noisy data set to obtain a relabeled sample set includes: using the relabeling model to classify the preheated divided noisy data set; i , if its confidence after classification is p i is less than the filtering threshold, then the entity x i Classify as noise instance; for the classified noise instance D ′ n Re-labeling is performed, and the re-labeling rule is to give noise instances Provide the corresponding noise label

[0030]

[0031] In the formula, is the noise instance D ′ n The re-labeled label of the jth instance in , n is the position of the noise text sequence where the instance is located, For entity x i The confidence level of the k-th label is relabeled as Where u is the ratio of the number of noise instances identified by the re-labeling model to the total number of input instances, and K is the number of categories in the training set.

[0032] Preferably, the power market anti-noise public opinion model is used to monitor public opinion data, including: presetting a target website, crawling real-time public opinion data and regularly updating the public opinion data; dividing the public opinion data into sentences to obtain the original text The public opinion data is classified by using the anti-noise public opinion model of the electricity market; the public opinion data related to the electricity market with tags is stored in the middle layer of the data warehouse, and when a public opinion analysis instruction is identified, the public opinion data related to the electricity market with tags is extracted for analysis; when the analysis result shows that the correlation between the public opinion analysis instruction and the public opinion data exceeds a preset threshold, a public opinion warning is issued.

[0033] The second aspect of the present invention relates to a system for monitoring public opinion in an electric power market against noise; the system is implemented using a method for monitoring public opinion in an electric power market against noise according to the first aspect of the present invention; the system comprises a training module, an integration module, a preheating module, a classification module, a labeling module and a monitoring module; the training module is used to input the randomly masked original data set into a plurality of sub-models obtained by connecting a pre-trained encoder to a pre-trained task classifier, and train the plurality of sub-models; the integration module is used to combine the trained multiple sub-models into an integrated model, input the original data set into the integrated model to obtain a cross entropy integrated label of the original data set, and obtain an integrated label data set; the preheating module is used to construct a preheating model that receives input from a pre-trained preheating encoder and takes the output of the preheating task classifier as a classification label, and the integrated label data set is input into the pre-trained preheating encoder to receive the input and takes the output of the preheating task classifier as a classification label, and the integrated label data set is input into the pre-trained preheating encoder to receive the input and the output of the preheating task classifier as the classification label, and the integrated label data set is input into the pre-trained preheating encoder to receive the input and ... The pre-trained data are input into the preheating model to preheat and divide clean instances and noise instances; a classification module is used to connect a natural language task classifier and a natural language dataset classifier downstream of the pre-trained natural language encoder to construct a natural language model, and the pre-trained natural language encoder, the natural language task classifier and the natural language dataset classifier are alternately frozen. In each alternation process, positive training and negative training are performed on the clean instances and noise instances divided by preheating to generate a natural language model and a preliminary classified data set; a labeling module is used to relabel the preliminary classified data set to obtain a relabeled sample set, and the pre-trained model is positively trained using the relabeled sample set to obtain an anti-noise public opinion monitoring model for the power market; a monitoring module is used to monitor public opinion data using the anti-noise public opinion model for the power market.

[0034] A third aspect of the present invention relates to a terminal, comprising a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the method described in the first aspect of the present invention.

[0035] A fourth aspect of the present invention relates to a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect of the present invention.

[0036] The beneficial effect of the present invention is that, compared with the prior art, the method and system for monitoring the anti-noise public opinion in the power market in the present invention trains the anti-noise public opinion model in the power market by comprehensive preheating division, alternating freezing training, re-labeling and other methods to obtain a public opinion monitoring method.

[0037] The beneficial effects of the present invention also include:

[0038] 1. The present invention proposes a method to effectively reduce the negative impact of noise samples in a limited class of scenarios, integrates positive training and negative training into a unified framework to improve the robustness of the model, utilizes the task adaptive pre-training method and loss weighted integration strategy to improve the recognition effect of noise samples in the warm-up stage, introduces the training idea of ​​generative adversarial neural network, and uses the data source confusion method to ensure that the model learns effective features that are not related to noise. The joint method reduces the dependence on high-confidence labeled samples, alleviates the impact of the scarcity of high-quality labeled data on the public opinion monitoring system, and makes the monitoring system more adaptable to the complex power market public opinion environment.

[0039] 2. By training the natural language processing model for noise tolerance, the present invention can effectively process noisy data, improve the accuracy of public opinion monitoring, and reduce the interference of noise on model recognition and classification. Task-adaptive pre-training is used to align the text domain of the model with the specific application scenarios of public opinion in the power market, so that the model can better process public opinion data in specific fields and improve the accuracy of analysis. Using a loss-weighted integration strategy to fuse the results of multiple pre-trained models can effectively reduce noise recognition errors in the warm-up stage. Using a noise-resistant data source confusion method, the model can learn features that are not related to the data source, thereby improving the model's key feature extraction capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A schematic diagram of a flow chart of a method for monitoring public opinion in an electric power market against noise according to the present invention;

[0041] Figure 2 A schematic diagram of an integrated model training process in a method for monitoring public opinion in an electric power market against noise according to the present invention;

[0042] Figure 3 It is a schematic diagram of a natural language anti-noise model in a method for monitoring public opinion in an electric power market against noise according to the present invention;

[0043] Figure 4 It is a schematic diagram of monitoring public opinion data by using public opinion analysis instructions in a method for anti-noise public opinion monitoring in an electric power market of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the present invention clearer and more accurate, the technical solution of the present invention is described in detail below through multiple specific implementation methods. The embodiments adopted by the present invention are only used to explain the present invention and are not used to limit the content of the present invention.

[0045] When processing noise data, the existing public opinion monitoring system cannot distinguish the noise data due to the presence of a large amount of noise, resulting in a decrease in accuracy. Existing methods usually rely on a large amount of labeled data. However, in the public opinion monitoring of the power market, it is very difficult to obtain high-quality labeled data, and the public opinion data is often mixed with a large amount of irrelevant information or noise data.

[0046] In a limited class of scenes, the identification of relevant information and noise is more targeted, but up to now, there is still no method that can efficiently and accurately identify relevant information based on the scene features of limited scenes and the general features of natural language. To this end, the present invention has made the following improvements.

[0047] Figure 1 FIG. 1 is a flow chart of a method for monitoring public opinion in an electric power market against noise according to the present invention. Figure 1 As shown, the first aspect of the present invention relates to a method for anti-noise public opinion monitoring in an electricity market, and the method includes steps 1 to 4.

[0048] Step 1: Input the randomly masked original data set into multiple sub-models obtained by connecting the pre-trained encoder to the pre-trained task classifier, and train the multiple sub-models.

[0049] Figure 2 FIG. 1 is a schematic diagram of an integrated model training process in a method for monitoring public opinion in an electric power market against noise according to the present invention. Figure 2 As shown, preferably, the randomly masked original data set is respectively input into multiple sub-models obtained by connecting the pre-trained encoder to the pre-trained task classifier, and the multiple sub-models are trained, including: freezing the task classifiers in the multiple sub-models, using the randomly masked original data set to fine-tune the pre-trained encoders in the multiple sub-models respectively, and obtaining the fine-tuning labels of the original data set; using the fine-tuned parameters to freeze the pre-trained encoders in the multiple sub-models, using the positive training combined with the negative training loss to minimize the loss, and using the original data set with fine-tuning labels to fine-tune the task classifiers of the multiple sub-models again; the training results of the multiple sub-models are the fine-tuned pre-trained encoder and the fine-tuned task classifier connected downstream of the pre-trained encoder.

[0050] Manually issue public opinion collection instructions, obtain the preset target URLs of major social and news platforms, and visit the target URLs to crawl historical public opinion data. Use the public opinion data as unlabeled pre-training data. Obtain the target URLs of major social and news platforms, and visit the target URLs to crawl real-time public opinion data. The crawled data sources include Weibo, Douyin, news portals, forums and other social media platforms. Obtain the data of the target platform through API interface or web crawler technology, and store it in the database for subsequent analysis. Use big data collection technology to save the crawled public opinion data to the Mysql database, and update the database data at hourly intervals. Read the public opinion data from the data source layer of the data warehouse as the data to be labeled, and construct the original data set. Use the public opinion data and the unique noisy label as training data to train the anti-noise natural language processing model to obtain a sub-model suitable for the corresponding text domain.

[0051] Each sub-model is constructed by an upstream encoder and a downstream task classifier. First, freeze the task classifier to train the encoder, and then freeze the pre-trained encoder to fine-tune the task classifier. Obtain the fine-tuning parameters and get a sub-model. The input data of multiple sub-models is the original data set with random masking. When the input is different, there are differences in the sub-models after training. Perform text domain alignment on several sub-models, and the alignment method is task adaptive pre-training. The encoder can use a general large language model. The encoder is pre-trained on an unlabeled dataset to align the encoder's domain to the domain of the anti-noise public opinion text in the power market.

[0052] Step 2: Combine the trained multiple sub-models into an integrated model, input the original data set into the integrated model to obtain the cross entropy integrated label of the original data set, and obtain an integrated label data set.

[0053] The integrated model is constructed with several pre-trained sub-models. The pre-collected public opinion data is used as unlabeled pre-training data, and several natural language processing pre-models are pre-trained for text domain alignment. Several natural language processing pre-training models are used to obtain several annotation results. Under a given integration strategy, the annotation results obtained by several pre-training models are integrated, and a unique noisy label is obtained through loss-weighted integration. The unique noisy label is the label corresponding to the original data set in the output of the integrated model.

[0054] The trained multiple sub-models are combined into an integrated model, the original data set is input into the integrated model to obtain the cross entropy integrated label of the original data set, and the integrated label data set is obtained, including: the integrated model is composed of M sub-models, then the integrated label y of the integrated model assemble for:

[0055]

[0056] in, The label y output by the mth sub-model m With the classification label y k The cross entropy loss between the labels y m With the classification label y k are all K-dimensional vectors, K is equal to the total number of classification labels, and y k The kth element of is 1, and the other elements are 0; get the integrated label y for each instance i assemble,i , and generate an integrated label dataset. In the integrated label dataset, the only noisy label for each instance i is the vector y assemble The category corresponding to the largest element in .

[0057] In other embodiments, a given integration strategy may also use a simple meta-learner to obtain a unique noisy label, such as a multi-layer feedforward neural network, integrating the labeling results obtained by several pre-trained models.

[0058] Step 3, construct a preheating model that receives input from a pretrained preheating encoder and uses the output of a preheating task classifier as a classification label, inputs the integrated label data set into the pretrained preheating model, and preheats to divide clean instances and noise instances.

[0059] This process includes inputting the unlabeled original data set into the preheating encoder for training to obtain a pretrained preheating encoder; connecting the preheating task classifier downstream of the pretrained preheating encoder, and training the preheating task classifier by combining positive training with negative training; constructing a preheating model using the trained preheating encoder and preheating task classifier, and inputting the integrated label data set into the preheating model to implement preheating partitioning to obtain clean instances and noisy instances.

[0060] The preheating encoder is similar to the pretrained encoder in step 1 above, and uses an existing natural language model as the preheating encoder. Input the unlabeled original data set into the preheating encoder for pretraining to obtain the parameters of the preheating encoder. Freeze the preheating encoder and connect the preheating task classifier downstream to fine-tune the parameters of the preheating task classifier. The construction of the preheating task classifier uses the same model as the task classifier mentioned in step 1 above. Use several fine-tuned pretrained models to annotate historical public opinion text data.

[0061] In step 1 and step 3, the model is trained by combining positive training with negative training, and the training loss function is adjusted to:

[0062]

[0063] In the formula, are positive training loss and negative training loss, respectively, y For the task classifier, warm up the model parameters of the task classifier.

[0064] After training, the model parameters are obtained, and an integrated label dataset is input into the preheated model, thereby dividing the data instances in the integrated label dataset into clean instances and noisy instances.

[0065] A preheating model is constructed by using a trained preheating encoder and a preheating task classifier, and an integrated label data set is input into the preheating model to implement preheating division to obtain clean instances and noise instances, including: inputting the integrated label data set into the preheating model to obtain a preheating probability distribution of each instance in the data set through the preheating model; assigning the instance to a clean data set or a noise data set according to the preheating probability distribution of the instance and the integrated label corresponding to the instance; the assignment is:

[0066]

[0067] x i For instance i,

[0068] D c and D n They are clean data set and noisy data set respectively.

[0069] p i is the integrated classification label y corresponding to instance i k The probability of

[0070] K is the number of classification labels.

[0071] During the training of the noise-resistant natural language processing model, the dataset By L c Clean text and L n Dataset D includes clean data sets and noisy dataset in, and denote the input sequences of clean text and noisy text respectively, and and Respectively represent the labels associated with them, where K is the total number of categories. The task goal is to learn a probability function with x as input under the condition that the data set is noisy and generate a probability distribution about y.

[0072] In other embodiments, the model composed of the encoder and the task classifier can also be trained based on the minimum loss function of negative training as the goal before the warm-up partition. Negative training Given an input text x with a label y, a complementary label y is generated by randomly extracting labels other than y from the label space (i.e., ). Therefore, the loss function of negative training is defined as:

[0073]

[0074] In the formula, p k is the probability that the entity to be trained falls into the kth label, is the complementary label value of y, is the loss function for negative training. The complementary label of y is randomly selected from all class labels excluding the specified label y in each training iteration. The goal of negative training is to reduce the probability of crossing the current label with the complementary label, ideally optimizing the loss function to close to zero (y k →0).

[0075] Negative training is also used below, so you can refer to the content mentioned here.

[0076] Step 4: Connect a natural language task classifier and a natural language dataset classifier to the downstream of the pre-trained natural language encoder to construct a natural language model, and alternately freeze the pre-trained natural language encoder, the natural language task classifier, and the natural language dataset classifier. In each alternating process, positive training and negative training are performed on the clean instances and noise instances divided by preheating to generate a natural language model and a preliminary classification dataset.

[0077] Preferably, pre-training is performed using a natural language encoder to obtain a pre-trained natural language encoder; the natural language data set classifier is frozen, and positive training and negative training are performed on the clean instances and noise instances divided by preheating, respectively, to update the parameters of the pre-trained natural language encoder and the natural language task classifier; the pre-trained natural language encoder and the natural language task classifier are frozen, and positive training and negative training are performed on the clean instances and noise instances divided by preheating, respectively, to update the natural language task classifier; the above steps are iterated multiple times until the iteration end conditions are met to obtain a natural language model.

[0078] Initialize the noise-resistant natural language processing model, using the clean instance D obtained by preheating partitioning c and noise instance D n As a dataset classifier The training benchmark.

[0079] Figure 3 Schematic diagram of a natural language anti-noise model in a method for monitoring public opinion in an electric power market. Figure 3As shown, the dataset classifier is connected downstream of the task classifier, and is frozen alternately. Positive training and negative training are performed on the clean instances and noise instances divided by preheating, respectively, to obtain model parameters respectively; the above steps are iterated multiple times until the iteration end conditions are met to obtain the pretrained model.

[0080] First, for the clean instance D c and noise instance D n Perform positive training and negative training separately, and freeze the dataset classifier at the same time The parameters of , make the encoder Enc learn features that are irrelevant to the data source. This step confuses the data source of the encoder Enc. c and noise instance D n Perform positive training and negative training separately, freeze the encoder Enc and task classifier at the same time, so that the dataset classifier Learn features related to the data source. This step uses the dataset classifier Guide the encoder Enc to confuse the data source. Repeat the above steps, and after multiple Epochs, obtain a noise-resistant natural language processing model that can represent both specific information related to the data source and general information unrelated to the data source.

[0081] Freeze the natural language dataset classifier, perform positive training and negative training on the clean instances and noise instances divided by preheating, respectively, to update the parameters of the pretrained natural language encoder and natural language task classifier, including: constructing a regularized loss function for:

[0082]

[0083] In the formula, θ f ,θ y and θ d are the parameters of the encoder, task classifier, and dataset classifier respectively; are the frozen encoder parameters, and They are the loss of positive training, the loss of negative training and the loss of the dataset classifier under different model parameters;

[0084] During the training process, the dataset classifier uses features to distinguish clean samples from noise samples, the task classifier uses features to output task labels, and the encoder uses input text to output features.

[0085] With the goal of minimizing the regularized loss function, the parameters of the task classifier and the dataset classifier are updated after the kth iteration as follows:

[0086]

[0087] Freeze the pre-trained natural language encoder and the natural language task classifier, and fine-tune the natural language task classifier using the clean instances and noise instances divided by pre-heating, including: constructing a natural language dataset classifier loss function for:

[0088]

[0089] With the goal of minimizing the loss of the dataset classifier, the parameters of the dataset classifier are updated after the kth iteration as follows:

[0090]

[0091] Use the preheated dataset classification information as the classification target to train the dataset classifier Make The prediction is towards the source of the correct instance, i.e. D c or D n This step counters the tendency of the encoder to try to ignore the source of the dataset, and prompts the encoder to ignore only the characteristics of the source of the dataset.

[0092] The positive training rule mentioned in the above training process is based on the re-labeled sample set D ′ n , in the context of multi-class classification, let x∈X be an input such that x∈D ′ n , y∈{1,2,..,K} is the label assigned to the text. The training objective f(x;θ) aims to map the input sentence into a c-dimensional score space, denoted as f: Where θ is the model parameter. The loss function for positive training is:

[0093]

[0094] Among them, p k represents the probability of the kth label. This equation optimizes the model loss so that the probability value corresponding to a given label is close to 1 (p y →1).

[0095] The negative training rules are the same as mentioned above.

[0096] Step 5: relabel the preheated and divided noisy data set to obtain a relabeled sample set, and use the relabeled sample set to perform positive training on the natural language model to obtain a noise-resistant public opinion monitoring model for the power market.

[0097] The sample confidence score is obtained by using a noise-resistant natural language processing model that is independent of the data source, and the noisy dataset is relabeled based on the relabeling rule to obtain D′ n . Perform the final positive training, using the re-labeled sample set D ′ n Continue to perform positive training on the noise-resistant natural language processing model to obtain the final noise-resistant natural language processing model.

[0098] Relabeling the preheated divided noisy data set to obtain a relabeled sample set, including: using the relabeling model to classify the preheated divided noisy data set; i , if its confidence after classification is p i is less than the filtering threshold, then the entity x i Classify as noise instance For the classified noise instance D ′ n Re-labeling is performed, and the re-labeling rule is to give noise instances Provide the corresponding noise label

[0099]

[0100] In the formula, is the noise instance D ′ n The re-labeled label of the jth instance in , n is the position of the noise text sequence where the instance is located,

[0101] For entity x i The confidence level of the k-th label,

[0102] The relabeling threshold is Where u is the ratio of the number of noise instances identified by the re-labeling model to the total number of input instances, and K is the number of categories in the training set. i <δ f The samples are marked as having high noise level D ′ n .

[0103] In one embodiment, when training model hyperparameters, 12 attention heads and 12 layers are used, and the dropout probability is kept at 0.1, and 6 epochs of positive training and 20 epochs of NT training are performed. The initial learning rate of all layers is 2e -5 , the batch size is 32. The number of negative samples is set to K-1, and the filtering threshold is set to The training evaluation can use the Macro-F1 score as a comparison metric, which is calculated based on the harmonic mean of Macro-precision and Macro-recall over all labels.

[0104] The positive training and negative training methods in the other steps mentioned above are similar, and the parameters and model structure used in the training can be adjusted.

[0105] Step 6: Monitor the public opinion data using the power market noise-resistant public opinion model.

[0106] The power market anti-noise public opinion model is used to monitor public opinion data, including: presetting a target website, crawling real-time public opinion data and regularly updating the public opinion data; dividing the public opinion data into sentences to obtain the original text The public opinion data is classified by using the anti-noise public opinion model of the electricity market; the public opinion data related to the electricity market with tags is stored in the middle layer of the data warehouse, and when a public opinion analysis instruction is identified, the public opinion data related to the electricity market with tags is extracted for analysis; when the analysis result shows that the correlation between the public opinion analysis instruction and the public opinion data exceeds a preset threshold, a public opinion warning is issued.

[0107] The public opinion collection instructions are manually issued to obtain the preset target URLs of the main social and news platforms, and the target URLs are visited to crawl historical public opinion data. The target URLs of the preset main social and news platforms are obtained, and the target URLs are visited to crawl real-time public opinion data. The crawled public opinion data is saved to the Mysql database using big data collection technology, and the database data is updated every hour.

[0108] In one embodiment, the method for crawling historical public opinion data specifically specifies public opinion keywords, sets a geographical scope to limit the source of crawled information, and sets a target website for crawling data. Specify several power market public opinion keywords, including but not limited to "power sales", "power trading", "retail electricity prices" and other related terms. Set geographical scope restrictions to crawl public opinion data related to a specific geographical area or administrative division by specifying the area. The crawled data sources include Weibo, Tik Tok, news portals, forums and other social media platforms. Obtain the data of the target platform through the API interface or web crawler technology, and store it in the database for subsequent analysis.

[0109] In one embodiment, the keyword table of power market public opinion is as follows:

[0110]

[0111]

[0112] Table 1 Keywords of power market public opinion

[0113] In actual practice, historical public opinion data can be crawled through open source web crawler toolkits such as Sitong Public Opinion, BeautifulSoup, and Scrapy.

[0114] The public opinion data is read out from the data source layer of the data warehouse as the data to be labeled, and the noise-resistant natural language processing model suitable for the corresponding text domain is used to classify and label the data to be labeled, and the public opinion data carrying labels related to the power market is stored in the middle layer of the data warehouse.

[0115] Figure 4 This is a schematic diagram of monitoring public opinion data using public opinion analysis instructions in a method for monitoring public opinion in an electric power market with noise immunity according to the present invention. Figure 4 As shown, a public opinion analysis instruction is manually issued, the electricity market public opinion data is read from the middle layer of the data warehouse as the data to be analyzed, and the noise-resistant natural language processing model is applied to the data to be analyzed to produce the electricity market public opinion analysis results; based on the electricity market public opinion analysis results, when the public opinion analysis results exceed the preset public opinion warning threshold, a public opinion warning is issued.

[0116] In the specific implementation process, the public opinion warning can be triggered according to a certain strategy based on the intermediate layer data inferred by the anti-noise natural language processing model for the corresponding text domain. When the public opinion data to be analyzed is classified as a negative category related to the power market, such as market fluctuations, policy changes, emergencies, etc., if the classification ratio output by the model, that is, the classification confidence is greater than the preset threshold θ1=80%, then the warning is triggered. Perform sentiment analysis on the intermediate layer data. If the proportion of negative sentiment text exceeds a certain threshold θ2=70%, it means that the sentiment trend in the public opinion data is negative, and then the warning is triggered. Set sensitive keywords related to the power market, such as "power price fluctuations" and "insufficient power supply". When the frequency of a certain sensitive keyword in the intermediate layer data exceeds the set threshold θ3=10 times), the warning is triggered. In the specified time period t4, for example, within 24 hours, if the fluctuation range of negative sentiment in the public opinion data exceeds the set threshold θ4=50%, it is regarded as a potential risk and triggers a warning. If an emergency event related to the electricity market triggers a large amount of discussion in a short period of time, and the growth rate of public opinion data per unit time exceeds the threshold value θ5=300%, it is judged as an emergency public opinion event and an early warning is triggered immediately.

[0117] The second aspect of the present invention relates to a system for monitoring public opinion in an electric power market against noise; the system is implemented by using a method for monitoring public opinion in an electric power market against noise as described in the first aspect of the present invention; the system includes a training module, an integration module, a preheating module, a classification module, a labeling module, and a monitoring module; the training module is used to input the randomly masked original data set into a plurality of sub-models obtained by connecting a pre-trained encoder to a pre-trained task classifier, and train the plurality of sub-models; the integration module is used to combine the trained multiple sub-models into an integrated model, input the original data set into the integrated model to obtain a cross-entropy integrated label of the original data set, and obtain an integrated label data set; the preheating module is used to construct a preheating model that receives input from a pre-trained preheating encoder and takes the output of the preheating task classifier as a classification label, and the integrated label data set is obtained. The set is input into the preheating model after pretraining, and the preheating is used to divide the clean instances and the noise instances; the classification module is used to connect the natural language task classifier and the natural language data set classifier respectively downstream of the pretrained natural language encoder to construct a natural language model, alternately freeze the pretrained natural language encoder, the natural language task classifier and the natural language data set classifier, and perform positive training and negative training on the clean instances and the noise instances divided by preheating in each alternating process to generate a natural language model and a preliminary classified data set; the labeling module is used to relabel the preliminary classified data set to obtain a relabeled sample set, and use the relabeled sample set to perform positive training on the pretrained model to obtain a noise-resistant public opinion monitoring model for the power market; the monitoring module is used to monitor the public opinion data using the noise-resistant public opinion model for the power market.

[0118] A third aspect of the present invention relates to a terminal, comprising a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the method described in the first aspect of the present invention.

[0119] A fourth aspect of the present invention relates to a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect of the present invention.

[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit them. Although the present invention is described in detail with reference to the above embodiments, it should be understood by those skilled in the art that the technical solutions of the present invention still include contents that can modify or replace the specific embodiments of the present invention. Any modification or replacement that does not depart from the spirit and scope of the present invention shall be included in the protection scope of the claims of the present invention.

Claims

1. A method for monitoring public opinion in an electric power market against noise, characterized in that: The method comprises the following steps: The randomly masked original data sets are respectively input into a plurality of sub-models obtained by connecting the pre-trained encoder to the pre-trained task classifier, and the plurality of sub-models are trained; Combining the trained multiple sub-models into an integrated model, inputting the original data set into the integrated model to obtain the cross entropy integrated label of the original data set, and obtaining an integrated label data set; Constructing a preheating model that receives input from a pretrained preheating encoder and uses the output of a preheating task classifier as a classification label, inputting the integrated label data set into the pretrained preheating model, and preheating to divide clean instances and noise instances; A natural language task classifier and a natural language dataset classifier are respectively connected to the downstream of the pre-trained natural language encoder to construct a natural language model, and the pre-trained natural language encoder, the natural language task classifier and the natural language dataset classifier are alternately frozen. In each alternating process, positive training and negative training are performed on the clean instances and noise instances divided by preheating to generate a natural language model. Relabeling the preheated and divided noisy data set to obtain a relabeled sample set, and using the relabeled sample set to perform positive training on the natural language model to obtain a noise-resistant public opinion monitoring model for the power market; The power market noise-resistant public opinion model is used to monitor public opinion data.

2. According to claim 1, a method for monitoring public opinion in an electric power market against noise is characterized by: The randomly masked original data sets are respectively input into a plurality of sub-models obtained by connecting a pre-trained encoder to a pre-trained task classifier, and the plurality of sub-models are trained, including: Freeze the task classifiers in the multiple sub-models, use the randomly masked original datasets to fine-tune the pre-trained encoders in the multiple sub-models respectively, and obtain the fine-tuning labels of the original datasets; Freeze the pre-trained encoders in the multiple sub-models using the fine-tuned parameters, and fine-tune the task classifiers of the multiple sub-models again using the original data set with the fine-tuning labels by combining positive training with negative training to minimize the loss; The training results of the multiple sub-models are the fine-tuned pre-trained encoder and the fine-tuned task classifier connected downstream of the pre-trained encoder.

3. The method for monitoring public opinion in an electric power market against noise according to claim 2, characterized in that: The method combines the trained multiple sub-models into an integrated model, inputs the original data set into the integrated model to obtain the cross entropy integrated label of the original data set, and obtains the integrated label data set, including: The integrated model is composed of M sub-models, so the integrated label y of the integrated model is assemble for: in, The label y output by the mth sub-model m With the classification label y k The cross entropy loss between The label y output by the mth sub-model m With the classification label y k They are all K-dimensional vectors, where K is equal to the total number of classification labels; Get the integrated label y for each instance i assemble,i , and generate an integrated labeled dataset.

4. The method for monitoring public opinion in an electric power market against noise according to claim 3 is characterized by: The construction receives input from a pre-trained pre-heating encoder and uses the output of a pre-heating task classifier as a classification label, inputs the integrated label data set into the pre-trained pre-heating model, and pre-heats to divide clean instances and noise instances, including: Input the unlabeled original dataset into the preheated encoder for training to obtain a pretrained preheated encoder; Connect the preheating task classifier downstream of the pretrained preheating encoder, and train the preheating task classifier by combining positive training with negative training. The preheating model is constructed using the trained preheating encoder and preheating task classifier, and the integrated label dataset is input into the preheating model to implement preheating partitioning to obtain clean instances and noisy instances.

5. The method for monitoring public opinion against noise in the power market according to claim 4, characterized in that: The preheating model is constructed by using the trained preheating encoder and preheating task classifier, and the integrated label data set is input into the preheating model to implement preheating partitioning to obtain clean instances and noise instances, including: Inputting the integrated label data set into the preheating model to obtain the preheating probability distribution of each instance in the data set through the preheating model; Assign instances to clean datasets or noisy datasets based on their preheated probability distribution and the integrated labels corresponding to them. The allocation is: x i For instance i, D c and D n They are clean data set and noisy data set respectively. p i is the integrated classification label y corresponding to instance i k The probability of K is the number of classification labels.

6. A method for monitoring public opinion in an electric power market against noise according to claim 5, characterized in that: The method includes connecting a natural language task classifier and a natural language dataset classifier to the downstream of the pre-trained natural language encoder to construct a natural language model, freezing the pre-trained natural language encoder, the natural language task classifier and the natural language dataset classifier alternately, and performing positive training and negative training on the clean instances and noise instances divided by preheating in each alternation process to generate a natural language model and a preliminary classification dataset, including: Pre-training is performed using a natural language encoder to obtain a pre-trained natural language encoder; Freeze the natural language dataset classifier, and perform positive training and negative training on the clean instances and noise instances divided by preheating, respectively, to update the parameters of the pretrained natural language encoder and the natural language task classifier; Freeze the pre-trained natural language encoder and the natural language task classifier, and fine-tune the natural language task classifier using the clean instances and noise instances divided by pre-heating; The above steps are iterated multiple times until the iteration end conditions are met to obtain a natural language model and a preliminary classification data set.

7. The method for monitoring public opinion against noise in the power market according to claim 6, characterized in that: The freezing of the natural language dataset classifier, and performing positive training and negative training on the clean instances and noise instances divided by preheating, respectively, to update the parameters of the pretrained natural language encoder and the natural language task classifier, include: Constructing regularized loss function for: In the formula, θ f ,θ y and θ d They are the parameters of the natural language encoder, natural language task classifier, and natural language dataset classifier respectively; are the frozen natural language encoder parameters, and They are the loss of positive training, the loss of negative training, and the loss of the natural language dataset classifier under different model parameters; With the goal of minimizing the regularized loss function, the parameters of the natural language task classifier and the natural language dataset classifier are updated after the kth iteration as follows:

8. The method for monitoring public opinion against noise in the power market according to claim 7, characterized in that: The freezing of the pre-trained natural language encoder and the natural language task classifier, and fine-tuning the natural language task classifier using the clean instances and noise instances divided by pre-heating, comprises: Constructing a natural language dataset classifier loss function for: With the goal of minimizing the loss of the natural language dataset classifier, the parameters of the natural language dataset classifier are updated after the kth iteration as follows:

9. The method for monitoring public opinion against noise in the power market according to claim 8, characterized in that: The step of re-labeling the pre-warmed and divided noisy data set to obtain a re-labeled sample set includes: Use the relabeling model to classify the preheated and partitioned noisy dataset; For any instance x in the classified preliminary classification data set i , if its confidence after classification is p i is less than the filtering threshold, then the entity x i Classified as a noise instance; For the classified noise instance D ′ n Re-labeling is performed, and the re-labeling rule is to give noise instances Provide the corresponding noise label In the formula, is the noise instance D ′ n The re-labeled label of the jth instance in , n is the position of the noise text sequence where the instance is located, For entity x i The confidence level of the k-th label, The relabeling threshold is Where u is the ratio of the number of noise instances identified by the re-labeling model to the total number of input instances, and K is the number of categories in the training set.

10. A method for monitoring public opinion in an electric power market against noise according to claim 9, characterized in that: The monitoring of public opinion data using the anti-noise public opinion model of the power market includes: Preset the target URL, crawl the real-time public opinion data and regularly update the public opinion data; The public opinion data is divided into sentences to obtain the original text and using the power market noise-resistant public opinion model to classify the public opinion data; The public opinion data related to the power market with the tag is stored in the middle layer of the data warehouse, and when the public opinion analysis instruction is recognized, the public opinion data related to the power market with the tag is extracted for analysis; When the analysis result shows that the correlation between the public opinion analysis instruction and the public opinion data exceeds a preset threshold, a public opinion warning is issued.

11. A power market anti-noise public opinion monitoring system; characterized by: Implemented by using a method for monitoring public opinion in an electric power market against noise as described in any one of claims 1 to 10; The system includes a training module, an integration module, a preheating module, a classification module, a marking module, and a monitoring module; The training module is used to input the randomly masked original data set into multiple sub-models obtained by connecting the pre-trained encoder to the pre-trained task classifier, and train the multiple sub-models; The integration module is used to combine the trained multiple sub-models into an integrated model, input the original data set into the integrated model to obtain the cross entropy integrated label of the original data set, and obtain the integrated label data set; The preheating module is used to construct a preheating model that receives input from a pretrained preheating encoder and uses the output of a preheating task classifier as a classification label, inputs the integrated label data set into the pretrained preheating model, and preheats to divide clean instances and noise instances; The classification module is used to respectively connect a natural language task classifier and a natural language dataset classifier downstream of a pre-trained natural language encoder to construct a natural language model, alternately freeze the pre-trained natural language encoder, the natural language task classifier and the natural language dataset classifier, and perform positive training and negative training on the clean instances and noise instances divided by preheating in each alternating process to generate a natural language model and a preliminary classification dataset; The labeling module is used to relabel the preliminary classification data set to obtain a relabeled sample set, and use the relabeled sample set to perform positive training on the pre-trained model to obtain a noise-resistant public opinion monitoring model for the power market; The monitoring module is used to monitor public opinion data using the power market anti-noise public opinion model.

12. A terminal comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1-10.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.