Chinese equipment fault mode entity relationship extraction method, device and equipment

By building a Chinese equipment failure mode entity relationship extraction model, using the pre-trained ChineseBERT model and BiLSTM model to generate Chinese character granular embedding vectors and extracting features, combined with the multi-head self-attention mechanism and residual neural network, we have solved the problem of insufficient performance in the existing technology. The problem of mining Chinese features improves the accuracy of entity relationship extraction.

CN118709694AActive Publication Date: 2024-09-27NAT UNIV OF DEFENSE TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410945991.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-09-27
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

Existing entity relationship extraction methods fail to fully mine the Chinese multi-feature information of Chinese equipment failure mode text data, making it difficult to accurately extract entity relationships when the equipment failure mode text data set is insufficient.

Method used

Construct a Chinese equipment failure mode entity relationship extraction model, including an embedding vector generation module, a preliminary local feature extraction module, a local and global feature iterative extraction module, and an entity relationship triplet generation module. The Chinese character granular embedding is generated by pre-training the ChineseBERT model and the BiLSTM model. Vector, perform preliminary extraction of subject-object local correlation and iterative extraction of global correlation, combine with multi-head self-attention mechanism and residual neural network to generate entity relationship prediction triples.

Benefits of technology

It improves the accuracy of entity relationship extraction in equipment failure mode text data, can generate high-quality embedding vectors and rich Chinese feature information when the data set is relatively insufficient, and enhances the accuracy of entity relationship triplet generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118709694A
    Figure CN118709694A
Patent Text Reader

Abstract

The invention relates to a Chinese equipment failure mode entity relationship extraction method, device and equipment. The method comprises the following steps: constructing a Chinese equipment fault mode entity relationship extraction model; wherein the Chinese equipment fault mode entity relationship extraction model is composed of an embedded vector generation module, a local feature preliminary extraction module, a local and global feature iteration extraction module and an entity relationship triple generation module; training the Chinese equipment fault mode entity relationship extraction model by using the training sample set to obtain a trained Chinese equipment fault mode entity relationship extraction model; and inputting a Chinese statement of a Chinese entity relationship to be extracted in the equipment fault mode into the trained Chinese equipment fault mode entity relationship extraction model to obtain an entity relationship prediction triple of the Chinese statement. By adopting the method, the accuracy of extracting the entity relationship of the Chinese equipment fault mode text data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of entity relationship extraction, and in particular to a method, device and equipment for extracting entity relationships of Chinese equipment failure modes. Background Art

[0002] Entity relationship extraction is a task in natural language processing, which aims to identify the semantic relationship between entities from text and form entity relationship triples, usually presented in the form of subject, relationship, and object. Entity relationship extraction is a very important link in the fields of information retrieval, knowledge graph construction, text mining, etc.

[0003] The task of extracting entity relationships from Chinese equipment failure mode text data is a research hotspot in the field of natural language processing. However, the existing entity relationship extraction methods do not fully exploit the Chinese multi-feature information of Chinese equipment failure mode text data, and it is difficult to accurately extract entity relationships when the Chinese equipment failure mode text data set is relatively insufficient. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device and equipment for extracting entity relations of Chinese equipment failure modes in response to the above technical problems.

[0005] A method for extracting entity relations of Chinese equipment failure modes, the method comprising:

[0006] Construct a Chinese equipment fault mode entity relationship extraction model; the Chinese equipment fault mode entity relationship extraction model consists of an embedding vector generation module, a local feature preliminary extraction module, a local and global feature iterative extraction module, and an entity relationship triple generation module;

[0007] The training sample set is used to train the Chinese equipment failure mode entity relationship extraction model to obtain a trained Chinese equipment failure mode entity relationship extraction model; wherein the training sample set includes Chinese sentence samples of equipment failure mode and corresponding entity relationship triple samples;

[0008] The Chinese sentences of the Chinese entity relations to be extracted in the equipment failure mode are input into the trained Chinese equipment failure mode entity relationship extraction model, and the Chinese character granularity embedding vector of the input Chinese sentence is generated according to the embedding vector generation module in the model. The local feature preliminary extraction module performs preliminary extraction of subject and object local associations on the Chinese character granularity embedding vector, and the local and global feature iterative extraction module performs local and global association iterative extraction on the preliminary extracted subject and object features. After the iterative extraction is completed, the iteratively extracted subject and object features are tripled according to the filling strategy adopted by the entity relationship triplet generation module to obtain the entity relationship prediction triplet of the Chinese sentence.

[0009] In one embodiment, the embedding vector generation module is the first module of the Chinese equipment failure mode entity relationship extraction model, the local feature preliminary extraction module is the second module of the Chinese equipment failure mode entity relationship extraction model, the local and global feature iterative extraction module includes the third module, the fourth module and the fifth module of the Chinese equipment failure mode entity relationship extraction model, and the entity relationship triple generation module is the sixth module of the Chinese equipment failure mode entity relationship extraction model;

[0010] Among them, the output end of the first module is connected to the input end of the second module; the output end of the second module is connected to the input end of the third module; the output end of the third module is respectively connected to the input end of the fourth module and the input end of the sixth module; the output end of the fourth module is connected to the input end of the fifth module; the output end of the fifth module is connected to the input end of the third module; the input end of the first module is the input end of the Chinese equipment failure mode entity relationship extraction model; the output end of the sixth module is the output end of the Chinese equipment failure mode entity relationship extraction model.

[0011] In one embodiment, the first module is a pre-trained ChineseBERT model, which is used to generate a Chinese character granularity embedding vector of an input Chinese sentence, and output the Chinese character granularity embedding vector to the input end of the second module; wherein the Chinese character granularity embedding vector is composed of pinyin and characters; wherein the i-th Chinese character c in the input Chinese sentence i The corresponding Chinese character granularity embedding vector is expressed as

[0012]

[0013] In one embodiment, the second module is a BiLSTM model, which is used to use a forward-backward calculation method to perform a preliminary extraction of subject-object local associations on the Chinese character granularity embedding vector output by the first module, obtain preliminary extracted subject features and object features, and output them to the input end of the third module;

[0014] Among them, the forward calculation and backward calculation of the BiLSTM model are symmetrical to each other. The forward calculation process is expressed as

[0015]

[0016] Among them, H s is the main feature extracted initially, H o is the initially extracted object feature, H is the Chinese sentence processed by vector encoding and BiLSTM model, the subscript 1 / 2 indicates two independent networks, and f t represents the BiLSTM forget gate at the tth iteration, Represents the BiLSTM forget gate weights corresponding to the subject and the object; Indicates the BiLSTM forget gate bias corresponding to the subject and the object; i t represents the first memory gate of BiLSTM at the tth iteration; σ() represents the sigmoid activation function, Represents the weight of the first memory gate of BiLSTM corresponding to the subject and the object; Indicates the bias of the first memory gate of BiLSTM corresponding to the subject and the object; represents the second memory gate of BiLSTM at the tth iteration, Represents the weight of the second memory gate of BiLSTM corresponding to the subject and the object; Indicates the bias of the second memory gate of BiLSTM corresponding to the subject and the object; C t represents the first output gate of BiLSTM at the tth iteration, o t represents the second output gate of BiLSTM at the tth iteration; Represents the weight of the second output gate of BiLSTM corresponding to the subject and the object, Represents the bias of the second output gate of BiLSTM corresponding to the subject and the object, represents the second output gate of BiLSTM corresponding to the subject at the tth iteration, Indicates that the subject at the tth iteration corresponds to the first output gate of BiLSTM, represents the second output gate of BiLSTM corresponding to the object at the tth iteration, Represents the first output gate of the BiLSTM corresponding to the object at the tth iteration.

[0017] In one embodiment, the third module is composed of a first fully connected layer, which is used to generate a table label feature for each relationship based on the subject features and object features initially extracted by the second module, and output the table label feature to the input end of the fourth module before the iterative extraction of the subject and object features is completed; after the iterative extraction of the subject and object features is completed, the table label feature generated by the last iteration is output to the input end of the sixth module;

[0018] Among them, the table label feature of relation r at the tth iteration is expressed as Each item in the table represents a token pair label feature. The token pair is the vector representation of the entity after vector encoding. A pair of token pairs (w i ,w j ) is represented by the table label feature

[0019]

[0020] Among them, ReLU is the activation function, represents the token w extracted at the tth iteration i The corresponding main features, represents the token w extracted at the tth iteration j The corresponding object characteristics, represents the Hadamard product, W r represents the weight of the first fully connected layer corresponding to the relation r, b r Represents the bias of the first fully connected layer corresponding to relation r, and the subscripts i and j represent the index subscripts of the token pair.

[0021] In one embodiment, the fourth module is composed of a splicing module, a multi-head self-attention layer, a multi-head attention layer and a second fully connected layer connected in sequence; the splicing module is used to horizontally splice the multi-head self-attention layer, the multi-head attention layer and the second fully connected layer; the multi-head self-attention layer is used to obtain the table label features of each relationship output by the third module, and use the multi-head self-attention mechanism to mine the local association between each relationship; the multi-head attention layer is used to further mine the association between token pairs based on the local association between each relationship obtained by mining; the second fully connected layer is used to further mine the association between token pairs from the perspective of the entire Chinese sentence based on the association between the acquired token pairs, and output the mining results to the input end of the fifth module;

[0022] Among them, the calculation formula of the fourth module is expressed as

[0023]

[0024] Among them, MultiHeadSelfAtt represents the multi-head self-attention mechanism, MultiHeadAtt represents the multi-head attention mechanism, H represents the Chinese sentence processed by vector encoding and BiLSTM model, ReLU is the activation function, FM represents the table label features containing all relations after the t-th iteration of mining by the multi-head self-attention layer. (t) represents the label features of the table containing all relations at the tth iteration, represents the table label features containing all relations after the t-th iteration of the multi-head attention layer mining, H'( t ) represents the table label features containing all relations after the t-th iteration mining of the second fully connected layer, W represents the weight of the second fully connected layer, and b represents the bias of the second fully connected layer.

[0025] In one embodiment, the fifth module is composed of a maximum pooling layer, a third fully connected layer and a residual neural network; the fifth module is used to obtain the result output by the fourth module, perform global correlation iterative extraction through the maximum pooling layer and the third fully connected layer, generate subject-related table features and object-related table features, and input the subject-related table features and object-related table features into the residual neural network, generate iteratively extracted subject features and object features through the residual neural network, and output them to the input end of the third module;

[0026] Among them, the subject-related table features generated at the t+1th iteration Object-related table features Respectively expressed as

[0027]

[0028] Among them, maxpool represents the maximum pooling, W s represents the weight of the third fully connected layer corresponding to the subject, b s represents the bias of the third fully connected layer corresponding to the main body, W o represents the weight of the third fully connected layer corresponding to the object, b o represents the bias of the third fully connected layer corresponding to the object;

[0029] The main features extracted at the t+1th iteration Object characteristics Respectively expressed as

[0030]

[0031] Among them, LayerNorm represents normalization processing, represents the main features extracted in the tth iteration, Represents the object features extracted at the tth iteration.

[0032] In one embodiment, the sixth module is used to obtain the table label features of each relationship output by the third module in the last iteration, fill the table label features of each relationship into the table according to a preset table filling strategy, extract an entity pair for each relationship by decoding the filled table, perform entity relationship matching on each entity pair according to a preset relationship type, and generate an entity relationship prediction triple; wherein the entity pair consists of a subject and an object, and the entity relationship prediction triple consists of a subject, a relationship, and an object;

[0033] The form filling strategy is expressed as

[0034]

[0035] Among them, softmax is a normalized exponential function, tabler (i,j) is a token pair (w i ,w j ) The relationship classification results in the table, represents the table label features of relation r at the Nth iteration, Denotes the predicted token pair (w i ,w j ) all relationship classification results in the table, which contains multiple relationship results, represents the set of all relations L, represents a set, L represents the number of relations, and l represents the predicted relation type; argmax represents finding all predicted relations such that The relation with the largest value is taken as the relation classification result;

[0036] Among them, there are three parallel search routes in the table decoding process to extract entity pairs for each relationship, namely the forward search route, the reverse search route and the single search route; the forward search route generates entity pairs in the order from subject to object, and the reverse search route generates entity pairs in the order from object to subject; the single search route generates a single entity pair.

[0037] In one embodiment, a training sample set is used to train a Chinese equipment failure mode entity relationship extraction model to obtain a trained Chinese equipment failure mode entity relationship extraction model, including:

[0038] Input the Chinese sentence samples of equipment failure modes in the training sample set into the Chinese equipment failure mode entity relationship extraction model to extract entity relationships and obtain entity relationship prediction triples;

[0039] The cross entropy loss function between the entity relationship prediction triples and the entity relationship triple samples in the training sample set is calculated, and the Chinese equipment failure mode entity relationship extraction model is trained according to the cross entropy loss function to obtain the trained Chinese equipment failure mode entity relationship extraction model.

[0040] A Chinese equipment failure mode entity relationship extraction device, the device comprising:

[0041] A model building unit is used to build a Chinese equipment fault mode entity relationship extraction model; wherein the Chinese equipment fault mode entity relationship extraction model is composed of an embedding vector generation module, a local feature preliminary extraction module, a local and global feature iterative extraction module, and an entity relationship triple generation module;

[0042] A model training unit is used to train the Chinese equipment failure mode entity relationship extraction model using a training sample set to obtain a trained Chinese equipment failure mode entity relationship extraction model; wherein the training sample set includes Chinese sentence samples of equipment failure modes and corresponding entity relationship triple samples;

[0043] The entity relationship extraction unit is used to input the Chinese sentence of the Chinese entity relationship to be extracted in the equipment failure mode into the trained Chinese equipment failure mode entity relationship extraction model, generate the Chinese character granularity embedding vector of the input Chinese sentence according to the embedding vector generation module in the model, perform preliminary extraction of subject and object local associations on the Chinese character granularity embedding vector according to the local feature preliminary extraction module, perform local and global association iterative extraction on the preliminary extracted subject and object features according to the local and global feature iterative extraction module, and after the iterative extraction is completed, perform triples on the iteratively extracted subject and object features according to the filling strategy adopted by the entity relationship triple generation module to obtain the entity relationship prediction triples of the Chinese sentence.

[0044] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0045] Construct a Chinese equipment fault mode entity relationship extraction model; the Chinese equipment fault mode entity relationship extraction model consists of an embedding vector generation module, a local feature preliminary extraction module, a local and global feature iterative extraction module, and an entity relationship triple generation module;

[0046] The training sample set is used to train the Chinese equipment failure mode entity relationship extraction model to obtain a trained Chinese equipment failure mode entity relationship extraction model; wherein the training sample set includes Chinese sentence samples of equipment failure mode and corresponding entity relationship triple samples;

[0047] The Chinese sentences of the Chinese entity relations to be extracted in the equipment failure mode are input into the trained Chinese equipment failure mode entity relationship extraction model, and the Chinese character granularity embedding vector of the input Chinese sentence is generated according to the embedding vector generation module in the model. The local feature preliminary extraction module performs preliminary extraction of subject and object local associations on the Chinese character granularity embedding vector, and the local and global feature iterative extraction module performs local and global association iterative extraction on the preliminary extracted subject and object features. After the iterative extraction is completed, the iteratively extracted subject and object features are tripled according to the filling strategy adopted by the entity relationship triplet generation module to obtain the entity relationship prediction triplet of the Chinese sentence.

[0048] The above-mentioned Chinese equipment failure mode entity relationship extraction method, device and equipment extract entity relationships of equipment failure mode text data by constructing and training a Chinese equipment failure mode entity relationship extraction model. The constructed entity relationship extraction model consists of an embedding vector generation module, a local feature preliminary extraction module, a local and global feature iterative extraction module and an entity relationship triple generation module. Among them, the embedding vector generation module can help the model obtain high-quality embedding vectors when the equipment failure mode text data set is relatively insufficient by generating Chinese character granularity embedding vectors for the input Chinese sentence, and enrich the Chinese feature dimensions in the embedding vector. In addition, the local feature preliminary extraction module and the local and global feature iterative extraction module realize full attention to the Chinese multi-feature information of the Chinese equipment failure mode text data by mining the local and global associations between the subject and the object in the input sentence, thereby improving the accuracy of the entity relationship prediction triples generated by the subsequent entity relationship triple generation module. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of a flow chart of a method for extracting entity relations of Chinese equipment failure modes in one embodiment;

[0050] Figure 2 A schematic diagram of the structure of a Chinese equipment failure mode entity relationship extraction model constructed in an embodiment;

[0051] Figure 3 A schematic diagram of a form filling strategy in an embodiment;

[0052] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] In one embodiment, Figure 1 As shown, a method for extracting entity relations of Chinese equipment failure modes is provided, comprising the following steps:

[0055] Step S1, constructing a Chinese equipment failure mode entity relationship extraction model; wherein the Chinese equipment failure mode entity relationship extraction model consists of an embedding vector generation module, a local feature preliminary extraction module, a local and global feature iterative extraction module, and an entity relationship triplet generation module.

[0056] Among them, the Chinese equipment failure mode entity relationship extraction model constructed by this application is also called the UREF model. The meanings of the letters in UREF are: (1) U stands for Unified, which means unified; (2) RE stands for Relation Extraction, that is, this model is used for relationship extraction; (3) F stands for Framework, which means framework. The overall meaning of UREF is: a unified entity relationship extraction framework for equipment failure mode constructed using BiLSTM and a large language model. The UREF model of this application can achieve good accuracy in both English general domain and Chinese equipment failure mode based on local and global associations to fill in the relationship table and perform entity relationship extraction.

[0057] Step S2, using the training sample set to train the Chinese equipment failure mode entity relationship extraction model to obtain a trained Chinese equipment failure mode entity relationship extraction model; wherein the training sample set includes Chinese sentence samples of equipment failure modes and corresponding entity relationship triple samples.

[0058] Step S3: input the Chinese sentence of the Chinese entity relationship to be extracted in the equipment failure mode into the trained Chinese equipment failure mode entity relationship extraction model; generate the Chinese character granularity embedding vector of the input Chinese sentence according to the embedding vector generation module in the model; perform preliminary extraction of subject and object local association on the Chinese character granularity embedding vector according to the local feature preliminary extraction module; perform local and global association iterative extraction on the preliminary extracted subject and object features according to the local and global feature iterative extraction module; and after the iterative extraction is completed, perform triple generation on the iteratively extracted subject and object features according to the filling-in strategy adopted by the entity relationship triple generation module to obtain the entity relationship prediction triple of the Chinese sentence.

[0059] In one embodiment, if Figure 2 As shown, the embedding vector generation module is the first module of the Chinese equipment failure mode entity relationship extraction model, the local feature preliminary extraction module is the second module of the Chinese equipment failure mode entity relationship extraction model, the local and global feature iterative extraction module includes the third module, the fourth module and the fifth module of the Chinese equipment failure mode entity relationship extraction model, and the entity relationship triplet generation module is the sixth module of the Chinese equipment failure mode entity relationship extraction model;

[0060] Among them, the output end of the first module is connected to the input end of the second module; the output end of the second module is connected to the input end of the third module; the output end of the third module is respectively connected to the input end of the fourth module and the input end of the sixth module; the output end of the fourth module is connected to the input end of the fifth module; the output end of the fifth module is connected to the input end of the third module; the input end of the first module is the input end of the Chinese equipment failure mode entity relationship extraction model; the output end of the sixth module is the output end of the Chinese equipment failure mode entity relationship extraction model.

[0061] In one embodiment, the first module is a pre-trained ChineseBERT model, which is used to generate a Chinese character granularity embedding vector of an input Chinese sentence, and output the Chinese character granularity embedding vector to the input end of the second module; wherein the Chinese character granularity embedding vector is composed of pinyin and characters; wherein the i-th Chinese character c in the input Chinese sentence i The corresponding Chinese character granularity embedding vector is expressed as

[0062]

[0063] Among them, ChineseBERT starts from these two characteristics of Chinese characters themselves, and integrates the glyph and pinyin feature information of Chinese characters into the pre-training process of Chinese corpus. For glyph information, it vectorizes the text image, and then uses the fully connected layer to obtain glyph embedding; for pinyin information, it uses CNN (convolutional neural network) to extract the information contained in the pinyin sequence corresponding to the text, and obtains the pinyin embedding after maximum pooling. The fusion vector obtained by fusing glyph embedding, pinyin embedding and word vector is the input of the pre-training model. Through Whole Word Masking (full word masking) and Character Masking (character masking) training, the model can learn the association information between Chinese characters, glyphs, pronunciations and contexts very well. Specifically, the ChineseBERT-base model open sourced on Huggingface is used in this embodiment. The Chinese character granularity embedding vector of the input Chinese sentence is generated by the ChineseBERT-base model, which can supplement the glyph and pinyin information in the Chinese character embedding vector, enrich the information of the embedding vector, and help to correctly complete the entity relationship extraction task.

[0064] In one embodiment, the second module is a BiLSTM model, which is used to use a forward-backward calculation method to perform a preliminary extraction of subject-object local associations on the Chinese character granularity embedding vector output by the first module, obtain preliminary extracted subject features and object features, and output them to the input end of the third module;

[0065] Among them, the forward calculation and backward calculation of the BiLSTM model are symmetrical to each other. The forward calculation process is expressed as

[0066]

[0067] Among them, H s is the main feature extracted initially, H o is the initially extracted object feature, H is the Chinese sentence processed by vector encoding and BiLSTM model, the subscript 1 / 2 indicates two independent networks, and f trepresents the BiLSTM forget gate at the tth iteration, Represents the BiLSTM forget gate weights corresponding to the subject and the object; Indicates the BiLSTM forget gate bias corresponding to the subject and the object; i t represents the first memory gate of BiLSTM at the tth iteration; σ() represents the sigmoid activation function, Represents the weight of the first memory gate of BiLSTM corresponding to the subject and the object; Indicates the bias of the first memory gate of BiLSTM corresponding to the subject and the object; represents the second memory gate of BiLSTM at the tth iteration, Represents the weight of the second memory gate of BiLSTM corresponding to the subject and the object; Indicates the bias of the second memory gate of BiLSTM corresponding to the subject and the object; C t represents the first output gate of BiLSTM at the tth iteration, o t represents the second output gate of BiLSTM at the tth iteration; Represents the weight of the second output gate of BiLSTM corresponding to the subject and the object, Represents the bias of the second output gate of BiLSTM corresponding to the subject and the object, represents the second output gate of BiLSTM corresponding to the subject at the tth iteration, Indicates that the subject at the tth iteration corresponds to the first output gate of BiLSTM, represents the second output gate of BiLSTM corresponding to the object at the tth iteration, Represents the first output gate of the BiLSTM corresponding to the object at the tth iteration.

[0068] In one embodiment, the third module is composed of a first fully connected layer, which is used to generate a table label feature for each relationship based on the subject features and object features initially extracted by the second module, and output the table label feature to the input end of the fourth module before the iterative extraction of the subject and object features is completed; after the iterative extraction of the subject and object features is completed, the table label feature generated by the last iteration is output to the input end of the sixth module;

[0069] Among them, the table label feature of relation r at the tth iteration is expressed as Each item in the table represents a token pair label feature. The token pair is the vector representation of the entity after vector encoding. A pair of token pairs (w i ,w j ) is represented by the table label feature

[0070]

[0071] Among them, ReLU is the activation function, represents the token w extracted at the tth iteration i The corresponding main features, represents the token w extracted at the tth iteration j The corresponding object characteristics, represents the Hadamard product, W r represents the weight of the first fully connected layer corresponding to the relation r, b r Represents the bias of the first fully connected layer corresponding to relation r, and the subscripts i and j represent the index subscripts of the token pair.

[0072] In one embodiment, the fourth module is composed of a splicing module, a multi-head self-attention layer, a multi-head attention layer and a second fully connected layer connected in sequence; the splicing module is used to horizontally splice the multi-head self-attention layer, the multi-head attention layer and the second fully connected layer; the multi-head self-attention layer is used to obtain the table label features of each relationship output by the third module, and use the multi-head self-attention mechanism to mine the local association between each relationship; the multi-head attention layer is used to further mine the association between token pairs based on the local association between each relationship obtained by mining; the second fully connected layer is used to further mine the association between token pairs from the perspective of the entire Chinese sentence based on the association between the acquired token pairs, and output the mining results to the input end of the fifth module;

[0073] Among them, the calculation formula of the fourth module is expressed as

[0074]

[0075] Among them, MultiHeadSelfAtt represents the multi-head self-attention mechanism, MultiHeadAtt represents the multi-head attention mechanism, H represents the Chinese sentence processed by vector encoding and BiLSTM model, ReLU is the activation function, FM represents the table label features containing all relations after the t-th iteration of mining by the multi-head self-attention layer. (t) represents the table label features containing all relations at the tth iteration, where For FM (t) The parameterized representation of the tabular label features of the relation r in for A pair of tokens (w i ,w j )'s table label feature parameterized representation; represents the table label features containing all relations after the t-th iteration of the multi-head attention layer mining, H'( t) represents the table label features containing all relations after the t-th iteration mining of the second fully connected layer, W represents the weight of the second fully connected layer, and b represents the bias of the second fully connected layer.

[0076] In one embodiment, the fifth module is composed of a maximum pooling layer, a third fully connected layer and a residual neural network; the fifth module is used to obtain the result output by the fourth module, perform global correlation iterative extraction through the maximum pooling layer and the third fully connected layer, generate subject-related table features and object-related table features, and input the subject-related table features and object-related table features into the residual neural network, generate iteratively extracted subject features and object features through the residual neural network, and output them to the input end of the third module;

[0077] Among them, the subject-related table features generated at the t+1th iteration Object-related table features Respectively expressed as

[0078]

[0079] Among them, maxpool represents the maximum pooling, W s represents the weight of the third fully connected layer corresponding to the subject, b s represents the bias of the third fully connected layer corresponding to the main body, W o represents the weight of the third fully connected layer corresponding to the object, b o represents the bias of the third fully connected layer corresponding to the object;

[0080] The main features extracted at the t+1th iteration Object characteristics Respectively expressed as

[0081]

[0082] Among them, LayerNorm represents normalization processing, represents the main features extracted in the tth iteration, Represents the object features extracted at the tth iteration.

[0083] Among them, the self-attention mechanism can reveal the intrinsic relationships and dependencies of the input sequence, and the residual neural network helps to avoid the problem of gradient disappearance.

[0084] In one embodiment, the sixth module is used to obtain the table label features of each relationship output by the third module in the last iteration, fill the table label features of each relationship into the table according to a preset table filling strategy, extract an entity pair for each relationship by decoding the filled table, perform entity relationship matching on each entity pair according to a preset relationship type, and generate an entity relationship prediction triple; wherein the entity pair consists of a subject and an object, and the entity relationship prediction triple consists of a subject, a relationship, and an object;

[0085] Among them, Figure 3 As shown, the form filling strategy is expressed as

[0086]

[0087] Among them, softmax is a normalized exponential function, table r (i,j) is a token pair (w i ,w j ) The relationship classification results in the table, represents the table label features of relation r at the Nth iteration, Denotes the predicted token pair (w i ,w j ) all relationship classification results in the table, which contains multiple relationship results, represents the set of all relations L, represents a set, L represents the number of relations, and l represents the predicted relation type; argmax represents finding all predicted relations such that The relation with the largest value is taken as the relation classification result;

[0088] Among them, there are three parallel search routes in the table decoding process to extract entity pairs for each relationship, namely the forward search route, the reverse search route and the single search route; the forward search route generates entity pairs in the order from subject to object, and the reverse search route generates entity pairs in the order from object to subject; the single search route generates a single entity pair.

[0089] Combination Figure 3 The search route of the table decoding of this application is further explained. Figure 3In the sentence, the token pair (battery, abnormal) has the label "SOH". The algorithm searches forward to link adjacent token pairs until it finds the token pair (failure, noise) with the label "SOT". The forward search stops and a complete (subject, object) pair (i.e., entity pair) is formed. However, the entity pair (battery failure, abnormal noise) formed is wrong. The reason for the error is the nested entities in the sentence, such as "battery failure" and "battery failure lamp". The nested entities will cause the forward search to stop early. In this case, the reverse search first finds the token pair (lamp, noise) with the label "SOT", and then finds the token pair (battery, abnormal) with "SOH", and obtains the expected entity pair (battery failure lamp, abnormal noise).

[0090] In one embodiment, a training sample set is used to train a Chinese equipment failure mode entity relationship extraction model to obtain a trained Chinese equipment failure mode entity relationship extraction model, including:

[0091] Input the Chinese sentence samples of equipment failure modes in the training sample set into the Chinese equipment failure mode entity relationship extraction model to extract entity relationships and obtain entity relationship prediction triples;

[0092] The cross entropy loss function between the entity relationship prediction triples and the entity relationship triple samples in the training sample set is calculated, and the Chinese equipment failure mode entity relationship extraction model is trained according to the cross entropy loss function to obtain the trained Chinese equipment failure mode entity relationship extraction model.

[0093] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0094] In one embodiment, a Chinese equipment failure mode entity relationship extraction device is provided, comprising:

[0095] A model building unit is used to build a Chinese equipment fault mode entity relationship extraction model; wherein the Chinese equipment fault mode entity relationship extraction model is composed of an embedding vector generation module, a local feature preliminary extraction module, a local and global feature iterative extraction module, and an entity relationship triple generation module;

[0096] A model training unit is used to train the Chinese equipment failure mode entity relationship extraction model using a training sample set to obtain a trained Chinese equipment failure mode entity relationship extraction model; wherein the training sample set includes Chinese sentence samples of equipment failure modes and corresponding entity relationship triple samples;

[0097] The entity relationship extraction unit is used to input the Chinese sentence of the Chinese entity relationship to be extracted in the equipment failure mode into the trained Chinese equipment failure mode entity relationship extraction model, generate the Chinese character granularity embedding vector of the input Chinese sentence according to the embedding vector generation module in the model, perform preliminary extraction of subject and object local associations on the Chinese character granularity embedding vector according to the local feature preliminary extraction module, perform local and global association iterative extraction on the preliminary extracted subject and object features according to the local and global feature iterative extraction module, and after the iterative extraction is completed, perform triples on the iteratively extracted subject and object features according to the filling strategy adopted by the entity relationship triple generation module to obtain the entity relationship prediction triples of the Chinese sentence.

[0098] For the specific limitations of the Chinese equipment failure mode entity relationship extraction device, please refer to the limitations of the Chinese equipment failure mode entity relationship extraction method mentioned above, which will not be repeated here. Each module in the above-mentioned Chinese equipment failure mode entity relationship extraction device can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0099] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for extracting entity relationships of Chinese equipment failure modes is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse, etc.

[0100] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0101] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0102] Construct a Chinese equipment fault mode entity relationship extraction model; the Chinese equipment fault mode entity relationship extraction model consists of an embedding vector generation module, a local feature preliminary extraction module, a local and global feature iterative extraction module, and an entity relationship triple generation module;

[0103] The training sample set is used to train the Chinese equipment failure mode entity relationship extraction model to obtain a trained Chinese equipment failure mode entity relationship extraction model; wherein the training sample set includes Chinese sentence samples of equipment failure mode and corresponding entity relationship triple samples;

[0104] The Chinese sentences of the Chinese entity relations to be extracted in the equipment failure mode are input into the trained Chinese equipment failure mode entity relationship extraction model, and the Chinese character granularity embedding vector of the input Chinese sentence is generated according to the embedding vector generation module in the model. The local feature preliminary extraction module performs preliminary extraction of subject and object local associations on the Chinese character granularity embedding vector, and the local and global feature iterative extraction module performs local and global association iterative extraction on the preliminary extracted subject and object features. After the iterative extraction is completed, the iteratively extracted subject and object features are tripled according to the filling strategy adopted by the entity relationship triplet generation module to obtain the entity relationship prediction triplet of the Chinese sentence.

[0105] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0106] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements may be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for extracting entity relations of Chinese equipment failure modes, characterized in that: The method comprises: Constructing a Chinese equipment fault mode entity relationship extraction model; wherein the Chinese equipment fault mode entity relationship extraction model is composed of an embedding vector generation module, a local feature preliminary extraction module, a local and global feature iterative extraction module, and an entity relationship triple generation module; Using the training sample set to train the Chinese equipment failure mode entity relationship extraction model to obtain a trained Chinese equipment failure mode entity relationship extraction model; wherein the training sample set includes Chinese sentence samples of equipment failure modes and corresponding entity relationship triple samples; The Chinese sentence of the Chinese entity relationship to be extracted in the equipment failure mode is input into the trained Chinese equipment failure mode entity relationship extraction model, and the Chinese character granularity embedding vector of the input Chinese sentence is generated according to the embedding vector generation module in the model. The local feature preliminary extraction module performs preliminary extraction of subject and object local associations on the Chinese character granularity embedding vector, and the local and global feature iterative extraction module performs local and global association iterative extraction on the preliminary extracted subject and object features. After the iterative extraction is completed, the iteratively extracted subject and object features are tripled according to the filling strategy adopted by the entity relationship triplet generation module to obtain the entity relationship prediction triplet of the Chinese sentence.

2. The method according to claim 1, characterized in that The embedding vector generation module is the first module of the Chinese equipment failure mode entity relationship extraction model, the local feature preliminary extraction module is the second module of the Chinese equipment failure mode entity relationship extraction model, the local and global feature iterative extraction module includes the third module, the fourth module and the fifth module of the Chinese equipment failure mode entity relationship extraction model, and the entity relationship triple generation module is the sixth module of the Chinese equipment failure mode entity relationship extraction model; Among them, the output end of the first module is connected to the input end of the second module; the output end of the second module is connected to the input end of the third module; the output end of the third module is respectively connected to the input end of the fourth module and the input end of the sixth module; the output end of the fourth module is connected to the input end of the fifth module; the output end of the fifth module is connected to the input end of the third module; the input end of the first module is the input end of the Chinese equipment fault mode entity relationship extraction model; the output end of the sixth module is the output end of the Chinese equipment fault mode entity relationship extraction model.

3. The method according to claim 2, characterized in that The first module is a pre-trained ChineseBERT model, which is used to generate a Chinese character granularity embedding vector of an input Chinese sentence, and output the Chinese character granularity embedding vector to the input end of the second module; wherein the Chinese character granularity embedding vector is composed of pinyin and characters; wherein the i-th Chinese character c in the input Chinese sentence i The corresponding Chinese character granularity embedding vector is expressed as 4. The method according to claim 2, characterized in that: The second module is a BiLSTM model, which is used to use a forward-backward calculation method to perform a preliminary extraction of subject-object local associations on the Chinese character granularity embedding vector output by the first module, obtain preliminary extracted subject features and object features, and output them to the input end of the third module; The forward calculation and backward calculation of the BiLSTM model are symmetrical to each other. The forward calculation process is expressed as Among them, H s is the main feature extracted initially, H o is the initially extracted object feature, H is the Chinese sentence processed by vector encoding and BiLSTM model, the subscript 1 / 2 indicates two independent networks, and f t represents the BiLSTM forget gate at the tth iteration, Represents the BiLSTM forget gate weights corresponding to the subject and the object; Indicates the BiLSTM forget gate bias corresponding to the subject and the object; i t represents the first memory gate of BiLSTM at the tth iteration; σ() represents the sigmoid activation function, Represents the weight of the first memory gate of BiLSTM corresponding to the subject and the object; Indicates the bias of the first memory gate of BiLSTM corresponding to the subject and the object; represents the second memory gate of BiLSTM at the tth iteration, Represents the weight of the second memory gate of BiLSTM corresponding to the subject and the object; Indicates the bias of the second memory gate of BiLSTM corresponding to the subject and the object; C t represents the first output gate of BiLSTM at the tth iteration, o t represents the second output gate of BiLSTM at the tth iteration; Represents the weight of the second output gate of BiLSTM corresponding to the subject and the object, Represents the bias of the second output gate of BiLSTM corresponding to the subject and the object, represents the second output gate of BiLSTM corresponding to the subject at the tth iteration, Indicates that the subject at the tth iteration corresponds to the first output gate of BiLSTM, represents the second output gate of BiLSTM corresponding to the object at the tth iteration, Represents the first output gate of the BiLSTM corresponding to the object at the tth iteration.

5. The method according to claim 2, characterized in that: The third module is composed of a first fully connected layer, which is used to generate a table label feature for each relationship according to the subject features and object features initially extracted by the second module, and output the table label feature to the input end of the fourth module before the iterative extraction of the subject and object features is completed; after the iterative extraction of the subject and object features is completed, the table label feature generated by the last iteration is output to the input end of the sixth module; Among them, the table label feature of relation r at the tth iteration is expressed as Each item in the table represents a token pair label feature. The token pair is the vector representation of the entity after vector encoding. A pair of token pairs (w i ,w j ) is represented by the table label feature Among them, ReLU is the activation function, represents the token w extracted at the tth iteration i The corresponding main features, represents the token w extracted at the tth iteration j The corresponding object characteristics, represents the Hadamard product, W r represents the weight of the first fully connected layer corresponding to the relation r, b r Represents the bias of the first fully connected layer corresponding to relation r, and the subscripts i and j represent the index subscripts of the token pair.

6. The method according to claim 2, characterized in that The fourth module is composed of a splicing module, a multi-head self-attention layer, a multi-head attention layer and a second fully connected layer connected in sequence; the splicing module is used to horizontally splice the multi-head self-attention layer, the multi-head attention layer and the second fully connected layer; the multi-head self-attention layer is used to obtain the table label features of each relationship output by the third module, and adopt the multi-head self-attention mechanism to mine the local association between each relationship; the multi-head attention layer is used to further mine the association between token pairs based on the local association between each relationship obtained by mining; the second fully connected layer is used to further mine the association between token pairs from the perspective of the entire Chinese sentence based on the association between the acquired token pairs, and output the mining results to the input end of the fifth module; Among them, the calculation formula of the fourth module is expressed as: Among them, MultiHeadSelfAtt represents the multi-head self-attention mechanism, MultiHeadAtt represents the multi-head attention mechanism, H represents the Chinese sentence processed by vector encoding and BiLSTM model, ReLU is the activation function, FM represents the table label features containing all relations after the t-th iteration of mining by the multi-head self-attention layer. (t) represents the label features of the table containing all relations at the tth iteration, represents the table label features containing all relations after the t-th iteration of the multi-head attention layer mining, H'( t ) represents the table label features containing all relations after the t-th iteration mining of the second fully connected layer, W represents the weight of the second fully connected layer, and b represents the bias of the second fully connected layer.

7. The method according to claim 2, characterized in that The fifth module is composed of a maximum pooling layer, a third fully connected layer and a residual neural network; the fifth module is used to obtain the result output by the fourth module, perform global correlation iterative extraction through the maximum pooling layer and the third fully connected layer, generate subject-related table features and object-related table features, and input the subject-related table features and object-related table features into the residual neural network, generate iteratively extracted subject features and object features through the residual neural network, and output them to the input end of the third module; Among them, the subject-related table features generated at the t+1th iteration Object-related table features Respectively expressed as Among them, maxpool represents the maximum pooling, W s represents the weight of the third fully connected layer corresponding to the subject, b s represents the bias of the third fully connected layer corresponding to the main body, W o represents the weight of the third fully connected layer corresponding to the object, b o represents the bias of the third fully connected layer corresponding to the object; The main feature H extracted at the t+1th iteration s ' (t+1 ) and object characteristics H o ′( t+1 ) are respectively expressed as Among them, LayerNorm represents normalization processing, represents the main features extracted in the tth iteration, Represents the object features extracted at the tth iteration.

8. The method according to claim 2, characterized in that: The sixth module is used to obtain the table label features of each relationship output by the third module at the last iteration, fill the table label features of each relationship into the table according to the preset table filling strategy, extract an entity pair for each relationship by decoding the filled table, perform entity relationship matching on each entity pair according to the preset relationship type, and generate an entity relationship prediction triple; wherein the entity pair consists of a subject and an object, and the entity relationship prediction triple consists of a subject, a relationship and an object; The form filling strategy is expressed as Among them, softmax is a normalized exponential function, table r (i,j) is a token pair (w i ,w j ) The relationship classification results in the table, represents the table label features of relation r at the Nth iteration, Denotes the predicted token pair (w i ,w j ) all relationship classification results in the table, which contains multiple relationship results, represents the set of all relations L, represents a set, L represents the number of relations, and l represents the predicted relation type; argmax represents finding all predicted relations such that The relation with the largest value is taken as the relation classification result; Among them, there are three parallel search routes in the table decoding process to extract entity pairs of each relationship, namely, a forward search route, a reverse search route and a single search route; the forward search route generates entity pairs in the order from subject to object, the reverse search route generates entity pairs in the order from object to subject; the single search route generates a single entity pair.

9. The method according to claim 1, characterized in that: The training sample set is used to train the Chinese equipment failure mode entity relationship extraction model to obtain a trained Chinese equipment failure mode entity relationship extraction model, including: Inputting Chinese sentence samples of equipment failure modes in the training sample set into the Chinese equipment failure mode entity relationship extraction model to extract entity relationships and obtain entity relationship prediction triples; Calculate the cross entropy loss function between the entity relationship prediction triples and the entity relationship triple samples in the training sample set, train the Chinese equipment failure mode entity relationship extraction model according to the cross entropy loss function, and obtain a trained Chinese equipment failure mode entity relationship extraction model.

10. A Chinese equipment failure mode entity relationship extraction device, characterized in that: The device comprises: A model building unit, used to build a Chinese equipment fault mode entity relationship extraction model; wherein the Chinese equipment fault mode entity relationship extraction model is composed of an embedding vector generation module, a local feature preliminary extraction module, a local and global feature iterative extraction module, and an entity relationship triple generation module; A model training unit, used to train the Chinese equipment failure mode entity relationship extraction model using a training sample set to obtain a trained Chinese equipment failure mode entity relationship extraction model; wherein the training sample set includes Chinese sentence samples of equipment failure modes and corresponding entity relationship triple samples; The entity relationship extraction unit is used to input the Chinese sentence of the Chinese entity relationship to be extracted in the equipment failure mode into the trained Chinese equipment failure mode entity relationship extraction model, generate the Chinese character granularity embedding vector of the input Chinese sentence according to the embedding vector generation module in the model, perform preliminary extraction of subject and object local association on the Chinese character granularity embedding vector according to the local feature preliminary extraction module, perform local and global association iterative extraction on the preliminary extracted subject and object features according to the local and global feature iterative extraction module, and after the iterative extraction is completed, perform triple generation on the iteratively extracted subject and object features according to the filling strategy adopted by the entity relationship triple generation module to obtain the entity relationship prediction triple of the Chinese sentence.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Relation extraction method based on multi-feature semantic tree kernel and information retrieving method

    CN104699695A

  • A multi-triple extraction method based on an entity-relationship joint extraction model

    CN109165385A

  • Chinese entity relationship extraction method and device, medium and product

    CN118013972A

  • Joint extraction of named entities and relations from text using machine learning models

    US20210224651A1