A method and system for extracting scientific research knowledge in the power industry
Through the improved BiLSTM-CNN-CRF network model, feature extraction and sequence annotation are carried out in the field of electric power scientific research, and a keyword dictionary in the field of electric power scientific research is constructed, which solves the problems of low accuracy and slow speed in the extraction of electric power scientific research knowledge and achieves more efficiency. Extraction of electric power scientific research knowledge.
Patent Information
- Application Number
- CN202410140232.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-31
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-01-31
AI Technical Summary
In the extraction of electric power scientific research knowledge, there are problems such as the lack of publicly available Chinese electric power text data sets, the difficulty in quickly obtaining the keyword database of electric power scientific research knowledge, the unsatisfactory effect of general domain named entity recognition methods in the electric power field, and the difficulty in quickly locating and fine-graining electric power scientific research knowledge on the Internet. field-specific issues.
The improved BiLSTM-CNN-CRF network model is used to extract and annotate features of electric power scientific research documents through the memory network layer and multi-window gated network layer. Combined with the CRF layer for sequence annotation, a keyword dictionary in the field of electric power scientific research is constructed and the prediction The output is stored in the graph database Neo4j.
It improves the accuracy and speed of entity relationship extraction in the electric power field, reduces redundant data information, enhances the accuracy and speed of keyword extraction, and solves the problems of low accuracy and slow speed in the existing technology.
Smart Images

Figure CN117933380B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric power scientific research knowledge extraction, and in particular to an electric power scientific research knowledge extraction method and system based on a neural network model. Background Art
[0002] As one of the infrastructures of modern society, the power industry plays a vital role worldwide. In power science research, rich literature provides us with valuable information. Effective mining and organization of literature can help support scientific research activities in the power field, promote the solution and innovation of existing problems, and provide a scientific basis for policy formulation.
[0003] The current extraction of power scientific research knowledge mainly has the following difficulties:
[0004] 1) There is a lack of publicly available, annotated Chinese electricity text datasets, which limits researchers from conducting systematic experiments and evaluations;
[0005] 2) It is difficult to quickly obtain a keyword database of power research knowledge;
[0006] 3) The named entity recognition method in the general field has an ideal recognition effect on the general data set, but the effect is not ideal when the general field technology is directly transferred to the power field;
[0007] 4) There is a lot of power research knowledge on the Internet, but there is no way to quickly obtain keyword information to locate the sub-fields of knowledge.
[0008] The invention patent with application number 2023111466413 discloses a method, device, equipment and medium for extracting entity relationships in the power industry. The method adopted is: obtaining and preprocessing the text data set of the power industry, extracting entities in the power industry based on the entity query template of the power industry using a generative pre-trained language model, and constructing a labeled entity data set; using the ELMO model and the Transformer-CRF model to extract contextual features and sequence annotation of the text data set of the power industry, and modeling to obtain global dependencies; based on the global dependencies, contextual feature extraction and sequence annotation are performed on the annotated text data to obtain an entity label sequence, and the continuous and identical entity labels are merged to determine several entities; based on the entity relationship query template, the generative pre-trained language model is used to extract relationship information, and a relationship instance is constructed for several entities according to the preset matching rules. Based on the above-mentioned prior art, those skilled in the art know that the ELMO model is not strong in the ability to adopt the fusion feature of bidirectional splicing, and the Transformer-CRF model is found in practice to encounter a longer sequence length during reasoning than during training and there are also processing problems in copying characters. Therefore, the combination of these two models does not necessarily lead to the entity relationship extraction method that the prior art claims can achieve higher accuracy and coverage. Summary of the invention
[0009] Purpose of the invention: In order to overcome the shortcomings of the prior art, the present invention provides a method for extracting scientific research knowledge from the electric power industry based on a neural network model, which solves the problems of low accuracy and slow speed in extracting entity relationships in the electric power field. The present invention also provides a system for extracting scientific research knowledge from the electric power industry based on a neural network model.
[0010] Technical solution: According to the first aspect of the present invention, a method for extracting scientific research knowledge in the power industry based on a neural network model is provided, the method comprising:
[0011] S1 collects power scientific research literature information and preprocesses the collected literature information;
[0012] S2 builds a keyword dictionary in the field of power research and obtains a corpus of named entity recognition annotations through machine annotation to obtain a training set;
[0013] S3 uses an improved BiLSTM-CNN-CRF network to train the training set to complete keyword extraction of power scientific research knowledge. The improved BiLSTM-CNN-CRF network includes an input feature layer, a feature extraction layer and a prediction output layer. The feature extraction layer includes a memory network layer and a multi-window gated network layer. The input character embedding vector passes through the memory network layer and the multi-window gated network layer in sequence. This process can better capture the associated information in the input sequence. After the model is trained, the test set is used to test the model to obtain the corresponding test results.
[0014] S4 finally stores the electric power research knowledge keywords obtained by the prediction output layer together with the electric power research literature information into the graph database Neo4j.
[0015] Further, including:
[0016] In the step S2, the input feature layer includes an embedding layer, and the training set is converted into a character embedding vector after passing through the embedding layer, specifically including:
[0017] S21 collects each word in the training set and assigns a unique number to each character in the word;
[0018] S22 converts each character into a corresponding number and passes it as input to the embedding layer;
[0019] The embedding layer in S23 converts the corresponding serial number into a high-dimensional vector representation, wherein each character corresponds to a character embedding vector.
[0020] Further, including:
[0021] In step S3, the memory network layer includes an input gate, a forget gate and an output gate. If the current time step is t, the character of the current time step is embedded in the vector x t , the hidden state h at the previous moment t-1 (forward) and memory cell state c t-1 (forward) As input, the hidden state h t (forward) The calculation formula is as follows:
[0022]
[0023]
[0024] in, They are all weight parameters, σ represents the sigmoid function, and ⊙ represents element-level multiplication.
[0025] Similar to the forward calculation process above, the reverse process is calculated to obtain its hidden state h t (backward) , and then embed the character-based vector x t The hidden state h t (forward) and h t (backward) Concatenate to generate the output h of the memory network layer t =[h t (forward) ,h t (backward) ] is the vector x obtained after passing through the memory network layer t It is expressed as:
[0026]
[0027] Therefore, each input character embedding vector x t The dimension after the memory network layer is 2*hidden_num, where hidden_num is the number of forward hidden layers.
[0028] In step S3, the multi-window gated network layer is used to capture local patterns and features in the input sequence, and the corresponding operation steps include:
[0029] S31 obtains the vector X=[x1,x2,…,x n ]=[h1,h2,...,h n ] is input into the multi-window gated network layer, and local feature information of different granularities is extracted through convolution kernels of different sizes, where n is the length of the keyword dictionary, that is, the number of characters in the sentence;
[0030] S32 uses the Tanh-ReLU gating unit to regulate the intensity of feature information transmission, alleviate the gradient diffusion problem, and enhance the semantic information of local features;
[0031] S33 uses average pooling to integrate local features to form the final multi-granularity local feature information, and then obtains the output of the multi-window gated network layer.
[0032] Further, including:
[0033] The step S31 specifically includes:
[0034] In this embodiment of the present invention, h is directly used q express
[0035] An element in , where q∈[1,2n], will be the vector h obtained after passing through the memory network layer tInput to a multi-window convolutional layer, C k Indicates the use of window size, Represents the features obtained using a convolution kernel with a window size of k:
[0036]
[0037] Here Represents the features obtained using a convolution kernel with a window size of k, which obtains different values according to the forward hidden state and the backward hidden state.
[0038] The steps S32 and S33 specifically include: Transmitted as input to the Tanh-ReLU gating unit, its specific formula is:
[0039]
[0040] Among them, W z,k , U z,k , W h,k , U h,k , W r,k , U r,k and b z,k , b h,k , b r,k are weight parameters and bias vectors; σ represents the sigmoid function, and ⊙ represents element-level multiplication.
[0041] Finally, the outputs of different gating windows are The output of the multi-window gated network layer is obtained by splicing them together. In the embodiment of the present invention, the size of the gated window convolution kernel k is [3,5] respectively, then the output
[0042] The prediction output layer in step S3 and step S4 includes a fully connected layer and a CRF feature extraction layer. The fully connected layer is used to convert the vector dimension of each character from Transformed into the final output dimension, and then the output dimension of all characters in the training set is obtained. If the current character has a total of num_class labels, the vector dimension of the current character after full connection is num_class;
[0043] The vector after the fully connected layer will pass through the CRF layer. The CRF feature extraction layer is used to calculate the dependencies between labels to ensure that the generated label sequence is reasonable. When using CRF, the label sequence output by the model is the most likely label sequence for the entire sequence, not just the most likely label at a single time step. This helps solve the local consistency problem in sequence labeling and ensures that the output label sequence is consistent across the entire sequence.
[0044] In the CRF layer, each label is considered a state of the model, and each time step in the input sequence is considered an observation of the model. The CRF layer models the overall structure of the label sequence by learning transition probabilities and emission probabilities.
[0045] Specifically, the following steps are included:
[0046] (1) Calculate the transition probability between the annotated labels in the text sequence based on the text sequence with keywords;
[0047] In the training set of the power text of the present invention, the power text is annotated with BIEO, where B represents the beginning of the power keyword, I represents the middle of the power keyword, E represents the end of the power keyword, and O represents the remaining characters. For example, "the power system is a unified whole composed of generators in power plants, transformers and transmission lines in power grids, and various power-consuming equipment of users, which are connected according to certain rules" is annotated as "electricity-B, power-I, system-I, system-E, is-O, consists of-O, generation-O". "-B, electric, plant, E, within, the, generating, electric, machine, electric, power, network, E, within, the, transformer, B, and, transmission, electric, lines, E, as well as,-O, and,-O, users,-O, various, kinds, of, electric, equipment, E" as well as the unified whole formed by connecting according to a certain rule are all marked as O and will not be marked one by one here.
[0048] For a text sequence with keyword tags, the number of transitions from the annotation label corresponding to each character in the text sequence to the annotation label corresponding to each character only occurs between two adjacent characters, and the number of transitions only counts the number of transitions from the first character to the second character in two adjacent characters. Then, the corresponding transfer matrix is calculated based on the annotated text sequence, and then the Laplace smoothing constant is used to smooth the observed values of the transfer matrix to obtain an updated transfer matrix.
[0049] The desmoothing observation principle adopted by the present invention is: the 0th position is the starting word of the first keyword in the text sequence and is adjacent to the continuation words and the ending words of other keywords.
[0050] or the non-keyword character is adjacent to the continuation character or the end character of the first keyword, and the non-keyword character does not precede the continuation character of the first keyword;
[0051] Or the non-keyword word is adjacent to the continuation word of other keyword tags, and the non-keyword word is not in front of the continuation word of other keyword tags. If it does not meet the 0 position, all other positions are 1, and the intermediate matrix is obtained. The previous transfer matrix is added to the intermediate matrix to obtain the updated transfer matrix;
[0052] After normalizing the updated transfer matrix, the transfer probability is calculated, that is, the probability A of transferring from one label to another label is obtained. For example, the probability of transferring from "B" (the starting character of the power keyword) to "I" (the continuation character of the power keyword);
[0053] (2) Calculate the probability of observing a specific input given the label, that is, the emission probability B. For example,
[0054] For example, when the labels are "B", "I", "E" and "O", the probability of observing the character "electricity" in the keyword is [0.9, 0.85, 0.5, 0.1], which means that the probability of the label corresponding to the character "electricity" is B is 0.9, the probability of I is 0.85, the probability of E is 0.5, and the probability of O is 0.1.
[0055] (3) For a given input text sequence X with keywords and a corresponding label sequence Y, the model’s goal is to maximize the conditional probability P(Y|X), which determines the rationality between the label and the sequence;
[0056]
[0057] Among them, Score(X,Y) is the score of the model given the input sequence X and the label sequence Y. In the present invention, the transition probability between the current label and the next label corresponding to the same character in the given input text sequence and the emission probability of the current label under the character are considered. n is the length of the current input text sequence, and Y' represents the possible label sequence, that is, all the prediction results.
[0058] On the other hand, the present invention provides a system for extracting scientific research knowledge in the electric power industry, the system comprising:
[0059] Information collection module, used to collect power scientific research literature information and pre-process the collected literature information;
[0060] The corpus annotation module is used to construct a keyword dictionary in the field of power research, and obtain a corpus annotated with named entity recognition through machine annotation, thereby obtaining a training set;
[0061] A neural network model building module is used to train the training set using an improved BiLSTM-CNN-CRF network to complete keyword extraction of electric power scientific research knowledge. The improved BiLSTM-CNN-CRF network includes an input feature layer, a feature extraction layer, and a prediction output layer. The feature extraction layer includes a memory network layer and a multi-window gating network layer. The input character embedding vector passes through the memory network layer and the multi-window gating network layer in sequence. This process can better capture the associated information in the input sequence.
[0062] The storage module is used to store the electric power scientific research knowledge keywords obtained by the prediction output layer together with the electric power scientific research literature information into the graph database Neo4j.
[0063] Further, including:
[0064] In the neural network model building module, the input feature layer includes an embedding layer, and the processed power scientific research literature information is converted into a character embedding vector after passing through the embedding layer, specifically including:
[0065] A numbering unit, which is used for each word in the training set and assigns a unique number to each character;
[0066] A correspondence unit, for converting each character into a corresponding number and passing it as input to the embedding layer;
[0067] A conversion unit is used to convert the corresponding serial number of the embedding layer into a high-dimensional vector representation, wherein each character corresponds to an embedding vector.
[0068] Further, including:
[0069] In the neural network model building module, the multi-window gated network layer is used to capture local patterns and features in the input sequence, including:
[0070] The local feature information extraction unit is used to embed the characters obtained from the input layer into the vector X = [x1, x2, ..., x n ] is input into the multi-window gated network layer, and the local feature information of different granularities is extracted through convolution kernels of different sizes, where n is the total number of words in the electric power research literature information;
[0071] The enhancement unit is used to adjust the intensity of feature information transmission through the Tanh-ReLU gating unit, alleviate the gradient diffusion problem, and enhance the semantic information of local features;
[0072] The integration unit is used to integrate the local features using average pooling to form the final multi-granularity local feature information, and then obtain the output of the multi-window gated network layer.
[0073] Finally, the present invention also provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to implement the above-mentioned method for extracting scientific research knowledge from the power industry when executed by a processor.
[0074] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0075] (1) The present invention converts the preprocessed electric power scientific research literature information into a character embedding vector after passing through the embedding layer. The character embedding vector calculation method adopted is to vectorize each character in the electric power industry, which is more neat than directly using the relevant model to extract features and then obtain the relevant character embedding vector, that is, it reduces a lot of redundant invalid data information, thereby improving the extraction accuracy and correspondingly improving the extraction speed;
[0076] (2) The present invention improves the BiLSTM-CNN-CRF network model, not only in the input feature layer, but also in the final CRF feature extraction, using the Viterbi algorithm to complete keyword extraction. Specifically: the word embedding combined with the character representation is used as the input layer of the model. After bidirectional LSTM encoding, the probability values of all labels of each word are obtained. The CRF layer uses the output of LSTM and the transition probability matrix as input, and uses the Viterbi algorithm to obtain the global optimal output sequence, that is, to solve the final label prediction, rather than using the conventional dynamic optimization algorithm. This avoids the problems of processing invalid data and low accuracy in the conventional dynamic optimization algorithm, thereby not only having obvious advantages in speed, but also improving the accuracy compared with the traditional method. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 This is a flow chart of the extraction method described in an embodiment of the present invention;
[0078] Figure 2 A flow chart of a character embedding vector conversion method in an extraction method according to an embodiment of the present invention;
[0079] Figure 3 A flow chart of a method for implementing a multi-window gated network layer according to an embodiment of the present invention;
[0080] Figure 4 A schematic diagram of the structure of a corpus annotated with named entity recognition according to an embodiment of the present invention;
[0081] Figure 5 This is a schematic diagram of the memory network layer structure according to an embodiment of the present invention;
[0082] Figure 6 It is a schematic diagram of the structure of the extraction system described in an embodiment of the present invention. DETAILED DESCRIPTION
[0083] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0084] First, if Figure 1 As shown, the present invention provides a method for extracting scientific research knowledge in the power industry based on a neural network model, the method comprising:
[0085] S1 collects electric power scientific research literature information and preprocesses the collected literature information.
[0086] The collection of literature information described in step 1 is to crawl the power research literature knowledge in public documents such as CNKI using legal crawler methods, including literature titles, literature abstracts, and literature keywords;
[0087] The crawler method uses the Scrapy framework to search for different power keywords such as power system, power supply, motor, and power electronics on CNKI, and then performs distributed crawling.
[0088] S2 constructs a keyword dictionary in the field of electric power research and obtains a corpus annotated with named entity recognition through machine annotation.
[0089] like Figure 4 As shown, in step 2, the keyword dictionary in the field of electric power research is constructed by removing duplicates and noise from all the literature keywords to obtain a keyword dictionary in the field of electric power, matching the abstracts of some articles with the keyword dictionary, and using BIEO annotation in named entity recognition to obtain a training set for named entity recognition.
[0090] S3 uses an improved BiLSTM-CNN-CRF network to train the training set to complete the keyword extraction of electric power scientific research knowledge. The improved BiLSTM-CNN-CRF network includes an input feature layer, a feature extraction layer and a prediction output layer. The feature extraction layer includes a memory network layer and a multi-window gated network layer; the input character embedding vector passes through the memory network layer and the multi-window gated network layer in turn. This process can better capture the associated information in the input sequence.
[0091] In step S3, the input feature layer includes an embedding layer, and each character in the input text is converted into a corresponding character embedding vector after passing through the embedding layer, such as Figure 2 As shown, the specific steps include:
[0092] S21 collects each word in the training set and assigns a unique number to each character in the word;
[0093] S22 converts each character into a corresponding number and passes it as input to the embedding layer;
[0094] The embedding layer in S23 converts the corresponding serial number into a high-dimensional vector representation, wherein each character corresponds to an embedding vector.
[0095] The feature extraction layer includes a memory network layer and a multi-window gating network layer;
[0096] The character embedding vector obtained by the input layer passes through the memory network layer and the multi-window gated network layer in sequence;
[0097] Among them, Figure 5 As shown, in step S3, the memory network layer includes an input gate, a forget gate and an output gate. If the current time step is t, the character of the current time step is embedded in the vector x t , the hidden state h at the previous moment t-1 (forward) and memory cell state c t-1 (forward) As input, the hidden state h t (forward) The calculation formula is as follows:
[0098]
[0099] in, They are all weight parameters, σ represents the sigmoid function, and ⊙ represents element-level multiplication.
[0100] Similar to the forward calculation process above, the reverse process is calculated to obtain its hidden state h t (backward) , and then embed the character-based vector x t The hidden state h t (forward) and h t (backward) Concatenate to generate the output h of the memory network layer t =[h t (forward) ,h t (backward) ], so the vector x obtained after passing through the memory network layer t It is expressed as:
[0101]
[0102] Therefore, each input character embedding vector x t The dimension after the memory network layer is 2*hidden_num, where hidden_num is the number of forward hidden layers.
[0103] In step S3, the multi-window gated network layer is used to capture local patterns and features in the input sequence. The corresponding operation steps are as follows: Figure 3 Shown include:
[0104] S31 passes the corpus of the current keyword dictionary in the training set through the memory network layer to obtain the vector X = [x1, x2, ..., x n ]=[h1,h2,...,h n ] are sequentially input into the multi-window gated network layer, and local feature information of different granularities is extracted through convolution kernels of different sizes, where n is the length of the keyword dictionary, that is, the number of characters in the sentence;
[0105] S32 uses the Tanh-ReLU gating unit to regulate the intensity of feature information transmission, alleviate the gradient diffusion problem, and enhance the semantic information of local features;
[0106] S33 uses average pooling to integrate local features to form the final multi-granularity local feature information, and then obtains the output of the multi-window gated network layer.
[0107] Further, including:
[0108] The step S31 specifically includes:
[0109] In this embodiment of the present invention, h is directly used q express
[0110] An element in , where q∈[1,2n], will be the vector h obtained after passing through the memory network layer t Input to a multi-window convolutional layer, C k Indicates the use of window size, Represents the features obtained using a convolution kernel with a window size of k:
[0111]
[0112] Here Represents the features obtained using a convolution kernel with a window size of k, which obtains different values according to the forward hidden state and the backward hidden state.
[0113] The steps S32 and S33 specifically include: Transmitted as input to the Tanh-ReLU gating unit, its specific formula is:
[0114]
[0115] Among them, W z,k , U z,k , W h,k , U h,k , W r,k , U r,k and b z,k , b h,k , b r,kare weight parameters and bias vectors; σ represents the sigmoid function, and ⊙ represents element-level multiplication.
[0116] Finally, the outputs of different gating windows are The output of the multi-window gated network layer is obtained by splicing them together. In the embodiment of the present invention, the size of the gated window convolution kernel k is [3,5] respectively, then the output
[0117] The prediction output layer in step S3 and step S4 includes a fully connected layer and a CRF feature extraction layer. The fully connected layer is used to convert the vector dimension of each character from Transformed into the final output dimension, and then the output dimension of all characters in the training set is obtained. If the current character has a total of num_class labels, the vector dimension of the current character after full connection is num_class.
[0118] The vector after the fully connected layer will pass through the CRF layer. The CRF feature extraction layer is used to calculate the dependencies between labels to ensure that the generated label sequence is reasonable. When using CRF, the label sequence output by the model is the most likely label sequence for the entire sequence, not just the most likely label at a single time step. This helps solve the local consistency problem in sequence annotation and ensures that the output label sequence is consistent across the entire sequence. The principle of the CRF feature extraction layer is as follows:
[0119] In the CRF layer, each label is considered a state of the model, and each time step in the input sequence is considered an observation of the model. The CRF layer models the overall structure of the label sequence by learning transition probabilities and emission probabilities.
[0120] Transition probability: represents the probability of transitioning from one label to another. For example, the probability of transitioning from "B" (the beginning of the power keyword) to "I" (the middle of the power keyword);
[0121] Emission probability: represents the probability of observing a specific input given a label. For example, the probability of observing the character "electricity" given the label "I";
[0122] For a given input sequence X and the corresponding label sequence Y, the goal of the model is to maximize the conditional probability P(Y|X);
[0123]
[0124] Among them, Score(X,Y) is the score of the model given the input sequence X and the label sequence Y, which is calculated by the emission probability and the transition probability, and Y' represents the possible label sequence.
[0125] Specifically, the following steps are included:
[0126] (1) Calculate the transition probability between the annotated labels in the text sequence based on the text sequence with keywords;
[0127] In the training set of the power text of the present invention, the power text is annotated with BIEO, where B represents the beginning of the power keyword, I represents the middle of the power keyword, E represents the end of the power keyword, and O represents the remaining characters. For example, "the power system is a unified whole composed of generators in power plants, transformers and transmission lines in power grids, and various power-consuming equipment of users, which are connected according to certain rules" is annotated as "electricity-B, power-I, system-I, system-E, is-O, consists of-O, generation-O". "-B, electric, plant, E, within, the, generating, electric, machine, electric, power, network, E, within, the, transformer, B, and, transmission, electric, lines, E, as well as,-O, and,-O, users,-O, various, kinds, of, electric, equipment, E" as well as the unified whole formed by connecting according to a certain rule are all marked as O and will not be marked one by one here.
[0128] For a text sequence with keyword tags, the number of transitions from the annotation label corresponding to each character in the text sequence to the annotation label corresponding to each character only occurs between two adjacent characters, and the number of transitions only counts the number of transitions from the first character to the second character in two adjacent characters. Then, the corresponding transfer matrix is calculated based on the annotated text sequence, and then the Laplace smoothing constant is used to smooth the observed values of the transfer matrix to obtain an updated transfer matrix.
[0129] The desmoothing observation principle adopted by the present invention is: the 0th position is the starting word of the first keyword in the text sequence and is adjacent to the continuation words and the ending words of other keywords.
[0130] or the non-keyword character is adjacent to the continuation character or the end character of the first keyword, and the non-keyword character does not precede the continuation character of the first keyword;
[0131] Or the non-keyword word is adjacent to the continuation word of other keyword tags, and the non-keyword word is not in front of the continuation word of other keyword tags. If it does not meet the 0 position, all other positions are 1, and the intermediate matrix is obtained. The previous transfer matrix is added to the intermediate matrix to obtain the updated transfer matrix;
[0132] After normalizing the updated transfer matrix, the transfer probability is calculated, that is, the probability A of transferring from one label to another label is obtained. For example, the probability of transferring from "B" (the starting character of the power keyword) to "I" (the continuation character of the power keyword);
[0133] (2) Calculate the probability of observing a specific input given the label, that is, the emission probability B.
[0134] For example, when the labels are "B", "I", "E" and "O", the probability of observing the character "electricity" in the keyword is [0.1, 0.15, 0.05, 0.01], which means that the probability of the label corresponding to the character "electricity" is B is 0.1, the probability of I is 0.15, the probability of E is 0.05, and the probability of O is 0.01.
[0135] (3) For a given input text sequence X with keywords and a corresponding label sequence Y, the model’s goal is to maximize the conditional probability P(Y|X), which determines the rationality between the label and the sequence;
[0136]
[0137] Among them, Score (X, Y) is the score of the model given input sequence X and label sequence Y. Due to the obviousness and coherence of the characters between the keywords in the field of electric power research, that is, the keywords in the field of electric power research are significantly different from other words, and generally the keywords are more than 3 characters, therefore, the present invention considers the transition probability between the current label and the next label corresponding to the same character in a given input text sequence, as well as the emission probability of the current label under the character, n is the length of the current input text sequence, and Y' represents the possible label sequence, that is, all the prediction results.
[0138] In the entity recognition of the power data set, the BLCNN-CRF network constructed by the present invention is experimentally compared with the traditional entity recognition CNN and BiLSTM networks. The evaluation indicators are accuracy and recall. The experiment shows that the accuracy can be improved from 83.76% to 86.90%, and the recall rate can be improved from 80.86% to 83.25%, reaching the current advanced level in the industry.
[0139] S4 stores the electric power research knowledge keywords obtained by the prediction output layer together with the electric power research literature information into the graph database Neo4j.
[0140] The electric power research knowledge described in step 4 is subjected to named entity recognition to obtain the key entities contained therein, which is to put the electric power research knowledge extracted in step 1 into the trained BLCNN-CRF neural network to obtain the electric power research knowledge keywords contained in the electric power research knowledge. Finally, some keywords and corresponding labels are input into the trained model as a test set to obtain the test results. This model can be used to quickly and accurately extract keywords from electric power research knowledge documents in the future.
[0141] The data visualization described in step 4 is specifically to store the crawled electric power research literature knowledge and electric power research knowledge keywords into the graph database Neo4j.
[0142] The present invention proposes a method for electric power scientific research knowledge, completes the construction of an electric power dictionary and a data set for named entity recognition of electric power knowledge, creates a BLCNN-CRF network model, completes the keyword extraction of electric power scientific research knowledge, and finally stores the extracted data in Neo4j. Its function is to quickly obtain the keywords of electric power scientific research literature and accurately obtain the required electric power scientific research knowledge.
[0143] The present invention effectively automates the construction of power data sets, and the BLCNN-CRF model also improves the accuracy of extracting entity relationships in the power field. Compared with traditional methods, it not only has obvious advantages in speed, but also has improved accuracy.
[0144] On the other hand, Figure 6 As shown, the present invention provides a system for extracting scientific research knowledge in the electric power industry, the system comprising:
[0145] Information collection module, used to collect power scientific research literature information and pre-process the collected literature information;
[0146] The corpus annotation module is used to construct a keyword dictionary in the field of power research, and obtain a corpus annotated with named entity recognition through machine annotation, thereby obtaining a training set;
[0147] A neural network model building module is used to train the training set using an improved BiLSTM-CNN-CRF network to complete keyword extraction of electric power scientific research knowledge. The improved BiLSTM-CNN-CRF network includes an input feature layer, a feature extraction layer, and a prediction output layer. The feature extraction layer includes a memory network layer and a multi-window gating network layer. The input character embedding vector passes through the memory network layer and the multi-window gating network layer in sequence. This process can better capture the associated information in the input sequence.
[0148] The storage module is used to store the electric power scientific research knowledge keywords obtained by the prediction output layer together with the electric power scientific research literature information into the graph database Neo4j.
[0149] Further, including:
[0150] In the neural network model building module, the input feature layer includes an embedding layer, and the processed power scientific research literature information is converted into a character embedding vector after passing through the embedding layer, specifically including:
[0151] The numbering unit is used to collect each word in the power research literature information and assign a unique number to each character;
[0152] A corresponding unit, used for converting characters in the electric power scientific research literature information into corresponding numbers and passing them as input to the embedding layer;
[0153] A conversion unit is used to convert the corresponding serial number of the embedding layer into a high-dimensional vector representation, wherein each character corresponds to an embedding vector.
[0154] Further, including:
[0155] In the neural network model building module, the multi-window gated network layer is used to capture local patterns and features in the input sequence, including:
[0156] The local feature information extraction unit is used to embed the characters obtained from the input layer into the vector X = [x1, x2, ..., x n ] is input into the multi-window gated network layer, and the local feature information of different granularities is extracted through convolution kernels of different sizes, where n is the total number of words in the electric power research literature information;
[0157] The enhancement unit is used to adjust the intensity of feature information transmission through the Tanh-ReLU gating unit, alleviate the gradient diffusion problem, and enhance the semantic information of local features;
[0158] The integration unit is used to integrate the local features using average pooling to form the final multi-granularity local feature information, and then obtain the output of the multi-window gated network layer.
[0159] The other technical details and methods corresponding to this system are the same and will not be repeated in this specification.
[0160] Finally, the present invention also provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to implement the above-mentioned method for extracting scientific research knowledge from the power industry when executed by a processor.
[0161] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0162] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0163] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present invention without departing from the spirit and scope of the embodiments of the present invention. Thus, if these modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for extracting scientific research knowledge in the power industry, characterized in that: The method comprises the following steps: S1 collects power scientific research literature information and preprocesses the collected literature information; S2 builds a keyword dictionary in the field of power research and obtains a corpus of named entity recognition annotations through machine annotation to obtain a training set; S3 uses an improved BiLSTM-CNN-CRF network to train the training set and complete the keyword extraction of power scientific research knowledge. The improved BiLSTM-CNN-CRF network includes an input feature layer, a feature extraction layer and a prediction output layer. The feature extraction layer includes a memory network layer and a multi-window gating network layer. The input character embedding vector passes through the memory network layer and the multi-window gating network layer in turn. This process can better capture the associated information in the input sequence. S4 stores the electric power research knowledge keywords obtained by the prediction output layer together with the electric power research literature information into the graph database Neo4j; The input feature layer includes an embedding layer, and the processed electric power research literature information is converted into a character embedding vector after passing through the embedding layer, specifically including: S21 collects each word in the training set and assigns a unique number to each character in the word; S22 converts each character into a corresponding number and passes it as input to the embedding layer; S23: the embedding layer converts the corresponding serial number into a high-dimensional vector representation, wherein each character corresponds to a character embedding vector; The prediction output layer includes a fully connected layer and a CRF feature extraction layer. The fully connected layer is used to transform the vector dimension of each character from the output of different gated windows. The concatenated vector is transformed into the dimension of the final output. If the character labels have num_class types, the vector dimension of the character after full connection is num_class; The vector after the fully connected layer will pass through the CRF layer. The CRF feature extraction layer is used to calculate the dependency between labels to ensure that the generated label sequence is reasonable. When using CRF, the label sequence output by the model is the most likely label sequence in the entire sequence, which helps to solve the local consistency problem in sequence labeling and ensure that the output label sequence is consistent in the entire sequence. In the CRF layer, each label is regarded as a state of the model, and each time step in the input sequence is regarded as an observation value of the model. The CRF layer models the overall structure of the label sequence by learning the transition probability and emission probability; specifically, the following steps are included: (1) Calculate the transition probability between the annotated labels in the text sequence based on the text sequence with keywords; In the training set of power text, the power text is annotated by BIEO, B represents the beginning of the power keyword, I represents the middle of the power keyword, E represents the end of the power keyword, and O represents the remaining characters. For a text sequence with a keyword tag, the number of transitions from the tag corresponding to each character in the text sequence to the tag corresponding to each character only occurs between two adjacent characters, and the number of transitions only counts the number of transitions from the first character to the second character in two adjacent characters, and then the corresponding transfer matrix is calculated according to the annotated text sequence, and then the Laplace smoothing constant is used to smooth the observed value of the transfer matrix to obtain an updated transfer matrix; The desmoothing observation principle adopted is: the 0th position is the starting word of the first keyword in the text sequence adjacent to the continuation words and the ending words of other keywords, or the non-keyword character is adjacent to the continuation character or the end character of the first keyword, and the non-keyword character does not precede the continuation character of the first keyword; Or the non-keyword word is adjacent to the continuation word of other keyword labels, and the non-keyword word is not in front of the continuation word of other keyword labels; other positions that do not meet the 0 position are all 1, and the intermediate matrix is obtained. The previous transfer matrix is added to the intermediate matrix to obtain the updated transfer matrix; After normalizing the updated transfer matrix, the transfer probability is calculated, that is, the probability A of transferring from one label to another is obtained; (2) Calculate the probability of observing a specific input given the label, that is, the emission probability B; (3) For a given input text sequence X with keywords and a corresponding label sequence Y, the model’s goal is to maximize the conditional probability P(Y|X), which determines the rationality between the label and the sequence; Among them, Score(X,Y) is the score of the model given the input sequence X and the label sequence Y. In the present invention, the transition probability between the current label and the next label corresponding to the same character in the given input text sequence and the emission probability of the current label under the character are considered. n is the length of the current input text sequence, and Y' represents the possible label sequence, that is, all the prediction results.
2. The method for extracting scientific research knowledge from the electric power industry according to claim 1 is characterized in that: In step S3, the memory network layer includes an input gate, a forget gate and an output gate. If the current time step is t, the character of the current time step is embedded in the vector x t , the hidden state h at the previous moment t-1 (forward) and memory cell state c t-1 (forward) As input, the hidden state h t (forward) The calculation formula is as follows: in, are all weight parameters, σ represents the sigmoid function, and ⊙ represents element-level multiplication; Similar to the forward calculation process above, the reverse process is calculated to obtain its hidden state h t (backward) , and then h t (forward) and h t (backward) Concatenate to generate the output h of the memory network layer t =[h t (forward) ,h t (backward) ]; Therefore, the dimension of each input character embedding vector after passing through the memory network layer is 2*hidden_num, where hidden_num is the number of forward hidden layers.
3. The method for extracting scientific research knowledge from the electric power industry according to claim 2 is characterized in that: In step S3, the multi-window gated network layer is used to capture local patterns and features in the input sequence, and the corresponding operation steps include: S31 inputs the vector obtained after passing through the memory network layer into the multi-window gated network layer, and extracts local feature information of different granularities through convolution kernels of different sizes; S32 uses the Tanh-ReLU gating unit to regulate the intensity of feature information transmission, alleviate the gradient diffusion problem, and enhance the semantic information of local features; S33 uses average pooling to integrate local features to form the final multi-granularity local feature information, and then obtains the output of the multi-window gated network layer.
4. The method for extracting scientific research knowledge from the electric power industry according to claim 3 is characterized in that: The step S31 specifically includes: The embedding vector of the tth character obtained after passing through the memory network layer is represented as h t , input to a multi-window convolutional layer, where C k Indicates the use of window size, Represents the features obtained using a convolution kernel with a window size of k: The steps S32 and S33 specifically include: Transmitted as input to the Tanh-ReLU gating unit, its specific formula is: Among them, W z,k , U z,k , W h,k , U h,k , W r,k , U r,k and b z,k , b r,k , b h,k are weight parameters and bias vectors; σ represents the sigmoid function, and ⊙ represents element-level multiplication; Finally, the outputs of different gating windows are Splice together to get the output of the multi-window gating network layer.
5. An extraction system implemented by the method for extracting scientific research knowledge in the electric power industry according to claim 1, characterized in that: The system includes: Information collection module, used to collect power scientific research literature information and pre-process the collected literature information; The corpus annotation module is used to construct a keyword dictionary in the field of power research, obtain a corpus annotated with named entity recognition through machine annotation, and obtain a training set; A neural network model building module is used to train the training set using an improved BiLSTM-CNN-CRF network to complete keyword extraction of power scientific research knowledge. The improved BiLSTM-CNN-CRF network includes an input feature layer, a feature extraction layer, and a prediction output layer. The feature extraction layer includes a memory network layer and a multi-window gating network layer. The input character embedding vector passes through the memory network layer and the multi-window gating network layer in sequence. This process can better capture the associated information in the input sequence. A storage module, used to store the electric power scientific research knowledge keywords obtained by the prediction output layer together with the electric power scientific research literature information into the graph database Neo4j; In the neural network model building module, the input feature layer includes an embedding layer, and the processed power scientific research literature information is converted into a character embedding vector after passing through the embedding layer, specifically including: The numbering unit is used to collect each word in the training set and assign a unique number to each character in the word; A correspondence unit, for converting each character into a corresponding number and passing it as input to the embedding layer; A conversion unit is used to convert the corresponding serial number of the embedding layer into a high-dimensional vector representation, wherein each character corresponds to a character embedding vector.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for extracting scientific research knowledge from the electric power industry as described in any one of claims 1-4 when executed.
