An abnormal device code detection method and system based on power short text classification
Patent Information
- Application Number
- CN202210204630.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-12-16
- Filing Date
- 2022-03-03
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-03-03
AI Technical Summary
[0006]首先,FastText基于新闻、百科等语料库进行训练,与这些文本相比,电力文本含有大量专业性词汇,这些语料库中缺少电力专业词汇,因此模型对电力文本的特征提取不足,对分类准确率造成影响
[0056]本发明提供了一种基于电力短文本分类的异常设备编码检测方法和系统,包括:获取电力设备数据;将电力设备数据中的描述信息输入预先训练的短文本分类接口模型,得到电力设备的标准编码;对比标准编码与电力设备数据中的设备编码,若存在差异,则电力设备数据中的设备编码为异常数据;本发明采用的短文本分类接口模型解决了对电力文本的特征提取不足、类型过多和样本不均衡的问题,提高了分类准确率,极大改善目前设备分类工作操作难的现状,可用在电力设备缺陷,电力检修,基建施工,客服工单,电力审计,电力调度,电企舆情等其他电力领域的自然语言处理场景中。
Smart Images

Figure CN114610882B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power information technology, specifically relating to an abnormal equipment coding detection method and system based on power short text classification. Background Technology
[0002] Electricity data exists in multiple application systems; however, the massive datasets aggregated from various data sources often contain useless and erroneous data. Taking power equipment data as an example, this data includes multiple fields such as equipment code, equipment description, and equipment price. Among them, the equipment code, as the unique value to identify whether the data is correct, also has a large number of empty values, garbled characters, and manual input errors. Compared with other numerical fields, the equipment description, as a multi-text field, is more reliable.
[0003] Traditional methods for addressing equipment coding anomalies require assistance from experts in the power equipment field. Furthermore, the sheer volume of anomaly data makes the process time-consuming, labor-intensive, inefficient, and difficult to maintain continuously. Therefore, artificial intelligence (AI) methods are needed for anomaly detection and correction of equipment asset types. In predicting equipment asset types, equipment descriptions, as multi-text fields, are more reliable than other numerical fields. By utilizing natural language processing algorithms to automatically identify equipment types based on the equipment description field in the equipment master data, problems such as missing equipment types and misclassification of equipment can be resolved, effectively improving data governance efficiency.
[0004] Text classification algorithms are mainly divided into traditional machine learning and deep learning models. Due to the large number of training samples and broad classification of power equipment text, traditional machine learning models cannot handle this complexity. Among common deep learning text classification models, FastText is the most suitable for this purpose. FastText is a fast text classification algorithm characterized by: accelerating training and testing speeds while maintaining high accuracy; and training its own word vectors without requiring pre-trained ones. Figure 1 The FastText model architecture is shown below, where x1, x2, ..., xN-1, xN represent n-gram vectors in a text, and each feature is the average of word vectors.
[0005] FastText is a subword embedding algorithm that runs quickly, but it has the following drawbacks:
[0006] First, FastText is trained on corpora of news, encyclopedias, etc. Compared with these texts, power-related texts contain a large number of professional terms, while these corpora lack professional terms related to electricity. Therefore, the model is not good at extracting features from power-related texts, which affects the classification accuracy.
[0007] Secondly, this model is used to process electricity text classification. Due to the large number of types (432 categories), multiple binary classification models are required for classification. This approach requires training too many models, resulting in excessive training costs. Furthermore, the lack of correlation between the classification models affects the inference prediction time and accuracy of the final model.
[0008] Finally, this classification technique does not take into account the problem of imbalanced samples, i.e., the amount of data in different classes differs significantly. Models trained using imbalanced samples have poor generalization ability and are prone to overfitting. Summary of the Invention
[0009] To overcome the shortcomings of the prior art, this invention proposes an abnormal equipment coding detection method based on short power text classification, comprising:
[0010] Acquire power equipment data;
[0011] The descriptive information from the power equipment data is input into a pre-trained short text classification interface model to obtain the standard code for the power equipment.
[0012] If there is a difference between the standard code and the equipment code in the power equipment data, then the equipment code in the power equipment data is abnormal data.
[0013] Preferably, the training of the short text classification interface model includes:
[0014] Obtain the standard codes and corresponding standardized descriptions of each power device;
[0015] Based on the standardized description information, the highest and lowest level categories of the corresponding power equipment are obtained;
[0016] The BERT model is trained by taking the standardized description information of each power device as input and the highest-level category of the corresponding power device as output, to obtain the first-level classification layer model.
[0017] For each top-level category, the standardized description information of the power equipment in the top-level category is used as input, and the corresponding bottom-level category of the power equipment is used as output to train the convolutional neural network to obtain a two-level classification layer model;
[0018] All secondary classification layer models and the primary classification layer model are used as the short text classification interface model.
[0019] Preferably, the acquisition of standardized description information for each power device includes:
[0020] Collect descriptive information of each device from the power equipment database;
[0021] The descriptive information of each device is processed by regular expressions, word segmentation, or word vector clustering to obtain standardized descriptive information for each power device.
[0022] Preferably, the descriptive information of each device is processed by word vector clustering to obtain standardized descriptive information for each power device, including:
[0023] Remove meaningless characters from the description information of each device, and segment the description information of each device to obtain multiple words;
[0024] Calculate the word frequency of each term in the description information of each device and the reverse file frequency of each term;
[0025] Based on the word frequency of each word in the description information of each device and the reverse file frequency of each word, calculate the TF-IDF value of each word in the description information of each device.
[0026] The descriptive information corresponding to words whose TF-IDF values exceed a preset threshold is converted into word vectors;
[0027] Cluster the word vectors and generate a standardized description for each category.
[0028] Preferably, the formula for calculating the word frequency is as follows:
[0029]
[0030] In the formula, tf ij Let n represent the frequency of the i-th word in the description information of the j-th device. ij n represents the number of times the i-th word appears in the description information of the j-th device. qj ∑ represents the number of times the i-th word appears in the description information of the q-th device. q n qj This represents the total number of times all words appear in the description information of the j-th device.
[0031] Preferably, the formula for calculating the reverse file frequency is as follows:
[0032]
[0033] In the formula, idf i Let |D| represent the inverse file frequency of the i-th word, |D| represent the total number of device description information, and |{j:t i ∈d j}| indicates that the i-th word t is included. i The total number of device descriptions.
[0034] Preferably, the TF-IDF value is calculated using the following formula:
[0035] (tf-idf) ij =tf ij *idf i
[0036] In the formula, (tf-idf) ij This represents the TF-IDF value of the i-th word in the description information of the j-th device. ij IDF represents the frequency of the i-th word in the description information of the j-th device. i This represents the reverse file frequency of the i-th word.
[0037] Preferably, the step of inputting the descriptive information from the power equipment data into a pre-trained short text classification interface model to obtain the standard code for the power equipment includes:
[0038] Input the descriptive information from the power equipment data into the first-level classification model to obtain the highest-level category corresponding to the descriptive information;
[0039] Select the corresponding secondary classification layer model based on the highest-level category, and input the description information into the selected secondary classification layer model to obtain the lowest-level category corresponding to the description information;
[0040] The standard code for the power equipment is obtained by finding the lowest-level category.
[0041] Based on the same inventive concept, this application also provides an abnormal equipment coding detection system based on short power text classification, including: a data acquisition module, a standard coding module, and an anomaly judgment module;
[0042] The data acquisition module is used to acquire power equipment data;
[0043] The standard encoding module is used to input the descriptive information in the power equipment data into a pre-trained short text classification interface model to obtain the standard encoding of the power equipment.
[0044] The anomaly detection module is used to compare the standard code with the device code in the power equipment data. If there is a difference, the device code in the power equipment data is considered abnormal data.
[0045] Preferably, the training of the short text classification interface model includes:
[0046] Obtain the standard codes and corresponding standardized descriptions of each power device;
[0047] Based on the standardized description information, the highest and lowest level categories of the corresponding power equipment are obtained;
[0048] The BERT model is trained by taking the standardized description information of each power device as input and the highest-level category of the corresponding power device as output, to obtain the first-level classification layer model.
[0049] For each top-level category, the standardized description information of the power equipment in the top-level category is used as input, and the corresponding bottom-level category of the power equipment is used as output to train the convolutional neural network to obtain a two-level classification layer model;
[0050] All secondary classification layer models and the primary classification layer model are used as the short text classification interface model.
[0051] Preferably, the standard encoding module is specifically used for:
[0052] Input the descriptive information from the power equipment data into the first-level classification model to obtain the highest-level category corresponding to the descriptive information;
[0053] Select the corresponding secondary classification layer model based on the highest-level category, and input the description information into the selected secondary classification layer model to obtain the lowest-level category corresponding to the description information;
[0054] The standard code for the power equipment is obtained by finding the lowest-level category.
[0055] Compared with the closest existing technology, the present invention has the following beneficial effects:
[0056] This invention provides a method and system for detecting abnormal equipment codes based on short text classification in the power industry. The method includes: acquiring power equipment data; inputting descriptive information from the power equipment data into a pre-trained short text classification interface model to obtain standard codes for the power equipment; comparing the standard codes with the equipment codes in the power equipment data; if a difference exists, the equipment codes in the power equipment data are considered abnormal data. The short text classification interface model used in this invention solves the problems of insufficient feature extraction, excessive types, and imbalanced samples in power text, improving classification accuracy and greatly alleviating the current operational difficulties in equipment classification. It can be applied to natural language processing scenarios in other power fields such as power equipment defects, power maintenance, infrastructure construction, customer service work orders, power audits, power dispatching, and public opinion monitoring of power companies. Attached Figure Description
[0057] Figure 1 This is a schematic diagram of the FastText model involved in the present invention;
[0058] Figure 2 A schematic diagram of the process for detecting abnormal equipment codes based on short power text classification provided by the present invention;
[0059] Figure 3This is a schematic diagram of the Bert-CNN model structure provided by the present invention;
[0060] Figure 4 This invention provides a schematic diagram of an abnormal equipment coding detection system based on short power text classification. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of the invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Under the premise of conforming to the technical concept of the invention, the features, structures, characteristics, or details described in a particular embodiment may be combined in suitable manner with one or more other embodiments. The flowcharts shown in the accompanying drawings are merely illustrative and do not represent all necessary content and operational steps, nor do they necessarily have to be performed in the described order. For example, some operational steps can be decomposed, while others can be combined or partially combined; therefore, the actual execution order may change depending on the actual situation.
[0062] Example 1:
[0063] A flowchart illustrating an abnormal equipment coding detection method based on short power text classification provided by this invention is shown below. Figure 2 As shown, it includes:
[0064] Step 1: Obtain power equipment data;
[0065] Step 2: Input the descriptive information from the power equipment data into the pre-trained short text classification interface model to obtain the standard code for the power equipment;
[0066] Step 3: Compare the standard code with the equipment code in the power equipment data. If there is a difference, the equipment code in the power equipment data is abnormal data.
[0067] Before step 1, it is necessary to train the short text classification interface model, which specifically includes:
[0068] A1: Using the power equipment database in the State Grid data platform as the data source, and based on the table structure, select and write SQL scripts to obtain power equipment data (hereinafter referred to as "data") from the database. Then, perform deduplication, standardization, error correction, etc., on the collected data and save it as a database file. Further processing of the collected data is performed, including handling special characters and data normalization. The power equipment data includes descriptive information and equipment codes.
[0069] A2: Equipment type standardization, which means obtaining standardized description information for each piece of equipment.
[0070] Based on the equipment standard coding table, the equipment type text undergoes preprocessing such as word segmentation, standard conversion, and word vector clustering. The region field and code are mapped to the headquarters code (i.e., the standard code) to support data annotation. A rule-based filtering method combined with manual assistance is used. First, the data is filtered based on its own category. Then, small batches are extracted to check the accuracy. If the accuracy is too low, manual annotation is performed. Based on the annotation results, the proportion of samples in different categories is calculated. Depending on the degree of imbalance, the SMOTE oversampling algorithm is used to supplement samples for equipment types with a proportion less than 1 / 10 of the average sample size. At the data level, the SMOTE oversampling algorithm generates more samples, reducing the impact of sample imbalance.
[0071] In this invention, before training the short text classification interface model, the original data (i.e., device description information) needs to be labeled. Sample labeling requires the device type of the original data, but most regions do not use standard codes, so standardization conversion is required. The specific steps are: map the data code to the device name (i.e. description information) through the region of the data and the device code unique to that region, and finally find the standard code using the device name, thus completing the device code standardization.
[0072] When processing actual data, it was found that when using device names to find standard codes, there is not a one-to-one correspondence between regional device names and standard device names, resulting in the following complexities:
[0073] I. The names contain a hierarchical relationship, such as "communication equipment - channel equipment - antenna";
[0074] II. Meaningless characters, such as "(2) Power generation and heating equipment - boiler equipment - boiler auxiliary equipment";
[0075] III. Different expressions for the same equipment, such as "centrifugal fan", "centrifugal blower", and "fan", all of which correspond to the "centrifugal fan" equipment;
[0076] For the first two scenarios, text preprocessing is performed using methods such as regular expressions and word segmentation. However, for the third scenario, relying on manual methods requires experts with extensive domain experience to create a standardized dictionary, incurring significant manpower and time costs. As the examples show, different expressions for the same device have high similarity. By using clustering methods from artificial intelligence, the device name text is converted into word vectors, and then clustering is used to compare similarity, allowing devices of the same category to be standardized.
[0077] The specific steps are as follows:
[0078] III-1: Segment the device text and remove meaningless characters such as spaces and parentheses.
[0079] III-2: Build a vocabulary based on the segmented words, and count the number of times the i-th word appears in the j-th device text. ij Device text d j The total number of occurrences of all words in the description information of the j-th device (i.e., the total number of times ∑) q n qj Calculate the word frequency tf of the i-th word in the description information of the j-th device. ij .
[0080]
[0081] III-3: Calculate the reverse document frequency, i.e., the reverse document frequency (idf) of the i-th word. i The value of idf can be obtained by dividing the total number of device texts by the number of device texts containing the term t, and then taking the logarithm of the quotient. If the number of device texts containing term t is smaller, the idf value will be higher. i The larger the value, the better the entry's ability to distinguish categories.
[0082]
[0083] Where |D| represents the total number of device description information, |{j:t i ∈d j}| indicates that the i-th word t is included. i The total number of device description information (i.e., n) ij (The number of texts ≠ 0). If the word is not in the corpus, the denominator will be zero, so generally 1+|{j:t i ∈d j The TF-IDF value represents the high frequency of a word within a specific device text set and its low frequency across the entire device text set, resulting in a high-weighted value. Therefore, TF-IDF values tend to filter out common words and retain important ones.
[0084] (tf-idf) ij =tf ij *idf i
[0085] In the formula, (tf-idf) ij This represents the TF-IDF value of the i-th word in the description information of the j-th device.
[0086] III-4: After calculating the TF-IDF values of the words, the device text corresponding to specific device types is converted into word vectors (usually, the descriptive information corresponding to words with TF-IDF values exceeding a preset threshold is converted into word vectors), forming a dataset. This method helps to retain keywords in the device text, i.e., capture key features, which facilitates subsequent clustering and finding similar words.
[0087] III-5: Randomly select k points from the dataset as initial cluster centers, and divide the data such that the total distance between all data points and their respective cluster centers is minimized. Use the mean of each cluster as the new cluster center and re-cluster the data, repeating the above steps until the cluster mean equals the cluster center. Finally, the data is divided into k sets.
[0088] III-6: Change the value of k and calculate the sum of squared errors (SSE) for different k values. Use the SSE, or elbow method, to find the optimal k value. The principle is as follows: As the number of clusters k increases, the sample partitioning becomes more refined, and the aggregation degree of each cluster gradually increases, so the SSE naturally decreases. Furthermore, when k is less than the actual number of clusters, increasing k will significantly increase the aggregation degree of each cluster, so the decrease in SSE will be large. However, when k reaches the actual number of clusters, the aggregation degree gain from further increasing k will rapidly decrease, so the decrease in SSE will drop sharply. Then, as the value of k continues to increase, it tends to level off. In other words, the relationship between SSE and k resembles the shape of an elbow, and the k value corresponding to this elbow is the actual number of clusters in the data.
[0089] III-7: Based on the clustering results, standardize the equipment types, that is, solve the different expressions of the same equipment in problem 3. For example, "centrifugal fan", "centrifugal blower" and "fan" all correspond to the "centrifugal fan" equipment, so the equipment description can be unified.
[0090] A3: Before inputting the preprocessed text into the deep learning model, each word in the text is converted into a word vector, which represents the syntactic and semantic information of each word. Using power equipment text data, a BERT-CNN multi-level classification model (i.e., a short text classification interface model) is trained. The appropriate model parameters are selected based on the classification results on the validation set to complete the model training.
[0091] The categories of electrical equipment are hierarchical, as shown in Table 1. The bottom layer has too many categories, and the distinction between categories is not obvious, making direct classification relatively difficult. In contrast, the top layer has fewer categories, stronger distinction between categories, and relatively easier classification.
[0092] Table 1 Equipment Code and Equipment Type Table
[0093]
[0094]
[0095] Therefore, a hierarchical model is adopted. For the input description of electrical equipment, the corresponding highest-level category is first defined, and then the corresponding lowest-level category is defined based on the classification results. Classification models for defining the highest-level and lowest-level categories are trained separately, i.e., a first-level classification model and a second-level classification model. Figure 3 As shown, the highest-level category classification uses the BERT model, while the lowest-level category classification is implemented using a CNN (Convolutional Neural Network) model. The BERT model consists of multiple bidirectional Transformers, each of which uses a multi-head self-attention mechanism to establish the strength of connections between words. Google has open-sourced two different scales of BERT models: BERT-Base and BERT-Large. BERT-Base has 12 Transformer layers, 768 hidden units, and 12 self-attention layers, containing a total of 110 million parameters; BERT-Large has 24 Transformer layers, 1024 hidden units, and 16 self-attention layers, containing a total of 340 million parameters. This invention selects BERT-Base as the pre-trained model. BERT-CNN uses the output of the last four Transformer layers in BERT as the input to the downstream CNN model. In this patent, the last four layers L12, L11, L10, and L9 are used as the input matrix I (768×4) of the CNN. Then, 32 filters F (3×4) with a step size of 1 are used to scan the input matrix I, with the aim of extracting the 3-Gram features of the text. The inner product yields 32 feature vectors. To reduce computational complexity, CNNs typically use pooling to reduce matrix dimensionality. Pooling can be performed in two ways: max pooling and average pooling. Max pooling is generally used, selecting the largest element within the pooling window. Since text classification is sensitive to certain local keywords or terms, this patent chooses max pooling. After the max pooling layer, the data is concatenated and passed through a softmax layer to obtain the device classification probability distribution. During network training, filter parameters are not shared and are updated simultaneously with the connection parameters between networks.
[0096] This network structure is used for model training. The model consists of two layers, L1 and L2, where L1 is the primary classification layer and L2 is the secondary classification layer. The model first receives all training samples as input and trains the primary classification layer Y (L1) using the BERT model. Then, a data transformation layer is placed in between. This layer's function is to filter the L2 network based on the labels of the L1 layer. Specifically, it uses all samples with the primary classification Ym from the L1 layer's output label value as training samples for the L2 layer. For example, if the L1 layer output is 'Y2', the L2 layer will only use data with the primary classification 'Y2' for training.
[0097] A4: After pruning and compression, the model is encapsulated into a short text classification interface. The input is the device description, and the output is the standard code corresponding to the device type.
[0098] Step 2 specifically includes:
[0099] 2-1: Input the descriptive information from the power equipment data into the first-level classification model to obtain the highest-level category corresponding to the descriptive information;
[0100] 2-2: Select the corresponding secondary classification layer model based on the highest-level category, and input the description information into the selected secondary classification layer model, down to the lowest-level category corresponding to the description information;
[0101] 2-3: Find the standard code of the power equipment based on the lowest level category.
[0102] Example 2:
[0103] Based on the same inventive concept, this invention also provides an abnormal equipment coding detection system based on short power text classification, the system structure of which is as follows: Figure 4 As shown, it includes: a data acquisition module, a standard encoding module, and an anomaly detection module;
[0104] The data acquisition module is used to acquire power equipment data;
[0105] The standard encoding module is used to input the descriptive information in the power equipment data into a pre-trained short text classification interface model to obtain the standard encoding of the power equipment.
[0106] The anomaly detection module is used to compare the standard code with the device code in the power equipment data. If there is a difference, the device code in the power equipment data is considered abnormal data.
[0107] The training of the short text classification interface model includes:
[0108] Obtain the standard codes and corresponding standardized descriptions of each power device;
[0109] Based on the standardized description information, the highest and lowest level categories of the corresponding power equipment are obtained;
[0110] The BERT model is trained by taking the standardized description information of each power device as input and the highest-level category of the corresponding power device as output, to obtain the first-level classification layer model.
[0111] For each top-level category, the standardized description information of the power equipment in the top-level category is used as input, and the corresponding bottom-level category of the power equipment is used as output to train the convolutional neural network to obtain a two-level classification layer model;
[0112] All secondary classification layer models and the primary classification layer model are used as the short text classification interface model.
[0113] The acquisition of standardized descriptive information for each power device includes:
[0114] Collect descriptive information of each device from the power equipment database;
[0115] The descriptive information of each device is processed by regular expressions, word segmentation, or word vector clustering to obtain standardized descriptive information for each power device.
[0116] The descriptive information for each device is processed through word vector clustering to obtain standardized descriptive information for each power device, including:
[0117] Remove meaningless characters from the description information of each device, and segment the description information of each device to obtain multiple words;
[0118] Calculate the word frequency of each term in the description information of each device and the reverse file frequency of each term;
[0119] Based on the word frequency of each word in the description information of each device and the reverse file frequency of each word, calculate the TF-IDF value of each word in the description information of each device.
[0120] The descriptive information corresponding to words whose TF-IDF values exceed a preset threshold is converted into word vectors;
[0121] Cluster the word vectors and generate a standardized description for each category.
[0122] The formula for calculating the word frequency is as follows:
[0123]
[0124] In the formula, tf ij Let n represent the frequency of the i-th word in the description information of the j-th device. ijn represents the number of times the i-th word appears in the description information of the j-th device. qj ∑ represents the number of times the i-th word appears in the description information of the q-th device. q n qj This represents the total number of times all words appear in the description information of the j-th device.
[0125] The formula for calculating the frequency of the reverse file is as follows:
[0126]
[0127] In the formula, idf i Let |D| represent the inverse file frequency of the i-th word, |D| represent the total number of device description information, and |{j:t i ∈d j}| indicates that the i-th word t is included. i The total number of device descriptions.
[0128] The formula for calculating the TF-IDF value is as follows:
[0129] (tf-idf) ij =tf ij *idf i
[0130] In the formula, (tf-idf) ij This represents the TF-IDF value of the i-th word in the description information of the j-th device. ij IDF represents the frequency of the i-th word in the description information of the j-th device. i This represents the reverse file frequency of the i-th word.
[0131] Specifically, the standard encoding module is used for:
[0132] Input the descriptive information from the power equipment data into the first-level classification model to obtain the highest-level category corresponding to the descriptive information;
[0133] Select the corresponding secondary classification layer model based on the highest-level category, and input the description information into the selected secondary classification layer model to obtain the lowest-level category corresponding to the description information;
[0134] The standard code for the power equipment is obtained by finding the lowest-level category.
[0135] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0136] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0137] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0138] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit its scope of protection. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that after reading the present invention, they can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the application, but these changes, modifications or equivalent substitutions are all within the scope of protection of the claims pending approval.
Claims
1. A method for detecting abnormal equipment codes based on short text classification of electrical data, characterized in that, include: Acquire power equipment data; The descriptive information from the power equipment data is input into a pre-trained short text classification interface model to obtain the standard code for the power equipment. If there is a difference between the standard code and the equipment code in the power equipment data, then the equipment code in the power equipment data is abnormal data. The short text classification interface model addresses the imbalanced sample characteristics of power equipment data by employing the SMOTE oversampling algorithm to supplement samples for equipment types that account for less than 1 / 10 of the average sample size. The training of the short text classification interface model includes: Obtain the standard codes and corresponding standardized descriptions of each power device; Based on the standardized description information, the highest and lowest level categories of the corresponding power equipment are obtained; The BERT model is trained by taking the standardized description information of each power device as input and the highest-level category of the corresponding power device as output, to obtain the first-level classification layer model. For each top-level category, the standardized description information of the power equipment in the top-level category is used as input, and the corresponding bottom-level category of the power equipment is used as output to train the convolutional neural network to obtain a two-level classification layer model; During training, a data transformation layer is set up to select the corresponding second-level classification model for training based on the highest-level category output by the first-level classification model; the second-level classification model reduces the matrix dimension through max pooling. The two-level classification layer model and the one-level classification layer model are used as the short text classification interface model; The acquisition of standardized description information for each power device includes: Collect descriptive information of each device from the power equipment database; The descriptive information of each device is processed by regular expressions, word segmentation or word vector clustering to obtain standardized descriptive information of each power device; The descriptive information of each device is processed by word vector clustering to obtain standardized descriptive information for each power device, including: Remove meaningless characters from the description information of each device, and segment the description information of each device to obtain multiple words; Calculate the word frequency of each term in the description information of each device and the reverse file frequency of each term; Based on the word frequency of each word in the description information of each device and the reverse file frequency of each word, calculate the TF-IDF value of each word in the description information of each device. The descriptive information corresponding to words whose TF-IDF values exceed a preset threshold is converted into word vectors; Cluster the word vectors and generate a standardized description for each category.
2. The method as described in claim 1, characterized in that, The formula for calculating the word frequency is as follows: In the formula, Indicates the first The word in the first The frequency of words appearing in the description information of each device Indicates the first The word in the first The number of times it appears in the description information of each device. Indicates the first The word in the first The number of times it appears in the description information of each device. Indicates the first The total number of times all words appear in the description information of each device.
3. The method as described in claim 1, characterized in that, The formula for calculating the frequency of the reverse file is as follows: In the formula, Indicates the first The frequency of reverse files for each word. This indicates the total number of descriptive information entries for the device. Indicates the first Description information of each device, Indicates containing the first vocabulary Description information of the device The total number.
4. The method as described in claim 1, characterized in that, The formula for calculating the TF-IDF value is as follows: In the formula, Indicates the first The word in the first The TF-IDF value in the description information of each device Indicates the first The word in the first The frequency of words appearing in the description information of each device Indicates the first Frequency of reverse files for each word.
5. The method as described in claim 1, characterized in that, The step of inputting descriptive information from power equipment data into a pre-trained short text classification interface model to obtain standard codes for power equipment includes: Input the descriptive information from the power equipment data into the first-level classification model to obtain the highest-level category corresponding to the descriptive information; Select the corresponding secondary classification layer model based on the highest-level category, and input the description information into the selected secondary classification layer model to obtain the lowest-level category corresponding to the description information; The standard code for the power equipment is obtained by finding the lowest-level category.
6. An abnormal equipment coding detection system based on short text classification of electrical power, characterized in that, include: Data acquisition module, standard encoding module, and anomaly detection module; The data acquisition module is used to acquire power equipment data; The standard encoding module is used to input the descriptive information in the power equipment data into a pre-trained short text classification interface model to obtain the standard encoding of the power equipment. The anomaly detection module is used to compare the standard code with the equipment code in the power equipment data. If there is a difference, the equipment code in the power equipment data is considered abnormal data. The short text classification interface model addresses the imbalanced sample characteristics of power equipment data by employing the SMOTE oversampling algorithm to supplement samples for equipment types that account for less than 1 / 10 of the average sample size. The training of the short text classification interface model includes: Obtain the standard codes and corresponding standardized descriptions of each power device; Based on the standardized description information, the highest and lowest level categories of the corresponding power equipment are obtained; The BERT model is trained by taking the standardized description information of each power device as input and the highest-level category of the corresponding power device as output, to obtain the first-level classification layer model. For each top-level category, the standardized description information of the power equipment in the top-level category is used as input, and the corresponding bottom-level category of the power equipment is used as output to train the convolutional neural network to obtain a two-level classification layer model; During training, a data transformation layer is set up to select the corresponding second-level classification model for training based on the highest-level category output by the first-level classification model; the second-level classification model reduces the matrix dimension through max pooling. The two-level classification layer model and the one-level classification layer model are used as the short text classification interface model; The acquisition of standardized descriptive information for each power device includes: Collect descriptive information of each device from the power equipment database; The descriptive information of each device is processed by regular expressions, word segmentation or word vector clustering to obtain standardized descriptive information of each power device; The descriptive information for each device is processed through word vector clustering to obtain standardized descriptive information for each power device, including: Remove meaningless characters from the description information of each device, and segment the description information of each device to obtain multiple words; Calculate the word frequency of each term in the description information of each device and the reverse file frequency of each term; Based on the word frequency of each word in the description information of each device and the reverse file frequency of each word, calculate the TF-IDF value of each word in the description information of each device. The descriptive information corresponding to words whose TF-IDF values exceed a preset threshold is converted into word vectors; Cluster the word vectors and generate a standardized description for each category.
7. The system as described in claim 6, characterized in that, The standard encoding module is specifically used for: Input the descriptive information from the power equipment data into the first-level classification model to obtain the highest-level category corresponding to the descriptive information; Select the corresponding secondary classification layer model based on the highest-level category, and input the description information into the selected secondary classification layer model to obtain the lowest-level category corresponding to the description information; The standard code for the power equipment is obtained by finding the lowest-level category.
Citation Information
Patent Citations
Substation maintenance work task multi-label classification method based on deep learning
CN112256873A
Equipment measurement data processing method and system based on deep neural network, and terminal
CN113326380A