Electric power field operation risk early warning method and related device

By employing OCR and language modeling to analyze record tickets, the method automates risk assessment in power field operations, improving efficiency and accuracy of risk detection.

CN119228123APending Publication Date: 2024-12-31SHENZHEN POWER SUPPLY BUREAU
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411276250.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The efficiency and accuracy of manually analyzing record sheets for power field operations are low due to the complexity and variability of these operations, hindering effective risk management and early warning.

Method used

A method and device utilizing optical character recognition (OCR) to extract and preprocess text data from record tickets, training a language model to calculate the conditional probability of each word, and evaluating risk based on perplexity to provide early warnings.

Benefits of technology

Improves the analysis efficiency of record tickets by automatically identifying potential risks in power field operations, enabling timely risk warnings and enhancing safety through automated risk assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119228123A_ABST
    Figure CN119228123A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an electric power field operation risk early warning method and related device.The method comprises the steps that a preset model is trained according to historical text corpus data, a target language model is obtained, then text information is extracted from a bill image of a recorded bill corresponding to current electric power field operation through the optical character recognition technology, and the target language model is obtained; the method comprises the steps of obtaining text information, preprocessing the text information to obtain text corpus data, inputting the text corpus data into a trained target language model to obtain the conditional probability of each word in the text corpus data, calculating the confusion degree of the text corpus data according to the conditional probability of each word in the text corpus data, and obtaining the confusion degree of the text corpus data. And performing assessment and early warning on the risk of the current electric power field operation according to the confusion degree, and the higher the confusion degree is, the higher the risk early warning degree of the current electric power field operation is.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of text processing, and in particular to a method and related device for early warning of risks in power field operations. Background Art

[0002] Power field operations refer to a series of operations performed by workers outdoors or in specific environments during the installation, maintenance, inspection and troubleshooting of power facilities. In power field operations, record tickets are key documents that record detailed information about the operation activities, including the operator, operation time, location, content, equipment used, safety measures taken, etc. This information is crucial for risk management and early warning. By analyzing the record tickets, potential risks in the operation can be discovered in a timely manner, such as incompatible personnel qualifications and lack of safety measures.

[0003] Currently, the record sheets of power field operations are mainly analyzed manually. However, due to the complexity and variability of power field operations, the efficiency of manual analysis of record sheets is low and the accuracy is insufficient.

[0004] Therefore, how to improve the analysis efficiency of record tickets to quickly provide risk warnings for power field operations has become an urgent problem to be solved. Summary of the invention

[0005] The embodiment of the present application provides a method and related device for early warning of risks in electric power field operations, which improves the efficiency of analyzing record documents of electric power field operations so as to quickly provide early warning of risks in electric power field operations.

[0006] In a first aspect, an embodiment of the present application provides a method for early warning of risks in electric power field operations, the method comprising:

[0007] Acquire historical text corpus data; the historical text corpus data is text data obtained by recognizing text information of record tickets corresponding to power field operations through optical character recognition technology, and the text corpus data is obtained by preprocessing the text data;

[0008] The preset model is trained by the historical text corpus data to obtain a target language model; the target language model is used to receive the text and generate the conditional probability of each word appearing in the text;

[0009] Recognize the text information of the record ticket corresponding to the current power field operation by the optical character recognition technology to obtain the target text data;

[0010] Preprocessing the target text data to obtain target text corpus data;

[0011] Inputting the target text corpus data into the target language model to obtain the conditional probability of each word in the target text corpus data, and determining the target perplexity of the target text corpus data according to the conditional probability of each word in the target text corpus data;

[0012] The current power field operation is evaluated according to the target perplexity to obtain the risk warning degree; the target perplexity is proportional to the risk warning degree.

[0013] In a second aspect, an embodiment of the present application provides a risk warning device for power field operations, the device comprising: a data acquisition module, a model training module, an image recognition module, a data processing module, a data determination module, and a risk assessment module, wherein:

[0014] The data acquisition module is used to acquire historical text corpus data; the historical text corpus data is text data obtained by recognizing text information of record tickets corresponding to power field operations through optical character recognition technology, and the text corpus data is obtained by preprocessing the text data;

[0015] The model training module is used to train the preset model through the historical text corpus data to obtain a target language model; the target language model is used to receive the text and generate the conditional probability of each word appearing in the text;

[0016] The image recognition module is used to recognize the text information of the record ticket corresponding to the current power field operation through the optical character recognition technology to obtain the target text data;

[0017] The data processing module is used to pre-process the target text data to obtain target text corpus data;

[0018] The data determination module is used to input the target text corpus data into the target language model, obtain the conditional probability of each word in the target text corpus data, and determine the target perplexity of the target text corpus data according to the conditional probability of each word in the target text corpus data;

[0019] The risk assessment module is used to assess the current power field operation according to the target perplexity to obtain the risk warning degree; the target perplexity is proportional to the risk warning degree.

[0020] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in the first aspect of the embodiment of the present application.

[0021] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in the first aspect of the embodiment of the present application.

[0022] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the embodiment of the present application. The computer program product may be a software installation package.

[0023] By implementing the embodiments of the present application, the preset model can be trained according to the historical text corpus data to obtain the target language model, then the text information is extracted from the bill image of the record bill corresponding to the current power field operation through optical character recognition technology, and the text information is preprocessed to obtain text corpus data, the text corpus data is input into the trained target language model, the conditional probability of each word in the text corpus data is obtained, the perplexity of the text corpus data is calculated according to the conditional probability of each word in the text corpus data, and the risk of the current power field operation is evaluated and warned according to the perplexity. The higher the perplexity, the higher the risk warning level of the current power field operation. Therefore, the analysis efficiency of the record bill of the power field operation is improved to quickly warn the risk of the power field operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0025] Figure 1 It is a flow chart of a method for early warning of risks in power field operations provided by an embodiment of the present application;

[0026] Figure 2 It is a structural schematic diagram of a power field operation risk warning device provided in an embodiment of the present application;

[0027] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0029] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0030] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0031] The following is an explanation of the relevant contents, concepts, meanings, technical issues, technical solutions, beneficial effects, etc. involved in the embodiments of the present application.

[0032] First, some terms involved in this application are explained:

[0033] Optical Character Recognition Technology: Optical Character Recognition (OCR) is a technology and process that converts text in different forms of documents into editable and searchable digital text data.

[0034] N-Gram language model: The N-Gram model is a statistical linguistic model that treats N consecutive words or characters as an independent unit and uses it to predict and generate language. In specific predictions, to predict the conditional probability of the Nth word, it is necessary to consider the number of the previous N-1 words. For Chinese, the N-Gram language model is also called the Chinese language model.

[0035] KenLM: KenLM is an efficient language model library that can be used to train and evaluate N-Gram language models.

[0036] Mean Absolute Deviation: Mean Absolute Deviation (MAD) refers to the average of the absolute values ​​of the deviations of each data from the mean, where the deviation refers to the difference between each data in the population and the overall mean.

[0037] See also Figure 1 , Figure 1 This is a flow chart of a method for early warning of risks in power field operations provided by an embodiment of the present application, which includes but is not limited to the following steps:

[0038] S101. Obtain historical text corpus data.

[0039] The historical text corpus data is text data obtained by recognizing text information of record tickets corresponding to power field operations through optical character recognition technology, and the text corpus data is obtained by preprocessing the text data.

[0040] Among them, record tickets refer to documents used in power field operations, which are used to record detailed information of power field operations. The content of record tickets includes but is not limited to the person in charge of the work, the work unit, the work team, the planned working time, the work content, the work location, the work tasks, the safety measures, the work permit, the person in charge of the work, etc. Record tickets can help managers of power field operations monitor the progress of operations and assess the risks of operations, and then take corresponding preventive or corrective measures to ensure the standardization, safety and traceability of power field operations.

[0041] In a specific embodiment, the record tickets related to the historical power field operations of the power company can be collected, including but not limited to work tickets, safety inspection forms, accident reports, etc. After the record tickets are collected, the record tickets are scanned into digital image files, and the scanned images are processed using OCR technology to convert the text information in the images into text data. Then, the text data can be preprocessed, including removing noise data, removing data with large missing amounts, correcting errors generated in the OCR process, standardizing the text format, performing word segmentation on the text data, and removing stop words, etc. The preprocessed text data is organized into text corpus data to obtain historical text corpus data.

[0042] S102, training a preset model using the historical text corpus data to obtain a target language model; the target language model is used to receive a text and generate a conditional probability of occurrence of each word in the text.

[0043] In a specific embodiment, KenLM can be used as a preset model, and the preset model can be trained by historical text corpus data to obtain a target language model, which can be an N-Gram language model. Before training, the model parameters of the N-Gram language model can be set, such as setting the N value of the model. In the embodiment of the present application, N is set to 3, and the N-Gram language model can be called a Tri-Gram language model (triplet language model), which represents a grammatical unit considering three consecutive words. During training, KenLM can combine grammatical units according to the input historical text corpus data, and calculate the conditional probability between words based on each grammatical unit, and perform regular statistics based on the conditional probability of each word, such as determining which words are usually followed by a certain word. In addition, to avoid the problem of zero probability during prediction, smoothing techniques (such as back-off smoothing, Laplace smoothing or Kneser-Ney smoothing) can be applied to ensure that the training model does not return zero probability by assigning non-zero probability to grammatical units with zero probability. After training is completed, the target language model can receive text and generate the conditional probability of each word in the text. The perplexity of the entire text is calculated based on the conditional probability of each word. The risk warning level of power field operations can then be evaluated based on the perplexity.

[0044] For example, suppose there is a whole text S consisting of n words. The probability of the whole text can be calculated by the following formula:

[0045] P(S)=(w1w2…w n )=(w1)×P(w2|w1)×P(w3|w2w1)…×P(w n | n-1 w n-2 …w1)

[0046] In the above formula, P(S) represents the probability of the entire text S appearing; w1 is the first word in the entire text S; P(w1) is the probability of the first word w1; P(w2|w1) is the probability of the second word w2 appearing when the first word w1 is known; and so on, P(w n | n-1 w n-2 ...w1) is the n-1th word w n-1 In the case of the entire n-1 words up to the first word w1, the nth word w n Probability of occurrence.

[0047] For the Tri-Gram language model, the conditional probability of each grammatical unit can be calculated by the following formula:

[0048]

[0049] Among them, P(w n |w n-1 w n-2 ) indicates that in the known phrase w n-1 w n-2 , the probability of the nth word appearing; C(w n- 2w n-1 w n ) indicates the phrase w n-2 w n-1 w n The number of occurrences, where w n-2 w n-1 w n is three consecutive words; C(w n-2 w n-1 ) indicates the phrase w n-2 w n-1 The number of occurrences, where w n-2 w n-1 Two consecutive words.

[0050] Optionally, the above step S102, training a preset model using the historical text corpus data to obtain a target language model, may include the following steps:

[0051] A21, performing word segmentation processing on the historical text corpus data to obtain a plurality of words;

[0052] A22, set the target predicted word sequence length;

[0053] A23, combining the multiple words according to the target predicted word sequence length to obtain multiple grammatical units;

[0054] A24, obtain a word reference data set;

[0055] A25, inputting the multiple grammatical units and the word reference data set into the preset model to obtain multiple fallback weights and multiple conditional probabilities; the fallback weights correspond to the grammatical units one by one; the conditional probabilities correspond to the grammatical units one by one;

[0056] A26. Construct the target language model according to the multiple fallback weights, the multiple conditional probabilities and the preset model.

[0057] In a specific embodiment, the historical text corpus data after preprocessing and sorting is obtained, the historical text corpus data is decomposed into multiple words, and the target predicted word sequence length is set. In the embodiment of the present application, the target predicted word sequence length is set to 3, that is, the target language model is a triple language model, and the target language model predicts the current word based on the first two words of the current word. According to the target predicted word sequence length, multiple words are combined to obtain multiple grammatical units, and the number of words in each grammatical unit is the target predicted word sequence length.

[0058] Furthermore, in order to improve the accuracy of model training, a word reference data set may be obtained, which includes a confusing word set, a Chinese dictionary, a similar sound dictionary, and a similar character dictionary, etc. Among them, the word reference data set may be a pre-set data set, wherein the confusing word set includes words that are easily confused or misrecognized, the Chinese dictionary provides detailed information on Chinese characters and words, the similar sound dictionary includes words with similar pronunciations, and the similar character dictionary includes Chinese characters with similar shapes. When training a natural language processing model, the word reference data set may help the model understand the text content more accurately and reduce misrecognition and erroneous parsing.

[0059] Furthermore, multiple grammatical units and word reference data sets are input into the preset model to obtain multiple fallback weights and multiple conditional probabilities, that is, each grammatical unit corresponds to a fallback weight and conditional probability. It should be noted that the fallback weight is a weight set to avoid the problem of zero probability during prediction. The target language model can be constructed based on multiple fallback weights, multiple conditional probabilities and the preset model.

[0060] For example, the text content of the existing historical text corpus data is "This is a test sentence", and the target prediction word sequence length is set to 3. Before training, a special start symbol " <s> " and add a special end symbol at the end of the historical text corpus data"< / s> ”, which in turn forms the following text “ <s> This is the test statement< / s> ", the text content of the historical text corpus data can be decomposed into multiple words, such as [" <s> ", "this", "is", "test", "statement", "< / s> ”], then these multiple words are combined according to the target predicted word sequence length to obtain [“yes”, “ <s> ", "this"], ["test", "this", "is"], ["statement", "is", "test"], ["< / s> For the second grammatical unit, assuming that in all training data, the triplet [“test”, “this”, “is”] appears twice, and the bigram [“this”, “is”] appears 10 times in total, then the conditional probability of the second grammatical unit is 0.2, which means that given the two words “this” and “is”, the conditional probability of the word “test” appearing is 0.2.

[0061] Optionally, the following steps may also be included:

[0062] B21. Obtain reference text corpus data;

[0063] B22, analyzing the reference text corpus data to obtain the actual risk warning level;

[0064] B23, inputting the reference text corpus data into the target language model to obtain the conditional probability of each word in the reference text corpus data, and determining the reference perplexity of the reference text corpus data according to the conditional probability of each word in the reference text corpus data;

[0065] B24, determining the theoretical risk warning level corresponding to the reference perplexity;

[0066] B25. Determine the evaluation index value corresponding to the target language model based on the actual risk warning level and the theoretical risk warning level;

[0067] B26. Determine the adjustment parameter of the target language model according to the evaluation index value to obtain the target adjustment parameter;

[0068] B27. Adjust the model parameters of the target language model according to the target adjustment parameters.

[0069] In a specific embodiment, reference text corpus data can be obtained by collecting historical records of power field operations, analyzing the reference text corpus data, and obtaining the actual risk warning degree. The reference text corpus data is input into the target language model to obtain the conditional probability of each word in the reference text corpus data, and the reference perplexity of the reference text corpus data is determined according to the conditional probability of each word in the reference text corpus data, and the theoretical risk warning degree corresponding to the reference perplexity is determined.

[0070] Furthermore, the evaluation index value corresponding to the target language model is determined based on the actual risk warning degree and the theoretical risk warning degree. The evaluation index may be an index such as model accuracy and precision. According to the evaluation index value, the parameters that need to be adjusted for the target language model are identified. The adjusted parameters may be adjusting the smoothing parameters of the model, increasing or decreasing the corpus data, adjusting the weight of the words, etc. The parameters of the target language model are actually adjusted. After the adjustment, the model is retrained to ensure that the text corpus data analysis is performed according to the adjusted training model, thereby effectively improving the accuracy of risk warning.

[0071] S103, recognizing text information of the record ticket corresponding to the current power field operation by using the optical character recognition technology to obtain target text data.

[0072] In a specific embodiment, the record ticket corresponding to the current power field operation is scanned into a digital image, which can be scanned by a scanner or a high-definition camera. The scanned digital image can be recognized using OCR technology to analyze the text layout and character shape in the image, and convert the text in the image into a machine-readable character code, that is, the target text data.

[0073] Optionally, the above step S103, identifying the text information of the record ticket corresponding to the current power field operation by the optical character recognition technology to obtain the target text data, may include the following steps:

[0074] A31, performing image preprocessing on the bill image of the recording bill corresponding to the current power field operation to obtain a target bill image;

[0075] A32, dividing the target bill image into blocks based on a preset region dividing algorithm to obtain a plurality of region blocks;

[0076] A33, locating the text position of each area block in the multiple area blocks to obtain multiple text positions;

[0077] A34, recognizing the text content in each of the multiple text positions according to the optical character recognition technology to obtain multiple text contents;

[0078] A35. Construct the target text data according to the multiple text contents.

[0079] In a specific embodiment, the image of the bill recording bill corresponding to the current power field operation is preprocessed to obtain a target bill image, and the image preprocessing includes denoising, binarization, rotation correction, etc. to improve the accuracy of text recognition. The preset region block algorithm is used to divide the preprocessed bill image into multiple logical regions, each logical region corresponds to a different part of the bill, such as a title area, a date area, a signature area, etc., wherein the region block algorithm can identify and locate these areas based on the texture, color or shape features of the image. In each region block, the text position of each region block in the multiple region blocks is located by the text positioning technology, and multiple text positions can be obtained, wherein the text position can be the coordinates, size and shape of the text in the image, etc., and the accuracy of text recognition can be improved according to the positioning of the exact text position. The text content in each text position in the multiple text positions is identified according to the OCR technology to obtain multiple text contents, wherein the text content includes words, numbers and symbols, etc., and the multiple text contents are integrated to construct the target text data.

[0080] S104: Preprocess the target text data to obtain target text corpus data.

[0081] In a specific embodiment, since the target text data recognized by OCR technology has problems such as low data quality, using it as corpus for model training will reduce the accuracy and efficiency of model analysis. Therefore, it is necessary to preprocess the target text data to obtain the target text corpus data for training the model.

[0082] Preprocessing includes removing noise data, removing data with large amounts of missing data, correcting errors generated during the OCR process, standardizing text formats, performing word segmentation on text data, and removing stop words. Noise data can be irrelevant symbols and special characters, etc. Words in the target text data can also be tagged with parts of speech and stemmed to ensure the standardization and consistency of the text.

[0083] Optionally, the above step S104, preprocessing the target text data to obtain target text corpus data, may include the following steps:

[0084] A41, performing a data cleaning operation on the target text data to obtain first text data;

[0085] A42. Selecting part of the text data in the first text data based on a preset delimiter to obtain second text data;

[0086] A43, determining the data type corresponding to the second text data, and obtaining a target data type;

[0087] A44. Perform feature processing on the second text data according to the target data type to obtain the target text corpus data.

[0088] Specifically, data cleaning operations are performed on the target text data, including removing redundant data, removing data with large missing amounts, removing abnormal data, deduplicating data, filling data and other operations, and finally the first text data is obtained, wherein texts of different data types in the first text data are separated by delimiters. Therefore, part of the text data in the first text data can be selected based on the preset delimiter to obtain the second text data, and the data type corresponding to the second text data is further determined to obtain the target data type. The second text data is characterized according to the target data type to obtain the target text corpus data.

[0089] Among them, there may be multiple data types in the second text data, such as character data, time data, numerical data, etc. Different data types are characterized in different ways, such as encoding for character data, time conversion for time data, and corresponding differentiation for numerical data based on feature distribution, etc. Standardized processing of text data according to different data types can improve the accuracy of language model analysis.

[0090] Optionally, when the target data type includes a numerical data type, the above step A44, performing feature processing on the second text data according to the target data type to obtain the target text corpus data, may include the following steps:

[0091] B41, extracting feature data from the second text data to obtain target feature data;

[0092] B42, determining the distribution characteristics of the second text data according to the target characteristic data to obtain a target distribution characteristic;

[0093] B43, normalizing the target characteristic data based on the target distribution characteristics to obtain target standard data;

[0094] B44. De-labeling and word segmentation are performed on the target standard data to obtain a plurality of words, and words that meet preset conditions are selected from the plurality of words to obtain the target text corpus data.

[0095] In a specific embodiment, feature data in the second text data is extracted to obtain target feature data, wherein the target feature data may be numerical data such as operation time, equipment number, temperature reading, voltage level, etc. After extracting the feature data in the second text data, the distribution characteristics of the second text data may be determined according to the target feature data to obtain target distribution characteristics, wherein the target distribution characteristics include the distribution range, central tendency and degree of dispersion of the numerical values, etc. The target feature data is normalized based on the target distribution characteristics to obtain target standard data, wherein the normalization processing includes normalization, standardization or logarithmic transformation, etc. The processed target standard data is de-labeled and segmented to obtain multiple words, and words that meet preset conditions are selected from the multiple words to obtain target text corpus data, wherein the preset condition may be that the word frequency is within the word frequency threshold range, and the target text corpus data obtained after processing can improve the accuracy and efficiency of the target language model analysis.

[0096] S105: Input the target text corpus data into the target language model to obtain the conditional probability of each word in the target text corpus data, and determine the target perplexity of the target text corpus data according to the conditional probability of each word in the target text corpus data.

[0097] In a specific embodiment, the target text corpus data is converted into a text format that can be processed by the target language model after preprocessing and feature extraction. The target language model calculates the conditional probability of each word appearing in the given target text corpus data context, and calculates the perplexity of the entire target text corpus data based on the conditional probability of each word to obtain the target perplexity. Among them, perplexity is an indicator to measure the performance of the target language model, which reflects the predictive ability of the model when predicting the next word. In the risk warning of power field operations, the smaller the perplexity, the more the text of the record ticket of the power field operation conforms to the expected language pattern, while the higher the perplexity, the more likely it is that there are potential risks or abnormalities in the power field operation.

[0098] Optionally, the above-mentioned determining the target perplexity of the target text corpus data according to the conditional probability of each word in the target text corpus data may include the following steps:

[0099] A51, scoring the conditional probability of each word in the target text corpus data to obtain multiple scores;

[0100] A52. Calculate the average absolute deviation of the multiple scores to obtain a target average absolute deviation;

[0101] A53, when the target mean absolute deviation is within a preset threshold range, calculating the target perplexity according to the conditional probability of each word in the target text corpus data;

[0102] A54, when the target mean absolute deviation is not within the preset threshold range, determining the word probability that is lower than the preset conditional probability among the conditional probabilities of each word in the target text corpus data, and obtaining at least one word probability;

[0103] A55, determining a target word corresponding to the at least one word probability, and obtaining at least one target word;

[0104] A56, determining a replacement word corresponding to the at least one target word according to the word reference data set, to obtain at least one replacement word;

[0105] A57, replacing the target word in the target text corpus data with the at least one replacement word to obtain error correction text corpus data;

[0106] A58. Input the error correction text corpus data into the target language model to obtain the conditional probability of each word in the error correction text corpus data, and determine the target perplexity according to the conditional probability of each word in the error correction text corpus data.

[0107] Specifically, the conditional probability of each word in the target text corpus data is scored to obtain multiple scores. The larger the conditional probability, the higher the probability that the word appears in a specific context, and the higher the score. Next, the average absolute deviation of multiple scores is calculated to obtain the target average absolute deviation to measure the difference between a single score and the overall average score. If the calculated target average absolute deviation is within the preset threshold range, the prediction quality of the text data is considered acceptable, and the target perplexity can be calculated based on the conditional probability of each word in the target text corpus data.

[0108] The calculation formula of the target perplexity is as follows:

[0109]

[0110] In the above formula, PP(S) represents the target perplexity of the entire sentence S; N represents the length of the sentence S, that is, the number of words; P(w i |1…w i-1 ) represents the conditional probability of the i-th word.

[0111] Further, when the target mean absolute deviation is not within the preset threshold range, it can be considered that there are erroneous texts in the text corpus data, and the word probability of each word in the target text corpus data that is lower than the preset conditional probability is determined to obtain at least one word probability. The target word corresponding to at least one word probability in the target text corpus data is determined to obtain at least one target word, and a replacement word corresponding to at least one target word can be determined according to the word reference data set to obtain at least one replacement word, and the target word in the target text corpus data is replaced by the at least one replacement word to obtain error correction text corpus data, and the error correction text corpus data is input into the target language model to obtain the conditional probability of each word in the error correction text corpus data, and the target perplexity is determined according to the conditional probability of each word in the error correction text corpus data. The risk assessment of power field operations is based on the content of the text data of the record bill, and the erroneous words may lead to misunderstanding of the intention and context of the record bill, thereby affecting the result of the risk assessment. Therefore, by replacing the erroneous words, the target perplexity and subsequent risk assessment can be ensured to be more accurate.

[0112] S106. Evaluate the current power field operation according to the target perplexity to obtain a risk warning degree; the target perplexity is proportional to the risk warning degree.

[0113] In a specific embodiment, the target perplexity reflects the uncertainty of the target language model in predicting the word sequence in the record bill text. The current power field operation is evaluated based on the target perplexity. The target perplexity is proportional to the risk warning degree. If the target perplexity is higher, it means that the target language model has encountered an abnormal situation when processing these texts, and there may be potential risks in the current power field operation. Otherwise, the lower the target perplexity, the smaller the risk warning degree of the current power field operation.

[0114] Furthermore, when evaluating the risk warning degree, the target perplexity is compared with the perplexity threshold. When the target perplexity exceeds the perplexity threshold, it can be considered that the current power site operation has a high risk, and the risk warning degree is increased accordingly. After determining the risk warning degree, an automatic alarm can be sent to the power site operation manager or risk mitigation suggestions can be provided for abnormal record tickets. It can be seen that in this way, the target perplexity can not only effectively help identify potential risks in record tickets, but also promote timely risk response and the implementation of preventive measures, thereby enhancing the safety of power site operations.

[0115] In summary, by implementing the embodiments of the present application, the preset model can be trained according to the historical text corpus data to obtain the target language model, then, the text information is extracted from the bill image of the record bill corresponding to the current power field operation through optical character recognition technology, and the text information is preprocessed to obtain text corpus data, and the text corpus data is input into the trained target language model to obtain the conditional probability of each word in the text corpus data, and the perplexity of the text corpus data is calculated according to the conditional probability of each word in the text corpus data, and the risk of the current power field operation is evaluated and warned according to the perplexity. The higher the perplexity, the higher the risk warning level of the current power field operation. Therefore, the analysis efficiency of the record bills of the power field operation is improved to quickly warn of the risk of the power field operation.

[0116] See also Figure 2 , Figure 2 1 is a schematic diagram of a structure of a power field operation risk warning device provided in an embodiment of the present application. The power field operation risk warning device 200 includes: a data acquisition module 201, a model training module 202, an image recognition module 203, a data processing module 204, a data determination module 205, and a risk assessment module 206, wherein:

[0117] The data acquisition module 201 is used to acquire historical text corpus data; the historical text corpus data is text data obtained by recognizing text information of record tickets corresponding to power field operations through optical character recognition technology, and the text corpus data is obtained by preprocessing the text data;

[0118] The model training module 202 is used to train the preset model through the historical text corpus data to obtain a target language model; the target language model is used to receive the text and generate the conditional probability of each word appearing in the text;

[0119] The image recognition module 203 is used to recognize the text information of the record ticket corresponding to the current power field operation through the optical character recognition technology to obtain the target text data;

[0120] The data processing module 204 is used to pre-process the target text data to obtain target text corpus data;

[0121] The data determination module 205 is used to input the target text corpus data into the target language model, obtain the conditional probability of each word in the target text corpus data, and determine the target perplexity of the target text corpus data according to the conditional probability of each word in the target text corpus data;

[0122] The risk assessment module 206 is used to assess the current power field operation according to the target perplexity to obtain a risk warning degree; the target perplexity is proportional to the risk warning degree.

[0123] Optionally, in the aspect of identifying the text information of the record ticket corresponding to the current power field operation by the optical character recognition technology to obtain the target text data, the image recognition module 203 is further specifically used for:

[0124] Performing image preprocessing on the bill image of the record bill corresponding to the current power field operation to obtain a target bill image;

[0125] Divide the target bill image into blocks based on a preset region dividing algorithm to obtain a plurality of region blocks;

[0126] Locating a text position of each area block in the multiple area blocks to obtain multiple text positions;

[0127] Recognize the text content in each of the multiple text positions according to the optical character recognition technology to obtain multiple text contents;

[0128] The target text data is constructed according to the multiple text contents.

[0129] Optionally, in the aspect of preprocessing the target text data to obtain the target text corpus data, the data processing module 204 is further specifically used for:

[0130] Performing a data cleaning operation on the target text data to obtain first text data;

[0131] Selecting part of the text data in the first text data based on a preset delimiter to obtain second text data;

[0132] Determine the data type corresponding to the second text data to obtain a target data type;

[0133] The second text data is feature processed according to the target data type to obtain the target text corpus data.

[0134] Optionally, when the target data type includes a numerical data type, in the aspect of performing feature processing on the second text data according to the target data type to obtain the target text corpus data, the data processing module 204 is further specifically used for:

[0135] Extracting feature data from the second text data to obtain target feature data;

[0136] Determine the distribution characteristics of the second text data according to the target characteristic data to obtain a target distribution characteristic;

[0137] Normalizing the target characteristic data based on the target distribution characteristics to obtain target standard data;

[0138] The target standard data is subjected to de-labeling and word segmentation processing to obtain a plurality of words, and words that meet preset conditions are selected from the plurality of words to obtain the target text corpus data.

[0139] Optionally, in the aspect of training a preset model by using the historical text corpus data to obtain a target language model, the model training module 202 is further specifically used for:

[0140] Performing word segmentation processing on the historical text corpus data to obtain a plurality of words;

[0141] Set the target prediction word sequence length;

[0142] Combining the multiple words according to the target predicted word sequence length to obtain multiple grammatical units;

[0143] Get a word reference dataset;

[0144] Input the plurality of grammatical units and the word reference data set into the preset model to obtain a plurality of fallback weights and a plurality of conditional probabilities; the fallback weights correspond to the grammatical units one by one; the conditional probabilities correspond to the grammatical units one by one;

[0145] The target language model is constructed according to the multiple backoff weights, the multiple conditional probabilities and the preset model.

[0146] Optionally, the power field operation risk warning device 200 is further specifically used for:

[0147] Obtain reference text corpus data;

[0148] Analyze the reference text corpus data to obtain the actual risk warning level;

[0149] Inputting the reference text corpus data into the target language model to obtain a conditional probability of each word in the reference text corpus data, and determining a reference perplexity of the reference text corpus data according to the conditional probability of each word in the reference text corpus data;

[0150] Determine the theoretical risk warning level corresponding to the reference perplexity;

[0151] Determining an evaluation index value corresponding to the target language model based on the actual risk warning level and the theoretical risk warning level;

[0152] Determining an adjustment parameter of the target language model according to the evaluation index value to obtain a target adjustment parameter;

[0153] The model parameters of the target language model are adjusted according to the target adjustment parameters.

[0154] Optionally, in determining the target perplexity of the target text corpus data according to the conditional probability of each word in the target text corpus data, the data determination module 205 is further specifically used for:

[0155] Scoring the conditional probability of each word in the target text corpus data to obtain multiple scores;

[0156] Calculating the average absolute deviation of the multiple scores to obtain a target average absolute deviation;

[0157] When the target mean absolute deviation is within a preset threshold range, calculating the target perplexity according to the conditional probability of each word in the target text corpus data;

[0158] When the target mean absolute deviation is not within the preset threshold range, determining the word probability of each word in the target text corpus data that is lower than the preset conditional probability, and obtaining at least one word probability;

[0159] Determine a target word corresponding to the at least one word probability to obtain at least one target word;

[0160] Determine a replacement word corresponding to the at least one target word according to the word reference data set to obtain at least one replacement word;

[0161] Replacing the target word in the target text corpus data with the at least one replacement word to obtain error correction text corpus data;

[0162] The error correction text corpus data is input into the target language model to obtain the conditional probability of each word in the error correction text corpus data, and the target perplexity is determined according to the conditional probability of each word in the error correction text corpus data.

[0163] The power field operation risk warning device 200 described in the present application can train a preset model based on historical text corpus data to obtain a target language model, then extract text information from the bill image of the record bill corresponding to the current power field operation through optical character recognition technology, and perform preprocessing operations on the text information to obtain text corpus data, input the text corpus data into the trained target language model, obtain the conditional probability of each word in the text corpus data, calculate the perplexity of the text corpus data based on the conditional probability of each word in the text corpus data, and evaluate and warn the risk of the current power field operation based on the perplexity. The higher the perplexity, the higher the risk warning degree of the current power field operation. Therefore, the analysis efficiency of the record bills of the power field operation is improved to quickly warn the risk of the power field operation.

[0164] See also Figure 3 , Figure 3 : is a structural diagram of an electronic device provided in an embodiment of the present application, the electronic device may include a processor, a memory, a communication interface and one or more programs, the processor, the memory and the communication interface may be interconnected through a bus; the one or more programs are stored in the memory and configured to be executed by the processor; in the embodiment of the present application, the program includes instructions for executing the following steps:

[0165] Acquire historical text corpus data; the historical text corpus data is text data obtained by recognizing text information of record tickets corresponding to power field operations through optical character recognition technology, and the text corpus data is obtained by preprocessing the text data;

[0166] The preset model is trained by the historical text corpus data to obtain a target language model; the target language model is used to receive the text and generate the conditional probability of each word appearing in the text;

[0167] Recognize the text information of the record ticket corresponding to the current power field operation by the optical character recognition technology to obtain the target text data;

[0168] Preprocessing the target text data to obtain target text corpus data;

[0169] Inputting the target text corpus data into the target language model to obtain the conditional probability of each word in the target text corpus data, and determining the target perplexity of the target text corpus data according to the conditional probability of each word in the target text corpus data;

[0170] The current power field operation is evaluated according to the target perplexity to obtain the risk warning degree; the target perplexity is proportional to the risk warning degree.

[0171] The electronic device described in the present application can train a preset model based on historical text corpus data to obtain a target language model, then extract text information from the bill image of the record bill corresponding to the current power field operation through optical character recognition technology, and perform preprocessing operations on the text information to obtain text corpus data, input the text corpus data into the trained target language model, obtain the conditional probability of each word in the text corpus data, calculate the perplexity of the text corpus data based on the conditional probability of each word in the text corpus data, and evaluate and warn the risk of the current power field operation based on the perplexity. The higher the perplexity, the higher the risk warning level of the current power field operation. Therefore, it is achieved to improve the analysis efficiency of the record bills of the power field operation to quickly warn the risk of the power field operation.

[0172] An embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.

[0173] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.

[0174] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

[0175] The steps of the method or algorithm described in the embodiments of the present application can be implemented in hardware or by executing software instructions by a processor. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM, flash memory, ROM, EPROM, electrically erasable programmable read-only memory (electrically EPROM, EEPROM), registers, hard disks, mobile hard disks, read-only compact disks (CD-ROMs) or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a terminal device or a management device. Of course, the processor and the storage medium can also be present in a terminal device or a management device as discrete components.

[0176] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server, or data center to another website site, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0177] The modules / units included in the devices and products described in the above embodiments may be software modules / units or hardware modules / units, or may be partially software modules / units and partially hardware modules / units. For example, for the devices and products applied to or integrated in the chip, the modules / units included therein may all be implemented in the form of hardware such as circuits, or at least some of the modules / units may be implemented in the form of software programs, which run on the processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits; for the devices and products applied to or integrated in the chip module, the modules / units included therein may all be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as a chip, circuit module, etc.) or in different components of the chip module, or at least some of the modules / units may be implemented in the form of software programs. The software programs run on the processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits. It is implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in hardware such as circuits; for various devices and products applied to or integrated in the terminal equipment, the various modules / units contained therein can be implemented in hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or in different components in the terminal equipment, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the terminal equipment, and the remaining (if any) modules / units can be implemented in hardware such as circuits.

[0178] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above description is only the specific implementation method of the embodiments of the present application and is not intended to limit the protection scope of the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.

Claims

1. A method for early warning of risks in power field operations, characterized in that: The method comprises: Acquire historical text corpus data; the historical text corpus data is text data obtained by recognizing text information of record tickets corresponding to power field operations through optical character recognition technology, and the text corpus data is obtained by preprocessing the text data; The preset model is trained by the historical text corpus data to obtain a target language model; the target language model is used to receive the text and generate the conditional probability of each word appearing in the text; Recognize the text information of the record ticket corresponding to the current power field operation by the optical character recognition technology to obtain the target text data; Preprocessing the target text data to obtain target text corpus data; Inputting the target text corpus data into the target language model to obtain the conditional probability of each word in the target text corpus data, and determining the target perplexity of the target text corpus data according to the conditional probability of each word in the target text corpus data; The current power field operation is evaluated according to the target perplexity to obtain the risk warning degree; the target perplexity is proportional to the risk warning degree.

2. The method according to claim 1, characterized in that The method of recognizing text information of the record ticket corresponding to the current power field operation by the optical character recognition technology to obtain target text data includes: Performing image preprocessing on the bill image of the record bill corresponding to the current power field operation to obtain a target bill image; Divide the target bill image into blocks based on a preset region dividing algorithm to obtain a plurality of region blocks; Locating a text position of each area block in the multiple area blocks to obtain multiple text positions; Recognize the text content in each of the multiple text positions according to the optical character recognition technology to obtain multiple text contents; The target text data is constructed according to the multiple text contents.

3. The method according to claim 1, characterized in that The preprocessing of the target text data to obtain the target text corpus data includes: Performing a data cleaning operation on the target text data to obtain first text data; Selecting part of the text data in the first text data based on a preset delimiter to obtain second text data; Determine the data type corresponding to the second text data to obtain a target data type; The second text data is feature processed according to the target data type to obtain the target text corpus data.

4. The method according to claim 3, characterized in that When the target data type includes a numerical data type, the characterization processing of the second text data according to the target data type to obtain the target text corpus data includes: Extracting feature data from the second text data to obtain target feature data; Determine the distribution characteristics of the second text data according to the target characteristic data to obtain a target distribution characteristic; Normalizing the target characteristic data based on the target distribution characteristics to obtain target standard data; The target standard data is subjected to de-labeling and word segmentation processing to obtain a plurality of words, and words that meet preset conditions are selected from the plurality of words to obtain the target text corpus data.

5. The method according to any one of claims 1 to 4, characterized in that: The method of training a preset model by using the historical text corpus data to obtain a target language model includes: Performing word segmentation processing on the historical text corpus data to obtain a plurality of words; Set the target prediction word sequence length; Combining the multiple words according to the target predicted word sequence length to obtain multiple grammatical units; Get a word reference dataset; Input the plurality of grammatical units and the word reference data set into the preset model to obtain a plurality of fallback weights and a plurality of conditional probabilities; the fallback weights correspond to the grammatical units one by one; the conditional probabilities correspond to the grammatical units one by one; The target language model is constructed according to the multiple backoff weights, the multiple conditional probabilities and the preset model.

6. The method according to claim 5, characterized in that After the preset model is trained by the historical text corpus data to obtain the target language model, the method further includes: Obtain reference text corpus data; Analyze the reference text corpus data to obtain the actual risk warning level; Inputting the reference text corpus data into the target language model to obtain a conditional probability of each word in the reference text corpus data, and determining a reference perplexity of the reference text corpus data according to the conditional probability of each word in the reference text corpus data; Determine the theoretical risk warning level corresponding to the reference perplexity; Determining an evaluation index value corresponding to the target language model based on the actual risk warning level and the theoretical risk warning level; Determining an adjustment parameter of the target language model according to the evaluation index value to obtain a target adjustment parameter; The model parameters of the target language model are adjusted according to the target adjustment parameters.

7. The method according to claim 5, characterized in that Determining the target perplexity of the target text corpus data according to the conditional probability of each word in the target text corpus data includes: Scoring the conditional probability of each word in the target text corpus data to obtain multiple scores; Calculating the average absolute deviation of the multiple scores to obtain a target average absolute deviation; When the target mean absolute deviation is within a preset threshold range, calculating the target perplexity according to the conditional probability of each word in the target text corpus data; When the target mean absolute deviation is not within the preset threshold range, determining the word probability of each word in the target text corpus data that is lower than the preset conditional probability, and obtaining at least one word probability; Determine a target word corresponding to the at least one word probability to obtain at least one target word; Determine a replacement word corresponding to the at least one target word according to the word reference data set to obtain at least one replacement word; Replacing the target word in the target text corpus data with the at least one replacement word to obtain error correction text corpus data; The error correction text corpus data is input into the target language model to obtain the conditional probability of each word in the error correction text corpus data, and the target perplexity is determined according to the conditional probability of each word in the error correction text corpus data.

8. A risk warning device for power field operations, characterized in that: The device includes: a data acquisition module, a model training module, an image recognition module, a data processing module, a data determination module, and a risk assessment module, wherein: The data acquisition module is used to acquire historical text corpus data; the historical text corpus data is text data obtained by recognizing text information of record tickets corresponding to power field operations through optical character recognition technology, and the text corpus data is obtained by preprocessing the text data; The model training module is used to train the preset model through the historical text corpus data to obtain a target language model; the target language model is used to receive the text and generate the conditional probability of each word appearing in the text; The image recognition module is used to recognize the text information of the record ticket corresponding to the current power field operation through the optical character recognition technology to obtain the target text data; The data processing module is used to pre-process the target text data to obtain target text corpus data; The data determination module is used to input the target text corpus data into the target language model, obtain the conditional probability of each word in the target text corpus data, and determine the target perplexity of the target text corpus data according to the conditional probability of each word in the target text corpus data; The risk assessment module is used to assess the current power field operation according to the target perplexity to obtain the risk warning degree; the target perplexity is proportional to the risk warning degree.

9. An electronic device, characterized in that: include: A processor, a memory, a communication interface, and one or more programs; The one or more programs are stored in the memory and configured to be executed by the processor, the programs comprising instructions for executing the steps in the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Method and device for identifying and automatically merging petition documents

    CN120877315A