Entity-relation triple extraction method, system, equipment, medium and product

Through the mark-oriented tabular feature construction method and multi-head self-attention mechanism, the problem of entity and relationship recognition in complex texts is solved, and the entity-relationship triple extraction with high accuracy and high efficiency is achieved.

CN119577157AActive Publication Date: 2025-03-07SHAANXI NORMAL UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411743962.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-30
Publication Date
2025-03-07
Estimated Expiration
2044-11-30

AI Technical Summary

Technical Problem

The prior art is difficult to accurately capture the subtle semantic connections between entities and relationships when processing complex texts, lack of recognition ability of cross-word or cross-marker relationships, and insufficient comprehensive processing of isolated entities.

Method used

The tag-oriented table feature construction method is adopted, and the table is marked through the vertex marking strategy of a specific relationship, and the mark representation is embedded in the table. Using technologies such as the multi-head self-attention mechanism and residual network, iteratively optimized word representations, and used hollow convolution to capture long-distance dependencies, and finally extracted entity-relationship triples through a bidirectional parallel decoding algorithm.

Benefits of technology

It improves the accuracy of entity recognition and overall decoding efficiency, covers all entities in a comprehensive manner, and enhances the practicality and comprehensiveness of the method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure SMS_23
    Figure SMS_23
Patent Text Reader

Abstract

The invention discloses an entity-relation triple extraction method, system and device, a medium and a product, and belongs to the technical field of natural language processing. According to the entity-relation triple extraction method provided by the invention, a mark-oriented table feature construction method is innovatively introduced, a table is marked through a vertex marking strategy of a specific relation, and a mark representation is embedded into the table. The method not only captures the relationship between the words, but also fully considers the complex interaction between the words and the marks and between the marks. Through forward and reverse bidirectional parallel search routes, the entity-relation triple can be extracted more accurately. Not only is the accuracy of entity identification improved, but also the efficiency of overall decoding is improved. Besides, the isolated entities are regarded as special cases having a relationship with the entities and are included in the category of triple classification, so that all entities are comprehensively covered, and the practicability and comprehensiveness of the method are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to an entity-relationship triple extraction method, system, device, medium and product. Background Art

[0002] In the construction of knowledge graphs, entities play a vital role. They usually refer to specific things or abstract concepts that have clear distinctions and exist independently. When these entities are connected to each other through specific relationships, a relationship triple (head entity-relationship-tail entity) is formed, where the head entity is the starting point of the relationship and the tail entity is the end point of the relationship. Together, they carry a specific piece of knowledge in the knowledge graph.

[0003] Relationships, as the cornerstone of knowledge graphs, describe various connections or interactions between entities. These relationships can be "belongs to", "is located in", "contains", etc., which together build a rich and diverse semantic network, enabling knowledge graphs to express complex knowledge structures.

[0004] In the field of natural language processing (NLP), word representation is a technique that converts words into numerical form, which makes it easier for the model to learn and understand the semantic relationship between words. This semantic relationship is crucial for entity recognition tasks, because entity recognition aims to accurately identify entities with specific meanings from text, such as names of people, places, and organizations. High-quality word representation can more accurately reflect the semantic similarity between words, thereby improving the accuracy of entity recognition.

[0005] With the development of deep learning technology, some advanced models (such as BERT and its variants) have been able to perform entity recognition tasks directly on text without an explicit word representation layer. These models have learned rich contextual information and semantic knowledge through a large amount of pre-training, which has enabled them to achieve significant performance improvements in entity recognition tasks. However, these models still use some form of word representation internally (although it may be implicit) to process and represent vocabulary and entities in text.

[0006] Relation extraction is another key task in NLP, which aims to identify semantic relations between entities from text and convert them into structured relation triplets. Word representation plays an important role in this process because it provides the model with numerical information about the semantic relations between words. By analyzing the similarities and differences between word representations, the model can infer possible semantic relations between entities.

[0007] As a basic task of relation extraction, named entity recognition (NER) is of great importance. The task of NER is to accurately identify entities with specific meanings from texts. These entities usually include names of people, places, institutions, etc. The performance of NER directly affects the effect of subsequent relation extraction tasks. Therefore, improving the accuracy of NER is crucial to building a high-quality knowledge graph.

[0008] However, traditional entity relationship extraction methods face many challenges when processing complex texts. These methods often focus on learning the relationship features between words, while ignoring cross-word or cross-tag relationships and tag information in the text. In addition, the processing of isolated entities is also a difficulty for traditional methods. In recent years, with the rise of deep learning technology, pre-trained models have demonstrated powerful feature extraction capabilities in NLP tasks. However, even with these advanced models, existing entity relationship extraction methods still have shortcomings when processing complex texts. Especially when faced with texts containing a large number of complex entities and relationships, existing methods often find it difficult to achieve high efficiency while ensuring high accuracy.

[0009] Therefore, how to realize an entity relationship extraction method that can accurately identify entities and relationships in complex texts and efficiently process large-scale data has become a technical problem that technicians in the current NLP field need to overcome urgently. Future research needs to further explore the application of deep learning technology in entity relationship extraction in order to achieve greater breakthroughs in performance. Summary of the invention

[0010] The purpose of the present invention is to provide an entity-relationship triple extraction method, system, device, medium and product to overcome the problems in the prior art of difficulty in accurately capturing the subtle semantic connections between entities and relationships when processing complex texts, insufficient recognition ability of cross-word or cross-tag relationships, and insufficient comprehensive processing of isolated entities.

[0011] The present invention solves the above technical problems through the following technical solutions: A method for extracting entity-relationship triples comprises the following steps: S1, train sentence S using a pre-trained word vector model to generate a word embedding representation; S2, encode the word embedding representation, capture the temporal and semantic relationships between words, and generate word representation; S31, perform named entity recognition and relation extraction on the word representation to obtain the entities and relations of the sentence S; S32, convert the feature information space represented by the word into the subspace of subject and object, and obtain the subject representation H s and object represents H o; Set hyperparameters to control the number of iterations; S33, iterative start: based on the subject representation H s and object represents H o , generate a corresponding label table feature representation TF for each relationship r , where the tags include HH, which indicates the start position of the head entity and the start position of the tail entity, HT, which indicates the start position of the head entity and the end position of the tail entity, TH, which indicates the end position of the head entity and the start position of the tail entity, TT, which indicates the end position of the head entity and the end position of the tail entity, and N / A for other situations; conditional layer normalization is used to generate word pair table feature representation M r , the word pair table feature representation Mr and the tag table feature representation TFr are merged to obtain the first table feature representation Tr; S34, combine the first table feature representations Tr of different relations, extract features, and generate label-aware word representations, including table features related to the subject and table features related to object , through the multi-head self-attention mechanism, the relationship between label-aware word representations and subject representation H is mined s and object represents H o The relationship between the label-aware word representation is generated through the residual network, and the final subject representation and object representation are fed back to the feature information space of the word representation for the next iteration until the iteration round is equal to the set hyperparameter. S4. After the iteration is completed, a dilated convolution is applied to capture the long-range dependencies between word pairs in the first table feature representation Tr, and obtain the second table feature representation Tr′; S5. Take the second table feature representation Tr′ as the first prediction factor, take the entity and relationship of the sentence S as the second prediction factor, obtain the final head entity and tail entity through prediction, and fill them into the table TableF; S6. Through a bidirectional parallel decoding algorithm, extract the entity pairs of each relationship in table TableF to obtain entity-relationship triples.

[0012] Furthermore, before step S1, the process also includes collecting statements to be processed, performing preprocessing, and obtaining statement S.

[0013] Furthermore, preprocessing includes word segmentation and part-of-speech tagging.

[0014] Furthermore, step S6 also includes constructing a unified label space method to set the isolated entity as an entity that has a specific relationship with itself.

[0015] Furthermore, the pre-trained word vector model is a BERT model.

[0016] Furthermore, the encoding in step S2 adopts a bidirectional long short-term memory network Bi-LSTM model.

[0017] An entity-relation triple extraction system, including A preprocessing module is used to collect the statements to be processed, perform preprocessing, and obtain the statement S; The word embedding generation module is used to train the sentence S using the pre-trained word vector model to generate word embedding representation; The word representation generation module is used to encode the word embedding representation, capture the temporal and semantic relationships between words, and generate word representations; The recognition and extraction module is used to perform named entity recognition and relation extraction on word representations to obtain entities and relations of sentence S; The feature conversion module is used to convert the feature information space represented by the word into the subspace of subject and object to obtain the subject representation H s and object represents H o ; Set hyperparameters to control the number of iterations; Iteration and optimization modules. The iteration module is used to set hyperparameters and control the iteration rounds until the iteration rounds are equal to the set hyperparameters. The optimization module specifically includes a table markup feature generation module, a label-aware word representation module, a multi-head self-attention module, and a residual network module. The label table feature generation module is used to represent H based on the subject s and object represents H o , generate a corresponding label table feature representation TF for each relationship r , where the tags include HH, which indicates the start position of the head entity and the start position of the tail entity, HT, which indicates the start position of the head entity and the end position of the tail entity, TH, which indicates the end position of the head entity and the start position of the tail entity, TT, which indicates the end position of the head entity and the end position of the tail entity, and N / A for other situations; conditional layer normalization is used to generate word pair table feature representation M r , the word pair table feature representation Mr and the tag table feature representation TFr are merged to obtain the first table feature representation Tr; The label-aware word representation module is used to combine the first table feature representations Tr of different relations, extract features, and generate label-aware word representations, including table features related to the subject. and table features related to object ; The multi-head self-attention module is used to mine the relationship between label-aware word representations and subject representation H through the multi-head self-attention mechanism. s and object represents H o Relationship with label-aware word representations; The residual network module is used to generate the final subject representation and object representation through the residual network and feed them back to the feature information space of the word representation; A long-distance dependency capture module is used to apply a dilated convolution to the final subject representation and object representation after the iteration is completed, to capture the long-distance dependency between word pairs in the first table feature representation Tr, and obtain the second table feature representation Tr′; The entity-relationship triple generation module is used to use the second table feature representation Tr′ as the first prediction factor and the entity and relationship of the sentence S as the second prediction factor, and obtain the final head entity and tail entity through prediction; and fill them into the table TableF; through a bidirectional parallel decoding algorithm, extract the entity pairs of each relationship in the table TableF to obtain the entity-relationship triple.

[0018] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the entity-relationship triple extraction method is implemented.

[0019] A computer-readable storage medium stores a computer program, which implements the above-mentioned entity-relationship triple extraction method when executed by a processor.

[0020] A computer program product includes a computer program, and when the computer program is executed by a processor, the above-mentioned entity-relationship triple extraction method is implemented.

[0021] Compared with the prior art, the positive and progressive effects of the present invention are: The entity-relationship triple extraction method provided by the present invention innovatively introduces a tag-oriented table feature construction method, tags the table through a vertex tagging strategy of a specific relationship, and embeds the tag representation into the table. This not only captures the relationship between words, but also fully considers the complex interactions between words and tags, and tags and tags. Through forward and reverse bidirectional parallel search routes, entity-relationship triples can be extracted more accurately. Not only is the accuracy of entity recognition improved, but also the efficiency of overall decoding is improved. In addition, isolated entities are regarded as special cases with relationships with themselves and are included in the category of triple classification, which achieves comprehensive coverage of all entities and improves the practicality and comprehensiveness of the method. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings in the specification are used to provide further understanding of the present invention and constitute a part of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0023] Figure 1 Schematic diagram of the process of extracting entity-relationship triples of the present invention; Figure 2 It is a structural schematic diagram of the entity-relationship triple extraction method of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0025] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. 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.

[0026] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0027] The present invention is further described in detail below in conjunction with the accompanying drawings, which are intended to explain the present invention rather than to limit it.

[0028] A method for extracting entity-relationship triples comprises the following steps: S1, train sentence S using a pre-trained word vector model to generate a word embedding representation; S2, encode the word embedding representation, capture the temporal and semantic relationships between words, and generate word representation; S31, perform named entity recognition and relation extraction on the word representation to obtain the entities and relations of the sentence S; S32, convert the feature information space represented by the word into the subspace of subject and object, and obtain the subject representation H s and object represents H o ; Set hyperparameters to control the number of iterations; S33, iterative start: based on the subject representation H sand object represents H o , generate a corresponding label table feature representation TF for each relationship r , where the tags include HH, which indicates the start position of the head entity and the start position of the tail entity, HT, which indicates the start position of the head entity and the end position of the tail entity, TH, which indicates the end position of the head entity and the start position of the tail entity, TT, which indicates the end position of the head entity and the end position of the tail entity, and N / A for other situations; conditional layer normalization is used to generate word pair table feature representation M r , the word pair table feature representation Mr and the tag table feature representation TFr are merged to obtain the first table feature representation Tr; S34, combine the first table feature representations Tr of different relations, extract features, and generate label-aware word representations, including table features related to the subject and table features related to object , through the multi-head self-attention mechanism, the relationship between label-aware word representations and subject representation H is mined s and object represents H o The relationship between the label-aware word representation is generated through the residual network, and the final subject representation and object representation are fed back to the feature information space of the word representation for the next iteration until the iteration round is equal to the set hyperparameter. S4. After the iteration is completed, a dilated convolution is applied to capture the long-range dependencies between word pairs in the first table feature representation Tr, and obtain the second table feature representation Tr′; S5. Take the second table feature representation Tr′ as the first prediction factor, take the entity and relationship of the sentence S as the second prediction factor, obtain the final head entity and tail entity through prediction, and fill them into the table TableF; S6. Through a bidirectional parallel decoding algorithm, extract the entity pairs of each relationship in table TableF to obtain entity-relationship triples.

[0029] As an optional embodiment of the present invention, before step S1, the step further includes collecting statements to be processed, performing preprocessing, and obtaining statement S.

[0030] As an optional embodiment of the present invention, the preprocessing includes word segmentation and part-of-speech tagging.

[0031] By collecting sentences to be processed and performing preprocessing (including word segmentation and part-of-speech tagging), key information in the text can be extracted more effectively, laying a solid foundation for subsequent entity recognition and relationship extraction.

[0032] As an optional embodiment of the present invention, step S6 also includes constructing a unified label space method to set the isolated entity as an entity that has a specific relationship with itself. Setting the isolated entity as an entity that has a specific relationship with itself solves the problem of insufficient processing of isolated entities in traditional methods, so that the model can more comprehensively cover all entities in the text, further improving the integrity of triple extraction.

[0033] As an optional embodiment of the present invention, the pre-trained word vector model is a BERT model. Selecting the BERT model as the pre-trained word vector model can more accurately represent the vocabulary and entities in the text, thereby improving the performance of triple extraction.

[0034] As an optional embodiment of the present invention, the encoding in step S2 adopts a bidirectional long short-term memory network Bi-LSTM model. The bidirectional long short-term memory network Bi-LSTM model can make full use of the context information in the text, improve the recognition ability of entities and relationships, and thus improve the accuracy of triple extraction.

[0035] In a specific embodiment of the present invention, see Figure 1~2 The purpose of entity-relation triple extraction is to extract all triples in the input sentence. , N is the number of triplets. in They are the head entity subject and the tail entity object, E is the predefined entity set, and m is the number of predefined entity types. , where R represents the set of predefined relations and k is the number of predefined relation types.

[0036] Given a sentence ( is the i-th word, n is the number of words in the sentence), in sentence S, we will maintain a relation table for each relation r (size is n×n). Define the label set as .if , then it means and The entity pairs are associated, and the corresponding items in the relationship table are represented as Five types are used in the marking strategy: (1) HH (Head-to-Head), indicating the start position of the head entity and the end position of the tail entity. (2) HT (Head-to-Tail), indicating the start position of the head entity and the end position of the tail entity. (3) TH (Tail-to-Head), indicating the end position of the head entity and the start position of the tail entity. (4) TT (Tail-to-Head), TT indicates the end position of the head entity and the end position of the tail entity. (5) N / A. All cells except the above four cases will be marked as N / A.

[0037] In the embodiment of the present invention, the sentence S is trained using a pre-trained word vector model to generate a word embedding representation, denoted as ,in It is Word vectors corresponding to words; Generate word representations using pre-training (BERT) and bidirectional long short-term memory network (Bi-LSTM) , which contains word-level feature information related to the task for a given sentence:

[0038] in and The forward LSTM and the backward LSTM are respectively at positions The hidden state of represents the connection operation; l is the number of hidden layers of the backward LSTM.

[0039] Since the relationship between entities in a triple is directional, each word plays either the subject role or the object role in a relationship. The subject represents the head of the triple, while the object represents the tail. The feature information space represented by the word is converted into the subspace of the subject and object, as shown below:

[0040] in, and They are the subject and object representations of the sentence, , ∈ and , ∈ are the trainable weights and biases respectively, and d is the dimension of the embedding vector.

[0041] Set hyperparameters to control the number of iterations; Through the Tag-based Table Feature Generation Module (TTFG), the tag features are embedded into the table to generate fine-grained table features containing word-word, word-tag, and tag-tag relationships:

[0042]

[0043] Among them, ⊙ represents the Hadamard product operation, σ is the activation function, and They are and The feature representation of W r ∈ and b r ∈ are trainable weights and biases respectively, and r represents the relationship between word pairs.

[0044] Finally, conditional layer normalization (CLN) is used to generate a directional word pair table feature representation M r , enhance the directional information of table features:

[0045] Among them, Wα, ∈ and , ∈ are trainable weights and biases, and r represents the relationship between word pairs. µ and σ are The mean and standard deviation of the elements are expressed as:

[0046] in, Indicates h j The kth dimension of .

[0047] The word pair table feature representation Mr is fused with the tag table feature representation TFr to obtain the first table feature representation Tr:

[0048] in, Represents element-wise addition.

[0049] Tr is input into the Global Average Pooling (GAP) and Feedforward Neural Network (FFN) layers to finally generate table features related to the subject and table features related to object .

[0050] Fine-grained Relational Feature Extraction (FRFE) is introduced to mine the global connection between tags and word pairs through a multi-head self-attention mechanism to further refine the table features:

[0051] The final subject representation and object representation are generated through the residual network and fed back to the feature information space of the word representation for the next iteration until the iteration round is equal to the set hyperparameter; In the embodiment of the present invention, dilated convolution is applied to increase the receptive field of the table feature, and the size of the receptive field is controlled by adjusting the dilation rate to capture the long-range dependency between word pairs:

[0052] in, is the output after the dilated convolution, is the weight of the convolution kernel, m, n are the rows and columns of the matrix operation, K is the size of the convolution kernel, and d is the dilation rate. Note that the indexes i+dm and j+dn here may require appropriate boundary processing (such as padding or cropping) to ensure that they are within the valid range of Tr.

[0053] In the embodiment of the present invention, based on the optimized table features, a vertex marking strategy of a specific relationship is used to maintain a relationship table for each relationship, and the table is filled to generate a marking matrix containing entity and relationship information; a decoding algorithm including forward search and reverse search is designed:

[0054] The forward search generates entity pairs in the order from the start tag of the head entity (subject) and the end tag of the tail entity (object). The reverse search generates entity pairs in the reverse order from the end tag of the tail entity (object) and the head entity (subject) to the start tag, which is mainly to handle nested entities. By using these labels, fine-grained entity spans can be simulated and some error propagation in model predictions can be alleviated. For example, the head entity spans "HH" to "TH" and "HT" to "TT" are searched together. When one of them exists, the corresponding span pair between the tags is considered to be the head entity (subject). Similarly, the tail entity spans "HH" to "HT" and "TH" to "TT" are searched together. When one of them exists, the corresponding span pair between the tags is considered to be the tail entity (object).

[0055] According to the tag type in the tag matrix, extract the entity-relationship triples, process the nested entities, and complete the joint extraction of entities and relationships:

[0056]

[0057] In an embodiment of the present invention, a unified label space method is constructed, isolated entities are regarded as having a specific relationship with themselves, included in the triple classification category, and meaningful labels are assigned through a classifier to achieve comprehensive entity and relationship extraction; the entity-relationship joint extraction task is converted into a fine-grained triple classification problem, effectively avoiding potential conflicts between entity and relationship representations.

[0058] Based on the same inventive concept, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the entity-relationship triple extraction method when executing the computer program, wherein the memory may include a memory, such as a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk memory, etc.; the processor, the network interface, and the memory are interconnected through an internal bus, and the internal bus may be an industrial standard architecture bus, a peripheral component interconnection standard bus, an extended industrial standard structure bus, etc., and the bus may be divided into an address bus, a data bus, a control bus, etc. The memory is used to store programs, and specifically, the program may include a program code, and the program code includes computer operation instructions. The memory may include a memory and a non-volatile memory, and provide instructions and data to the processor.

[0059] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the entity-relationship triple extraction method are implemented. Specifically, the computer-readable storage medium includes, but is not limited to, for example, a volatile memory and / or a non-volatile memory. The volatile memory may include a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include a read-only memory (ROM), a hard disk, a flash memory, an optical disk, a magnetic disk, etc.

[0060] Based on the same inventive concept, an embodiment of the present application provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer device, the computer device executes the steps of the above-mentioned entity-relationship triple extraction method.

[0061] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0062] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0063] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0064] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0065] Finally, it should be noted that the above-listed embodiments exist only as one or more specific forms of expression of the technical solution of the present invention. Their purpose is to clearly explain the concept, principle and application of the present invention through specific examples, and it is by no means intended to limit the protection scope of the present invention to these specific embodiments. In fact, the real value of the present invention lies in the technical ideas and innovations it proposes, rather than its form of expression or means of implementation.

[0066] For ordinary technicians in the relevant technical field, after in-depth reading and understanding of the technical solution of the present invention, they are fully capable of making various forms of changes, modifications or equivalent substitutions to the specific implementation methods of the invention based on their own professional knowledge and skills. These changes may include but are not limited to: adjusting the value range of technical parameters, optimizing algorithm processes to improve efficiency, replacing some technical components to achieve better compatibility or reduce costs, etc. As long as these changed technical solutions still substantially maintain the technical features claimed for protection by the original invention, that is, they can still achieve the core functions and effects of the present invention, then these changes should be deemed to fall within the scope of protection of the pending claims of the present invention.

[0067] In addition, with the continuous progress and development of technology, new technical means and methods continue to emerge, which also provides broad space for further improvement and perfection of the present invention. Therefore, the protection scope of the present invention should also include those reasonably foreseeable improvements and extensions based on the existing technology. As long as these improvements and extensions do not deviate from the basic principles and core concepts of the present invention, they should be regarded as equivalents of the present invention and are also protected by patent rights.

Claims

1. A method for extracting entity-relationship triples, characterized in that: The following steps are involved: S1, train sentence S using a pre-trained word vector model to generate a word embedding representation; S2, encode the word embedding representation, capture the temporal and semantic relationships between words, and generate word representation; S31, perform named entity recognition and relation extraction on the word representation to obtain the entities and relations of the sentence S; S32, convert the feature information space represented by the word into the subspace of subject and object, and obtain the subject representation H s and object represents H o ; Set hyperparameters to control the number of iterations; S33, iterative start: based on the subject representation H s and object represents H o , generate a corresponding label table feature representation TF for each relationship r , where the tags include HH, which indicates the start position of the head entity and the start position of the tail entity, HT, which indicates the start position of the head entity and the end position of the tail entity, TH, which indicates the end position of the head entity and the start position of the tail entity, TT, which indicates the end position of the head entity and the end position of the tail entity, and N / A for other situations; conditional layer normalization is used to generate word pair table feature representation M r , the word pair table feature representation Mr and the tag table feature representation TFr are merged to obtain the first table feature representation Tr; S34, combine the first table feature representations Tr of different relations, extract features, and generate label-aware word representations, including table features related to the subject and table features related to object , through the multi-head self-attention mechanism, the relationship between label-aware word representations and subject representation H is mined s and object represents H o The relationship between the label-aware word representation is generated through the residual network, and the final subject representation and object representation are fed back to the feature information space of the word representation for the next iteration until the iteration round is equal to the set hyperparameter. S4. After the iteration is completed, a dilated convolution is applied to capture the long-range dependencies between word pairs in the first table feature representation Tr, and obtain the second table feature representation Tr′; S5. Take the second table feature representation Tr′ as the first prediction factor, take the entity and relationship of the sentence S as the second prediction factor, obtain the final head entity and tail entity through prediction, and fill them into the table TableF; S6. Through a bidirectional parallel decoding algorithm, extract the entity pairs of each relationship in table TableF to obtain entity-relationship triples.

2. The entity-relationship triple extraction method according to claim 1, characterized in that: Before step S1, the process also includes collecting the statements to be processed, performing preprocessing, and obtaining the statements S.

3. The entity-relationship triple extraction method according to claim 2, characterized in that: The preprocessing includes word segmentation and part-of-speech tagging.

4. The entity-relationship triple extraction method according to claim 1, characterized in that: Step S6 also includes constructing a unified label space method to set the isolated entity as an entity that has a specific relationship with itself.

5. The entity-relationship triple extraction method according to claim 1, characterized in that: The pre-trained word vector model is a BERT model.

6. The entity-relationship triple extraction method according to claim 1, characterized in that: The encoding described in step S2 adopts a bidirectional long short-term memory network Bi-LSTM model.

7. An entity-relationship triple extraction system, characterized in that: include A preprocessing module is used to collect the statements to be processed, perform preprocessing, and obtain the statement S; The word embedding generation module is used to train the sentence S using the pre-trained word vector model to generate word embedding representation; The word representation generation module is used to encode the word embedding representation, capture the temporal and semantic relationships between words, and generate word representations; The recognition and extraction module is used to perform named entity recognition and relation extraction on word representations to obtain entities and relations of sentence S; The feature conversion module is used to convert the feature information space represented by the word into the subspace of subject and object to obtain the subject representation H s and object represents H o ; Set hyperparameters to control the number of iterations; Iteration and optimization modules. The iteration module is used to set hyperparameters and control the iteration rounds until the iteration rounds are equal to the set hyperparameters. The optimization module specifically includes a table markup feature generation module, a label-aware word representation module, a multi-head self-attention module, and a residual network module. The label table feature generation module is used to represent H based on the subject s and object represents H o , generate a corresponding label table feature representation TF for each relationship r , where the tags include HH, which indicates the start position of the head entity and the start position of the tail entity, HT, which indicates the start position of the head entity and the end position of the tail entity, TH, which indicates the end position of the head entity and the start position of the tail entity, TT, which indicates the end position of the head entity and the end position of the tail entity, and N / A for other situations; conditional layer normalization is used to generate word pair table feature representation M r , the word pair table feature representation Mr and the tag table feature representation TFr are merged to obtain the first table feature representation Tr; The label-aware word representation module is used to combine the first table feature representations Tr of different relations, extract features, and generate label-aware word representations, including table features related to the subject. and table features related to object ; Multi-head self-attention module, used to mine the relationship between label-aware word representations and subject representation H through multi-head self-attention mechanism s and object represents H o Relationship with label-aware word representations; The residual network module is used to generate the final subject representation and object representation through the residual network and feed them back to the feature information space of the word representation; A long-distance dependency capture module is used to apply a dilated convolution to the final subject representation and object representation after the iteration is completed, to capture the long-distance dependency between word pairs in the first table feature representation Tr, and obtain the second table feature representation Tr′; The entity-relationship triple generation module is used to use the second table feature representation Tr′ as the first prediction factor and the entity and relationship of the sentence S as the second prediction factor, and obtain the final head entity and tail entity through prediction; and fill them into the table TableF; through a bidirectional parallel decoding algorithm, extract the entity pairs of each relationship in the table TableF to obtain the entity-relationship triple.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the entity-relationship triple extraction method as described in any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the entity-relationship triple extraction method as described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the entity-relationship triple extraction method as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • High-universality many-to-many relation triple extraction method fusing five-dimensional features

    CN114091464A

  • Entity relationship extraction method and system based on LSTM and location-aware network

    CN116384396A

  • Entity relationship extraction method and device based on word enhancement

    CN116842944A

  • Systems and methods for extracting entity features from a relational database

    WO2022260670A1