Entity relationship extraction method and device, electronic equipment and storage medium
By using a combination model of self-attention network and semantic fusion network in the financial field, the problem of difficulty in capturing deep semantic relationships in the existing technology is solved, and the accuracy of entity relationship extraction and complex relationship recognition is achieved. ability.
Patent Information
- Application Number
- CN202411389114.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-07
AI Technical Summary
The prior art is difficult to capture deep semantic relationships in the extraction of entity relationships in the financial field, resulting in low accuracy.
A combination model of self-attention network, semantic fusion network and entity relationship extraction network is adopted to obtain target text features and text semantic dependency matrix for fusion, so as to achieve deep fusion of semantics and text features, and enhance the ability to identify complex relationships.
It improves the accuracy of entity relationship extraction, can accurately locate entity boundaries in text and extract relationships between entities at the same time.
Smart Images

Figure CN119272865A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of financial technology and artificial intelligence technology, and in particular to an entity relationship extraction method and device, an electronic device and a storage medium. Background Art
[0002] At present, entity relationship extraction is usually performed by using traditional machine learning methods (such as support vector machines (SVMs), random forests, etc.). For example, in the financial field, entity relationship extraction is to identify entities such as "policyholders", "insurance companies" and "beneficiaries", as well as to identify the relationship between the entities of "policyholders paying premiums to insurance companies" and "beneficiaries receiving compensation under certain conditions", and to extract the relationship between entity pairs through SVM, thereby extracting the specific relationships of "policyholder-payment-premium" and "beneficiary-receive-compensation". However, this method is still difficult to capture the deep semantic relationships in text data, resulting in a low accuracy rate of entity relationship extraction. Therefore, how to improve the accuracy of entity relationship extraction has become an urgent problem to be solved. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose an entity relationship extraction method and device, an electronic device and a storage medium, aiming to improve the accuracy of entity relationship extraction.
[0004] To achieve the above objectives, a first aspect of an embodiment of the present application proposes an entity relationship extraction method, the method comprising:
[0005] Get the target text;
[0006] Constructing a text semantic dependency matrix according to the target text;
[0007] Obtain a pre-trained entity relationship extraction model; wherein the entity relationship extraction model includes a self-attention network, a semantic fusion network and an entity relationship extraction network;
[0008] Encoding the target text using the self-attention network to obtain target text features;
[0009] Using the semantic fusion network to fuse the target text features with the text semantic dependency matrix to obtain fused semantic features;
[0010] The entity relationship extraction network is used to extract entity relationships from the fused semantic features to obtain target entity relationships.
[0011] In some embodiments, the using the semantic fusion network to fuse the target text feature with the text semantic dependency matrix to obtain a fused semantic feature includes:
[0012] Performing attention weight allocation on the target text features to obtain an attention score matrix;
[0013] The attention score matrix and the text semantic dependency matrix are fused using the semantic fusion network to obtain a semantic attention score matrix;
[0014] The semantic attention score matrix is activated to obtain the fused semantic feature.
[0015] In some embodiments, the entity relationship extraction network includes a multi-head graph attention network layer, an entity subject-object relationship network layer, an entity head relationship network layer, an entity tail relationship network layer, and a relationship fusion network layer;
[0016] The step of extracting entity relations from the fused semantic features using the entity relation extraction network to obtain target entity relations includes:
[0017] Obtaining a fused semantic node of the fused semantic feature;
[0018] Using the multi-head graph attention network layer to perform multi-head encoding on the fused semantic node to obtain fused node features;
[0019] Using the entity subject-object relationship network layer to identify the entity subject-object relationship of the fusion node features, and obtain an entity subject-object relationship matrix;
[0020] Using the entity head relationship network layer to perform entity head relationship recognition on the fusion node features to obtain an entity head relationship matrix;
[0021] Using the entity tail relationship network layer to identify the entity tail relationship of the fusion node features, and obtain an entity tail relationship matrix;
[0022] The entity subject-object relationship matrix, the entity head relationship matrix and the entity tail relationship matrix are fused according to the relationship fusion network layer to obtain the target entity relationship.
[0023] In some embodiments, the multi-head encoding of the fused semantic node using the multi-head graph attention network layer to obtain the fused node feature includes:
[0024] Select any node from the fused semantic nodes as a target semantic node, and obtain adjacent semantic nodes of the target semantic node;
[0025] Using the multi-head graph attention network layer to perform attention calculation on the target semantic node and the adjacent semantic nodes to obtain a node attention coefficient;
[0026] Performing multi-head attention averaging and activation processing on the node attention coefficient to obtain the target node feature;
[0027] The fused node feature is determined according to all the target node features.
[0028] In some embodiments, before extracting entity relations from the fused semantic features using the entity relation extraction network to obtain target entity relations, the method further includes:
[0029] Encoding the text semantic dependency matrix to obtain a semantic dependency embedding matrix;
[0030] The semantic dependency embedding matrix and the fused semantic feature are semantically aggregated to obtain an aggregated semantic feature, and the aggregated semantic feature is used as the fused semantic feature.
[0031] In some embodiments, constructing a text semantic dependency matrix according to the target text includes:
[0032] Constructing a text semantic dependency tree according to the target text;
[0033] Obtain tree nodes of the text semantic dependency tree, and obtain node dependency relationships between the tree nodes;
[0034] The pre-constructed initial matrix is filled according to the tree nodes and the node dependencies to obtain the text semantic dependency matrix.
[0035] In some embodiments, constructing a text semantic dependency tree according to the target text includes:
[0036] Performing syntactic dependency analysis on the target text to obtain a text syntactic dependency tree;
[0037] Pruning non-trunk elements of the text syntactic dependency tree to obtain a pruned syntactic dependency tree;
[0038] Performing semantic dependency analysis on the pruned syntactic dependency tree to obtain the semantics of associated words;
[0039] The pruned syntactic dependency tree is reconstructed according to the semantics of the associated words to obtain the text semantic dependency tree.
[0040] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides an entity relationship extraction device, the device comprising:
[0041] A text acquisition module is used to acquire the target text;
[0042] A semantic dependency matrix construction module, used to construct a text semantic dependency matrix according to the target text;
[0043] A relationship model acquisition module, used to acquire a pre-trained entity relationship extraction model; wherein the entity relationship extraction model includes a self-attention network, a semantic fusion network and an entity relationship extraction network;
[0044] A text encoding module, used to encode the target text using the self-attention network to obtain target text features;
[0045] A semantic fusion module, used to fuse the target text feature with the text semantic dependency matrix using the semantic fusion network to obtain a fused semantic feature;
[0046] The entity relationship extraction module is used to extract entity relationships from the fused semantic features using the entity relationship extraction network to obtain target entity relationships.
[0047] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0048] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes 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 method described in the first aspect is implemented.
[0049] The entity relationship extraction method and device, electronic device and storage medium proposed in the present application obtain target text; construct a text semantic dependency matrix according to the target text; obtain a pre-trained entity relationship extraction model; wherein the entity relationship extraction model includes a self-attention network, a semantic fusion network and an entity relationship extraction network; use the self-attention network to encode the target text to obtain target text features; use the semantic fusion network to fuse the target text features with the text semantic dependency matrix to obtain fused semantic features; use the entity relationship extraction network to extract entity relationships from the fused semantic features to obtain target entity relationships. The present application first encodes the target text to capture key information in the text; secondly, fuses the target text features with the text semantic dependency matrix, and can achieve deep fusion of semantics and text features through the model, enhance the model's ability to capture deep semantic relationships of text data, thereby improving the model's ability to recognize complex relationships between entities, and facilitate subsequent improvement of the accuracy of entity relationship extraction; finally, use the entity relationship extraction network to extract entity relationships from the fused semantic features, which can accurately locate the entity boundaries in the text, and can also achieve simultaneous extraction of relationships between entities, thereby improving the accuracy of entity relationship extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 is a flow chart of the entity relationship extraction method provided in an embodiment of the present application;
[0051] Figure 2 is another flow chart of the entity relationship extraction method provided in an embodiment of the present application;
[0052] Figure 3 yes Figure 1 Flow chart of step S102 in FIG.
[0053] Figure 4 yes Figure 3 Flow chart of step S301 in FIG.
[0054] Figure 5 yes Figure 4 Flow chart of step S406 in FIG.
[0055] Figure 6 yes Figure 3 Flow chart of step S301 in FIG.
[0056] Figure 7 is a schematic diagram of the structure of an entity relationship extraction device provided in an embodiment of the present application;
[0057] Figure 8 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0061] First, some nouns involved in this application are analyzed:
[0062] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, language recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0063] Based on this, the embodiments of the present application provide an entity relationship extraction method and device, an electronic device and a storage medium, aiming to improve the accuracy of entity relationship extraction.
[0064] The entity relationship extraction method and device, electronic device and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the entity relationship extraction method in the embodiments of the present application is described.
[0065] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0066] The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, processing / interaction systems, mechatronics, etc. Artificial intelligence software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0067] The entity relationship extraction method provided in the embodiment of the present application relates to the fields of financial technology and artificial intelligence technology. The entity relationship extraction method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the entity relationship extraction method, etc., but is not limited to the above forms.
[0068] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0069] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on user information and data related to user identity or characteristics, the user's permission or consent will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0070] Figure 1 is an optional flowchart of the entity relationship extraction method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0071] Step S101, obtaining target text.
[0072] Step S102: construct a text semantic dependency matrix according to the target text.
[0073] Step S103, obtaining a pre-trained entity relationship extraction model; wherein the entity relationship extraction model includes a self-attention network, a semantic fusion network and an entity relationship extraction network.
[0074] Step S104, using the self-attention network to encode the target text to obtain the target text features.
[0075] Step S105: Using a semantic fusion network, the target text feature is fused with the text semantic dependency matrix to obtain a fused semantic feature.
[0076] Step S106, using the entity relationship extraction network to extract entity relationships from the fused semantic features to obtain target entity relationships.
[0077] Steps S101 to S106 shown in the embodiment of the present application are obtained by obtaining a target text; constructing a text semantic dependency matrix according to the target text; obtaining a pre-trained entity relationship extraction model; wherein the entity relationship extraction model includes a self-attention network, a semantic fusion network and an entity relationship extraction network; using the self-attention network to encode the target text to obtain target text features; using the semantic fusion network to fuse the target text features with the text semantic dependency matrix to obtain fused semantic features; using the entity relationship extraction network to extract entity relationships from the fused semantic features to obtain target entity relationships. The present application first encodes the target text to capture key information in the text; secondly, the target text features are fused with the text semantic dependency matrix, which can achieve deep fusion of semantics and text features through the model, enhance the model's ability to capture deep semantic relationships of text data, thereby improving the model's ability to recognize complex relationships between entities, and facilitate subsequent improvement of the accuracy of entity relationship extraction; finally, using the entity relationship extraction network to extract entity relationships from the fused semantic features, it is possible to accurately locate entity boundaries in the text, and can also achieve simultaneous extraction of relationships between entities, thereby improving the accuracy of entity relationship extraction.
[0078] In step S101 of some embodiments, specifically, the target text refers to the text to be subjected to entity and entity relationship extraction, and the specific content of the target text can be determined based on the actual business scenario.
[0079] For example, in the financial field, the target text may include user information when purchasing insurance products (such as the name and contact information of the policyholder, the insured and the beneficiary), insurance product information (such as the insurance product name, category, insurance finance, insurance scope, etc.), and insurance contract information (such as insurance liability, insurance policy content, insurance period, etc.).
[0080] Specifically, the target text can be obtained from the enterprise backend database.
[0081] In step S102 of some embodiments, the text semantic dependency matrix refers to a numerical matrix used to represent the semantic relationship between words in the target text, and the text semantic dependency matrix is used to identify the semantic connection between words in a text sentence (such as causal relationship, conditional relationship, etc.).
[0082] For example, in the financial field, the target text is "If the insured fails to pay the first premium within 90 days after the contract takes effect, the insurance company has the right to terminate the contract." Through semantic dependency analysis, it can be determined that there are semantic connections between the insured and payment, the first premium and non-payment, the contract taking effect and 90 days, and the insurance company and the right to terminate.
[0083] See also Figure 2 In some embodiments, step S102 includes but is not limited to steps S201 to S203:
[0084] Step S201, constructing a text semantic dependency tree according to the target text.
[0085] Step S202, obtaining tree nodes of the text semantic dependency tree, and obtaining node dependency relationships between the tree nodes.
[0086] Step S203, filling the pre-constructed initial matrix according to the tree nodes and node dependencies to obtain a text semantic dependency matrix.
[0087] See also Figure 3 In some embodiments, step S201 includes but is not limited to steps S301 to S304:
[0088] Step S301, performing syntactic dependency analysis on the target text to obtain a text syntactic dependency tree.
[0089] Step S302, pruning non-trunk elements of the text syntactic dependency tree to obtain a pruned syntactic dependency tree.
[0090] Step S303: perform semantic dependency analysis on the pruned syntactic dependency tree to obtain the semantics of associated words.
[0091] Step S304, reconstructing the pruned syntactic dependency tree according to the semantics of the associated words to obtain a text semantic dependency tree.
[0092] In step S301 of some embodiments, specifically, the text syntactic dependency tree is a tree structure that describes the syntactic relationship between lexical units (such as nouns, verbs, adjectives, etc.) in a text sentence. This structure represents the words in the sentence through nodes, and represents the syntactic dependency relationship between words (such as subject-predicate relationship, verb-object relationship, attributive relationship, etc.) through directed edges.
[0093] For example, in the financial field, the insurance company assumes the insurance liability after the user pays the full premium. Through syntactic dependency analysis, we can understand that the relationship between the user and payment is a subject-predicate relationship, and the relationship between assumption and insurance liability is a verb-object relationship.
[0094] Specifically, LTP (Language Technology Platform) can be used to segment and tag sentences in the target text, and the dependency relationship between different words in the text after segmentation and part-of-speech tagging can be identified, and the identified dependency relationship can be further represented in the form of a dependency tree. Each node of the dependency tree represents a word in the sentence, the edge between the nodes represents the dependency relationship, and the arrow points to the parent node of the dependency relationship.
[0095] For example, in the financial field, if there is a sentence in the target text that this insurance product covers the risks of accidental injury, disease and property loss, the sentence after word segmentation and part-of-speech tagging is segmented into: This / r. insurance product / n. covers / v. the / u. risk / n. of / u. accidental injury / n. disease / n. and / c. property loss / n. Among them, r. represents a pronoun, n. represents a noun, v. represents a verb, u. represents an auxiliary word, and c. represents a conjunction.
[0096] Furthermore, through syntactic dependency analysis, we can understand that "insurance product" is the subject of the sentence, forming a subject-predicate relationship with "coverage", and "risk" is the object of "coverage", forming a subject-object relationship between them, indicating the scope covered by the insurance product. "Accidental injury", "disease" and "property loss" serve as the complement of the sentence, further supplementing the risk types covered by the insurance product.
[0097] In step S302 of some embodiments, specifically, since the trunk information in the sentence (such as the subject-predicate-object structure) contains the main meaning of the sentence, and removing some non-trunk elements (such as modifiers, prepositional phrases, etc.) will not affect the main meaning of the sentence, the tree structure can be simplified by pruning the non-trunk elements of the syntactic dependency tree to obtain a pruned syntactic dependency tree.
[0098] For example, in the financial field, the target text has a sentence that this high-yield insurance product provides investors with long-term stable returns. Through LTP analysis, we can understand that "this", "high-yield" and "long-term stable" are respectively used as attributes to modify words such as "insurance product" or "return". It can be determined that "this", "high-yield" and "long-term stable" are all non-main elements. By removing these non-main elements, we can get the final sentence trunk that insurance products provide investors with returns.
[0099] In this embodiment, by pruning non-trunk elements of the text syntactic dependency tree, noise and redundant information in the sentence can be eliminated, the complexity of syntactic dependency analysis can be reduced, and the analysis speed and efficiency can be improved.
[0100] In step S303 of some embodiments, specifically, in semantic dependency analysis, it is usually necessary to perform semantic role labeling on sentences, assign semantic roles to predicates (verbs or adjectives) in sentences, and identify arguments related to these predicates (such as agents, patients, etc.), thereby determining the semantics of associated words.
[0101] For example, in the financial field, there is a sentence in the target text that this insurance product covers the risks of accidental injury, disease and property loss. Through semantic dependency analysis, it can be determined that there is a semantic action-object relationship between the associated terms "insurance product" and "coverage", that is, the insurance product performs the action of coverage; "risk" is the object of "coverage", that is, risk is the object to be covered; "accidental injury", "disease" and "property loss" are specific types of "risk", forming a semantic enumeration relationship with "coverage".
[0102] In this embodiment, by performing semantic dependency analysis on the pruned syntactic dependency tree, it is helpful to understand the deep semantic relationship between words, enhance the semantic information representation of the text, and facilitate the subsequent improvement of the accuracy of entity relationship extraction.
[0103] In step S304 of some embodiments, specifically, the text semantic dependency tree refers to a tree that retains the dependency relationship between each word in the sentence (such as subject-predicate relationship, verb-object relationship, etc.), and highlights the semantic relationship between words (such as agent relationship, patient relationship, etc.).
[0104] Specifically, the pruned syntactic dependency tree is reconstructed according to the semantics of the connecting words. First, the core verbs in the text syntactic dependency tree are identified, and a core verb chain is constructed based on the core verbs. The level of each core verb node in the core verb chain is upgraded so that all core verb nodes have the same level as the core parent node, that is, they are adjusted to the direct child nodes of the core parent node, and the original relationships are connected with directed dotted lines.
[0105] Furthermore, the predicate of a sentence is generally a verb. When multiple predicates in a sentence are parent-child nodes in the text syntactic dependency tree, and the parent-child nodes are in a continuous relationship, and the dependency relationship between the parent-child nodes is a parallel relationship, then these predicates are core verbs, and a core verb chain is constructed based on these predicates.
[0106] For example, in the financial field, after a user encounters an accident or loss, the user first "reports" the insurance company, the claim process is initiated, and the claim application is "submitted" to the insurance company through a phone or online platform, including accident description, loss proof and other relevant information; secondly, after receiving the application, the insurance company assigns professionals to "review" the information submitted by the user. During the review process, if the information is found to be incomplete or there are doubts, it is necessary to "require" the user to supplement or explain the information; finally, after the review is passed, the insurance company will "assess" the loss, calculate the amount to be paid according to the terms of the insurance contract, "notify" the user of the claim decision, and "arrange" the payment of compensation. In the entire claim process, verbs such as "report", "submit", "review", "require", "assess", "notify" and "arrange" constitute the core verb chain.
[0107] Furthermore, in the financial field, the core parent node can be "Claims Process Management". First, "Reporting a Case" is promoted to a direct child node of "Claims Process Management", indicating that it is a sign of the start of the claims process; secondly, a directed dotted line is used from "Reporting a Case" to "Submitting a Case", indicating that after reporting a case, the user needs to submit claim information, and then "Submitting a Case" is also promoted to a direct child node of "Claims Process Management", and a directed dotted line is used to connect the "Submitting" and "Reviewing" links, and so on, until "Arrangement" is also promoted to a direct child node of "Claims Process Management".
[0108] Furthermore, during the reconstruction process, the preposition structure can be adjusted to improve the node level of the subject or object introduced by the preposition, so that it serves as the direct child node of the corresponding core parent node. Furthermore, the passive voice can be adjusted to improve the node level corresponding to the passive sentence, thereby obtaining a reconstructed text semantic dependency tree.
[0109] In this embodiment, the pruned syntactic dependency tree is reconstructed according to the semantics of the associated words, so that the text semantic dependency tree combines the syntactic structure and semantic information, providing a more accurate and comprehensive text semantic representation, which is convenient for subsequent improvement of the accuracy of entity relationship extraction.
[0110] In step S202 of some embodiments, the node dependency relationship includes but is not limited to agent relationship, patient relationship, sequence relationship and conditional relationship.
[0111] For example, in the financial field, there is a sentence in the target text that this insurance product covers the risks of accidental injury, disease and property loss. The tree nodes are "insurance product", "coverage", "risk", "accidental injury", "disease" and "property loss". The node dependencies are the patient relationship between "insurance product" and "coverage", the patient relationship between "risk" and "coverage", and the enumeration relationship between "accidental injury", "disease", "property loss" and "risk".
[0112] In step S203 of some embodiments, specifically, first, a matrix is initialized according to the tree nodes and node dependencies, the rows and columns of the matrix correspond to these tree nodes, and each edge between the tree nodes (i.e., the node dependency) is traversed; secondly, for each tree node, according to the node dependency, the relationship label is filled in the corresponding position in the matrix. If there are tree nodes without direct dependencies, a special mark (such as a zero value) can be filled in the matrix to indicate that there is no direct dependency between the tree nodes. If a tree node depends on multiple tree nodes, or multiple tree nodes depend on the same tree node, multiple positions in the matrix are marked accordingly; finally, all tree nodes and tree node dependencies are filled into the matrix to form a complete text semantic dependency matrix.
[0113] In this embodiment, by filling the pre-constructed initial matrix according to the tree nodes and node dependencies, the semantic relationship between different tree nodes in the text can be clearly displayed, which is convenient for improving the efficiency of entity relationship extraction later.
[0114] In step S103 of some embodiments, specifically, the entity relationship extraction model includes a self-attention network, a semantic fusion network and an entity relationship extraction network.
[0115] Specifically, the self-attention network can be a BERT model, which is used to encode the target text so as to capture the key information in the text; the semantic fusion network can be a Semantic Attention network, which is used to fuse the target text features with the text semantic dependency matrix, thereby achieving a deep fusion of semantic and text features and enhancing the model's ability to capture the deep semantic relationships of text data; the entity relationship extraction network can be a multi-head attention graph convolutional network, which is used for entity relationship extraction and can accurately locate the entity boundaries in the text, thus facilitating the precise extraction of entity relationships.
[0116] In step S104 of some embodiments, each word in the target text can be converted into a word embedding vector through the BERT model, the word embedding vector can be marked with the [CLS] identifier, and the marked word embedding vector can be output through the fully connected layer to obtain the target text features with high-dimensional semantic representation.
[0117] Specifically, the target text can be expressed as X = {x1, x2, ..., xn}. By using BERT (X) to encode the text, the target text features represented by Hxn can be obtained.
[0118] For example, in the financial field, if the target text is the content of a car insurance claim report, the BERT model can convert the content of the car insurance claim report into a word embedding vector, and input the vector into the fully connected layer for feature extraction to obtain target text features such as insurance company, payment, claim reason, and degree of damage.
[0119] See also Figure 4 In some embodiments, step S105 includes but is not limited to steps S401 to S403:
[0120] Step S401, assigning attention weights to target text features to obtain an attention score matrix.
[0121] Step S402, using a semantic fusion network to fuse the attention score matrix and the text semantic dependency matrix to obtain a semantic attention score matrix;
[0122] Step S403, performing activation processing on the semantic attention score matrix to obtain fused semantic features.
[0123] In step S401 of some embodiments, specifically, different weights may be assigned to target text features through a Semantic Attention network.
[0124] Specifically, first, the query attention weight WQ, key attention weight WK and value attention weight WV can be assigned to the target text feature Hxn respectively; secondly, the target text feature is multiplied by the query attention weight to obtain the query matrix Q, and then the target text feature is multiplied by the key attention weight to obtain the key matrix K, and the target text feature is further multiplied by the value attention weight to obtain the value matrix V; finally, the transposed matrices of Q and K are multiplied through the attention mechanism to obtain the attention score matrix.
[0125] In step S402 of some embodiments, the semantic attention score matrix may be determined by the following formula:
[0126] S=(W a A+b a )*Att_Score
[0127] Among them, S represents the semantic attention score matrix, Wa represents the weight of the text semantic dependency matrix, A represents the text semantic dependency matrix, ba represents the bias coefficient of the text semantic dependency matrix, and Att_Score represents the attention score matrix.
[0128] In step S403 of some embodiments, specifically, the fused semantic feature may be determined by the following formula:
[0129]
[0130] Among them, G represents the fused semantic features, S represents the semantic attention score matrix, dk represents the dimension of the S semantic attention score matrix, and V represents the value matrix.
[0131] For example, in the text content of a car insurance claim application, the target feature text is the vehicle loss, the location of the vehicle accident and the reason for the vehicle claim. The speech dependency matrix contains the object relationship between "vehicle" and "loss", and the indirect relationship between "loss degree" and "claim amount". By fusing the target feature text with the speech dependency matrix, the loss degree of the damaged vehicle and the fused semantic features of the claim amount based on the loss degree can be determined.
[0132] See also Figure 5 In some embodiments, step S106 includes but is not limited to steps S501 to S506:
[0133] Step S501, obtaining a fused semantic node of fused semantic features.
[0134] Step S502, using a multi-head graph attention network layer to perform multi-head encoding on the fused semantic nodes to obtain fused node features.
[0135] Step S503: using the entity subject-object relationship network layer to identify the entity subject-object relationship of the fused node features, and obtaining an entity subject-object relationship matrix.
[0136] Step S504: Use the entity head relationship network layer to perform entity head relationship recognition on the fusion node features to obtain an entity head relationship matrix.
[0137] Step S505 , using the entity tail relationship network layer to perform entity tail relationship recognition on the fused node features to obtain an entity tail relationship matrix.
[0138] Step S506, according to the relationship fusion network layer, the entity subject-object relationship matrix, the entity head relationship matrix and the entity tail relationship matrix are fused to obtain the target entity relationship.
[0139] In step S501 of some embodiments, specifically, since the fused semantic features are obtained through the target text features and the text semantic dependency matrix, the structure of the fused semantic features is the tree structure of the semantic dependency tree, so the fused semantic node is the tree node after the semantic dependency tree node and the target text feature are fused.
[0140] For example, in the text content of a car insurance claim application, the fused semantic nodes may be "vehicle", "loss", "extent of loss" and "claim amount".
[0141] See also Figure 6 In some embodiments, step S502 includes but is not limited to steps S601 to S604:
[0142] Step S601 : Select any node from the fused semantic nodes as a target semantic node, and obtain the adjacent semantic nodes of the target semantic node.
[0143] Step S602, using a multi-head graph attention network layer to perform attention calculation on the target semantic node and adjacent semantic nodes to obtain a node attention coefficient.
[0144] Step S603, perform multi-head attention averaging and activation processing on the node attention coefficient to obtain the target node feature.
[0145] Step S604: determining fusion node features according to all target node features.
[0146] In step S601 of some embodiments, for example, in the text content of a car insurance claim application, the target semantic node may be "vehicle" and the adjacent semantic node may be "loss".
[0147] In step S602 of some embodiments, the node attention coefficient may be determined by the following formula:
[0148]
[0149] Among them, ρ ij represents the node attention coefficient between the target semantic node and the adjacent semantic nodes, i represents the target semantic node, j represents the adjacent semantic node pointed to by the target semantic node, l represents the adjacent semantic node pointing to the target semantic node, Di represents the set of adjacent semantic nodes pointing to the target semantic node i, LeakyReLU is the activation function, φ T represents the transposed attention weight matrix of all fused semantic features, W represents the feature weight of the fused semantic features, Gi represents the fused semantic features of the target semantic node i, Gj represents the fused semantic features of the adjacent semantic node j, and Gl represents the fused semantic features of the adjacent semantic node l.
[0150] In this embodiment, by utilizing a multi-head graph attention network layer to perform attention calculations on the target semantic node and adjacent semantic nodes, and combining the attention weights between the adjacent semantic nodes pointing to the target semantic node and the attention weights between the target semantic node and the adjacent semantic nodes pointing to the target semantic node, the model can capture the semantic associations between the fused semantic nodes more comprehensively and accurately, thereby facilitating further improvement of the accuracy of entity relationship extraction in the future.
[0151] In step S603 of some embodiments, the target node feature may be determined by the following formula:
[0152]
[0153] Among them, G i ′ represents the target node feature, σ is a nonlinear activation function, M represents the number of attention heads, j represents the adjacent semantic nodes pointed to by the target semantic node, Di represents the set of adjacent semantic nodes pointing to the target semantic node i, represents the node attention coefficient between the target semantic node of the mth attention head pointing to the adjacent semantic nodes, Wm represents the feature weight of the fused semantic feature corresponding to the adjacent semantic node j of the mth attention head, and Gj represents the fused semantic feature of the adjacent semantic node j.
[0154] In this embodiment, by performing multi-head attention averaging and activation processing on the node attention coefficient, since each attention head focuses on different node features, the model can capture richer node semantic features from multiple different angles, and by averaging the node features extracted by each attention head, the model can integrate node features from different angles to form a more comprehensive and accurate node feature representation, which is convenient for subsequent improvement of the accuracy of internship relationship extraction.
[0155] In step S604 of some embodiments, specifically, the fused node features may be represented by target node features of each multi-head graph attention network layer.
[0156] In some embodiments, after step S604 and before step S106, specifically, the text semantic dependency matrix can be subjected to embedding processing to obtain a semantic dependency embedding matrix, which can enable each semantic relationship and semantic node to have a vector representation of a fixed dimension and convert discrete semantic relationships and semantic nodes into representations in a continuous vector space.
[0157] Furthermore, the method of semantically aggregating the semantic dependency embedding matrix and the fused semantic features is consistent with the method of fusing the target text features with the text semantic dependency matrix, which will not be repeated here.
[0158] In step S503 of some embodiments, the entity relationship extraction network further includes an entity subject-object relationship network layer, and the entity subject-object relationship network layer may be a Global Pointer model.
[0159] Specifically, first, the Global Pointer model predicts an entity score for each fused node feature, which is used to indicate the possibility that the fused node feature is a subject entity or an object entity; secondly, by comparing the entity score with the preset entity score threshold, if the entity score is greater than the subject score threshold, it indicates that the fused node feature is a subject entity; if the entity score is greater than the object score threshold, it indicates that the fused node feature is an object entity.
[0160] For example, in the financial field, the fusion node features are "policyholder", "premium", "insurance company" and "beneficiary", the entity score of "policyholder" as the main entity is 0.9, and the entity score of "premium" as the object entity is 0.85. The entity score threshold is 0.7, then the main entity is determined to be "policyholder" and the object entity is determined to be "premium".
[0161] Specifically, after the Global Pointer model can determine the subject entity and the object entity, it can further identify the relationship between the subject entity and the object entity. Since there may be multiple relationships between the subject entity and the object entity, a relationship category matrix between the subject entity and the object entity is generated, and according to the preset model relationship threshold, the relationship category with the highest probability in the relationship category matrix is selected as the relationship between the subject entity and the object entity.
[0162] For example, in the financial field, the subject entity is "policyholder", the object entity is "premium", the relationship categories include "payment", "purchase", etc. The relationship category probability of "payment" is 0.9, and the relationship category probability of "purchase" is 0.6. The preset model relationship threshold is 0.75. Since the "payment" relationship category is higher than 0.75, the final entity relationship category is "payment", thereby extracting the entity relationship of "policyholder-payment-premium".
[0163] In this embodiment, by utilizing the entity subject-object relationship network layer to identify the entity subject-object relationship of the fused node features, it is possible to extract the key information of the subject entity and the object entity from complex text data, and accurately extract the entity relationship between the subject entity and the object entity, thereby improving the accuracy of entity relationship extraction.
[0164] In step S504 of some embodiments, specifically, the entity head relationship network layer is also a Global Pointer model, but the linear perception layer used by this model in entity head relationship recognition pays more attention to the relevant features of the entity head.
[0165] Specifically, the entity head refers to the entity located at the beginning position in the sentence structure.
[0166] Specifically, entity head relationship refers to the entity relationship between entity heads.
[0167] For example, in the financial field, the semantic fusion feature is that the insurance company provides insurance for the insured's car, "provide" is the entity head of the verb, and "insurance company", "insured" and "car" are the entity heads of the noun phrase. The linear perception layer is used to score the relationship between the four possible entity heads, that is, there is an execution relationship between "insurance company" and "provide", and the execution relationship score is 0.8. When the entity head relationship threshold provided by the linear perception layer is 0.75, the entity head relationship between "insurance company" and "provide" is an execution relationship.
[0168] In this embodiment, by using the entity head relationship network layer to identify the entity head relationship of the fusion node features, the core semantics in the sentence can be identified, and the entity relationship between the core semantics can be accurately extracted, which helps to improve the accuracy of entity relationship extraction.
[0169] In step S505 of some embodiments, specifically, the entity tail relationship network layer is also a Global Pointer model, but the linear perception layer used by this model in entity tail relationship recognition pays more attention to the relevant features of the entity tail.
[0170] Specifically, the entity tail refers to the entity located at the end position in the sentence structure; wherein the entity tail may be a noun, an adjective, a prepositional phrase or a clause, which is used to modify or limit the entity head.
[0171] Specifically, the entity tail relationship refers to the entity relationship between the entity tail and the entity head.
[0172] For example, in the financial field, the semantic fusion feature is that the insurance company provides insurance for the insured's car. "Insurance" is the entity tail of the noun phrase. Since "insurance" and "provide" form a subject-object relationship, and the attributive of "provide" is "car", the entity tail "insurance" limits the entity head "car", and the relationship score between "insurance" and "car" is 0.85, which is greater than the entity head relationship threshold of 0.75 provided by the linear perception layer, so there is an entity tail relationship between "insurance" and "car".
[0173] In this embodiment, the entity tail relationship network layer is used to identify the entity tail relationship of the fused node features, which can accurately locate the end position of the entity and realize the modification and limitation of the entity head, thereby improving the accuracy of entity relationship extraction.
[0174] In step S506 of some embodiments, for example, in the financial field, the subject-object relationship matrix outputs "policyholder-payment-premium", the entity head relationship matrix outputs "policyholder-payment", and the entity tail relationship matrix outputs "insurance period-premium". After the three matrices are merged, the target entity relationship finally output is "policyholder-payment-insurance period-premium."
[0175] In this embodiment, the entity subject-object relationship matrix, entity head relationship matrix and entity tail relationship matrix are fused according to the relationship fusion network layer, which can accurately locate the boundaries of different entities in the semantic fusion features, and realize the joint entity relationship extraction of entity subject-object relationship, entity head relationship and entity tail relationship, thereby improving the accuracy of entity relationship extraction.
[0176] The embodiment of the present application obtains the target text; constructs a text semantic dependency matrix according to the target text; obtains a pre-trained entity relationship extraction model; wherein the entity relationship extraction model includes a self-attention network, a semantic fusion network and an entity relationship extraction network; uses the self-attention network to encode the target text to obtain the target text feature; uses the semantic fusion network to fuse the target text feature with the text semantic dependency matrix to obtain the fused semantic feature; uses the entity relationship extraction network to extract the entity relationship of the fused semantic feature to obtain the target entity relationship. The present application first encodes the target text to capture the key information in the text; secondly, fuses the target text feature with the text semantic dependency matrix, and can realize the deep fusion of semantics and text features through the model, enhances the model's ability to capture the deep semantic relationship of text data, thereby improving the model's ability to recognize complex relationships between entities, and facilitates the subsequent improvement of the accuracy of entity relationship extraction; finally, uses the entity relationship extraction network to extract the fused semantic feature to accurately locate the entity boundary in the text, and can also realize the simultaneous extraction of the relationship between entities, thereby improving the accuracy of entity relationship extraction.
[0177] See also Figure 7 The embodiment of the present application also provides an entity relationship extraction device, which can implement the above entity relationship extraction method, and the device includes:
[0178] A text acquisition module is used to acquire the target text;
[0179] A semantic dependency matrix construction module is used to construct a text semantic dependency matrix based on the target text;
[0180] The relationship model acquisition module is used to obtain the pre-trained entity relationship extraction model; the entity relationship extraction model includes a self-attention network, a semantic fusion network and an entity relationship extraction network;
[0181] The text encoding module is used to encode the target text using the self-attention network to obtain the target text features;
[0182] The semantic fusion module is used to fuse the target text features with the text semantic dependency matrix using the semantic fusion network to obtain fused semantic features;
[0183] The entity relationship extraction module is used to extract entity relationships from fused semantic features using the entity relationship extraction network to obtain target entity relationships.
[0184] The specific implementation of the entity relationship extraction device is basically the same as the specific implementation of the above-mentioned entity relationship extraction method, and will not be repeated here.
[0185] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above entity relationship extraction method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.
[0186] See also Figure 8 , Figure 8 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0187] The processor 801 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0188] The memory 802 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 802 can store processing systems and other applications. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 802, and the processor 801 calls and executes the entity relationship extraction method of the embodiment of the present application;
[0189] Input / output interface 803, used to implement information input and output;
[0190] The communication interface 804 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WI FI, Bluetooth, etc.);
[0191] A bus 805 that transmits information between the various components of the device (e.g., the processor 801, the memory 802, the input / output interface 803, and the communication interface 804);
[0192] The processor 801 , the memory 802 , the input / output interface 803 and the communication interface 804 are connected to each other in communication within the device via a bus 805 .
[0193] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned entity relationship extraction method is implemented.
[0194] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0195] The entity relationship extraction method, entity relationship extraction device, electronic device and storage medium provided in the embodiments of the present application obtain target text; construct a text semantic dependency matrix according to the target text; obtain a pre-trained entity relationship extraction model; wherein the entity relationship extraction model includes a self-attention network, a semantic fusion network and an entity relationship extraction network; encode the target text using the self-attention network to obtain target text features; use the semantic fusion network to fuse the target text features with the text semantic dependency matrix to obtain fused semantic features; use the entity relationship extraction network to extract entity relationships from the fused semantic features to obtain target entity relationships. This application first encodes the target text to capture the key information in the text; secondly, the target text features are fused with the text semantic dependency matrix, which can achieve deep fusion of semantic and text features through the model, and enhance the model's ability to capture deep semantic relationships of text data, thereby improving the model's ability to recognize complex relationships between entities, facilitating subsequent improvement in the accuracy of entity relationship extraction; finally, the entity relationship extraction network is used to extract entity relationships from the fused semantic features, which can accurately locate the entity boundaries in the text, and can also achieve simultaneous extraction of relationships between entities, thereby improving the accuracy of entity relationship extraction.
[0196] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0197] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0198] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0199] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0200] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0201] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0202] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0203] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0204] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0205] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0206] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for extracting entity relations, characterized in that: The method comprises: Get the target text; Constructing a text semantic dependency matrix according to the target text; Obtain a pre-trained entity relationship extraction model; wherein the entity relationship extraction model includes a self-attention network, a semantic fusion network and an entity relationship extraction network; Encoding the target text using the self-attention network to obtain target text features; Using the semantic fusion network to fuse the target text features with the text semantic dependency matrix to obtain fused semantic features; The entity relationship extraction network is used to extract entity relationships from the fused semantic features to obtain target entity relationships.
2. The method according to claim 1, characterized in that The step of fusing the target text feature with the text semantic dependency matrix using the semantic fusion network to obtain a fused semantic feature includes: Performing attention weight allocation on the target text features to obtain an attention score matrix; The attention score matrix and the text semantic dependency matrix are fused using the semantic fusion network to obtain a semantic attention score matrix; The semantic attention score matrix is activated to obtain the fused semantic feature.
3. The method according to claim 1, characterized in that The entity relationship extraction network includes a multi-head graph attention network layer, an entity subject-object relationship network layer, an entity head relationship network layer, an entity tail relationship network layer and a relationship fusion network layer; The step of extracting entity relations from the fused semantic features using the entity relation extraction network to obtain target entity relations includes: Obtaining a fused semantic node of the fused semantic feature; Using the multi-head graph attention network layer to perform multi-head encoding on the fused semantic node to obtain fused node features; Using the entity subject-object relationship network layer to identify the entity subject-object relationship of the fusion node features, and obtain an entity subject-object relationship matrix; Using the entity head relationship network layer to perform entity head relationship recognition on the fusion node features to obtain an entity head relationship matrix; Using the entity tail relationship network layer to identify the entity tail relationship of the fusion node features, and obtain an entity tail relationship matrix; The entity subject-object relationship matrix, the entity head relationship matrix and the entity tail relationship matrix are fused according to the relationship fusion network layer to obtain the target entity relationship.
4. The method according to claim 3, characterized in that: The multi-head encoding of the fused semantic node using the multi-head graph attention network layer to obtain fused node features includes: Select any node from the fused semantic nodes as a target semantic node, and obtain adjacent semantic nodes of the target semantic node; Using the multi-head graph attention network layer to perform attention calculation on the target semantic node and the adjacent semantic nodes to obtain a node attention coefficient; Performing multi-head attention averaging and activation processing on the node attention coefficient to obtain the target node feature; The fused node feature is determined according to all the target node features.
5. The method according to claim 4, characterized in that Before extracting entity relations from the fused semantic features using the entity relation extraction network to obtain target entity relations, the method further includes: Encoding the text semantic dependency matrix to obtain a semantic dependency embedding matrix; The semantic dependency embedding matrix and the fused semantic feature are semantically aggregated to obtain an aggregated semantic feature, and the aggregated semantic feature is used as the fused semantic feature.
6. The method according to any one of claims 1 to 5, characterized in that: The step of constructing a text semantic dependency matrix according to the target text comprises: Constructing a text semantic dependency tree according to the target text; Obtain tree nodes of the text semantic dependency tree, and obtain node dependency relationships between the tree nodes; The pre-constructed initial matrix is filled according to the tree nodes and the node dependencies to obtain the text semantic dependency matrix.
7. The method according to claim 6, characterized in that The step of constructing a text semantic dependency tree according to the target text comprises: Performing syntactic dependency analysis on the target text to obtain a text syntactic dependency tree; Pruning non-trunk elements of the text syntactic dependency tree to obtain a pruned syntactic dependency tree; Performing semantic dependency analysis on the pruned syntactic dependency tree to obtain the semantics of associated words; The pruned syntactic dependency tree is reconstructed according to the semantics of the associated words to obtain the text semantic dependency tree.
8. An entity relationship extraction device, characterized in that: The device comprises: A text acquisition module is used to acquire the target text; A semantic dependency matrix construction module, used to construct a text semantic dependency matrix according to the target text; A relationship model acquisition module, used to acquire a pre-trained entity relationship extraction model; wherein the entity relationship extraction model includes a self-attention network, a semantic fusion network and an entity relationship extraction network; A text encoding module, used to encode the target text using the self-attention network to obtain target text features; A semantic fusion module, used to fuse the target text feature with the text semantic dependency matrix using the semantic fusion network to obtain a fused semantic feature; The entity relationship extraction module is used to extract entity relationships from the fused semantic features using the entity relationship extraction network to obtain target entity relationships.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the entity relationship extraction method described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the entity relationship extraction method described in any one of claims 1 to 7 is implemented.