CN112699244A - Deep learning-based method and system for classifying defect texts of power transmission and transformation equipment - Google Patents
Deep learning-based method and system for classifying defect texts of power transmission and transformation equipment Download PDFInfo
- Publication number
- CN112699244A CN112699244A CN202110279537.6A CN202110279537A CN112699244A CN 112699244 A CN112699244 A CN 112699244A CN 202110279537 A CN202110279537 A CN 202110279537A CN 112699244 A CN112699244 A CN 112699244A
- Authority
- CN
- China
- Prior art keywords
- power transmission
- transformation equipment
- vector
- text
- word
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000007547 defect Effects 0.000 title claims abstract description 76
- 230000009466 transformation Effects 0.000 title claims abstract description 70
- 230000005540 biological transmission Effects 0.000 title claims abstract description 67
- 238000000034 method Methods 0.000 title claims abstract description 27
- 238000013135 deep learning Methods 0.000 title claims abstract description 15
- 230000002457 bidirectional effect Effects 0.000 claims abstract description 13
- 238000007781 pre-processing Methods 0.000 claims abstract description 12
- 230000007787 long-term memory Effects 0.000 claims abstract description 8
- 230000007246 mechanism Effects 0.000 claims abstract description 8
- 238000012545 processing Methods 0.000 claims description 16
- 230000006870 function Effects 0.000 claims description 12
- 239000011159 matrix material Substances 0.000 claims description 12
- 238000000605 extraction Methods 0.000 claims description 8
- 230000011218 segmentation Effects 0.000 claims description 8
- 230000006403 short-term memory Effects 0.000 claims description 8
- 230000005284 excitation Effects 0.000 claims description 5
- 230000015654 memory Effects 0.000 claims description 5
- 238000012549 training Methods 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 4
- 238000005065 mining Methods 0.000 description 4
- 230000002950 deficient Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000003058 natural language processing Methods 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013145 classification model Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000003066 decision tree Methods 0.000 description 1
- 238000011478 gradient descent method Methods 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 239000012212 insulator Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000007789 sealing Methods 0.000 description 1
- 238000012706 support-vector machine Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/35—Clustering; Classification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/048—Activation functions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Biophysics (AREA)
- Evolutionary Computation (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Machine Translation (AREA)
Abstract
本发明提供一种基于深度学习的输变电设备缺陷文本分类方法及系统,方法包括步骤:S1:将获取的输变电设备缺陷文本预处理,然后进行词嵌入得到带电力语义特征的第一词向量;S2:通过双向长短时记忆网络获取输变电设备缺陷文本前向和后向特征信息,输出隐藏层状态向量;S3:利用自注意力机制对隐藏层状态向量进行加权变换,获取深层语义特征,得到最终的待分类句向量;S4:将待分类向量经过全连接层输出至Softmax分类器,获得输变电设备缺陷文本分类结果。该方法能解决现有的电力领域缺陷文本分类的人工成本高,分类结果易受分类技术人员经验影响及传统文本分类方法不适用于电力领域的技术性问题。
The present invention provides a method and system for classifying power transmission and transformation equipment defect texts based on deep learning. The method includes the following steps: S1: preprocessing the acquired power transmission and transformation equipment defect text, and then performing word embedding to obtain a first text with power semantic features. Word vector; S2: Obtain the forward and backward feature information of the defect text of the power transmission and transformation equipment through the bidirectional long-term memory network, and output the hidden layer state vector; S3: Use the self-attention mechanism to weight the hidden layer state vector to obtain the deep layer. Semantic features are obtained to obtain the final sentence vector to be classified; S4: the vector to be classified is output to the Softmax classifier through the fully connected layer to obtain the text classification result of power transmission and transformation equipment defects. The method can solve the technical problems that the existing text classification of defects in the electric power field has high labor costs, the classification results are easily affected by the experience of classification technicians, and the traditional text classification methods are not suitable for the electric power field.
Description
技术领域technical field
本发明属于自然语言处理技术领域,具体涉及一种基于深度学习的输变电设备缺陷文本分类方法及系统。The invention belongs to the technical field of natural language processing, and in particular relates to a method and system for classifying defective texts of power transmission and transformation equipment based on deep learning.
背景技术Background technique
随着智能电网的不断发展,电网在日常运行和维护过程中,会产生大量的缺陷文本数据;而缺陷文本数据的分析汇总是电网设备缺陷故障处理并分析的原始依据。目前,电网输变电设备缺陷文本分析主要依靠人工完成,成本高,效率低,且易受人工经验差异的影响导致分类结果有偏差。人工智能和自然语言处理技术的发展为电力设备缺陷文本挖掘提供了可能。现有的文本分类技术有朴素贝叶斯、支持向量机、决策树等,但传统的基于机器学习相关算法的文本分类器难以挖掘出文本的深层特征,不利于文本数据的进一步分析研究和应用,同时电力领域的文本包含大量的专业用语和特殊符号,专业性强,深度学习中通用的分类模型难以得到直接的迁移应用,而目前电力文本挖掘尚处于起步阶段。With the continuous development of the smart grid, a large amount of defect text data will be generated during the daily operation and maintenance of the power grid; and the analysis and summary of the defect text data is the original basis for the processing and analysis of the faults of power grid equipment. At present, the text analysis of power transmission and transformation equipment defects in the power grid is mainly done manually, which is costly and inefficient, and is easily affected by differences in manual experience, resulting in biased classification results. The development of artificial intelligence and natural language processing technology provides the possibility of text mining of electrical equipment defects. Existing text classification technologies include Naive Bayes, Support Vector Machines, Decision Trees, etc., but traditional text classifiers based on machine learning related algorithms are difficult to mine the deep features of text, which is not conducive to further analysis and application of text data. At the same time, the text in the field of electric power contains a large number of professional terms and special symbols, which is highly professional, and it is difficult for the general classification model in deep learning to be directly transferred and applied, and the current power text mining is still in its infancy.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明的目的之一在于提供一种基于深度学习的输变电设备缺陷文本分类方法,该方法能适用于电力领域缺陷文本分类。In view of this, one of the objectives of the present invention is to provide a text classification method for power transmission and transformation equipment defects based on deep learning, which can be applied to the classification of defect texts in the power field.
为实现上述目的,本发明的技术方案为:一种基于深度学习的输变电设备缺陷文本分类方法,包括以下步骤:In order to achieve the above purpose, the technical scheme of the present invention is: a deep learning-based method for classifying defective texts of power transmission and transformation equipment, comprising the following steps:
S1:将获取的输变电设备缺陷文本预处理,然后将预处理后的输变电设备缺陷文本进行词嵌入得到带电力语义特征的第一词向量;S1: Preprocess the acquired power transmission and transformation equipment defect text, and then perform word embedding on the preprocessed power transmission and transformation equipment defect text to obtain a first word vector with power semantic features;
S2:通过双向长短时记忆网络获取输变电设备缺陷文本前向和后向特征信息,输出隐藏层状态向量;S2: Obtain the forward and backward feature information of the defect text of the power transmission and transformation equipment through the bidirectional long-short-term memory network, and output the hidden layer state vector;
S3:利用自注意力机制对隐藏层状态向量进行加权变换,获取深层语义特征,得到最终的待分类句向量;S3: Use the self-attention mechanism to perform weighted transformation on the hidden layer state vector, obtain deep semantic features, and obtain the final sentence vector to be classified;
S4:将所述待分类句向量经过全连接层输出至Softmax分类器,获得输变电设备缺陷文本分类结果。S4: Output the to-be-classified sentence vector to the Softmax classifier through a fully connected layer to obtain a text classification result of power transmission and transformation equipment defects.
进一步地,所述预处理包括对所述输变电设备缺陷文本进行分词、去除停用词和统一化用语处理。Further, the preprocessing includes word segmentation, stop word removal and unified terminology processing on the power transmission and transformation equipment defect text.
进一步地,所述步骤S1中将预处理后的输变电设备缺陷文本进行词嵌入得到带电力语义特征的第一词向量的步骤具体包括:Further, in the step S1, the step of performing word embedding on the preprocessed power transmission and transformation equipment defect text to obtain the first word vector with power semantic features specifically includes:
读取预处理后的输变电设备缺陷文本,统计词频信息;Read the preprocessed power transmission and transformation equipment defect text, and count the word frequency information;
构建词典,并初始化哈夫曼树以及随机初始化词向量;Build a dictionary, initialize the Huffman tree and randomly initialize the word vector;
以行为单位训练模型,获取当前行中一个输入样本;Train the model in row units and get an input sample in the current row;
累积上下文词向量中每个维度的值并求平均得到投影层向量;Accumulate the value of each dimension in the context word vector and average it to get the projection layer vector;
遍历当前词到根节点经过的每个中间节点;Traverse each intermediate node from the current word to the root node;
计算中间节点对应梯度g*学习速率,刷新投影层到该中间节点的误差向量,刷新中间节点向量,刷新上下文词向量。Calculate the gradient g*learning rate corresponding to the intermediate node, refresh the error vector of the projection layer to the intermediate node, refresh the intermediate node vector, and refresh the context word vector.
进一步地,所述步骤S2具体包括以下步骤:Further, the step S2 specifically includes the following steps:
定义前向LSTM结构和后向LSTM结构,采用动态RNN单元对网络输出的结果进行拼接,然后输入到下一层双向长短时记忆网络,将最后一层Bi-LSTM输出的结果通过split方法分割成前向和后向的输出;Define the forward LSTM structure and the backward LSTM structure, use the dynamic RNN unit to splicing the results of the network output, and then input them to the next layer of bidirectional long and short-term memory network, and divide the output results of the last layer of Bi-LSTM into split methods. forward and backward output;
将前向和后向的输出相加得到最后的隐藏层状态。Add the forward and backward outputs to get the final hidden layer state.
进一步地,所述LSTM结构中每一时间状态通过以下方式进行更新公式:Further, each time state in the LSTM structure is updated in the following way:
其中, 为LSTM状态和LSTM内部状态的激励函数,设置为双曲正切函数tanh, b为偏置常量,下标中i、f、o分别表示输入门、遗忘门和输出门;g为随时间步更新的控制门 单元,即以sigmiod函数为激励函数的前馈神经网络, 为当前t时间状态, 为前一 时间状态, 为当前时刻的输入, 为权重值, 为输入门权重值,为输出门权重 值, 为遗忘门权重值, 为当前时刻的抽象化信息,为前一时间步的抽象化信息, 为权重系数。 in, is the excitation function of the LSTM state and the LSTM internal state, set to the hyperbolic tangent function tanh, b is the bias constant, i, f, o in the subscript represent the input gate, forget gate and output gate respectively; g is updated with time steps The control gate unit of , that is, the feedforward neural network with the sigmiod function as the excitation function, is the current state at time t, is the state of the previous time, is the input at the current moment, is the weight value, is the input gate weight value, is the output gate weight value, is the forget gate weight value, is the abstract information of the current moment, is the abstracted information of the previous time step, is the weight coefficient.
进一步地,所述步骤S3中深层语义特征通过以下方式获得:Further, the deep semantic features in the step S3 are obtained in the following ways:
; ;
其中Q=WqH,K= WkH,V=WvH,Wq、Wk、Wv均是初始化权重矩阵,H是隐藏层状态矩阵, Self-attention为自注意力值,Q为quary值,K为key值,V为value值,为词向量维度,T为 矩阵转置。 Where Q=W q H, K= W k H, V=W v H, W q , W k , W v are initialization weight matrices, H is the hidden layer state matrix, Self-attention is the self-attention value, Q is the quary value, K is the key value, V is the value value, is the word vector dimension, and T is the matrix transpose.
本发明的目的之二在于提供一种基于深度学习的输变电设备缺陷文本分类系统,该系统可应用于电力领域的缺陷文本分类。The second purpose of the present invention is to provide a text classification system for power transmission and transformation equipment defects based on deep learning, which can be applied to the classification of defect texts in the field of electric power.
为实现上述目的,本发明的技术方案为:一种基于深度学习的输变电设备缺陷文本分类系统,包括:In order to achieve the above purpose, the technical solution of the present invention is: a deep learning-based power transmission and transformation equipment defect text classification system, comprising:
文本处理模块,用于将获取的输变电设备缺陷文本预处理,然后将预处理后的输变电设备缺陷文本进行词嵌入得到带电力语义特征的第一词向量;The text processing module is used to preprocess the acquired power transmission and transformation equipment defect text, and then perform word embedding on the preprocessed power transmission and transformation equipment defect text to obtain a first word vector with power semantic features;
语义特征提取模块,与所述文本处理模块相连,用于通过双向长短时记忆网络获取输变电设备缺陷文本前向和后向特征信息,输出隐藏层状态向量,并用于利用自注意力机制对隐藏层状态向量进行加权变换,获取深层语义特征,得到最终的待分类句向量;The semantic feature extraction module is connected to the text processing module, and is used to obtain the forward and backward feature information of the defect text of the power transmission and transformation equipment through the bidirectional long and short-term memory network, output the hidden layer state vector, and use it to use the self-attention mechanism. The hidden layer state vector is weighted and transformed to obtain deep semantic features, and the final sentence vector to be classified is obtained;
文本分类模块,用于将接收的所述待分类句向量输入全连接层输出至Softmax分类器,获得输变电设备缺陷文本分类结果。The text classification module is used for inputting the received sentence vector to be classified into the fully connected layer and outputting it to the Softmax classifier, so as to obtain the text classification result of the defect of the power transmission and transformation equipment.
进一步地,所述文本处理模块对输变电设备缺陷文本进行预处理包括对所述输变电设备缺陷文本进行分词、去除停用词和统一化用语处理。Further, the text processing module preprocessing the power transmission and transformation equipment defect text includes word segmentation, stop word removal, and unified terminology processing on the power transmission and transformation equipment defect text.
进一步地,所述深层语义特征通过以下方式获得:Further, the deep semantic features are obtained in the following ways:
; ;
其中Q=WqH,K= WkH,V=WvH,Wq、Wk、Wv均是初始化权重矩阵,H是隐藏层状态矩阵, Self-attention为自注意力值,Q为quary值,K为key值,V为value值, 为词向量维度,T 为矩阵转置。 Where Q=W q H, K= W k H, V=W v H, W q , W k , W v are initialization weight matrices, H is the hidden layer state matrix, Self-attention is the self-attention value, Q is the quary value, K is the key value, V is the value value, is the word vector dimension, and T is the matrix transpose.
进一步地,所述语义特征提取模块还用于定义前向LSTM结构和后向LSTM结构,采用动态RNN单元对网络输出的结果进行拼接,然后输入到下一层双向长短时记忆网络,将最后一层Bi-LSTM输出的结果通过split方法分割成前向和后向的输出,将前向和后向的输出相加得到最后的隐藏层状态。Further, the semantic feature extraction module is also used to define the forward LSTM structure and the backward LSTM structure, and use the dynamic RNN unit to splicing the results output by the network, and then input it to the next layer of bidirectional long-term memory network, and the last The output of the layer Bi-LSTM is split into forward and backward outputs by the split method, and the forward and backward outputs are added to obtain the final hidden layer state.
与现有技术相比,本发明具有如下优点:Compared with the prior art, the present invention has the following advantages:
1、减少电网实际生产的人力成本,避免故障缺陷文本分类结果受不同人员经验的影响,极大提高输变电设备缺陷文本分类效率,提高输变电设备缺陷文本分类准确率。1. Reduce the labor cost of the actual production of the power grid, avoid the failure and defect text classification results from being affected by the experience of different personnel, greatly improve the efficiency of power transmission and transformation equipment defect text classification, and improve the power transmission and transformation equipment defect text classification accuracy rate.
2、在电力行业的实际生产中,输变电设备缺陷文本自动分类能够提供客观高效的故障划分参考,同时可结合结构化数据对输变电设备健康状态进行全面状态估计;2. In the actual production of the power industry, the automatic classification of power transmission and transformation equipment defect texts can provide an objective and efficient fault classification reference, and at the same time, it can be combined with structured data to perform comprehensive state estimation of the health status of power transmission and transformation equipment;
3、输变电设备缺陷文本分类是电力文本挖掘的部分研究内容,为挖掘分析电力设备缺陷文本数据及其他电力文本数据奠定基础。3. Power transmission and transformation equipment defect text classification is part of the research content of power text mining, which lays the foundation for mining and analyzing power equipment defect text data and other power text data.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍。显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to illustrate the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that are required to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.
图1为本发明一种基于深度学习的输变电设备缺陷文本分类系统的结构图;1 is a structural diagram of a deep learning-based power transmission and transformation equipment defect text classification system of the present invention;
图2为本发明一种基于深度学习的输变电设备缺陷文本分类方法的流程图;2 is a flowchart of a deep learning-based method for classifying defective texts of power transmission and transformation equipment according to the present invention;
图3为本发明一实施例中训练后100维词向量示意图。FIG. 3 is a schematic diagram of a 100-dimensional word vector after training in an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
所举实施例是为了更好地对本发明进行说明,但并不是本发明的内容仅局限于所举实施例。所以熟悉本领域的技术人员根据上述发明内容对实施方案进行非本质的改进和调整,仍属于本发明的保护范围。The examples are given to better illustrate the present invention, but the content of the present invention is not limited to the examples. Therefore, those skilled in the art make non-essential improvements and adjustments to the embodiments according to the above-mentioned contents of the invention, which still belong to the protection scope of the present invention.
实施例1Example 1
参考图1为本发明一种基于深度学习的输变电设备缺陷文本分类系统结构图,具体地,该系统包括:1 is a structural diagram of a text classification system for power transmission and transformation equipment defects based on deep learning of the present invention. Specifically, the system includes:
文本处理模块1,用于将获取的输变电设备缺陷文本预处理,然后将预处理后的输变电设备缺陷文本进行词嵌入得到带电力语义特征的第一词向量;The text processing module 1 is used for preprocessing the acquired power transmission and transformation equipment defect text, and then performing word embedding on the preprocessed power transmission and transformation equipment defect text to obtain a first word vector with power semantic features;
本实施例中,文本处理模块对输变电设备缺陷文本进行预处理包括对输变电设备缺陷文本进行分词、去除停用词和统一化用语处理。In this embodiment, the text processing module performs preprocessing on the defect text of the power transmission and transformation equipment, including word segmentation, removal of stop words, and unified terminology processing on the defect text of the power transmission and transformation equipment.
语义特征提取模块2,与文本处理模块1相连,用于通过双向长短时记忆网络获取输变电设备缺陷文本前向和后向特征信息,输出隐藏层状态向量,并用于利用自注意力机制对隐藏层状态向量进行加权变换,获取深层语义特征,得到最终的待分类句向量;The semantic feature extraction module 2 is connected to the text processing module 1, and is used to obtain the forward and backward feature information of the defect text of the power transmission and transformation equipment through the bidirectional long-short-term memory network, output the hidden layer state vector, and use it to use the self-attention mechanism. The hidden layer state vector is weighted and transformed to obtain deep semantic features, and the final sentence vector to be classified is obtained;
在语义特征提取模块2中,定义前向LSTM结构和后向LSTM结构,采用动态RNN单元对网络输出的结果进行拼接,然后输入到下一层双向长短时记忆网络,将最后一层Bi-LSTM输出的结果通过split方法分割成前向和后向的输出,将前向和后向的输出相加得到最后的隐藏层状态。In the semantic feature extraction module 2, the forward LSTM structure and the backward LSTM structure are defined, and the dynamic RNN unit is used to splicing the results of the network output, and then input to the next layer of bidirectional long and short-term memory network, and the last layer of Bi-LSTM The output results are divided into forward and backward outputs by the split method, and the forward and backward outputs are added to obtain the final hidden layer state.
优选地,深层语义特征通过以下方式获得:Preferably, the deep semantic features are obtained by:
; ;
其中Q=WqH,K= WkH,V=WvH,Wq、Wk、Wv均是初始化权重矩阵,H是隐藏层状态矩阵, Self-attention为自注意力值,Q为quary值,K为key值,V为value值, 为词向量维度,T为 矩阵转置。 Where Q=W q H, K= W k H, V=W v H, W q , W k , W v are initialization weight matrices, H is the hidden layer state matrix, Self-attention is the self-attention value, Q is the quary value, K is the key value, V is the value value, is the word vector dimension, and T is the matrix transpose.
文本分类模块3,与语义特征提取模块2相连,用于将接收的待分类句向量输入全连接层输出至Softmax分类器,获得输变电设备缺陷文本分类结果。The text classification module 3 is connected to the semantic feature extraction module 2, and is used for inputting the received sentence vector to be classified into the fully connected layer and outputting it to the Softmax classifier, so as to obtain the text classification result of power transmission and transformation equipment defects.
实施例2Example 2
基于实施例1的系统,本实施例中提供一种基于深度学习的输变电设备缺陷文本分类方法,参考图2,该方法包括以下步骤:Based on the system of Embodiment 1, this embodiment provides a deep learning-based text classification method for power transmission and transformation equipment defects. Referring to FIG. 2 , the method includes the following steps:
S1:将获取的输变电设备缺陷文本预处理,然后将预处理后的输变电设备缺陷文本进行词嵌入得到带电力语义特征的第一词向量;S1: Preprocess the acquired power transmission and transformation equipment defect text, and then perform word embedding on the preprocessed power transmission and transformation equipment defect text to obtain a first word vector with power semantic features;
本步骤中,对输变电设备缺陷文本进行预处理包括对输变电设备缺陷文本进行分词、去除停用词和统一化用语处理;In this step, the preprocessing of the power transmission and transformation equipment defect text includes word segmentation, stop word removal and unified terminology processing for the power transmission and transformation equipment defect text;
进一步地,将预处理后的输变电设备缺陷文本进行词嵌入得到带电力语义特征的第一词向量的步骤具体包括:Further, the step of performing word embedding on the preprocessed power transmission and transformation equipment defect text to obtain a first word vector with power semantic features specifically includes:
读取预处理后的输变电设备缺陷文本,统计词频信息;Read the preprocessed power transmission and transformation equipment defect text, and count the word frequency information;
构建词典,并初始化哈夫曼树以及随机初始化词向量,词向量维度为100;Build a dictionary, initialize the Huffman tree and randomly initialize the word vector, and the word vector dimension is 100;
以行为单位训练模型,获取当前行中一个输入样本;Train the model in row units and get an input sample in the current row;
累积上下文词向量中每个维度的值并求平均得到投影层向量;Accumulate the value of each dimension in the context word vector and average it to get the projection layer vector;
遍历当前词到根节点经过的每个中间节点;Traverse each intermediate node from the current word to the root node;
计算中间节点对应梯度g*学习速率,刷新投影层到该中间节点的误差向量,刷新中间节点向量,刷新上下文词向量。Calculate the gradient g*learning rate corresponding to the intermediate node, refresh the error vector of the projection layer to the intermediate node, refresh the intermediate node vector, and refresh the context word vector.
在一具体实施例中,选取某省电力公司2018-2019年的电网设备缺陷记录数据,因输变电设备是缺陷记录数目最多的设备类型,而其余设备类型数目较少,不具备构成深度学习数据集条件,因此选取其中的输变电设备缺陷记录作为原始数据。对输变电设备缺陷文本进行预处理,包括分词,去除停用词和统一化用语;采用5折验证法,将所有输变电设备缺陷文本随机排列后平均划分为5份,轮番选取其中4份作为训练集,1份作为测试集进行验证,假定其中一份测试数据集为“35kv万里坡变电站1#主变本体储油柜油位过低”、“35kv日火水电厂主变压器分接开关呼吸器封油过多”;在对上述数据集进行预处理后分别为“35kv”“主变压器”“本体”“储油柜”“油位”“过低”和“35kv”“主变压器”“分接开关”“呼吸器”“封油”“过多”。In a specific embodiment, the grid equipment defect record data of a provincial power company from 2018 to 2019 is selected, because the power transmission and transformation equipment is the equipment type with the largest number of defect records, while the number of other equipment types is small, and does not have the ability to constitute deep learning. Data set conditions, so the defect records of power transmission and transformation equipment are selected as the original data. Preprocessing the text of power transmission and transformation equipment defects, including word segmentation, removing stop words and unified terms; using the 5-fold verification method, all power transmission and transformation equipment defect texts are randomly arranged and divided into 5 parts on average, and 4 of them are selected in turn. As a training set, 1 is used as a test set for verification, assuming that one of the test data sets is "35kv Wanlipo substation 1# main transformer oil conservator oil level is too low", "35kv day thermal hydropower plant main transformer tap Excessive oil sealing of the switch respirator"; after preprocessing the above data set, they are "35kv", "main transformer", "main body", "oil conservator", "oil level", "too low" and "35kv" "main transformer" "Tap changer" "Breather" "Oil seal" "Too much".
如在一具体实施例中,假定其中一份测试数据集分词结果为“绝缘子”,训练后其100维词向量表示为图3所示;As in a specific embodiment, it is assumed that the word segmentation result of one of the test data sets is "insulator", and its 100-dimensional word vector representation after training is shown in Figure 3;
S2:通过双向长短时记忆网络获取输变电设备缺陷文本前向和后向特征信息,输出隐藏层状态向量;S2: Obtain the forward and backward feature information of the defect text of the power transmission and transformation equipment through the bidirectional long-short-term memory network, and output the hidden layer state vector;
本实施例中,先定义前向长短时记忆网络(LSTM)结构和后向长短时记忆网络(LSTM)结构,采用动态RNN单元对网络输出的结果(fw和bw,fw为前向LSTM输出结果,bw为反向LSTM输出结果)进行拼接,然后输入到下一层双向长短时记忆网络,将最后一层Bi-LSTM输出的结果通过python中split方法(split函数)分割成前向和后向的输出;In this embodiment, the forward long short-term memory network (LSTM) structure and the backward long short-term memory network (LSTM) structure are first defined, and the dynamic RNN unit is used to output the results of the network (fw and bw, fw is the forward LSTM output result , bw is the reverse LSTM output result) for splicing, and then input to the next layer of bidirectional long and short-term memory network, and the result of the last layer of Bi-LSTM output is divided into forward and backward through the split method (split function) in python Output;
将前向和后向的输出相加得到最后的隐藏层状态。Add the forward and backward outputs to get the final hidden layer state.
进一步地,LSTM结构中每一时间(步)状态通过以下方式进行更新公式:Further, each time (step) state in the LSTM structure is updated by the following formula:
其中, 为系统状态和内部状态的激励函数,设置为双曲正切函数tanh,b为 偏置常量,下标中i、f、o分别表示输入门、遗忘门和输出门;g为随时间步更新的控制门单 元,即以sigmiod函数为激励函数的前馈神经网络,为当前时刻t的状态,为前一时间 隐藏层状态, 为当前时刻的输入, 为权重值, 为输入门权重值,为输出门权重 值, 为遗忘门权重值, 为当前时刻的抽象化信息, 为前一时间步的抽象化信息, 为权重系数。 in, is the excitation function of the system state and internal state, set as the hyperbolic tangent function tanh, b is the bias constant, i, f, o in the subscript represent the input gate, forget gate and output gate respectively; g is updated with time steps The control gate unit, that is, the feedforward neural network with the sigmiod function as the excitation function, is the state at the current time t, is the state of the hidden layer at the previous time, is the input at the current moment, is the weight value, is the input gate weight value, is the output gate weight value, is the forget gate weight value, is the abstract information of the current moment, is the abstracted information of the previous time step, is the weight coefficient.
S3:利用自注意力机制对隐藏层状态向量进行加权变换,获取深层语义特征,得到最终的待分类句向量;S3: Use the self-attention mechanism to perform weighted transformation on the hidden layer state vector, obtain deep semantic features, and obtain the final sentence vector to be classified;
本步骤中,将隐藏层状态引入自注意力机制;计算各个输入分配的注意力权重,用计算获得的权重作用于特征向量,以获得最终的输出特征向量。具体计算公式如下:In this step, the state of the hidden layer is introduced into the self-attention mechanism; the attention weight assigned to each input is calculated, and the calculated weight is applied to the feature vector to obtain the final output feature vector. The specific calculation formula is as follows:
; ;
其中Q=WqH,K= WkH,V=WvH,Wq、Wk、Wv均是初始化权重矩阵,H是隐藏层状态矩阵, Self-attention为自注意力值,Q为quary值,K为key值,V为value值, 为词向量维度,T 为矩阵转置。 Where Q=W q H, K= W k H, V=W v H, W q , W k , W v are initialization weight matrices, H is the hidden layer state matrix, Self-attention is the self-attention value, Q is the quary value, K is the key value, V is the value value, is the word vector dimension, and T is the matrix transpose.
S4:将待分类句向量经过全连接层输出至Softmax分类器,获得输变电设备缺陷文本分类结果。S4: The to-be-classified sentence vector is output to the Softmax classifier through the fully connected layer, and the text classification result of the defect of the power transmission and transformation equipment is obtained.
本实施例中,将待分类的句向量经过全连接层,输出至softmax分类器,得到对应类别的概率,选取概率最大的类作为最终的类。In this embodiment, the sentence vector to be classified is output to the softmax classifier through the fully connected layer to obtain the probability of the corresponding class, and the class with the highest probability is selected as the final class.
优选地,本实施例中softmax分类器构建过程如下:获取已知缺陷类型的输变电设备缺陷文本,通过缺陷文本预处理单元进行数据预处理,再利用缺陷文本特征表示单元获取带有文本特征的词向量,通过缺陷文本特征提取单元获得待分类的语义特征句向量,获得训练数据,采用随机梯度下降法训练softmax分类器的模型参数,训练至损失函数最小化时结束训练,获得softmax分类器。Preferably, the construction process of the softmax classifier in this embodiment is as follows: acquiring the power transmission and transformation equipment defect texts of known defect types, performing data preprocessing through the defect text preprocessing unit, and then using the defect text feature representation unit to obtain text features with text features The word vector is obtained through the defect text feature extraction unit to obtain the semantic feature sentence vector to be classified, and the training data is obtained. The model parameters of the softmax classifier are trained by the stochastic gradient descent method, and the training ends when the loss function is minimized, and the softmax classifier is obtained. .
上面结合附图对本发明的实施例进行了描述,但是本发明并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本发明的启示下,在不脱离本发明宗旨和权利要求所保护的范围情况下,还可做出很多形式,这些均属于本发明的保护之内。The embodiments of the present invention have been described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the inspiration of the present invention, without departing from the scope of protection of the present invention and the claims, many forms can be made, which all belong to the protection of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110279537.6A CN112699244A (en) | 2021-03-16 | 2021-03-16 | Deep learning-based method and system for classifying defect texts of power transmission and transformation equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110279537.6A CN112699244A (en) | 2021-03-16 | 2021-03-16 | Deep learning-based method and system for classifying defect texts of power transmission and transformation equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112699244A true CN112699244A (en) | 2021-04-23 |
Family
ID=75515268
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110279537.6A Pending CN112699244A (en) | 2021-03-16 | 2021-03-16 | Deep learning-based method and system for classifying defect texts of power transmission and transformation equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112699244A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113935338A (en) * | 2021-10-13 | 2022-01-14 | 北京有竹居网络技术有限公司 | Method, apparatus, device and medium for language translation based on layer prediction |
CN114328797A (en) * | 2021-11-09 | 2022-04-12 | 腾讯科技(深圳)有限公司 | Content search method, content search device, electronic device, storage medium, and program product |
CN115563528A (en) * | 2022-11-25 | 2023-01-03 | 四川飞宇电力股份有限公司 | Transformer maintenance equipment control method, electronic equipment and medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108363753A (en) * | 2018-01-30 | 2018-08-03 | 南京邮电大学 | Comment text sentiment classification model is trained and sensibility classification method, device and equipment |
CN110135551A (en) * | 2019-05-15 | 2019-08-16 | 西南交通大学 | A chatting method for robots based on word vectors and recurrent neural networks |
CN110457562A (en) * | 2019-08-15 | 2019-11-15 | 中国农业大学 | A method and device for classifying food safety incidents based on a neural network model |
US20200380213A1 (en) * | 2018-02-09 | 2020-12-03 | Salesforce.Com, Inc. | Multitask Learning As Question Answering |
-
2021
- 2021-03-16 CN CN202110279537.6A patent/CN112699244A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108363753A (en) * | 2018-01-30 | 2018-08-03 | 南京邮电大学 | Comment text sentiment classification model is trained and sensibility classification method, device and equipment |
US20200380213A1 (en) * | 2018-02-09 | 2020-12-03 | Salesforce.Com, Inc. | Multitask Learning As Question Answering |
CN110135551A (en) * | 2019-05-15 | 2019-08-16 | 西南交通大学 | A chatting method for robots based on word vectors and recurrent neural networks |
CN110457562A (en) * | 2019-08-15 | 2019-11-15 | 中国农业大学 | A method and device for classifying food safety incidents based on a neural network model |
Non-Patent Citations (5)
Title |
---|
冯斌 等: "基于BiLSTM-Attention神经网络的电力设备缺陷文本挖掘", 《中国电机工程学报》 * |
廖伟涵: "基于机器学习与自然语言处理的变压器故障诊断与状态评价研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 * |
张振: "基于车辆通行大数据的高速公路路况预测的研究与应用", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 * |
杨鹏: "基于领域词典与机器学习的中文评论情感分析", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
类库: ""双向LSTM模型的tensorflow实现"", 《HTTPS://WWW.136.LA/SHIDA/SHOW-97712.HTML》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113935338A (en) * | 2021-10-13 | 2022-01-14 | 北京有竹居网络技术有限公司 | Method, apparatus, device and medium for language translation based on layer prediction |
CN114328797A (en) * | 2021-11-09 | 2022-04-12 | 腾讯科技(深圳)有限公司 | Content search method, content search device, electronic device, storage medium, and program product |
CN114328797B (en) * | 2021-11-09 | 2024-03-19 | 腾讯科技(深圳)有限公司 | Content search method, device, electronic apparatus, storage medium, and program product |
CN115563528A (en) * | 2022-11-25 | 2023-01-03 | 四川飞宇电力股份有限公司 | Transformer maintenance equipment control method, electronic equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112699244A (en) | Deep learning-based method and system for classifying defect texts of power transmission and transformation equipment | |
CN110943857B (en) | Power communication network fault analysis and positioning method based on convolutional neural network | |
CN112100369B (en) | Semantic-combined network fault association rule generation method and network fault detection method | |
CN108985330A (en) | A kind of autoencoder network and its training method abnormal use electric detection method and system | |
CN107861942A (en) | A kind of electric power based on deep learning is doubtful to complain work order recognition methods | |
CN108596470A (en) | A kind of power equipments defect text handling method based on TensorFlow frames | |
CN114661905B (en) | A BERT-based power grid fault diagnosis method | |
CN107688576B (en) | A CNN-SVM model construction and propensity classification method | |
CN114167180B (en) | A fault diagnosis method for oil-filled electrical equipment based on graph attention neural network | |
CN112560997B (en) | Fault identification model training method, fault identification method and related device | |
CN111950297A (en) | A relation extraction method for abnormal events | |
CN108733928A (en) | A kind of SCD file void circuit automatic Verification method based on mid-module file | |
CN111274814A (en) | A Novel Semi-Supervised Text Entity Information Extraction Method | |
CN108170994A (en) | A kind of oil-immersed electric reactor method for diagnosing faults based on two-way depth network | |
CN110321555A (en) | A kind of power network signal classification method based on Recognition with Recurrent Neural Network model | |
CN116010619A (en) | Knowledge extraction method in complex equipment knowledge graph construction process | |
CN116484299A (en) | Charging pile fault diagnosis method based on integration of gradient lifting tree and multi-layer perceptron | |
CN115129892A (en) | Method and device for constructing knowledge graph of fault handling in distribution network | |
CN117421595A (en) | System log anomaly detection method and system based on deep learning technology | |
CN117347052A (en) | An adaptive bearing fault diagnosis method based on multi-scale and multi-source domains | |
CN113705695B (en) | A method for fault data identification in distribution network based on convolutional neural network | |
CN116663499A (en) | Intelligent industrial data processing method and system | |
CN116401572A (en) | A method and system for fault diagnosis of transmission lines based on CNN-LSTM | |
CN111080168A (en) | A Reliability Evaluation Method of Power Communication Network Equipment Based on Capsule Network | |
CN118227361B (en) | An unsupervised log anomaly detection method that does not rely on log parsers |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210423 |