{'fraction_non_alphanumeric': 0.020540203453248626, 'fraction_numerical': 0.006664847799820712, 'mean_word_length': 5.226158699344819, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Application of Text Mining Method for Classification of Work Order in Power Grid Production

. With the completion of the State Grid Corporation's maintenance system, the number of substations has increased dramatically, the grid structure has become increasingly complex, and there have been internal and external reasons such as the contingency of emergencies, and equipment failures have occurred from time to time. This paper aims to explore the potential value of massive data, show the laws of business data, and further give full play to the comprehensive support of data for enterprise operation and production management, and promote the realization of intelligent and lean power grid core business. This paper uses power system data to provide reliable data support for equipment defect full cycle management and equipment state analysis through ANOVA and neural network statistical analysis. At the same time, we use Term Frequency-Inverse Document Frequency(TF- IDF)Algorithm to calculate the importance of keywords and construct the power keyword library. By constructing Bayesian text classification model, we can classify the defect parts, defect categories and defect causes automatically. This method can be applied to the construction of power grid production work order text analysis system, improve the data quality and system automation level, help the business department to improve work efficiency and provide the basis for power grid business analysis. This method is applied to the data cleaning of the primary production equipment of power grid enterprises, and the accuracy of data error correction for equipment defects with voltages above 110kV is between 93% and 95%, and good results have been achieved.


Introduction
Under the influence of the development of modern enterprises and the macro-economy, as the operators of the main power network business and the main trading body of the regional power market, Power grid enterprises have higher demand for the timely and effective enterprise management operation data [1]. With the continuous development of network technology and information technology, the digital degree of power grid enterprises is gradually improved, the application of equipment (asset) operation and maintenance lean management system (PMS2.0) is deepening, while the continuous increase of information system, the enterprise data is also growing greatly [2]. Extension of digital information enables them to realise on an increased efficiency of the electrical grids, and further control the network dynamically to improve the security and reliability [3]. With the increasing increase of substation scale, the grid structure is increasingly complex, equipment failure occurs, the traditional equipment failure prediction lacks the systematic scientific support and effective early warning and decision-making mechanism. Meanwhile, most of the business data reporting of power grid enterprises in China still adopts manual method, which is easily affected by personnel quality and department management mode, that makes the data appear inconsistent or inaccurate in the process of creating, resulting in serious data crossover and redundancy [4].
How to better tap the potential value in these massive data, further give play to the comprehensive support of data for enterprise operation and production management, and promote the intelligent and lean realization of the core business of the power grid has become an important topic facing enterprises in the era of big data. State Grid Corporation proposes a new strategy for developing leading international energy Internet companies with Chinese characteristics, accelerates the construction of a new power systems. It requires greater use of corporate data value, big data intelligent analysis and multi-source big data governance, active enabling business management and external business services [5]. As an important foundation, big data method has been applied to many specialties in the field of electrician to improve data quality and realize reasonable operation of data [6][7]. Chen Yongjun analyzed the defect data of power network operation analysis decision support system and proposed a time series method for equipment defect prediction [8]. Tarik provides a text classification, which is a process of automatically assigning sets of documents into class labels depending on their data contents [9]. From the defect data of secondary equipment, Zhang Yanxu et al proposed a defect data mining method based on Apriori algorithm, which can effectively analyze the weak links of secondary equipment and provide reference for equipment control [10]. At the same time, we also used big data methods to carry out electricity recovery risk prediction and electricity potential sensitive customer prediction, which achieved relevant results [11][12].
For descriptive text data, text mining method can be used to organize and solidify the data based on the low efficiency and incomplete data [13][14][15]. This paper makes full use of the data of PMS2.0 and other systems, through text mining [16] and data analysis of equipment defects and other data to provide reliable data support for the whole cycle management of equipment defects and equipment status analysis, providing accurate and effective auxiliary decision-making suggestions and improving the level of lean transportation and accurate maintenance. Through this study, we have realized the correct prediction of the probability of defects of the main network equipment and treatment in advance, reduce the risk of power grid operation, ensure that the management personnel have more energy to study and judge the management process, making lean scientific management possible.
This paper aims to explore the potential value of massive data, show the laws of business data, and further give full play to the comprehensive support of data for enterprise operation and production management, and promote the realization of intelligent and lean power grid core business. The paper first introduces some theoretical methods, such as Pearson correlation analysis, analysis of variance, text mining, logistic regression algorithm and neural network algorithm. And then, we apply these theoretical methods for equipment fault prediction and equipment defect management. Finally, we make the conclusion and propose the content of future work.

Pearson correlation analysis
Correlation analysis is the process of describing the degree of close relationship between objective things with appropriate statistical indicators. The degree of correlation between the two variables is expressed by the correlation coefficient r. When two variables are positively correlated, the r values are between 0 and 1, indicating an increase as the other variable increases, and when two variables are negatively correlated, the r values are between-1 and 0, indicating that the other variable decreases as one variable increases. The closer the absolute value of r to 1, the stronger the association of the two variables and the weaker vice versa.

Analysis of variance
The ANOVA was investigated by analyzing the contribution magnitude of variants of different sources to the total variants, thus determining the magnitude of the influence of controlled factors on the study results. The rationale for ANOVA is that there are two basic sources of differences between means across treatment groups, and we used F values to infer whether each sample came from the same population.
x Experimental conditions: differences caused by different treatments are called intergroup differences, it is expressed as the sum of square of the deviation between the mean in eac group.(Msb) x Random error: differences caused by measurement error or differences between individuals, called within-group differences, are expressed as the sum of the square sum of the deviation of the variable mean in each group from the values of the variables within that group.(Msw) x The MSb/MSw ratio constitutes the F distribution.

Text MINING
Text Mining refers to the classification of a text into a known text category, mainly including text preprocessing and classifier model construction. The text classification process is shown in Figure 1.  , i d represents the text, ij t represents the word j in the i text, ij w represents the weight of the ij t in the text i d .The classifier model construction process is to generate the classifier model based on the training set data after text pretreatment through relevant algorithms, and use the classifier model to automatically classify the new text data. In this paper, text preprocessing is implemented by jieba word segmentation and the term frequency-inverse document frequency method(TF-IDF), the classifier construction takes a Bayesian classification algorithm.

Text Segmentation Algorithm
Chinese word segmentation can be roughly divided into two categories: dictionary-based word segmentation and statistics-based word segmentation methods. The word segmentation method used in this paper is jieba word segmentation, which is a combination of the two before and after, that is, based on the prefix dictionary to scan the word graph to form a directed acyclic graph of all possible word segmentation results, and dynamic programming to find the path of maximum probability, thus solving the problem of double understanding word combination.
In statistics-based word segmentation method, the statistical sample content comes from some standard corpora. If there is a sentence M ,it has m word segmentation options: where the subscript i n represents the number of words in the i th participle. If we choose the best segmentation method r ,the statistical distribution probability corresponding to this word segmentation method should be the largest, which is: ,..., , max arg 2 1 . In order to simplify calculations, Markov hypothesis is usually used, that is, assuming that the probability of each participle is only related to the previous participle, it can be written as: Then the joint distribution can be obtained as: Through the standard corpus, the binary conditional probability between any two word segments can be calculated approximately. For example, any two words 2 1 , a a , the conditional probability distribution can be approximately expressed as:  respectively indicates the statistical times that each word appears in the corpus. Then for a new sentence, using the corpus to establish statistical probability, the word segmentation method corresponding to the maximum probability can be found by calculating the joint distribution probability corresponding to various word segmentation methods, which is the optimal word segmentation.

TF-IDF algorithm
Using Jieba word segmentation can divide the document, but not every word is meaningful (the word contributes less to the content of the document.), so we use TF-IDF method to judge the importance of words to the document.
The main idea of TF-IDF is: if a word or phrase appears in a certain category with a high frequency of TF and rarely appears in other categories, it is considered that this word or phrase has good classification ability, suitable for classification, and can be marked as a keyword glossary. Suppose that d is the classification category, f is a feature word based on the content of the ticket, d f TF , represents the number of times a given word appears in the category. Document frequency is represented by DF , it represents the number of all categories containing a vocabulary in a sample set, it is mapped to a smaller value range and expressed as inverse document frequency (IDF) as follows: (5) in which N represents the total number of categories in the sample collection, f DF represents the number of categories that contain the vocabulary f .The significance is that if the fewer categories include the word, the larger the IDF, which means that the vocabulary has a good classification ability. The weight of the term is represented by IDF TF , and the calculation formula is as follows: This method can calculate the importance of a certain vocabulary in a certain classification, identify whether the vocabulary is a keyword vocabulary, realize the construction of classification rules, and accurately locate the basic content of the text description, so as to provide a basis for subsequent classification analysis.

Bayesian Classification Algorithm
In the naive Bayes classifier, it is determined based on each feature that the label should be assigned to the given input value. Besides, the Naive Bayes classifier determines the label prior probability by calculating the frequency of each label on the training set, and the contribution of each feature is combined with its prior probability to obtain the likelihood estimate of each label. The label with the highest likelihood estimate will be assigned to the input value. Let each data sample describe the value of the n properties with a n-dimensional eigenvector can be obtained from the training dataset. The classification principle is shown in Figure  2.

Figure 2. Classification principle description
Suppose that label is the output label, features represent the n eigenvalues of the input. The calculation process of the algorithm is as follows: The likelihood label can be expanded as the probability of the label multiplied by the probability of a given label feature, in the case of feature independence, we have: , select the label corresponding to the maximum probability value as the label result for the new input value. When the training set has features that never appear with a given label, the label f P calculated value is 0, which would cause the input to never be assigned to this label, resulting in a reduced classification accuracy. To avoid such situations, we typically apply the "Laplace corrections" for "smooth" processing when

Logistic Regression Algorithm
Logistic regression is a study of dichotomous variable Y and a series of influencing factors n X ,the multivariate analysis method of the relationship is further developed on the basis of the linear model.Its general form is: In the formula, P is a probability occurrence of the variable Y , between 0-1.Logistic regression model has fast calculation speed, obvious results and good fitting effect. It is widely used in big data, machine learning, economics and other fields.

Neural network algorithm
The BP neural network is a multi-layer feedforward network trained for propagation from the direction of error. The BP neural network maps the input variable to the output variable via the excitation function and the constant weight threshold for adjusting each layer connection. To align the output variables of the network with the expectation, the learning of BP neural networks generally requires repeated training multiple times so that the error value tends to zero and eventually reaches zero.
The implementation process of the BP neural network algorithm is as follows: The input matrix of the sample is assumed to be In which n ones u 1 represents a matrix with all elements of 1. The expression of the implied layer incentive function is: Thus we can get the output of the implied layer as , the input for the output layer is .

I O
can be considered for the output of the output layer. The initial weight threshold selected by the BP algorithm can determine the weight threshold from the second to the n adjustment weight threshold, so the accuracy of the BP network training is determined by the selection of the initial weight threshold. If the initial weight threshold is inappropriate, it is likely to make the network slow convergence and easily fall into the local optimal solution, so the selection of the initial power threshold has a great relationship to the quality of the BP network training results.
Genetic Algorithm (GA) is a heuristic global search algorithm (Three-dimensional coordinate measurement algorithm by optimizing BP neural network based on GA) inspired by the evolutionary processes of living organisms. Genetic algorithm simulates the problems to be solved into a process of biological evolution, generating the next generation of solutions through selection, crossover and variation. By calculating the fitness of individuals, the individuals with low fitness are eliminated, the individuals with high fitness are increased, and the optimal fitness function value solution is found after n iterations. The characteristics of genetic algorithms can compensate for the defect that BP neural networks can easily fall into local optimal solutions, so usually we use genetic algorithms to optimize BP neural networks to build correlation models.

Equipment fault prediction
We use Pearson correlation analysis, single-factor variance analysis and other methods to conduct correlation analysis of various types of data and determine the main factors affecting the equipment failure. Then, we establish a Logistic regression fault prediction identification model to achieve an advance warning of the device state. Finally, we establish a classified neural network model to judge the possible fault types of the early warning equipment, supporting the differentiated operation and maintenance of the substation equipment.
We get the data from SCADA system, PMS2.0 system, intelligent inspection robot system, equipment online monitoring system, weather forecast system, etc. We take data from a prefecture-level company from January 2019 to August 2020, obtaining data from five dimensions, including operating conditions, equipment attributes, system mode, external environment, and seasonal characteristics, with a total of 135 fields and 179311 data. The specific data sources are listed in the Table 1. Equipment fault influencing data can be divided into continuous, classification and unstructured types.According to different data types, Pearson correlation analysis and single-factor variance analysis etc. are used to analyze the fault influencing factors. The operating influence factors of equipment failure mainly extracted "the average monthly load rate" as the characteristic variables. We calculate the correlation coefficient value of 0.9317 through the correlation analysis, so there is a strong positive correlation between the device failure rate and the load rate. At the same time, we analyzed a strong positive correlation between the equipment failure rate and the operation life, temperature and humidity, with the correlation coefficient values of 0.7484,0.617 and 0.602, respectively. The experimental results are shown in Figure 3, Figure 4 and Figure  5.  We perform a variance analysis for the "region where the device belongs" variables. According to the variance analysis table, calculating P=0.0387<0.05, we can assume that the "region where the device belongs" has a significant impact on the equipment failure rate. Using the same method, we analyzed that the equipment model number has a significant influence on the equipment failure rate as shown in Table 2. Based on the "time (month)", "manufacturer", "precipitation", "thunderstorm", "gale" and other classification or unstructural factors, we use the statistical comparison method, the examples are as follows. It can be seen in Figure 6 and Figure 7 that different manufacturers and weather conditions will affect the improvement of equipment failure rate. We included 143,832 records for full year 2019 as training samples and the first quarter 2020 as test data. We used the Logistic regression model to obtain the training results with different probabilities. From the Table 3, it works best when the classification critical probability is 0.5.  Based on the regression model constructed above, the samples from April-May 2020 were predicted, as shown in the Table 4. The total prediction accuracy was approximately 90.45% with high accuracy. We performed fault identification through a neural network method with an identification accuracy of 93.16% and the results shown in the Table 5. At the same time, we can calculate that variables such as load rate, operation years of equipment, ttemperature and humidity, equipment model play an important role in the prediction process. In internal management, we often use the influencing factors of equipment failure prediction to carry out equipment defects management, and the purpose is to reduce the time cost of labor input and increase work efficiency through intelligent means.

Equipment defect management
The main classification algorithm is used in the construction of the power grid production work order text analysis system, and its functional framework is shown in Figure 8. The keyword library management module extracts production keywords based on defect grading standards, realizes the original keyword mining function, and provides keyword query at the same time. The basic data classification standard library and the original work order library are based on the keyword library, and the classification rules are composed of keywords, and training is performed based on the rules and tags, forming an automatic classification after the work order is entered. The classification knowledge base and statistical analysis report function are based on the keyword extraction and classification functions to establish classification rules and various production business relationships to support more business applications. The classified work orders are used as basic data according to different businesses. Perform report statistics to realize different functional applications based on grid business. As one of the important contents of power equipment operation and maintenance, defect management has always been a work of great concern for power enterprise managers and production and maintenance personnel. In actual work, there are irregularities in defect management, especially the non-standard description and handling of defects, which affect the level of defect management. The description content of the equipment defect is the closest to the site situation and can reflect the specific situation of the site. Therefore, the word segmentation processing of the defect description text can obtain the keywords of the specific situation of the site. Perform word frequency analysis based on the processed keywords and classification criteria, use the TF-IDF algorithm to calculate the frequency of words in this category and the frequency of words in other categories, generate work order keywords, and build a keyword library. The principle is shown in Figure 9. Based on the keyword database, a sample data set of classification rules is established, and the classification rules are obtained by means of machine learning and Bayesian model training.  Based on the defect data, the defect location, defect category, and defect cause are classified respectively, where the defect locations are divided into first, second, and third levels, the defect causes are divided into first and second levels, and algorithms can be used for iterative calculations. Figure 10 shows an example of the whole process of automatic classification. The defect type is used as the target classification content. The input value is "The oil level of the No. 2 main transformer on-load pressure regulator respirator is low", and the output type value is "Abnormal oil level".

Conclusion
The power grid production work order text analysis system applies text word segmentation, keyword mining, and automatic classification technology to each module to solidify the keyword database and cleaning rules for cleaning the production data of the primary equipment of the power grid. This method was applied to the data cleaning of primary production equipment for a power grid enterprise in the past seven years, and the total number of defects of equipment with a voltage of 110kV or above was 36255. The classification results are shown in Table 6, where there are 21,220 pieces of error correction data, accounting for 58.52%; 31,857 pieces of error correction data, accounting for 87.87%; data correction accuracy rates are between 93%-95%, achieving good results. The text analysis system of power grid production work orders ranges from a general data quality management platform that can only find problems to the system from discovery to problem solving. It combines classification rules and standard formulation to provide data problem solutions. At present, the power industry has not established a standardized power word database, which is in its infancy. Therefore, the establishment of this system provides a basis and development direction for grid companies to establish a set of standardized power word databases in the future. On the basis of realizing the automatic data cleaning function, the system has improved data quality and clear efficiency. It has functions such as intelligent classification of work orders, construction and optimization of keyword databases, and statistical analysis assistance. It can be used for system application construction departments, equipment management departments and various business research departments.
In the future, it is planned to apply more algorithms to the system to optimize the functions of each module, and at the same time increase the business expansion of the application part, such as increasing the research on the distribution network data, the intelligent classification of equipment accident event data, etc., to support more and higher power grid business analysis to promote the high-quality development of ubiquitous power Internet of Things business.