Joint relation triple extraction method based on table filling

Through the joint relationship triple extraction method based on table filling, the interactive association and maximum pooling operation of subject and object features are solved, and the problem of neglecting association in the existing technology is achieved, and a more accurate and efficient relationship triple extraction is achieved. .

CN119248942APending Publication Date: 2025-01-03XINJIANG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411383473.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The existing triple extraction method ignores the association between subject and object and the association between relational triples, resulting in the problem of overlapping relationships and nesting entities that cannot be effectively solved.

Method used

Using a joint relationship triple extraction method based on table filling, the combined table features are generated through two interactive correlations between subject-related features and object-related features, combined with maximum pooling operation and feedforward neural network, and combined table features are generated through multiple iterations and prevention. Gradient vanishing mechanism optimizes relationship extraction.

Benefits of technology

Improve the accuracy and efficiency of relational triple extraction, effectively reduce the interference of relation overlap and entity nesting on extraction, enhance the capture of potential associations between subject, object and relationship, and ensure the accuracy and reliability of extraction sex.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248942A_ABST
    Figure CN119248942A_ABST
Patent Text Reader

Abstract

The invention provides a joint relation triple extraction method based on table filling. The joint relation triple extraction method comprises the following steps of obtaining text data and generating subject related features and object related features; based on the subject-related features and the object-related features, carrying out two times of interaction association to obtain relationship types and combined table features of the entity pairs; processing the features of the combined table to obtain a subject-related maximum feature and an object-related maximum feature; interacting the maximum characteristics related to the subjects and the objects with the global information of the text data to obtain reasoning path information between the relation triples; iterating the steps for multiple times to output a final feature vector, obtaining a head-tail entity relation set based on the final feature vector, and generating a relation triple by using a decoding strategy; according to the method, the association between the host and the guest and the association between the relation triads are fully considered, so that the interference of relation overlapping and entity nesting on the accuracy of table filling is effectively reduced, and the extraction of the relation triads is more accurate and efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of relation triple extraction, and in particular to a joint relation triple extraction method based on table filling. Background Art

[0002] Relation triple extraction (RTE) refers to the extraction of relation triples from unstructured text (usually sentences), usually represented as (subject, relation, object) triples, where the relation is the link between the subject and object semantics. Relation triple extraction is an important information extraction task that is crucial to many downstream fields such as knowledge graphs. In the process of relation triple extraction, it is crucial to extract the connection between the subject and the object and to extract the connection between relation triples. The former helps to determine the relationship between the subject and the object, while the latter helps to extract new reasoning paths from known relation triples.

[0003] Currently, the most commonly used triple extraction method is the end-to-end joint triple extraction method, which can extract entity pairs and relations simultaneously and solve the problem of relation overlap by using a relation-specific sequence labeling component. However, this method ignores two very valuable features hidden in the sentence: the association between the subject and the object in the relation triple and the association between relation triples.

[0004] In addition to the current end-to-end joint RTE methods, table-filling-based joint RTE methods have also received increasing attention. This method maintains a table for each relation to perform RTE, where each table element represents an entity pair. Although these methods have made many efforts in joint RTE, they fail to consider the impact of internal connections between subjects and objects and connections between relation triples on the extraction of relation overlapping triples. In addition, previous sequence labeling methods also fail to consider the case of entity nesting. Therefore, there is still room for improvement in the problem of relation overlap and entity nesting. Summary of the invention

[0005] In order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a joint relationship triple extraction method based on table filling, which fully considers the association between subject and object and the association between relationship triples, effectively reduces the interference of relationship overlap and entity nesting on the accuracy of table filling, and makes the extraction of relationship triples more accurate and efficient.

[0006] To achieve the above object, the present invention provides the following solution: a method for extracting joint relationship triples based on table filling, comprising the following steps:

[0007] S1, obtaining text data and encoding the text data into a series of token representations, and using the token representations to generate subject-related features and object-related features;

[0008] S2, performing a first interactive association between the subject-related features and the object-related features and extracting associated useful information to determine the relationship type of the entity pair;

[0009] S3, using the relationship type of the entity pair, connecting all the table features in the text data to achieve a second interactive association between the subject-related features and the object-related features, and obtaining a combined table feature;

[0010] S4, processing the combined table features using a maximum pooling operation and a feedforward neural network model to obtain a maximum subject-related feature and a maximum object-related feature;

[0011] S5, interacting the subject-related maximum feature and the object-related maximum feature with the global information of the text data to extract reasoning path information between relation triples;

[0012] S6, iterating steps S2-S5 multiple times to output a final feature vector, generating a global entity task and entity head and tail tasks based on the final feature vector to obtain a head and tail entity relationship set, and then generating a relationship triple based on the head and tail entity relationship set and a decoding strategy;

[0013] Among them, the anti-gradient vanishing mechanism and loss function are introduced in the process of multiple iterations.

[0014] Optionally, text data is obtained and encoded into a series of token representations, and the token representations are used to generate subject-related features and object-related features, including

[0015] The text data is segmented and formatted, and the segmented sentences are converted into corresponding index sequences using the BERT-Base-Cased vocabulary. The index sequences are then encoded into a series of token representations for representing the contextual features of each word in the sentence using the BERT model.

[0016] A sequence of token representations is extracted and the token representations are input into two independent feedforward neural networks for feature extraction; the feedforward neural networks include a first feedforward network for generating subject-related features and a second feedforward network for generating object-related features.

[0017] Optionally, performing a first interactive association between the subject-related features and the object-related features and extracting associated useful information to determine the relationship type of the entity pair includes:

[0018] Extracting a subject-related feature vector set and an object-related feature set from the token representation and the feedforward neural network;

[0019] Using the first multi-head attention mechanism and the reverse operation, the subject-related feature vector set is set as a query and the object-related feature vector set is set as a key-value to perform a first attention operation, and then the subject-related feature vector set is set as a key-value and the object-related feature vector set is set as a query to perform a second attention operation, so as to obtain a query vector and a key vector;

[0020] Based on the first multi-head attention mechanism, in each attention head, a dot product operation is performed on the query vector and the key vector to obtain a first attention score, and the first attention score is converted into a first attention weight, and then the first attention weights of each head are connected and the associated useful information is obtained through linear transformation.

[0021] Optionally, using the relationship type of entity pairs, all table features in the text data are connected to achieve a second interactive association between the subject-related features and the object-related features to obtain a combined table feature, including:

[0022] Based on the token representation, extract the feature representation of each word to obtain basic features, extract the table features and process them;

[0023] Connecting the basic features and the processed table features to obtain a comprehensive feature vector, and then separating the comprehensive feature vector to obtain a subject feature vector and an object feature vector;

[0024] Introducing an interactive mechanism to exchange information between the subject feature vector and the object feature vector to obtain interactive information;

[0025] The subject feature vector and the object feature vector are fused using the interaction information to obtain the combined table feature.

[0026] Optionally, the combined table features are processed using a maximum pooling operation and a feedforward neural network model to obtain the maximum subject-related features and the maximum object-related features, including:

[0027] Dividing the combined table features into subject-related feature segments and object-related feature segments;

[0028] Using a maximum pooling operation to extract the maximum value of each dimension in the subject-related feature segment to generate an initial subject feature vector for capturing all important characteristics of the subject;

[0029] Extracting important information from the object-related feature fragment using a maximum pooling operation to generate an object feature initial vector;

[0030] The subject feature initial vector and the object feature initial vector are input into a feedforward neural network for processing to obtain the subject-related maximum feature and the object-related maximum feature.

[0031] Optionally, interacting the subject-related maximum feature and the object-related maximum feature with global information of text data to extract reasoning path information between relation triples includes:

[0032] Using the second multi-head attention mechanism, the subject-related maximum feature and the object-related maximum feature are set as queries, and the global information of the text data is set as key-value,

[0033] Based on the second multi-head attention mechanism, a dot product operation is performed in each attention head to obtain a second attention score, and then the second attention score is converted into a second attention weight for weighted integration of global information to realize interactive information extraction;

[0034] Each attention head is interactively integrated so that each head captures different global feature elements and obtains the reasoning path information between relation triplets.

[0035] Optionally, iterating steps S2-S5 multiple times to output a final feature vector, generating a global entity task and entity head and tail tasks based on the final feature vector to obtain a head and tail entity relationship set, and then generating a relationship triple based on the head and tail entity relationship set and a decoding strategy, including:

[0036] Setting the iteration end condition, and obtaining the final feature vector output in the last iteration of steps S2-S5; the final feature vector includes the subject, the object, the sentence global context interaction information and the sentence deep-level relationship;

[0037] The final feature vector is used to identify the positions and categories of all entities involved in the relationship in the sentence to establish an entity graph, and sequence annotation is used to construct an entity set on the entity graph to complete the global entity task;

[0038] Based on the entity graph, the final feature vector is used to predict the entity pairs to determine the entity pairs with direct relationship, so as to complete the entity head and tail task; the entity pair includes an entity head and an entity tail;

[0039] Combining the entity set with entity pairs having direct relationships, obtaining a head-tail entity relationship set;

[0040] The head and tail entity relationship sets are decoded using a decoding strategy to obtain all relationship triples in the sentence, and then the relationship triples are filtered, sorted or modified to improve the quality and relevance of the relationship triples.

[0041] Optionally, the anti-gradient vanishing mechanism includes a residual connection for adding input features to outputs in each iteration, a regularization strategy for gradient propagation, an activation function for preventing gradients from being too small, and gradient clipping for avoiding gradient explosion and vanishing.

[0042] Optionally, the loss function includes a global entity task loss function, an entity head and tail task loss function and a total loss function; the total loss function is obtained by combining the global entity task loss function and the entity head and tail task loss function, and the expression of the total loss function is L=λ1L1+λ2L2, wherein L is the total loss function, L1 is the global entity task loss function, L2 is the entity head and tail task loss function, and λ1 and λ2 are adjustable weight parameters.

[0043] The present invention discloses the following technical effects by providing a method for extracting joint relationship triples based on table filling:

[0044] 1. The present invention realizes effective feature interaction between the subject and the object by interactively associating the subject-related features and the object-related features twice, extracts the most helpful information for relationship judgment from the rich context information, can determine the relationship type of entity pairs more quickly and accurately, and can effectively combine and interact with all the table features in the sentence to generate a more expressive feature representation, making the extraction of relationship triples more accurate and efficient.

[0045] 2. In the extraction of relational triples, the present invention utilizes combined table features and combines maximum pooling operations and feedforward neural networks to extract the maximum feature vector related to the subject and the object, wherein the maximum pooling operation can help filter out less relevant information and retain only the strongest signal. The feedforward neural network can further compress and integrate the subject's maximum feature vector to form a more representative subject feature output, while the object's maximum feature vector is also processed to generate a feature vector that is more closely related to the object. Through the above process, the present invention can effectively extract and enhance the key information in the combined features, emphasizing the potential association between the subject and the object and between the two and the relationship, thereby providing strong support for the determination of relational triples.

[0046] 3. The present invention makes full use of the multi-head attention mechanism by interacting the maximum feature with the global information, so that the subject and object features can obtain deep interaction with the global information. This fusion not only enhances the expression of the subject and object, but also reveals a clear reasoning path. The reasoning path is to deduce the association between the context and specific details, pay attention to information of different granularities and levels, especially the comprehensive performance in the context between sentences, so that the inferred triple relationship is more accurate.

[0047] 4. The present invention uses multiple iterations of subject-object interaction and reasoning path extraction to gradually refine features, repeatedly process and strengthen information, and capture more complex and deep relationships in sentences. At the same time, through the anti-gradient vanishing mechanism and loss function in the multiple iterations, the relationship extraction process can be optimized, making each round of iterative training more efficient and directional, ensuring the accuracy and reliability of relationship triple extraction.

[0048] 5. Through global entity tasks and entity head and tail tasks, the present invention can form a complete entity set and determine which entity pairs (i.e., between the head entity and the tail entity) have a direct relationship, thereby enhancing and enriching the ability of relationship identification, thereby extracting all relationship triplets in the sentence.

[0049] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0051] Figure 1 A flow chart of a method provided by an embodiment of the present invention;

[0052] Figure 2 A schematic diagram of an iterative cycle of final output features provided by an embodiment of the present invention;

[0053] Figure 3 A schematic diagram of relation triple generation after the iterative loop provided in an embodiment of the present invention is completed. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0056] like Figure 1-3 As shown, the present invention provides a method for extracting joint relationship triples based on table filling, comprising the following steps:

[0057] S1. Obtain text data and encode the text data into a series of token representations, and use the token representations to generate subject-related features and object-related features; the specific process is:

[0058] 1.1 Segment the text data and convert its format, including the special start tag `[CLS]` and the separation tag `[SEP]`; use the BERT-Base-Cased vocabulary to convert the segmented sentences into corresponding index sequences.

[0059] 1.2 The BERT model is then used to encode the index sequence into a series of token representations for representing the context features of each word in the sentence; each token corresponds to a vector.

[0060] 1.3 Extract the sequence of token representations and input the token representations into two independent feedforward neural networks (usually multi-layer perceptrons or MLPs) for feature extraction; the feedforward neural networks include a first feedforward network for generating the subject-related features and a second feedforward network for generating the object-related features.

[0061] 1.4 The output of each feedforward network can be mapped to a specific label space as needed. Typically, this might be a classification task, predicting whether each token is part of the subject, object, or something else.

[0062] S2, such as Figure 1-2 As shown, the subject-related features and the object-related features are first interactively associated and useful associated information is extracted to determine the relationship type of the entity pair; the specific process is:

[0063] 2.1 Extract a subject-related feature vector set and an object-related feature set from the token representation and the feedforward neural network; each set contains a number of vectors, and each vector corresponds to a token in the sentence.

[0064] 2.2 Using the first multi-head attention mechanism and the reverse operation, the subject-related feature vector set is set as the query and the object-related feature vector set is set as the key-value for the first attention operation, and then the subject-related feature vector set is set as the key-value and the object-related feature vector set is set as the query for the second attention operation to obtain the query vector and the key vector.

[0065] 2.3 Based on the first multi-head attention mechanism, in each attention head, a dot product operation is performed on the query vector and the key vector to obtain a first attention score, and the first attention score is converted into a first attention weight, and then the first attention weights of each head are connected and the associated useful information is obtained through linear transformation.

[0066] Among them, the introduction of the multi-head attention mechanism allows the model to pay attention to the information of multiple feature spaces at the same time. The characteristic of multi-head attention is that it decomposes the attention mechanism into different "heads", each of which operates in a different projection space, so that the model can capture richer information. The attention output generated by each head is connected and the final output feature is obtained through linear transformation. This feature can be regarded as a representation that integrates the correlation between the subject and the object. The purpose of this step is to extract the association information between the subject and the object that can help classify the relationship by emphasizing the interaction between the feature vectors of the subject and the object.

[0067] The above method uses the attention mechanism to help the model focus on the effective feature interaction between the subject and the object, and extract the most helpful information for relationship judgment from the rich context information. In this way, the model can determine the relationship type of entity pairs more quickly and accurately.

[0068] S3, such as Figure 1-2 As shown, by using the relationship type of entity pairs, all table features in the text data are connected to realize the second interactive association of the subject-related features and the object-related features, and obtain the combined table features; the specific process is:

[0069] 3.1 Based on the token representation, extract the feature representation of each word (these representations can capture the basic semantic and syntactic information of the sentence) to obtain basic features, extract table features and process them. Table features include grammatical features (such as part-of-speech tags), positional features (such as word position indexes), dependency features (such as dependency paths obtained from sentence parsing), lexical level features, and other features that may be obtained from the sequence labeling model. These features are then standardized or preprocessed so that they can be processed uniformly.

[0070] 3.2 Connect the basic features and the processed table features to obtain a comprehensive feature vector, which contains rich information about each word in the sentence, and then use a certain mechanism (such as a sequence labeling algorithm) to identify and separate the comprehensive feature vector to obtain a subject feature vector and an object feature vector; this involves understanding decoding or labeling to identify the specific positions of the subject and object in the sentence.

[0071] 3.3 Introducing an interaction mechanism to exchange information between the subject feature vector and the object feature vector to obtain interaction information, so as to explicitly simulate the possible semantic association between the subject and the object. At the same time, for each subject feature vector, its interaction with all object feature vectors is calculated (possibly through methods such as attention scores), and vice versa, to emphasize important semantic connections.

[0072] 3.4 Using the interaction information to fuse the subject feature vector and the object feature vector, the combined table feature is obtained. The combined table feature models the interaction between the subject and the object to form a more compact and unified feature representation, which is convenient for downstream tasks.

[0073] In the above design, nonlinear activation functions and regularization techniques may be introduced to ensure the maximum representation and generalization ability of feature representation. The above design can effectively combine and interact all the table features in the sentence and generate more expressive feature representations, which can extract relation triples more accurately and efficiently.

[0074] S4, such as Figure 1-2 As shown, the combined table features are processed using the maximum pooling operation and the feedforward neural network model to obtain the maximum subject-related features and the maximum object-related features; the specific process is:

[0075] 4.1 The combined table features are divided into subject-related feature segments and object-related feature segments.

[0076] 4.2 Use the maximum pooling operation to extract the maximum value of each dimension in the subject-related feature segment to generate an initial subject feature vector for capturing all important characteristics of the subject.

[0077] 4.3 Use the maximum pooling operation to extract important information from the object-related feature fragment to generate an object feature initial vector.

[0078] 4.4 Input the subject feature initial vector and the object feature initial vector into a feedforward neural network for processing (including integration and nonlinear transformation) to obtain the subject-related maximum feature and the object-related maximum feature.

[0079] S5, such as Figure 1-2 As shown, the subject-related maximum feature and the object-related maximum feature interact with the global information of the text data to extract the reasoning path information between the relation triples; the specific process is:

[0080] 5.1 Using the second multi-head attention mechanism, the subject-related maximum feature and the object-related maximum feature are set as queries, and the global information of the text data is set as key-value. This setting allows the subject and object feature vectors to focus on important elements in the global sentence information.

[0081] 5.2 Based on the second multi-head attention mechanism, a dot product operation is performed in each attention head to obtain a second attention score, which is then converted into a second attention weight for weighted integration of global information to highlight those global information features that are highly relevant to the query. The second attention weight is then applied to the value vector of the global information to achieve weighted integration of global information and extraction of interactive information.

[0082] 5.3 Each attention head is interactively integrated so that each head captures different global feature elements (such as tense, place, mode, etc.). The subject or object features thus selectively absorb relevant global context information to support the parsing of relation triples. The information captured by different heads jointly reveals possible reasoning paths, thus obtaining the reasoning path information between relation triples.

[0083] S6, such as Figure 3 As shown, steps S2-S5 are iterated multiple times to output a final feature vector, global entity tasks and entity head and tail tasks are generated based on the final feature vector to obtain a head and tail entity relationship set, and then relationship triples are generated based on the head and tail entity relationship set and the decoding strategy; wherein, an anti-gradient vanishing mechanism and a loss function are introduced in the multiple iterations.

[0084] 6.1 The specific process is:

[0085] 6.11 Set the iteration end condition, by determining the number of iterations or stopping the iteration when a satisfactory loss convergence level is reached, to ensure that computational efficiency is maintained in the model. After completing a round of iterative processing, the output features are sent back to step S2 as input to start the next round of processing. Through multiple rounds of iterations, the features are gradually refined, the information is repeatedly processed and strengthened, and the model can capture more complex and deep relationships.

[0086] 6.12 Obtain the final feature vector output in the last iteration of steps S2-S5; the final feature vector includes the subject, the object, the sentence global context interaction information and the sentence deep-level relationship.

[0087] 6.13 Using the final feature vector, identify the positions and categories of all entities involved in the relationship in the sentence to build an entity graph, which can identify all possible subject or object entities involved in the relationship. Use sequence annotation to build an entity set on the entity graph, lay the foundation for relationship identification, and complete the global entity task.

[0088] 6.14 Based on the entity graph, the final feature vector is used to predict entity pairs to determine entity pairs with direct relationships. This stage can further filter possible relationship candidates to complete the entity head and tail task; the entity pair includes an entity head and an entity tail.

[0089] 6.15 Combine the entity set and the entity pairs with direct relationships to obtain a head-tail entity relationship set.

[0090] 6.16 Decode the head and tail entity relationship sets using a decoding strategy to obtain all the relationship triples in the sentence. Common decoding strategies include: Greedy decoding: quickly and simply select the most likely triple for output, but may miss some important but not obvious relationships. Beam search decoding: a method that keeps multiple possible paths and selects the best solution among them. Although the calculation is more complex, it helps to capture more potential relationships. Conditional Random Field (CRF) decoding: ensures the coherence of the generated triples in the context of the sentence by taking into account the global consistency of the overall scores of entities and relationships.

[0091] 6.17 After decoding, all the relation triples in the sentence are output, each triple is composed of a subject, a relation and an object, which means that the key elements that participate in and affect the expression in the sentence and the interaction patterns between them are successfully identified. Based on the needs, the relation triples are filtered, sorted or modified to improve the quality and relevance of the relation triples.

[0092] Through the above process, after iterative and cyclical refinement, all the relation triplets in the sentence are finally extracted successfully using the decoding strategy and task generation method. This series of steps combines feature extraction and deep decoding to enhance and enrich the ability of relation recognition.

[0093] 6.2 The anti-gradient vanishing mechanism includes:

[0094] Residual connection: In each iteration, a residual connection is introduced, which directly adds the input features to the output. This can effectively alleviate the gradient vanishing problem common in deep networks because the gradient can be propagated through a short-circuit path.

[0095] Regularization techniques: Using appropriate regularization strategies such as layer normalization can stabilize the training process and promote effective propagation of gradients.

[0096] Appropriate activation function: Choosing an appropriate activation function (such as ReLU or its variant Leaky ReLU, etc.) helps prevent the gradient from being too small.

[0097] Gradient clipping: avoid gradient explosion and disappearance, control it within an appropriate range, and ensure the stability of the optimization process.

[0098] 6.3 The loss function includes:

[0099] 6.31 Global Entity Task Loss Function

[0100] Goal: Identify all possible entities and their categories in a sentence.

[0101] Label preparation: Define the label of each word (such as B-entity type, O represents non-entity) for supervising model training.

[0102] Loss calculation: The cross entropy loss function is used to calculate the difference between the predicted entity label and the actual label. Cross entropy loss is a commonly used loss function in classification tasks that can measure the distance between the predicted distribution and the true distribution. The cross entropy loss is calculated for the entity label of each word and averaged over the entire sentence to obtain the average loss of the global entity task.

[0103] 6.32 Entity Head and Tail Task Loss Function

[0104] Goal: Identify entity pairs that may have a relationship, that is, determine the direct relationship between the head entity and the tail entity.

[0105] Label preparation: assign a relationship label (such as no relationship or a specific relationship type) to each pair of entities.

[0106] Loss calculation: Use the cross entropy loss function for multi-label classification or the binary cross entropy loss function, depending on whether the task is multi-category or multi-label. Calculate the cross entropy loss between the predicted relationship label and the true relationship label for each pair of entities (head entity and tail entity). Average the losses of all entity pairs to get the average loss for entity head and tail tasks.

[0107] 6.33 Total Loss Function

[0108] The total loss function is obtained by combining the global entity task loss function and the entity head and tail task loss function. The expression of the total loss function is L=λ1L1+λ2L2, wherein L is the total loss function, L1 is the global entity task loss function, L2 is the entity head and tail task loss function, and λ1 and λ2 are adjustable weight parameters.

[0109] Through the above loss design and calculation mechanism, we can achieve a coordinated improvement in focusing on local entity recognition and overall relationship understanding, making each round of iterative training more efficient and directional.

[0110] Therefore, the present invention provides a joint relationship triple extraction method based on table filling, which fully considers the association between subject and object and the association between relationship triples, effectively reduces the interference of relationship overlap and entity nesting on the accuracy of table filling, and makes the extraction of relationship triples more accurate and efficient.

[0111] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0112] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for extracting joint relationship triples based on table filling, characterized in that: The following steps are involved: S1, obtaining text data and encoding the text data into a series of token representations, and using the token representations to generate subject-related features and object-related features; S2, performing a first interactive association between the subject-related features and the object-related features and extracting associated useful information to determine the relationship type of the entity pair; S3, using the relationship type of the entity pair, connecting all the table features in the text data to achieve a second interactive association between the subject-related features and the object-related features, and obtaining a combined table feature; S4, processing the combined table features using a maximum pooling operation and a feedforward neural network model to obtain a maximum subject-related feature and a maximum object-related feature; S5, interacting the subject-related maximum feature and the object-related maximum feature with the global information of the text data to extract reasoning path information between relation triples; S6, iterating steps S2-S5 multiple times to output a final feature vector, generating a global entity task and entity head and tail tasks based on the final feature vector to obtain a head and tail entity relationship set, and then generating a relationship triple based on the head and tail entity relationship set and a decoding strategy; Among them, the anti-gradient vanishing mechanism and loss function are introduced in the process of multiple iterations.

2. The method for extracting joint relationship triples based on table filling according to claim 1, characterized in that: Acquire text data and encode the text data into a series of token representations, and use the token representations to generate subject-related features and object-related features, including The text data is segmented and formatted, and the segmented sentences are converted into corresponding index sequences using the BERT-Base-Cased vocabulary. The index sequences are then encoded into a series of token representations for representing the contextual features of each word in the sentence using the BERT model. A sequence of token representations is extracted and the token representations are input into two independent feedforward neural networks for feature extraction; the feedforward neural networks include a first feedforward network for generating subject-related features and a second feedforward network for generating object-related features.

3. The method for extracting joint relationship triples based on table filling according to claim 2, characterized in that: The subject-related features and the object-related features are first interactively associated and useful associated information is extracted to determine the relationship type of the entity pair, including: Extracting a subject-related feature vector set and an object-related feature set from the token representation and the feedforward neural network; Using the first multi-head attention mechanism and the reverse operation, the subject-related feature vector set is set as a query and the object-related feature vector set is set as a key-value to perform a first attention operation, and then the subject-related feature vector set is set as a key-value and the object-related feature vector set is set as a query to perform a second attention operation, so as to obtain a query vector and a key vector; Based on the first multi-head attention mechanism, in each attention head, a dot product operation is performed on the query vector and the key vector to obtain a first attention score, and the first attention score is converted into a first attention weight, and then the first attention weights of each head are connected and the associated useful information is obtained through linear transformation.

4. The method for extracting joint relationship triples based on table filling according to claim 3 is characterized in that: By using the relationship type of entity pairs, all table features in the text data are connected to realize the second interactive association of the subject-related features and the object-related features, and the combined table features are obtained, including: Based on the token representation, extract the feature representation of each word to obtain basic features, extract the table features and process them; Connecting the basic features and the processed table features to obtain a comprehensive feature vector, and then separating the comprehensive feature vector to obtain a subject feature vector and an object feature vector; Introducing an interactive mechanism to exchange information between the subject feature vector and the object feature vector to obtain interactive information; The subject feature vector and the object feature vector are fused using the interaction information to obtain the combined table feature.

5. The method for extracting joint relationship triples based on table filling according to claim 4 is characterized in that: The combined table features are processed using a maximum pooling operation and a feedforward neural network model to obtain the maximum subject-related features and the maximum object-related features, including: Dividing the combined table features into subject-related feature segments and object-related feature segments; Using a maximum pooling operation to extract the maximum value of each dimension in the subject-related feature segment to generate an initial subject feature vector for capturing all important characteristics of the subject; Extracting important information from the object-related feature fragment using a maximum pooling operation to generate an object feature initial vector; The subject feature initial vector and the object feature initial vector are input into a feedforward neural network for processing to obtain the subject-related maximum feature and the object-related maximum feature.

6. The method for extracting joint relationship triples based on table filling according to claim 5, characterized in that: Interacting the subject-related maximum feature and the object-related maximum feature with global information of text data to extract reasoning path information between relation triples, including: Using the second multi-head attention mechanism, the subject-related maximum feature and the object-related maximum feature are set as queries, and the global information of the text data is set as key-value, Based on the second multi-head attention mechanism, a dot product operation is performed in each attention head to obtain a second attention score, and then the second attention score is converted into a second attention weight for weighted integration of global information to realize interactive information extraction; Each attention head is interactively integrated so that each head captures different global feature elements and obtains the reasoning path information between relation triplets.

7. The method for extracting joint relationship triples based on table filling according to claim 6, characterized in that: Iterate steps S2-S5 multiple times to output a final feature vector, generate a global entity task and entity head and tail tasks based on the final feature vector to obtain a head and tail entity relationship set, and then generate a relationship triple based on the head and tail entity relationship set and a decoding strategy, including: Setting the iteration end condition, and obtaining the final feature vector output in the last iteration of steps S2-S5; the final feature vector includes the subject, the object, the sentence global context interaction information and the sentence deep-level relationship; The final feature vector is used to identify the positions and categories of all entities involved in the relationship in the sentence to establish an entity graph, and sequence annotation is used to construct an entity set on the entity graph to complete the global entity task; Based on the entity graph, the final feature vector is used to predict the entity pairs to determine the entity pairs with direct relationship, so as to complete the entity head and tail task; the entity pair includes an entity head and an entity tail; Combining the entity set with entity pairs having direct relationships, obtaining a head-tail entity relationship set; The head and tail entity relationship sets are decoded using a decoding strategy to obtain all relationship triples in the sentence, and then the relationship triples are filtered, sorted or modified to improve the quality and relevance of the relationship triples.

8. The method for extracting joint relationship triples based on table filling according to claim 7, characterized in that: The anti-gradient vanishing mechanism includes a residual connection for adding input features to output in each iteration, a regularization strategy for gradient propagation, an activation function for preventing the gradient from being too small, and gradient clipping for avoiding gradient explosion and disappearance.

9. The method for extracting joint relationship triples based on table filling according to claim 8, characterized in that: The loss function includes a global entity task loss function, an entity head and tail task loss function and a total loss function; the total loss function is obtained by combining the global entity task loss function and the entity head and tail task loss function, and the expression of the total loss function is L=λ1L1+λ2L2, wherein L is the total loss function, L1 is the global entity task loss function, L2 is the entity head and tail task loss function, and λ1 and λ2 are adjustable weight parameters.