Power industry structured text generation method based on NLP technology
By applying the structured text generation method based on NLP technology in the power industry, the problem of difficulty in analyzing unstructured data is solved, efficient and accurate data processing and report generation are achieved, and analysis and decision-making efficiency is improved.
Patent Information
- Application Number
- CN202411483807.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-10-22
AI Technical Summary
A large amount of unstructured data in the power industry (such as user reports and maintenance records) is difficult to directly use in intelligent analysis and decision-making, and traditional manual processing methods are time-consuming and error-prone.
The structured text generation method based on NLP technology is adopted, and multi-source data is collected and preprocessed, feature extraction and annotation is performed, and structured text is generated by using the BERT model, and structured text is generated by combining rules and templates, and the generation quality is optimized through ROUGE evaluation indicators.
It realizes efficient and accurate data processing and report generation, and improves the efficiency and accuracy of data analysis and decision-making.
Smart Images

Figure CN119692310A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of electric power technology, and more specifically, to a method for generating structured text in the electric power industry based on NLP technology. Background Art
[0002] With the digital transformation of the power industry, the amount of data generated by the power system is becoming increasingly large, involving multiple data sources such as sensor data, equipment logs, user reports, and maintenance records. These data provide rich information resources for the operation, fault diagnosis, and equipment maintenance of the power system. However, most of these data exist in unstructured form, especially the natural language text in user reports and maintenance records, which is difficult to be directly used for intelligent analysis and decision-making of the power system. Therefore, how to convert these unstructured data into structured text that can be used for analysis has become an important issue in the power industry.
[0003] The traditional manual method of processing this data is very time-consuming and error-prone, especially in fault handling and maintenance decision-making, where power companies often need to generate standardized report texts by analyzing a large number of logs and reports. Therefore, the power industry urgently needs a technical solution that can automatically generate structured texts to complete data processing and report generation more efficiently and accurately. Summary of the invention
[0004] The present invention provides a structured text generation method for the electric power industry based on NLP technology, which aims to achieve efficient and accurate data processing and report generation.
[0005] The structured text generation method for the power industry based on NLP technology includes the following steps:
[0006] Step 1: Collect sensor data, equipment logs, user reports, and maintenance record data from the power system and pre-process the collected data;
[0007] Step 2: Perform primary feature extraction on the preprocessed data, and then use PCA feature extraction technology to further extract important features in the data, reduce the high-dimensional data into key features, and standardize the extracted key features;
[0008] Step 3: Use power expert knowledge to annotate the extracted feature data, including fault type, equipment status, and event category; use classification algorithms to classify the annotated data and organize the data into predefined categories;
[0009] Step 4: Use the BERT model for training. The input data includes the annotated key feature data and text data. Use the supervised learning method to train the BERT model to generate text that meets the needs of the power industry. Iterate and optimize the BERT model based on the training results, and adjust the feature extraction and classification strategies.
[0010] Step 5: Design rules and templates for text generation. Determine the structure, language style, and use of professional terms of the text according to the business needs of the power industry and the purpose of generating text. Use the trained BERT model combined with pre-designed rules and templates to automatically generate structured text, and use pre-defined verification rules to check the generated text.
[0011] Step 6: Use the ROUGE evaluation indicator to evaluate the quality of the generated text, identify deficiencies in the generated text, and further optimize the BERT model and text generation rules.
[0012] The present invention aims to achieve efficient and accurate data processing and report generation through a structured text generation method for the power industry based on NLP technology. The method first collects multi-source data such as sensor data, equipment logs, user reports, etc. from the power system and performs preprocessing. Then, the key features are extracted by primary feature extraction and PCA dimensionality reduction technology, and standardized. Subsequently, the feature data is annotated using the knowledge of power experts, and the annotated data is classified and sorted by the classification algorithm. Then, the BERT model is used for training, the annotated key feature data and text data are input, and supervised learning is used to generate text that meets the needs of the power industry, and the feature extraction and classification strategies are optimized through multiple iterations. Subsequently, structured text is generated in combination with pre-designed rules and templates, and the text is checked using verification rules. Finally, the quality of the text is evaluated by the ROUGE evaluation index, and the model and generation rules are further optimized, thereby achieving the goal of efficient and accurate text generation in the power industry.
[0013] Preferably, step 2 comprises the following steps:
[0014] Time series feature extraction: For time series data, the following primary features are extracted:
[0015]
[0016] Where: μ represents the mean of the time series; N represents the number of points in the time series data; x i Represents the i-th time series point;
[0017]
[0018] Where: 2 Represents the variance of time series data;
[0019] Maximum value and minimum value: the maximum and minimum values in the time series data respectively;
[0020] Event record feature extraction: The primary features extracted from event records in device logs and user reports include: the number of events occurring per unit time and the proportion of different types of events per unit time;
[0021] Numerical measurement feature extraction: For the numerical measurement data in the maintenance records, the primary feature extracted is the mean maintenance time;
[0022] Data standardization: Before performing PCA, the primary features are standardized so that each feature has a mean of 0 and a variance of 1;
[0023] Calculate the covariance matrix: For the standardized feature data set, calculate the covariance matrix:
[0024]
[0025] Where: C represents the covariance matrix; N represents the number of samples; z i represents the feature vector of the i-th sample; μ represents the feature mean vector;
[0026] Eigenvalue decomposition: Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and eigenvectors:
[0027] Cv=λv;
[0028] Where: v represents the eigenvector; λ represents the eigenvalue;
[0029] Select principal components: select the eigenvectors corresponding to the largest k eigenvalues as the new feature space;
[0030] Dimensionality reduction transformation: Project the original data into the selected principal component space to obtain the key features after dimensionality reduction, where the projection expression is as follows:
[0031] Y=XV k ;
[0032] Where: Y represents the data after dimensionality reduction; X represents the primary feature data after standardization; V k Represents the matrix composed of the first k eigenvectors;
[0033] Standardization: Standardize the extracted key features.
[0034] Preferably, the labeling of the extracted feature data in step 3 includes manual labeling and automatic labeling;
[0035] First, the feature data is automatically annotated, and the data that cannot be annotated automatically is annotated using power expert knowledge;
[0036] The automatic annotation base historical data and known labels are labeled by similarity matching:
[0037]
[0038] Where: L i represents the label category of the i-th feature data point; F(x i ) represents the fault scoring function corresponding to the i-th characteristic data point; T1 and T2 are fault thresholds set according to the power industry standards;
[0039] in:
[0040] F(x i )=α1·Voltage Deviation+α2·Current Deviation+α3·Temperature;
[0041] Where: Voltage Deviation represents voltage deviation, which is the difference between the current voltage and the rated voltage of the device; Current Deviation represents current deviation, which is the difference between the current current and the rated current of the device; Temperature represents the current temperature of the device; α1, α2, and α3 represent fault coefficients, which are given based on expert experience.
[0042] Preferably, the data classification is performed using a random forest model.
[0043] Preferably, the training steps of the BERT model in step 4 are as follows:
[0044] Feature input: For each input sample, the feature vector X and its corresponding annotated text T are used as the input of the BERT model. The text data needs to be segmented and encoded before entering the BERT model. The input format is as follows:
[0045] [CLS]+Token1+Token2+…+[SEP];
[0046] Among them: [CLS] represents the classification tag; [SEP] represents the separator between sentences; Token represents the word in the text;
[0047] Objective function: Use the cross entropy loss function to optimize the text generation ability of the BERT model:
[0048]
[0049] Where: L represents the loss value; N represents the number of words in the sample; yi Represents the actual label of the i-th word; Represents the predicted probability of the i-th word generated by the BERT model;
[0050] By minimizing the loss function, the model can gradually generate more accurate text.
[0051] The beneficial effects of the present invention include:
[0052] The present invention aims to achieve efficient and accurate data processing and report generation through a structured text generation method for the power industry based on NLP technology. The method first collects multi-source data such as sensor data, equipment logs, user reports, etc. from the power system and performs preprocessing. Then, the key features are extracted by primary feature extraction and PCA dimensionality reduction technology, and standardized. Subsequently, the feature data is annotated using the knowledge of power experts, and the annotated data is classified and sorted by the classification algorithm. Then, the BERT model is used for training, the annotated key feature data and text data are input, and supervised learning is used to generate text that meets the needs of the power industry, and the feature extraction and classification strategies are optimized through multiple iterations. Subsequently, structured text is generated in combination with pre-designed rules and templates, and the text is checked using verification rules. Finally, the quality of the text is evaluated by the ROUGE evaluation index, and the model and generation rules are further optimized, thereby achieving the goal of efficient and accurate text generation in the power industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0054] Figure 1 An overall step block diagram provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] See also Figure 1 As shown, the best embodiment of the present invention is further described;
[0057] The structured text generation method for the power industry based on NLP technology includes the following steps:
[0058] Step 1: Collect sensor data, equipment logs, user reports, and maintenance record data from the power system and pre-process the collected data;
[0059] Step 2: Perform primary feature extraction on the preprocessed data, and then use PCA feature extraction technology to further extract important features in the data, reduce the high-dimensional data into key features, and standardize the extracted key features;
[0060] Step 3: Use power expert knowledge to annotate the extracted feature data, including fault type, equipment status, and event category; use classification algorithms to classify the annotated data and organize the data into predefined categories;
[0061] Step 4: Use the BERT model for training. The input data includes the annotated key feature data and text data. Use the supervised learning method to train the BERT model to generate text that meets the needs of the power industry. Iterate and optimize the BERT model based on the training results, and adjust the feature extraction and classification strategies.
[0062] Step 5: Design rules and templates for text generation. Determine the structure, language style, and use of professional terms of the text according to the business needs of the power industry and the purpose of generating text. Use the trained BERT model combined with pre-designed rules and templates to automatically generate structured text, and use pre-defined verification rules to check the generated text.
[0063] Step 6: Use the ROUGE evaluation indicator to evaluate the quality of the generated text, identify deficiencies in the generated text, and further optimize the BERT model and text generation rules.
[0064] The present invention aims to achieve efficient and accurate data processing and report generation through a structured text generation method for the power industry based on NLP technology. The method first collects multi-source data such as sensor data, equipment logs, user reports, etc. from the power system and performs preprocessing. Then, the key features are extracted by primary feature extraction and PCA dimensionality reduction technology, and standardized. Subsequently, the feature data is annotated using the knowledge of power experts, and the annotated data is classified and sorted by the classification algorithm. Then, the BERT model is used for training, the annotated key feature data and text data are input, and supervised learning is used to generate text that meets the needs of the power industry, and the feature extraction and classification strategies are optimized through multiple iterations. Subsequently, structured text is generated in combination with pre-designed rules and templates, and the text is checked using verification rules. Finally, the quality of the text is evaluated by the ROUGE evaluation index, and the model and generation rules are further optimized, thereby achieving the goal of efficient and accurate text generation in the power industry.
[0065] As a possible implementation of this embodiment, step 2 includes the following steps:
[0066] Time series feature extraction: For time series data, the following primary features are extracted:
[0067]
[0068] Where: μ represents the mean of the time series; N represents the number of points in the time series data; x i Represents the i-th time series point;
[0069]
[0070] Where: 2 Represents the variance of time series data;
[0071] Maximum value and minimum value: the maximum and minimum values in the time series data respectively;
[0072] Event record feature extraction: The primary features extracted from event records in device logs and user reports include: the number of events occurring per unit time and the proportion of different types of events per unit time;
[0073] Numerical measurement feature extraction: For the numerical measurement data in the maintenance records, the primary feature extracted is the mean maintenance time;
[0074] Data standardization: Before performing PCA, the primary features are standardized so that each feature has a mean of 0 and a variance of 1;
[0075] Calculate the covariance matrix: For the standardized feature data set, calculate the covariance matrix:
[0076]
[0077] Where: C represents the covariance matrix; N represents the number of samples; z i represents the feature vector of the i-th sample; μ represents the feature mean vector;
[0078] Eigenvalue decomposition: Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and eigenvectors:
[0079] Cv=λv;
[0080] Where: v represents the eigenvector; λ represents the eigenvalue;
[0081] Select principal components: select the eigenvectors corresponding to the largest k eigenvalues as the new feature space;
[0082] Dimensionality reduction transformation: Project the original data into the selected principal component space to obtain the key features after dimensionality reduction, where the projection expression is as follows:
[0083] Y=XV k ;
[0084] Where: Y represents the data after dimensionality reduction; X represents the primary feature data after standardization; V k Represents the matrix composed of the first k eigenvectors;
[0085] Standardization: Standardize the extracted key features.
[0086] As a possible implementation of this embodiment, the labeling of the extracted feature data in step 3 includes manual labeling and automatic labeling;
[0087] First, the feature data is automatically annotated, and the data that cannot be annotated automatically is annotated using power expert knowledge;
[0088] The automatic annotation base historical data and known labels are labeled by similarity matching:
[0089]
[0090] Where: L i represents the label category of the i-th feature data point; F(x i ) represents the fault scoring function corresponding to the i-th characteristic data point; T1 and T2 are fault thresholds set according to the power industry standards;
[0091] in:
[0092] F(x i )=α1·Voltage Deviation+α2·Current Deviation+α3·Temperature;
[0093] Where: Voltage Deviation represents voltage deviation, which is the difference between the current voltage and the rated voltage of the device; Current Deviation represents current deviation, which is the difference between the current current and the rated current of the device; Temperature represents the current temperature of the device; α1, α2, and α3 represent fault coefficients, which are given based on expert experience.
[0094] As a possible implementation of this embodiment, the data classification is performed using a random forest model; wherein the training steps of the classification model are as follows:
[0095] Input data preparation:
[0096] Input features (X): After feature extraction and labeling, we use the standardized feature data as the input of the model. Each sample (such as sensor data of a device, work log, etc.) is represented as a feature vector X = [x1, x2, ..., x n ]; where each x i are different characteristics, such as temperature, voltage, current, etc.;
[0097] Output label (C): The label is the category information generated by the annotation step, such as "fault type" (such as overload, short circuit, etc.) or "equipment status" (such as normal, minor fault, major fault);
[0098] Construction of the random forest model: Create multiple decision tree models, each tree independently learns from the training data, as follows:
[0099] Random sampling: Perform random sampling on the data set multiple times to form different subsets.
[0100] Random feature selection: Each decision tree randomly selects some features when splitting a node, so as to reduce the influence of a single feature on the model decision.
[0101] Decision tree generation: On each sample subset, build a decision tree until all nodes can be finally classified.
[0102] Classification formula: The final classification result of random forest is based on the voting results of multiple decision trees. The specific formula is:
[0103]
[0104] Where: C represents the final classification result; P t (c|X) represents the predicted probability of category c by the tth decision tree; T represents the total number of decision trees;
[0105] Finally, the random forest selects the most likely category as the classification result by combining the prediction results of multiple trees;
[0106] After the model completes the classification, the data is organized according to the categories predicted by the model:
[0107] Merge similar events: All events of the same type (such as the same equipment failure type or equipment status) will be merged together.
[0108] Output format preparation: According to the subsequent required text generation or data analysis process, the classified data is converted into a suitable format for further processing.
[0109] Model Validation:
[0110] After the classification is completed, we need to use the validation set to evaluate the model. The validation set is a part randomly extracted from the original dataset and does not participate in the training of the model. The evaluation index uses one of the following indicators:
[0111] Accuracy: The proportion of correct classification by the model;
[0112] Recall: The proportion of all positive samples that the model can correctly predict;
[0113] F1 score: The harmonic average of precision and recall, a comprehensive measure of model performance.
[0114] After testing the validation set, evaluate the performance of the model. If the results are not satisfactory, adjust the model parameters based on the validation results. For example:
[0115] Number of trees: Increasing or decreasing the number of decision trees affects the complexity and stability of the model.
[0116] Feature selection: Adjust the number of features used by each tree to enhance the generalization ability of the model.
[0117] Based on the validation results, the random forest model can be adjusted in the following ways:
[0118] Adjust the number of trees: Properly increasing the number of trees can help improve the classification accuracy of the model.
[0119] Optimize feature selection: Based on the feature importance score, retain the features that have a greater impact on classification and remove redundant features.
[0120] Dealing with unbalanced data: For the problem of class imbalance, the model's ability to recognize minority classes can be improved by increasing data sampling, cost-sensitive learning, and other methods.
[0121] Through the random forest model, combined with the labeled data of the power industry, we can effectively classify data. The advantage of random forest lies in its ability to handle high-dimensional, multi-category data and its robustness to noise. Through model training, verification and adjustment, we can eventually build an efficient and stable classification model for equipment status monitoring and fault diagnosis.
[0122] As a possible implementation of this embodiment, the training steps of the BERT model in step 4 are as follows:
[0123] Feature input: For each input sample, the feature vector X and its corresponding annotated text T are used as the input of the BERT model. The text data needs to be segmented and encoded before entering the BERT model. The input format is as follows:
[0124] [CLS]+Token1+Token2+…+[SSEP];
[0125] Among them: [CLS] represents the classification tag; [SEP] represents the separator between sentences; Token represents the word in the text;
[0126] Objective function: Use the cross entropy loss function to optimize the text generation ability of the BERT model:
[0127]
[0128] Where: L represents the loss value; N represents the number of words in the sample; y i Represents the actual label of the i-th word; Represents the predicted probability of the i-th word generated by the BERT model;
[0129] By minimizing the loss function, the model can gradually generate more accurate text.
[0130] As a possible implementation of this embodiment, step 5 includes the following steps:
[0131] Design of text generation rules: Design text generation rules to ensure that the generated content meets the business needs and professional language habits of the power industry. These rules determine the structure, language style, use of professional terms, and accuracy of the text.
[0132] The content of rule design includes:
[0133] Text structure: Determine the overall structure of the text, which usually includes five parts: title, event description, cause analysis, treatment suggestions and conclusion. The order and content of these parts may vary depending on the type of event.
[0134] For example, for a device failure report, the text structure might be as follows:
[0135] Title: Equipment name + fault type + time.
[0136] Event Description: A brief description of the current status of the device.
[0137] Cause Analysis: Give possible causes of the failure.
[0138] Handling suggestions: Provide handling suggestions based on the fault type.
[0139] Conclusion: The outcome of the incident or subsequent follow-up measures.
[0140] Language style: Power industry texts usually need to be concise, accurate, and emphasize logic and operability. Avoid lengthy sentences and use accurate terminology and standard expressions. For example:
[0141] Correctly use terms such as "power outage", "equipment overload", and "current excess".
[0142] Choose concise sentences, such as "the equipment has returned to normal operation" instead of "after repair, the equipment has finally returned to normal state."
[0143] Use of professional terminology: Make sure to use terminology related to the power industry and use fixed expressions in specific situations. For example:
[0144] For equipment maintenance processes, common terms include "inspect," "replace," "repair," "recalibrate," etc.
[0145] For fault types, common terms include "overload", "short circuit", "insulation damage", etc.
[0146] Template design: In order to improve the consistency and readability of generated text, a fixed text template is designed to ensure that reports that meet industry standards can be quickly generated under different event types.
[0147] The design of the template needs to consider the following aspects:
[0148] Title template:
[0149] Template: "[Device Name]+[Fault Type]+[Time] Report"
[0150] Example: "Transformer overload fault report - October 21, 2024 14:30"
[0151] Event description template:
[0152] Template: "Device [device name] experienced [fault type] at [time] and is currently in [device status]."
[0153] Example: "Device A experienced an overload fault at 14:30 on October 21, 2024, and its current status is automatic power off."
[0154] Cause Analysis Template:
[0155] Template: "Based on sensor data and device logs, the failure may be caused by [reason] and manifested as [related phenomenon]."
[0156] Example: "Sensor data indicates that the fault may be caused by a loose cable connection, which manifests itself as abnormal current fluctuations in the device."
[0157] Processing suggestion template:
[0158] Template: "Recommend [specific action] for [issue section], including [further action]."
[0159] Example: "It is recommended to tighten and test the cable connections and check for short circuits in related circuits."
[0160] Conclusion Template:
[0161] Template: "After processing is completed, the device status is [status], and [follow-up action] is recommended."
[0162] Example: "After the processing is completed, the device status has returned to normal operation. It is recommended to strengthen the current monitoring of the device in the future to prevent overload from occurring again."
[0163] Combined with the BERT model for generation:
[0164] After having rules and templates, the generated text can be filled into these templates using the BERT model trained in the previous step. During the generation process, the model outputs the relevant text content based on the input event features and matches different parts of the template. The order of the generation process is as follows:
[0165] Input features: Take the key features extracted and labeled in step 3 (such as equipment status, fault type, and cause) as input.
[0166] Template filling: Match the corresponding template according to the input features and fill in the specific content in the template.
[0167] If the input features indicate that the equipment has an overload failure, the BERT model will generate text related to "overload" and fill in the corresponding template according to the rules.
[0168] Automatic adjustment: If the text generated by the model is ambiguous or does not meet business specifications, the generated text is automatically adjusted using rules. For example:
[0169] If: The text generated by BERT contains inappropriate sentence structures (such as lengthy or ambiguous descriptions), it will be corrected into concise industry standard terms through predefined rules.
[0170] If: the professional terminology generated by the model does not match (such as the fault type description is wrong), the template rules are used to verify whether the correct terminology is used.
[0171] Verification and Adjustment: Use predefined verification rules to check the generated text to ensure that the text meets the expected quality standards and industry specifications. These verification rules include:
[0172] Terminology checking: Checks whether the professional terminology in the generated text is correct, for example, whether "overload" is used in the appropriate place.
[0173] Sentence checking: Check whether the sentence structure meets the requirements and whether there are grammatical errors or logical errors.
[0174] Consistency check: Ensure that the device status, fault cause, and treatment suggestions described in the text are consistent. For example, if the text mentions that the device is overloaded, the subsequent cause analysis and treatment suggestions must be related to the overload.
[0175] Validation rules may include logical matching formulas, such as:
[0176] if (T = overload) then R = {check cable, test current};
[0177] Where: T represents the fault type (e.g., overload) in the generated text; R represents the set of optional actions to handle the suggestions;
[0178] Through verification rules, ensure that the generated text conforms to the logic and operation process of the power industry;
[0179] Build Example
[0180] Title: Equipment A Overload Fault Report—October 21, 2024 14:30
[0181] Event description: Device A experienced an overload failure at 14:30 on October 21, 2024, and is currently in the automatic power-off state.
[0182] Cause analysis: According to the sensor data, the fault may be caused by a loose cable connection, which manifests as abnormal current fluctuations in the equipment.
[0183] Handling suggestions: It is recommended to tighten and test the cable connection parts and check whether there is a short circuit in the related circuits.
[0184] Conclusion: After the processing is completed, the equipment status has returned to normal operation. It is recommended to strengthen the equipment current monitoring in the future to prevent overload from occurring again.
[0185] By designing rules and templates, combined with the BERT model to generate text, we ensure that the generated structured text meets the standards of the power industry. By designing standardized templates, predefined rules, and verification mechanisms, the automatically generated text can meet the business needs and industry specifications of different power events.
[0186] As a possible implementation of this embodiment, step 6 includes the following steps:
[0187] The purpose of step 6 is to evaluate the quality of the automatically generated structured text using the ROUGE (Recall-Oriented Understudy for GistingEvaluation) evaluation metric, thereby identifying deficiencies in the generated text and further optimizing the BERT model and text generation rules. ROUGE is a common metric for evaluating text summary generation tasks that can quantify the similarity between automatically generated text and reference text (such as manually written power reports).
[0188] Reference text construction: In order to conduct ROUGE assessment, a set of reference texts needs to be constructed. These texts are usually high-quality texts written by power industry experts or professional report writers, which are used as standards for generating texts.
[0189] Contents of reference text: Reference text should contain complete descriptions of different types of power events (such as fault reports, equipment maintenance records, etc.), in line with the business needs and specifications of the power industry. Each type of event corresponds to a set of reference texts to be compared with the generated texts of the same type.
[0190] Comparison of generated text with reference text: After constructing the reference text, compare the automatically generated text with the reference text one by one. The specific steps are as follows:
[0191] Text alignment: For each type of event (e.g. overload failure of a certain device), the generated text is aligned with the corresponding reference text. This ensures the accuracy of the comparison results.
[0192] Content matching: Compare the contents of the generated text and the reference text, mainly comparing the coverage of important information points in the text, such as equipment name, fault type, fault cause, and treatment measures.
[0193] Calculation of ROUGE evaluation indicators:
[0194] ROUGE-N (Recall): N-gram-based recall, which indicates the proportion of N-grams in the generated text that match the reference text. The formula is as follows:
[0195]
[0196] Where: N-gram represents a sequence of N consecutive words in the generated text and the reference text; count(N-gram) represents the number of times N-gram appears in the text; CK represents the reference text; SC represents the generated text;
[0197] ROUGE-N (Precision): Based on the precision of N-gram, it indicates the ratio of N-gram in the generated text to the reference text. The formula is as follows:
[0198]
[0199] ROUGE-L: An evaluation indicator based on the longest common subsequence (LCS), which reflects the similarity between the generated text and the reference text in sentence structure. The formula is as follows:
[0200]
[0201] Where: CK, D represents the length of the reference text; LCS (SC, CK) represents the longest common subsequence length between the generated text and the reference text;
[0202] Based on the calculated ROUGE metric, specific problems in the generated text can be identified, including:
[0203] Insufficient information coverage: The generated text may lack some key event descriptions or cause analysis.
[0204] Mismatched language style: The sentence structure or wording of the generated text may not conform to the standard language style of the power industry, or may differ from the description in the reference text.
[0205] Incorrect use of professional terminology: Some generated terms may not comply with industry standards, resulting in inconsistencies with professional terminology in the reference text.
[0206] Unreasonable structure: The text structure may not conform to the predetermined template, resulting in the wrong logical order or incompleteness of some parts.
[0207] After identifying the problems in the generated text, targeted optimization is performed to improve the quality of text generation. Specific optimization strategies include:
[0208] Optimizing the BERT model:
[0209] Training data enhancement: Increase the diversity of high-quality annotated data to cover more types of power industry events, especially those where the model performs poorly in generating text.
[0210] Fine-tune the model: Improve the accuracy and coverage of text generated by the model by adjusting the hyperparameters of the BERT model or using a more suitable loss function.
[0211] Optimize text generation rules:
[0212] Adjust template design: Based on the evaluation results, optimize the structure of the text generation template to ensure the logic and content integrity of the generated text. For example, add conditional judgments in the template to ensure that certain types of events contain necessary descriptions and analysis in the generated text.
[0213] Increase terminology verification: Introduce stricter terminology verification rules to ensure that the generated text complies with industry terminology standards.
[0214] Adjust feature extraction and classification strategies:
[0215] Optimize the feature extraction and classification algorithms in steps 2 and 3 so that the generated key features are more representative, thereby helping the BERT model generate more accurate text.
[0216] After the optimization of the model and generation rules is completed, the text is regenerated and ROUGE evaluation is performed again. Through multiple rounds of iterations, the quality of the generated text is gradually improved until the ROUGE indicators of the generated text and the reference text meet the business requirements.
[0217] The generated text is evaluated through the ROUGE indicator to identify text quality issues, and the quality of text generation is improved by optimizing the BERT model and generation rules. This step ensures that the generated structured text meets the business requirements and quality standards of the power industry, with high information coverage, accurate professional terminology and logical text structure.
[0218] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A structured text generation method for the power industry based on NLP technology, characterized by: The following steps are involved: Step 1: Collect sensor data, equipment logs, user reports, and maintenance record data from the power system and pre-process the collected data; Step 2: Perform primary feature extraction on the preprocessed data, and then use PCA feature extraction technology to further extract important features in the data, reduce the high-dimensional data into key features, and standardize the extracted key features; Step 3: Use power expert knowledge to annotate the extracted feature data, including fault type, equipment status, and event category; use classification algorithms to classify the annotated data and organize the data into predefined categories; Step 4: Use the BERT model for training. The input data includes the annotated key feature data and text data. Use the supervised learning method to train the BERT model to generate text that meets the needs of the power industry. Iterate and optimize the BERT model based on the training results, and adjust the feature extraction and classification strategies. Step 5: Design rules and templates for text generation. Determine the structure, language style, and use of professional terms of the text according to the business needs of the power industry and the purpose of generating text. Use the trained BERT model combined with pre-designed rules and templates to automatically generate structured text, and use pre-defined verification rules to check the generated text. Step 6: Use the ROUGE evaluation indicator to evaluate the quality of the generated text, identify deficiencies in the generated text, and further optimize the BERT model and text generation rules.
2. The method for generating structured text in the power industry based on NLP technology according to claim 1 is characterized in that: Step 2 The following steps are involved: Time series feature extraction: For time series data, the following primary features are extracted: Where: μ represents the mean of the time series; N represents the number of points in the time series data; x i Represents the i-th time series point; Where: 2 Represents the variance of time series data; Maximum value and minimum value: the maximum and minimum values in the time series data respectively; Event record feature extraction: The primary features extracted from event records in device logs and user reports include: the number of events occurring per unit time and the proportion of different types of events per unit time; Numerical measurement feature extraction: For the numerical measurement data in the maintenance records, the primary feature extracted is the mean maintenance time; Data standardization: Before performing PCA, the primary features are standardized so that each feature has a mean of 0 and a variance of 1; Calculate the covariance matrix: For the standardized feature data set, calculate the covariance matrix: Where: C represents the covariance matrix; N represents the number of samples; z i represents the feature vector of the i-th sample; μ represents the feature mean vector; Eigenvalue decomposition: Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and eigenvectors: Cv=λv; Where: v represents the eigenvector; λ represents the eigenvalue; Select principal components: select the eigenvectors corresponding to the largest k eigenvalues as the new feature space; Dimensionality reduction transformation: Project the original data into the selected principal component space to obtain the key features after dimensionality reduction, where the projection expression is as follows: Y=XV k ; Where: Y represents the data after dimensionality reduction; X represents the primary feature data after standardization; V k Represents the matrix composed of the first k eigenvectors; Standardization: Standardize the extracted key features.
3. The method for generating structured text in the power industry based on NLP technology according to claim 1 is characterized in that: The step 3 of labeling the extracted feature data includes manual labeling and automatic labeling; First, the feature data is automatically annotated, and the data that cannot be annotated automatically is annotated using power expert knowledge; The automatic annotation base historical data and known labels are labeled by similarity matching: Where: L i represents the label category of the i-th feature data point; F(x i ) represents the fault scoring function corresponding to the i-th characteristic data point; T1 and T2 are fault thresholds set according to the power industry standards; in: F(x i )=α1·Voltage Deviation+α2·Current Deviation+α3·Temperature; Where: Voltage Deviation represents voltage deviation, which is the difference between the current voltage and the rated voltage of the device; Current Deviation represents current deviation, which is the difference between the current current and the rated current of the device; Temperature represents the current temperature of the device; α1, α2, and α3 represent fault coefficients, which are given based on expert experience.
4. The method for generating structured text in the power industry based on NLP technology according to claim 1 is characterized in that: The data classification is performed using a random forest model.
5. The method for generating structured text in the power industry based on NLP technology according to claim 1 is characterized in that: The training steps of the BERT model in step 4 are as follows: Feature input: For each input sample, the feature vector X and its corresponding annotated text T are used as the input of the BERT model. The text data needs to be segmented and encoded before entering the BERT model. The input format is as follows: [CLS]+Token1+Token2+…+[SEP]; Among them: [CLS] represents the classification tag; [SEP] represents the separator between sentences; Token represents the word in the text; Objective function: Use the cross entropy loss function to optimize the text generation ability of the BERT model: Where: L represents the loss value; N represents the number of words in the sample; y i Represents the actual label of the i-th word; Represents the predicted probability of the i-th word generated by the BERT model; By minimizing the loss function, the model can gradually generate more accurate text.
Citation Information
Patent Citations
AR-based ring main unit, branch box and substation collaborative management and control method
CN118710235A
Photovoltaic array fault diagnosis method based on composite information
US20210135625A1
Cited By
Emergency report generation method and device, equipment and storage medium
CN120278136A
Structured data security identifier intelligent extraction and matching method and model
CN121350027A