Weapon equipment entity relationship extraction method based on pre-training model and rule combination

By combining pre-trained models and rule knowledge for filtering and adjustment in entity relationship extraction in the field of weapons and equipment, redundancy and error problems are solved, accuracy and recall rates are improved, and more efficient entity relationship extraction is achieved.

CN115114382BInactive Publication Date: 2024-09-06SHENYANG AEROSPACE UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210766484.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-01
Publication Date
2024-09-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology has redundancy and error problems in entity relationship extraction in the field of weapons and equipment, as well as low accuracy of text data in specific fields.

Method used

Using a method based on the combination of pre-training models and rules, through filtering and adjusting the model and the weapon and equipment entity relationship extraction model based on rule knowledge, two extractions and fusions are performed to remove redundancy and errors and improve accuracy. Specific steps include: using the pre-trained model for the first time to extract entity relationships, using rule knowledge for the second time to filter and adjust, and finally obtaining the final entity relationship set through deduplication and ablation operations.

Benefits of technology

It effectively solves the redundancy and error problems in entity relationship extraction results, and improves the accuracy and recall rate of entity relationship extraction in the field of weapons and equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115114382B
    Figure CN115114382B
Patent Text Reader

Abstract

The invention discloses a weapon equipment entity relationship extraction method based on the combination of pre-training model and rules, and relates to the technical field of information extraction; a weapon equipment text data set is processed to obtain two types of entities and entity relationships of weapon equipment and its attribute values; a weapon equipment entity relationship extraction model is constructed by combining the pre-training model with rule knowledge, firstly the pre-training model is used to complete the preliminary extraction of entity relationships, and then the extraction results are introduced into the filter adjustment module to screen and obtain the filtered and adjusted entity relationship set R1; then, the entity relationship extraction model based on rule knowledge is used to re-extract the entity relationship of the weapon equipment text data set to obtain the entity relationship set R2; R1 and R2 are merged to obtain the final entity relationship result. The invention can realize the extraction of entity relationships from text data in the field of weapon equipment, and provide a new method for the knowledge-based organization and management of weapon equipment information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of information extraction, and in particular to a weapon equipment entity relationship extraction method based on the combination of a pre-training model and rules. Background Art

[0002] In the era of big data, data presents characteristics such as wide sources, multiple types, large scale, high noise, and rapid changes. How to quickly integrate multi-source heterogeneous data and construct knowledge graphs has become the key to the successful transformation of various industries to intelligence. In the military field, as the combat form develops towards multi-domain and global directions, the degree of informatization of weapons and equipment is also getting higher and higher. Using knowledge graphs to organize and manage the information of existing main combat weapons and equipment is an important guarantee for realizing intelligent cognition of battlefield situations and seizing the initiative on future battlefields.

[0003] With the rapid development of information extraction technology, more and more attention has been paid to automatically obtaining weapon and equipment information from military text data through computers. For text data in the field of weapons and equipment, there are many professional terms and a large number of overlapping entity relationships. It is hoped that information extraction technology can be used to analyze a large amount of weapon and equipment text data and extract entity relationships, thereby improving the comprehensive processing and utilization capabilities of data in the field of weapons and equipment.

[0004] Entity relationship extraction is usually divided into two parts: named entity recognition and entity relationship extraction. The goal of named entity recognition is to identify the corresponding named entities in the text; the goal of entity relationship extraction is to extract the specific relationship between two entities from the text. At present, there are many methods for entity relationship extraction, which can be roughly divided into two categories: pipeline extraction model (pipeline) and joint extraction model (joint).

[0005] The pipeline extraction model divides entity relationship extraction into two subtasks: entity recognition and relationship extraction. The two subtasks are executed sequentially without interaction. This method treats entity recognition and relationship extraction as two independent processes, which can cause the error of the previous task to propagate to the next task.

[0006] The joint extraction model alleviates this problem. The joint extraction method combines entity recognition and relationship extraction tasks together for extraction, and can use the interaction between the two tasks to alleviate the propagation of errors. The joint extraction model needs to strengthen the interaction between the entity model and the relationship model. For example, there are certain constraints between the outputs of the entity model and the relationship model. Considering such constraints during modeling will help the performance of the joint model.

[0007] There are two significant problems with existing methods: first, due to the lack of corresponding filtering and adjustment mechanisms, the results of entity relationship extraction have a certain degree of redundancy and errors; second, due to the presence of some special terms in the text data content of certain specific fields, the classic entity relationship extraction method has low accuracy when extracting entity relationships in these specific fields. Summary of the invention

[0008] In response to the problems existing in the prior art, the present invention provides a weapons and equipment entity relationship extraction method based on a combination of a pre-trained model and rules. By filtering and adjusting the model, the redundancy and error problems in the entity relationship extraction results are solved; through a weapons and equipment entity relationship extraction model based on rule knowledge, the problem of low accuracy in entity relationship extraction in the field of weapons and equipment is solved.

[0009] To achieve the above object, the technical solution adopted by the present invention is:

[0010] The weapon equipment entity relationship extraction method based on the combination of pre-training model and rules includes the following steps:

[0011] S1: De-duplicate, fill or truncate the weapons and equipment text dataset to obtain two types of entities, weapons and equipment and their attribute values, entity relationships between weapons and equipment, and entity relationships between weapons and equipment and attribute values;

[0012] S2: The pre-trained entity relationship extraction model is combined with rule knowledge to build a weapon equipment entity relationship extraction model, and the first extraction of entity relationships is completed in the pre-trained entity relationship extraction model to obtain the entity relationship extraction result;

[0013] S3: The entity relationship extraction results obtained in S2 and the entity pairs corresponding to the extraction results provided in the weapon and equipment text dataset are combined into triples and introduced into the filtering and adjustment model. According to the constraint relationship between the entity relationship type and the head entity type and the tail entity type, the triples whose head and tail entity types do not meet the constraint rules are filtered out through the filtering layer, and the relationship between the filtered triples is adjusted through the adjustment layer to obtain the filtered and adjusted entity relationship set R1;

[0014] S4: Use the weapon equipment entity relationship extraction model based on rule knowledge to perform a second extraction of entity relationships on the weapon equipment text dataset to obtain the entity relationship set R2;

[0015] S5: R1 and R2 are merged through deduplication and ablation operations to obtain the entity relationship set R.

[0016] The S1 specifically includes the following steps:

[0017] S1.1: Read the weapon equipment text dataset with entity and entity relationship label information, perform deduplication processing, and obtain the entity set, entity type set, entity relationship set, and entity relationship type set;

[0018] S1.2: Pad or truncate the sentences in the weapon and equipment text dataset according to the character length of the input sentence of the pre-trained entity relationship extraction model, and add the beginning flag and the end flag to each sentence in the weapon and equipment text dataset;

[0019] S1.3: Divide the processed weapons and equipment text dataset into training set, validation set, and test set.

[0020] The padding or truncation process is:

[0021] The maximum character length of each weapon and equipment text data input based on the pre-trained entity relationship extraction model is set to n1. If the character length of the sentence in the weapon and equipment text dataset is greater than n1, the sentence is truncated at the n1-2th character, and the beginning and end flags of the sentence are added to obtain the maximum character length n1. If the character length of the sentence in the weapon and equipment text dataset is less than n1, O is used to fill it to n1-2 character length, and the beginning and end flags of the sentence are added to obtain a total of n1 character length.

[0022] The S2 specifically includes the following steps:

[0023] S2.1: Use the BERT layer based on the pre-trained entity relationship extraction model as the representation layer, input each sentence in the weapons and equipment text dataset into the representation layer to obtain a set of word vector representations that integrate contextual semantic information;

[0024] S2.2: Input the word vector that integrates the contextual semantic information into the recurrent neural network to obtain the complete hidden layer state sequence H corresponding to the entire sentence;

[0025] S2.3: The complete hidden layer state sequence H of the sentence is introduced into the convolutional neural network layer, and through convolution and pooling operations, a vector representation S that integrates the local and global semantic features of the sentence is obtained;

[0026] S2.4: Input S into the fully connected layer, and the obtained feature vector v is introduced into the output layer to use the classifier to classify the relationship, complete the extraction of the relationship between entities, and obtain the extraction result of the relationship between entities;

[0027] S2.5: According to the extraction results of the inter-entity relations and the entity relationship label information, set the inter-entity relationship extraction loss function, complete the training and testing of the pre-trained entity relationship extraction model, and update the pre-trained entity relationship extraction model according to the test results.

[0028] The recurrent neural network adopts the BiGRU neural network:

[0029] The BiGRU neural network extracts sentence context features by combining the forward GRU encoder and the backward GRU encoder, and outputs the unidirectional hidden layer state h' corresponding to each word in the sentence. i and h″ i , and h' i and h″ i The hidden state h corresponding to each word in the sentence is concatenated to obtain the fusion context semantic information i =[h' i ;h″ i ], the complete hidden layer state sequence corresponding to the entire sentence is H = [h0,h1,…,h n ].

[0030] The classifier uses the Softmax function, as shown in formula (1):

[0031]

[0032] Among them: Softmax(v i ) is the predicted value of the i-th entity relationship in the entity relationship set; v i is the input feature vector; v j is the weight of the jth position of the vector; N is the total number of entity relationships.

[0033] The loss function for extracting the relationship between entities is set as:

[0034] The result y extracted based on the pre-trained entity relationship extraction model i Relationship with real label Set the cross entropy loss function to calculate the loss value L of the model, as shown in formula (2):

[0035]

[0036] Update the model parameters according to the loss value to complete the training of the pre-trained entity relationship extraction model;

[0037] The model is tested N times using the test set, and the accuracy P, recall R, and F1 value of the model in each test are recorded as the evaluation indicators of the model, as shown in formulas (3) to (5):

[0038]

[0039]

[0040]

[0041] Among them, TP represents the correct number of entity relationship triples extracted by the model, FP represents the incorrect number of extracted entity relationship triples, and FN represents the number of correct entity relationship triples that have not been extracted;

[0042] According to the accuracy, recall rate and F1 value, a set of model parameters with the best effect is selected as the final parameters of the pre-trained entity relationship extraction model.

[0043] The S3 specifically includes the following steps:

[0044] S3.1: According to the constraint relationship between the entity relationship type and the head entity type and the tail entity type, a filtering layer for filtering the relationship between entities and an adjustment layer for adjusting the relationship between entities are established;

[0045] S3.2: The extraction results of the relationship between entities in S2.4 and the entity pairs corresponding to the extraction results provided in the weapon and equipment text dataset are introduced into the filtering layer to form triples, and the triples whose head and tail entity types do not meet the constraint rules are filtered out through the filtering rules;

[0046] S3.3: Introduce the triples filtered out by S3.2 into the adjustment layer, and adjust the relationship between entities according to the adjustment rules and the head and tail entity types in the triples to obtain the relationship between entities that can satisfy the constraint rules;

[0047] S3.4: After filtering and adjustment by the filtering layer and the adjustment layer, the entity relationship set R1 is obtained.

[0048] The constraint relationship between the entity relationship and the head entity type and the tail entity type is:

[0049] When the head entity type in the triple is PRODUCT and the tail entity type is PRODUCT, the corresponding entity relationship type is equipment relationship; when the head entity type is PRODUCT and the tail entity type is FAC or LOC, the corresponding entity relationship type is location relationship or target relationship, or affiliation relationship; when the head entity type is PRODUCT and the tail entity type is QUANTITY, the corresponding entity relationship type is location relationship; when the head entity type is PRODUCT and the tail entity type is CATEGORY, the corresponding entity relationship type is type relationship.

[0050] The filtering rules are:

[0051] Through the entity label information and entity relationship label information provided in the weapon and equipment text dataset, the head entity type and tail entity type in the triple are obtained, and the triples whose head and tail entity type combinations do not exist in the constraint relationship are filtered out.

[0052] The adjustment rules are:

[0053] Through the entity label information and entity relationship label information provided in the weapon and equipment text dataset, the entity type and entity relationship type of the head and tail entities in the triple are obtained. According to the head and tail entity types in the constraint relationship and their corresponding entity relationship types, the entity relationships in the triples that do not meet the constraint relationship are adjusted.

[0054] The S4 specifically comprises the following steps:

[0055] S4.1: Compare the entity relationship set R1 extracted in S3 with the entity relationship label information provided in the weapon and equipment text dataset to see if they are consistent, locate the inconsistent triples in the weapon and equipment text dataset, and analyze their semantic information. Based on the analysis results, obtain the fine-grained semantic information and relationship type description corresponding to each relationship type;

[0056] S4.2: Establish a rule knowledge base for extracting the relationship between entities based on the types of the head entity and the tail entity, the distance constraint relationship between the two entities, the key words and phrases that express different semantic relationships, and the structural relationship between the weapon equipment entity and the attribute value;

[0057] S4.3: The entity relationships of the weapons and equipment text dataset are extracted through the rule-based knowledge-based weapons and equipment entity relationship extraction model to obtain the entity relationship set R2.

[0058] The relationship type description includes:

[0059] There are two types of entity relationship type descriptions corresponding to location relationships: one is that the head entity is a ship and the tail entity is longitude and latitude, and the corresponding entity relationship type keyword is located; the other is that the head entity is a ship and the tail entity is a place, and the corresponding entity relationship type keyword is located.

[0060] Description of the entity relationship type corresponding to the equipment relationship: the head entity is a ship, the tail entity is an aircraft or a weapon, and the corresponding entity relationship type key words are carried or equipped.

[0061] There are two types of entity relationship type descriptions corresponding to the target relationship: one is that the head entity is a ship and the tail entity is a place, and the corresponding entity relationship type keyword is intrusion; the other is that the head entity is a ship and the tail entity is a place, and the corresponding entity relationship type keyword is arrival.

[0062] Description of the entity relationship type corresponding to the affiliation relationship: the head entity is a ship, the tail entity is a country or a structure, and the corresponding entity relationship type keyword is belongs to.

[0063] Description of the entity relationship type corresponding to the type relationship: the head entity is a ship, the tail entity is an anti-tank weapon, an anti-aircraft weapon, an anti-ship weapon, an anti-submarine weapon or an anti-missile weapon, and the corresponding entity relationship type keyword is type.

[0064] The S5 specifically includes the following steps:

[0065] S5.1: performing a fusion operation on the entity relationship set R1 obtained in S3 and the entity relationship set R2 obtained in S4, wherein the fusion operation includes deduplication and ablation;

[0066] S5.2: According to the entity relationship sets R1 and R2 and their corresponding entity pair information, the duplicate entity relationships existing in both R1 and R2 are deleted from R1 to obtain the entity relationship set R'1;

[0067] S5.3: According to the entity relationship sets R'1 and R2 and their corresponding entity pair information, for the relationships with the same entity pairs but inconsistent relationships in R'1 and R2, the entity relationship set R2 obtained by the weapon equipment entity relationship extraction model based on rule knowledge is used as the basis, and the relationships in R'1 are deleted to obtain the entity relationship set R″1;

[0068] S5.4: Merge the entity relationship sets R″1 and R2 to obtain the weapon equipment entity relationship set R.

[0069] The beneficial effects of adopting the above technical solution are:

[0070] 1. The present invention adopts a method based on combining a pre-trained entity relationship extraction model with rule knowledge to construct a weapon equipment entity relationship extraction model. A filtering adjustment mechanism is added on the basis of the pre-trained extraction model to solve the problem of redundancy and error of some results during entity relationship extraction;

[0071] 2. By constructing a knowledge base of weapon and equipment entity relationship extraction rules, the common problems of low accuracy and recall rate in vertical field entity relationship extraction are solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 A flow chart of a weapon equipment entity relationship extraction method based on a combination of a pre-trained model and rules provided in an embodiment of the present invention;

[0073] Figure 2 A framework diagram of a pre-trained entity relationship extraction model provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0074] The specific implementation of the present invention is further described in detail below in conjunction with the drawings and examples.

[0075] This embodiment provides a weapons and equipment entity relationship extraction method based on a combination of a pre-trained model and rules. By filtering and adjusting the model, the redundancy and error problems in the entity relationship extraction results are solved; the problem of low accuracy of entity relationship extraction in the field of weapons and equipment is solved by using a weapons and equipment entity relationship extraction model based on rule knowledge; Figure 1 As shown, the following steps are included:

[0076] S1: Remove duplicates, fill or truncate the weapons and equipment text dataset, divide it into training set, validation set and test set, and obtain two types of entities and entity relationships of weapons and equipment and their attribute values, which specifically includes the following steps:

[0077] S1.1: Read the weapon equipment text dataset with entity and entity relationship label information, perform deduplication processing, and obtain the entity set, entity type set, entity relationship set, and entity relationship type set, where the entity type set includes {PERSON, NORP, FAC, ORG, GRE, LOC, PRODUCT, DATE, CATEGORY, QUANTITY}, and the entity relationship type set includes {position relationship, equipment relationship, target relationship, affiliation relationship, type relationship};

[0078] S1.2: Pad and truncate the sentences in the weapon and equipment text dataset according to the character length of the input sentence of the pre-trained entity relationship extraction model, and add the sentence start flag [CLS] and sentence end flag [SEP] to each sentence in the weapon and equipment text dataset;

[0079] The framework of the pre-trained entity relationship extraction model is as follows Figure 2 As shown;

[0080] The padding or truncation is:

[0081] The maximum character length of each weapon and equipment text data input based on the pre-trained entity relationship extraction model is set to 128. If the character length of the sentence in the weapon and equipment text dataset is greater than 128, the sentence is truncated at the 126th character, and the beginning and end flags are added to make the maximum character length 128; if the character length of the sentence in the weapon and equipment text dataset is less than 128, O is used to fill it to 126 characters, and the beginning and end flags are added.

[0082] S1.4: Divide the processed weapons and equipment text dataset into training set, validation set, and test set.

[0083] S2: Combining the pre-trained entity relationship extraction model with rule knowledge, constructing a weapon and equipment entity relationship extraction model, completing the first extraction of entity relationships in the pre-trained entity relationship extraction model, and obtaining entity relationship extraction results, specifically including the following steps:

[0084] S2.1: Use the BERT layer based on the pre-trained entity relationship extraction model as the representation layer, input each sentence in the weapon equipment text dataset into the representation layer, where each sentence contains n characters, and obtain a set of word vector representations e=(e0,e1,e2,…,e n );

[0085] S2.2: Input the word vector representation e that integrates the contextual semantic information into the recurrent neural network to obtain the complete hidden layer state sequence H corresponding to the entire sentence;

[0086] The recurrent neural network adopts the BiGRU neural network:

[0087] The BiGRU neural network extracts sentence context features by combining the forward GRU encoder and the backward GRU encoder, and outputs the unidirectional hidden layer state h' corresponding to each word in the sentence. i and h″ i , and h' i and h″ i The hidden layer state h = [h' i ;h″ i ], the complete hidden layer state sequence corresponding to the entire sentence is H = [h0,h1,…,h n ].

[0088] S2.3: The complete hidden layer state sequence H of the sentence is introduced into the convolutional neural network layer, and through convolution and pooling operations, a vector representation S that integrates the local and global semantic features of the sentence is obtained;

[0089] S2.4: Input S into the fully connected layer, and the resulting feature vector v = (v0, v1, v2, ..., v N ) Introduce the classifier in the output layer to classify the relationship, complete the extraction of the relationship between entities, and obtain the extraction result y of the relationship between entities i ;

[0090] The classifier uses the Softmax function, as shown in formula (1):

[0091]

[0092] Among them: Softmax(v i) is the predicted value of the i-th entity relationship in the entity relationship set; v i is the input feature vector; v j is the weight of the jth position of the vector; N is the total number of entity relationships.

[0093] S2.5: According to the extraction results of the inter-entity relations and the entity relation label information, the inter-entity relation extraction loss function is set, the training and testing of the pre-trained entity relation extraction model is completed, and the pre-trained entity relation extraction model is updated according to the test results;

[0094] The loss function for extracting the relationship between entities is set as:

[0095] The result y extracted based on the pre-trained entity relationship extraction model i Relationship label with real The cross entropy loss function is designed to calculate the loss value L of the model, as shown in formula (2):

[0096]

[0097] Update the model parameters according to the loss value to complete the training of the pre-trained entity relationship extraction model;

[0098] The model is tested N times using the test set, and the accuracy P, recall R, and F1 value of the model in each test are recorded as the evaluation indicators of the model, as shown in formulas (3) to (5):

[0099]

[0100]

[0101]

[0102] Among them, TP represents the correct number of entity relationship triples extracted by the model, FP represents the incorrect number of extracted entity relationship triples, and FN represents the number of correct entity relationship triples that have not been extracted;

[0103] According to the accuracy, recall rate and F1 value, the best set of model parameters are selected as the final parameters of the model.

[0104] S3: Extract the entity relationship from S2 i The filtering and adjustment model is introduced to complete the screening of the extraction results and obtain the filtered and adjusted entity relationship set R1, which specifically includes the following steps:

[0105] S3.1: According to the constraint relationship between the entity relationship and the head entity type and the tail entity type, a filtering layer for filtering the relationship between entities and an adjustment layer for adjusting the relationship between entities are established;

[0106] The constraint relationship is shown in Table 1:

[0107] Table 1 Constraints

[0108]

[0109] S3.2: Extract the relationship between entities in S2.4 i The entity pairs corresponding to the extraction results provided in the weapon and equipment text dataset are introduced into the filtering layer to form triples, and the triples whose head and tail entity types do not meet the constraint rules are filtered out through the filtering rules;

[0110] The filtering rules are as follows:

[0111] Through the entity label information and entity relationship label information provided in the weapon and equipment text dataset, the head entity type and tail entity type in the triple are obtained, and the triples whose head and tail entity type combinations do not exist in the constraint relationship are filtered out.

[0112] S3.3: Introduce the triples filtered out by S3.2 into the adjustment layer, and adjust the relationship between entities according to the adjustment rules and the head and tail entity types in the triples to obtain the relationship between entities that can satisfy the constraint rules;

[0113] The adjustment rules are as follows:

[0114] Through the entity label information and entity relationship label information provided in the weapon and equipment text dataset, the entity type and entity relationship type of the head and tail entities in the triple are obtained. According to the head and tail entity types in the constraint relationship and their corresponding entity relationship types, the entity relationships in the triples that do not meet the constraint relationship are adjusted.

[0115] S3.4: After filtering and adjustment by the filtering layer and the adjustment layer, the entity relationship set R1 is obtained.

[0116] S4: Use the weapon equipment entity relationship extraction model based on rule knowledge to perform a second extraction of entity relationships on the weapon equipment text dataset to obtain the entity relationship set R2, which specifically includes the following steps:

[0117] S4.1: Compare the entity relationship set R1 extracted by S3 with the entity relationship label information provided in the weapon and equipment text dataset to see if they are consistent, locate the inconsistent triples in the weapon and equipment text dataset, and analyze their semantic information. Based on the analysis results, the fine-grained semantic information and relationship type description corresponding to each relationship type are obtained, as shown in Table 2:

[0118] Table 2 Fine-grained semantic information and relationship type description corresponding to each relationship type

[0119]

[0120] S4.2: Based on the types of the head entity and the tail entity, the distance constraint relationship between the two entities, the key words and phrases expressing different semantic relationships, and the structural relationship between the weapon and equipment entities and attribute values, a rule knowledge base for extracting the relationship between entities is established. The rule knowledge is shown in Table 3:

[0121] Table 3 Rule knowledge

[0122] Position||<head entity>d(located at)d<tail entity>||PRODUCT, QUANTITY Located||<Head entity>d(located)d<Tail entity>||PRODUCT, LOC\FAC Carry||<head entity>d(carry|shipborne)d<tail entity>||PRODUCT,PRODUCT Destination||<Head entity>d(Arrival|Entry)d<Tail entity>||PRODUCT,LOC\FAC Target||<Head Entity>d(Intrusion|Intrusion)d<Tail Entity>||PRODUCT, LOC\FAC Belongs to||<head entity>d(belongs to)d<tail entity>||PRODUCT, GPE\FAC type||<head entity>d(type)d<tail entity>||PRODUCT, CATEGORY

[0123] S4.3: The entity relationships of the weapons and equipment text dataset are extracted through the rule-based knowledge-based weapons and equipment entity relationship extraction model to obtain the entity relationship set R2.

[0124] S5: Merge R1 and R2, and obtain the final entity relationship set R through deduplication and ablation operations. The specific steps include the following steps

[0125] S5.1: performing a fusion operation on the entity relationship set R1 obtained in S3 and the entity relationship set R2 obtained in S4, wherein the fusion operation includes deduplication and ablation;

[0126] S5.2: Find the repeated entity relationship information that exists in both entity relationship sets R1 and R2. The entity relationship information includes entity relationship, corresponding entity pair name and type, and entity pair location information. Delete the repeated entity relationship in R1 and R2 from R1 to obtain the entity relationship set R'1.

[0127] S5.3: Find out the entity relationships that have the same entity pair information but inconsistent corresponding relationships in the entity relationship sets R1 and R2, and take the entity relationship set R2 obtained by the weapon equipment entity relationship extraction model based on rule knowledge as the standard, delete the relationship in R'1, and obtain the entity relationship set R″1;

[0128] S5.4: Merge the entity relationship sets R″1 and R2 to obtain the weapon equipment entity relationship set R.

Claims

1. A weapon equipment entity relationship extraction method based on a combination of pre-training models and rules, characterized by: The following steps are involved: S1: De-duplicate, fill or truncate the weapons and equipment text dataset to obtain two types of entities, weapons and equipment and their attribute values, entity relationships between weapons and equipment, and entity relationships between weapons and equipment and attribute values; S2: The pre-trained entity relationship extraction model is combined with rule knowledge to build a weapon equipment entity relationship extraction model, and the first extraction of entity relationships is completed in the pre-trained entity relationship extraction model to obtain the entity relationship extraction result; S3: The entity relationship extraction results obtained in S2 and the entity pairs corresponding to the extraction results provided in the weapon and equipment text dataset are combined into triples and introduced into the filtering and adjustment model. According to the constraint relationship between the entity relationship type and the head entity type and the tail entity type, the triples whose head and tail entity types do not meet the constraint rules are filtered out through the filtering layer, and the relationship between the filtered triples is adjusted through the adjustment layer to obtain the filtered and adjusted entity relationship set R1; S4: Use the weapon equipment entity relationship extraction model based on rule knowledge to perform a second extraction of entity relationships on the weapon equipment text dataset to obtain the entity relationship set R2; S5: R1 and R2 are merged through deduplication and ablation operations to obtain the entity relationship set R; The S2 specifically includes the following steps: S2.1: Use the BERT layer based on the pre-trained entity relationship extraction model as the representation layer, input each sentence in the weapons and equipment text dataset into the representation layer to obtain a set of word vector representations that integrate contextual semantic information; S2.2: Input the word vector that integrates the contextual semantic information into the recurrent neural network to obtain the complete hidden layer state sequence H corresponding to the entire sentence; S2.3: The complete hidden layer state sequence H of the sentence is introduced into the convolutional neural network layer, and through convolution and pooling operations, a vector representation S that integrates the local and global semantic features of the sentence is obtained; S2.4: Input S into the fully connected layer, and the obtained feature vector v is introduced into the output layer to use the classifier to classify the relationship, complete the extraction of the relationship between entities, and obtain the extraction result of the relationship between entities; S2.5: According to the extraction results of the inter-entity relations and the entity relation label information, the inter-entity relation extraction loss function is set, the training and testing of the pre-trained entity relation extraction model is completed, and the pre-trained entity relation extraction model is updated according to the test results; The recurrent neural network adopts the BiGRU neural network: The BiGRU neural network extracts sentence context features by combining the forward GRU encoder and the backward GRU encoder, and outputs the unidirectional hidden layer state h' corresponding to each word in the sentence. i and h″ i , and h' i and h″ i The hidden state h corresponding to each word in the sentence is concatenated to obtain the fusion context semantic information i =[h' i ;h″ i ], the complete hidden layer state sequence corresponding to the entire sentence is H = [h0,h1,…,h n ]; The classifier uses the Softmax function, as shown in formula (1): Among them: Softmax(v i ) is the predicted value of the i-th entity relationship in the entity relationship set; v i is the input feature vector; v j is the weight of the jth position of the vector; N is the total number of entity relationships; The loss function for extracting the relationship between entities is set as: According to the result y extracted based on the pre-trained entity relationship extraction model i Relationship with real label Set the cross entropy loss function to calculate the loss value L of the model, as shown in formula (2): Update the model parameters according to the loss value to complete the training of the pre-trained entity relationship extraction model; The model is tested N times using the test set, and the accuracy P, recall R, and F1 value of the model in each test are recorded as the evaluation indicators of the model, as shown in formulas (3) to (5): Among them, TP represents the correct number of entity relationship triples extracted by the model, FP represents the incorrect number of extracted entity relationship triples, and FN represents the number of correct entity relationship triples that have not been extracted; According to the accuracy, recall rate and F1 value, select the best set of model parameters as the final parameters of the pre-trained entity relationship extraction model; The S3 specifically includes the following steps: S3.1: According to the constraint relationship between the entity relationship type and the head entity type and the tail entity type, a filtering layer for filtering the relationship between entities and an adjustment layer for adjusting the relationship between entities are established; S3.2: The extraction results of the relationship between entities in S2.4 and the entity pairs corresponding to the extraction results provided in the weapon and equipment text dataset are introduced into the filtering layer to form triples, and the triples whose head and tail entity types do not meet the constraint rules are filtered out through the filtering rules; S3.3: Introduce the triples filtered out by S3.2 into the adjustment layer, and adjust the relationship between entities according to the adjustment rules and the head and tail entity types in the triples to obtain the relationship between entities that can satisfy the constraint rules; S3.4: After filtering and adjustment by the filtering layer and the adjustment layer, the entity relationship set R1 is obtained; The constraint relationship between the entity relationship and the head entity type and the tail entity type is: When the head entity type in the triple is PRODUCT and the tail entity type is PRODUCT, the corresponding entity relationship type is equipment relationship; when the head entity type is PRODUCT and the tail entity type is FAC or LOC, the corresponding entity relationship type is location relationship or target relationship, affiliation relationship; when the head entity type is PRODUCT and the tail entity type is QUANTITY, the corresponding entity relationship type is location relationship; when the head entity type is PRODUCT and the tail entity type is CATEGORY, the corresponding entity relationship type is category relationship; The filtering rules are: Through the entity label information and entity relationship label information provided in the weapon equipment text dataset, the head entity type and tail entity type in the triple are obtained, and the triples whose head and tail entity type combinations do not exist in the constraint relationship are filtered out; The adjustment rules are: Through the entity label information and entity relationship label information provided in the weapon and equipment text dataset, the entity type and entity relationship type of the head and tail entities in the triple are obtained. According to the head and tail entity types in the constraint relationship and their corresponding entity relationship types, the entity relationships in the triples that do not meet the constraint relationship are adjusted.

2. The weapon equipment entity relationship extraction method based on the combination of pre-training model and rules according to claim 1 is characterized in that: The S1 specifically includes the following steps: S1.1: Read the weapon equipment text dataset with entity and entity relationship label information, perform deduplication processing, and obtain the entity set, entity type set, entity relationship set, and entity relationship type set; S1.2: Pad or truncate the sentences in the weapon and equipment text dataset according to the character length of the input sentence of the pre-trained entity relationship extraction model, and add the beginning flag and the end flag to each sentence in the weapon and equipment text dataset; S1.3: Divide the processed weapons and equipment text dataset into training set, validation set, and test set.

3. The weapon equipment entity relationship extraction method based on the combination of pre-training model and rules according to claim 2 is characterized in that: The padding or truncation process is: The maximum character length of each weapon and equipment text data input based on the pre-trained entity relationship extraction model is set to n1. If the character length of the sentence in the weapon and equipment text dataset is greater than n1, the sentence is truncated at the n1-2th character, and the beginning and end flags of the sentence are added to obtain the maximum character length n1. If the character length of the sentence in the weapon and equipment text dataset is less than n1, O is used to fill it to n1-2 character length, and the beginning and end flags of the sentence are added to obtain a total of n1 character length.

4. The weapon equipment entity relationship extraction method based on the combination of pre-training model and rules according to claim 1 is characterized in that: The S4 specifically comprises the following steps: S4.1: Compare the entity relationship set R1 extracted in S3 with the entity relationship label information provided in the weapon and equipment text dataset to see if they are consistent, locate the inconsistent triples in the weapon and equipment text dataset, and analyze their semantic information. Based on the analysis results, obtain the fine-grained semantic information and relationship type description corresponding to each relationship type; S4.2: Establish a rule knowledge base for extracting the relationship between entities based on the types of the head entity and the tail entity, the distance constraint relationship between the two entities, the key words and phrases that express different semantic relationships, and the structural relationship between the weapon equipment entity and the attribute value; S4.3: Extract entity relationships from the weapons and equipment text dataset through the weapons and equipment entity relationship extraction model based on rule knowledge, and obtain the entity relationship set R2; The relationship type description includes: There are two types of entity relationship type descriptions corresponding to location relationships: one is that the head entity is a ship and the tail entity is longitude and latitude, and the corresponding entity relationship type key word is located; the other is that the head entity is a ship and the tail entity is a place, and the corresponding entity relationship type key word is located; Description of the entity relationship type corresponding to the equipment relationship: the head entity is a ship, the tail entity is an aircraft or a weapon, and the corresponding entity relationship type key words are carrying or equipment; There are two types of entity relationship type descriptions corresponding to the target relationship: one is that the head entity is a ship and the tail entity is a place, and the corresponding entity relationship type key word is intrusion; the other is that the head entity is a ship and the tail entity is a place, and the corresponding entity relationship type key word is arrival; Description of the entity relationship type corresponding to the affiliation relationship: the head entity is a ship, the tail entity is a country or a structure, and the corresponding entity relationship type key word is belong to; Description of the entity relationship type corresponding to the type relationship: the head entity is a ship, the tail entity is an anti-tank weapon, an anti-aircraft weapon, an anti-ship weapon, an anti-submarine weapon or an anti-missile weapon, and the corresponding entity relationship type keyword is type.

5. The weapon equipment entity relationship extraction method based on the combination of pre-training model and rules according to claim 1 is characterized in that: The S5 specifically includes the following steps: S5.1: performing a fusion operation on the entity relationship set R1 obtained in S3 and the entity relationship set R2 obtained in S4, wherein the fusion operation includes deduplication and ablation; S5.2: According to the entity relationship sets R1 and R2 and their corresponding entity pair information, the duplicate entity relationships existing in both R1 and R2 are deleted from R1 to obtain the entity relationship set R'1; S5.3: According to the entity relationship sets R'1 and R2 and their corresponding entity pair information, for the relationships with the same entity pairs but inconsistent relationships in R'1 and R2, the entity relationship set R2 obtained by the weapon equipment entity relationship extraction model based on rule knowledge is used as the basis, and the relationships in R'1 are deleted to obtain the entity relationship set R'1'; S5.4: Merge the entity relationship sets R'1' and R2 to obtain the weapon equipment entity relationship set R.