Heterogeneous graph neural network-based automobile part supply chain entity relationship extraction method
Through a method based on heterogeneous graph neural network, the entities and relationships in the supply chain information of automobile parts are uniformly modeled, and iterative updates are used to use multi-layer heterogeneous graph neural network and attention mechanism to ultimately achieve efficient and accurate extraction of entity relationships, which solves the problem that existing methods are difficult to deal with complex supply chain information.
Patent Information
- Application Number
- CN202411903473.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-23
AI Technical Summary
Existing entity relationship extraction methods are difficult to effectively identify entities and their complex relationships in automotive accessories supply chain information, especially when there are multiple overlapping relationship triplets in sentences.
Using a method based on heterogeneous graph neural network, the relationship system between entities and entities is modeled as nodes in the graph, and the node representation is updated through iterative fusion of multi-layer heterogeneous graph neural network, and the node representation ability is enhanced by the subject feature fusion module of the attention mechanism, and finally the subject-relationship-object triplet is extracted at one time through the subject marker and the relationship-object pair marker.
It improves the efficiency and accuracy of the extraction of entity relationships in automotive accessories supply chains, can better identify entities and relationships in complex supply chain information, reduce redundant information, and enhance the model's representation and semantic understanding ability.
Smart Images

Figure CN119808785A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet big data and new generation information technology, and in particular to an entity relationship extraction method for an automobile parts supply chain based on a heterogeneous graph neural network. Background Art
[0002] In the cloud service environment, the automotive parts supply chain is experiencing a trend of complexity and diversification. The multi-subject, multi-link structure of the automotive parts supply chain leads to diverse information types, wide sources, large volumes, and complex associations. These heterogeneous information are difficult to describe and adaptively identify in a unified manner, which poses a huge challenge to the management and optimization of the automotive parts supply chain. If these multi-source heterogeneous information cannot be effectively integrated and utilized, the collaborative efficiency of the automotive parts supply chain will be seriously affected, hindering product operation and maintenance and parts supply under the large-scale manufacturing model.
[0003] As an effective tool, knowledge graph can integrate multi-source heterogeneous information into a unified structure, reveal the complex relationships between elements in the supply chain, and thus form a comprehensive view to support cross-domain collaborative interaction. However, accurately extracting entities and relationships from multi-source heterogeneous information is the key to building knowledge graphs, and it is also the main technical challenge currently faced. Traditional entity relationship extraction methods often fail to achieve ideal results when dealing with complex fields such as the automotive parts supply chain, mainly because they cannot fully utilize the deep correlation information between entities and relationships.
[0004] Most of the existing studies on entity relationship extraction are based on pipeline methods. First, the entities in the sentence are identified, and then the relationship classification is performed for each entity pair. This method ignores the dependency between entity recognition and relationship classification, and is prone to error propagation. In order to retain the correlation between entity recognition and relationship classification, subsequent studies have proposed a joint training method for entities and relationships. However, most existing methods cannot correctly handle scenarios where sentences contain multiple overlapping relationship triplets, and will generate a large amount of redundant information. There are multiple entities in a piece of information in the automotive parts supply chain, with overlapping triplets. There are multiple triplets in a piece of information, and an entity can belong to multiple triplets at the same time. Some entities are subjects in one triplet, but objects in another triplet, presenting a complex link structure. Existing entity relationship extraction methods cannot well identify the entities in the automotive parts supply chain information and the complex relationships between entities. Summary of the invention
[0005] In view of the deficiencies of the above-mentioned prior art, the technical problem to be solved by the present invention is: how to provide an entity relationship extraction method for an automobile parts supply chain based on a heterogeneous graph neural network, firstly, the relationship types between entities are uniformly modeled as nodes in the graph; then, the node representation is updated by iterative fusion through a multi-layer heterogeneous graph neural network, and the subject feature fusion module based on the attention mechanism is used to fuse the subject feature into the word node representation; finally, the subject-relationship-object triples are extracted at one time through a subject marker and a relationship-object pair marker, thereby improving the efficiency and accuracy of entity relationship extraction in the automobile parts supply chain.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] The entity relationship extraction method of automobile parts supply chain based on heterogeneous graph neural network includes:
[0008] S1: Obtain the automotive parts supply chain information to be processed and the predefined relationship types;
[0009] S2: Perform word information embedding and word vector embedding on the automobile parts supply chain information and relationship types respectively to obtain the initial representation of word nodes and relationship nodes;
[0010] S3: Input the initial representations of word nodes and relation nodes into the trained relation extraction model, and output several subject-relation-object triplets;
[0011] The processing steps when training a relation extraction model are as follows:
[0012] S301: iteratively fuse word nodes and relationship nodes through a multi-layer heterogeneous graph neural network, update the representation of the word node, and use the word node representation output by the last layer of the heterogeneous graph neural network as the updated word node representation;
[0013] S302: Marking the starting position and the ending position of the subject in the updated word node representation by a subject marker, and finding a number of subjects;
[0014] S303: randomly selecting a subject, fusing the features of the current subject with the updated word node representation through a subject feature fusion module, and obtaining a word node representation of the fused subject features;
[0015] S304: Marking the position of the relationship in the word node representation fused with the subject feature and the starting position and ending position of the object by a relationship-object pair marker, and finding the relationship-object pair corresponding to the subject;
[0016] S305: combining the subject and the corresponding relation-object pair to generate a subject-relation-object triple;
[0017] S306: Repeat S303 to S305 until all subjects are selected, and all subject-relation-object triples are extracted;
[0018] S307: Calculate a loss function based on the extracted subject-relation-object triples and the (pre-labeled) real subject-relation-object triples, and reversely optimize the parameters of the relation extraction model;
[0019] S308: Repeat steps S301 to S307 to iteratively train the relationship extraction model until the model converges or reaches a preset number of iterations;
[0020] S4: All the output subject-relationship-object triples are used as entity relationship extraction results of the automotive parts supply chain information to be processed.
[0021] Preferably, in step S2, the processing steps of word information embedding and word vector embedding are as follows:
[0022] S201: Perform word segmentation on the automobile parts supply chain information to obtain corresponding one-hot vector representation;
[0023] S202: inputting the unique hot vector representation of the automobile parts supply chain information into the pre-trained BERT model to embed word information, thereby obtaining hidden features of the automobile parts supply chain information;
[0024] S203: Use the hidden features of the last layer of the BERT model as the initial representation of the word node;
[0025] The formula is:
[0026]
[0027] Where: represents the initial representation of the i-th word node; w i represents the i-th word in the original automobile parts supply chain information; n represents the number of words in a piece of automobile parts supply chain information;
[0028] S204: embedding the relationship type into a high-dimensional word vector through the relationship type embedding layer to obtain a relationship node representation;
[0029] The formula is:
[0030]
[0031] Where: r i 0 represents the initial representation of the jth relationship node; r jrepresents the predefined j-th relation type; E represents the relation type embedding layer; m represents the number of predefined relation types; W and b are trainable parameters.
[0032] Preferably, in step S301, the processing steps of the multi-layer heterogeneous graph neural network are as follows:
[0033] S3011: Use the initial representation of word nodes and relationship nodes as input to the multi-layer heterogeneous graph neural network;
[0034] S3012: Update the representation of word nodes and relationship nodes through iterative fusion of multi-layer heterogeneous graph neural networks;
[0035] The formula is:
[0036]
[0037] Where: Represents the word node representation of the output of the l+1th layer heterogeneous graph neural network; Represents the relational node representation of the output of the heterogeneous graph neural network at the l+1th layer; HGNN represents the heterogeneous graph neural network; Represents the word node h in the l-th layer heterogeneous graph neural network i The set of all neighbor relationship nodes; Represents the relationship node r in the lth layer of heterogeneous graph neural network j The set of all neighbor word nodes; Represents the word node representation output by the l-th layer heterogeneous graph neural network.
[0038] Preferably, in step S3012, the processing steps of each layer of the heterogeneous graph neural network are as follows:
[0039] 1) Convert the initial representations of word nodes and relationship nodes into word node vectors and relationship node vectors through a linear layer;
[0040] The formula is:
[0041] α i =W h h i +b i ;
[0042] β j =W r r j +b r ;
[0043] Where: α i , β i Represents word node vectors and relationship node vectors; W h , b h , Wr , b r is a trainable parameter;
[0044] 2) Concatenate the word node vector and the relationship node vector and calculate the similarity, and then calculate the attention weight between the word node and the relationship node based on the similarity;
[0045] γ ij =Linear(W a [α i :β j ]);
[0046]
[0047] Where: Represents word node h i and relationship node r j The attention weight between ij Represents the word node vector α i and the relationship node vector β i The similarity between them; [:] indicates vector concatenation; Liner indicates linear layer; f indicates softmax; W a Represents trainable parameters;
[0048] 3) Based on the attention weight between word nodes and relationship nodes Combined with the gating mechanism, the representation of word nodes is updated;
[0049] The formula is:
[0050]
[0051] Where: Represents the word node representation after passing through the heterogeneous graph neural network;
[0052] 4) Represent the word nodes after the heterogeneous graph neural network Add the word node to the input as the word node representation output by the heterogeneous graph neural network;
[0053] The formula is:
[0054]
[0055] Preferably, in step S302, the processing steps of the subject marker are as follows:
[0056] S3021: Map each word node in the updated word node representation through linear mapping to obtain a space K with a two-dimensional output, where the two dimensions of each word node in the space K respectively represent the probability of being the starting position and the ending position of the topic;
[0057] The formula is:
[0058] K = (σ(Linear(Dropout(X)))) 2 ;
[0059] Where: X∈R n×d represents the updated word node representation; Dropout is used to prevent overfitting; σ represents the sigmod activation function; Liner represents the linear layer;
[0060] S3022: Determine whether each word node is the starting position and ending position of the subject: if the probability of the starting position and ending position of the word node subject is greater than the set threshold, its dimension is set to 1, otherwise it is set to 0, thereby obtaining the starting position index and the ending position index of the subject;
[0061] S3023: Find the actual subject S through the starting position index and the ending position index of the subject.
[0062] Preferably, in step S303, the processing steps of the subject feature fusion module are as follows:
[0063] S3031: Calculate subject features based on all word nodes between the start position and the end position of the subject;
[0064] S3032: fusing the subject feature with each word node in the updated word node representation through a gating mechanism to generate a subject feature fusion representation of the word node;
[0065] The formula is:
[0066]
[0067] Where: represents the main feature fusion representation of the i-th word node; h i represents the i-th word node in the updated word node representation; gate represents the gating mechanism; s f represents the main feature; σ represents the sigmoid activation function; W g , b g Represents the linear layer parameters of the gating mechanism; cue_len represents the effective length of the information;
[0068] S3033: adding the main feature fusion representation of the word node to the updated word node representation to obtain the word node representation fused with the main feature;
[0069] The formula is:
[0070]
[0071] Where: The i-th word node representation representing the fusion subject feature; represents the main feature fusion representation of the i-th word node; h i Represents the updated representation of the i-th word node.
[0072] Preferably, in step S3031, the subject feature is calculated by the following formula:
[0073]
[0074] Where: s f Indicates the main features of the current training; h x and h y They represent the updated x-th and y-th word node representations of the current training subject respectively; b and e represent the starting position and ending position of the current training subject respectively; a x represents the attention weight of the x-th word node in the body, x,y∈(b,e); It is a trainable parameter.
[0075] Preferably, in step S304, the relationship-object pair marker is processed as follows:
[0076] S3041: mapping each word node dimension in the word node representation of the fused subject feature from the d dimension to a (2×m×d) dimension through a linear layer, where m represents the number of predefined relationship types; the value of the first dimension 2 represents the probability that each word node is the starting position and the ending position of the object, and the value of the second dimension m represents the probability that each word node is the position where the relationship is located;
[0077] The formula is:
[0078] (r,o)=(σ(Linear(Dropout(X′)))) 4 ;
[0079] Where: (r, o) represents the object start position, end position index and relationship category index in the relation-object pair; X′∈R n×d Represents the word node representation of the fused subject features; σ represents the sigmoid activation function; Liner represents the linear layer;
[0080] S3042: Determine whether each word node is the starting position and the ending position of the object, and whether it is one of the m types of relationships: if the probability of the position of the word node relationship is greater than the set threshold, its dimension is set to 1, otherwise it is 0; if the probability of the starting position and the ending position of the word node object is greater than the set threshold, its dimension is set to 1, otherwise it is 0;
[0081] S3043: Obtain a relationship-object pair (R, O) through the relationship category index and the object start position and end position indexes.
[0082] Preferably, a subject-relationship-object triple is represented as (S, R, O), where S represents the subject, R represents the relationship, and O represents the object.
[0083] Preferably, in step S3, the loss function when training the relationship extraction model is as follows:
[0084]
[0085] Where: U is the set of all relations in the training set; I represents a piece of labeled automotive parts supply chain information, T represents the triples contained in the information, S∈T represents the subject in the triples; T|S represents the set of all triples with S as the subject; (R,O)∈T|S represents the relation-object pair with S as the subject; U / T∈S represents all relations other than those contained in the triple set; Represents an empty relation-object pair, used to indicate that there is no corresponding relation and object; represents the subject prediction probability, Represents the predicted probability of a relation-object pair.
[0086] Compared with the prior art, the entity relationship extraction method for automobile parts supply chain based on heterogeneous graph neural network in the present invention has the following beneficial effects:
[0087] The present invention can embed word information and high-dimensional word vectors into automobile parts supply chain information and relationship types, and can unify the modeling of entities and relationships between entities in automobile parts supply chain information as nodes in the graph, which not only retains the richness of the original information, but also provides a data basis for subsequent relationship extraction. Secondly, the present invention iteratively fuses word nodes and relationship nodes to update the representation of word nodes through a multi-layer heterogeneous graph neural network, which can capture the deep association in the information and perform well in processing complex supply chain information containing multiple overlapping triples (i.e., multiple entities share the same or similar relationship); at the same time, through continuous iteration, the representation of each node is fused with the representation of its neighboring nodes, and the features of each node are gradually refined, so that key information can be located more quickly, thereby improving the efficiency of entity relationship extraction in automobile parts supply chain; and the features of the subject are fused with the updated word node representation through the subject feature fusion module, which enhances the representation ability of the node, so that the model can better pay attention to the relationship between the subject-relationship-object triples in the information, and can understand the meaning of the automobile parts supply chain information at a deeper level and make more accurate judgments, thereby improving the performance of model entity relationship extraction. Then, the present invention marks the positions of the subject, relationship and object through the subject marker and the relationship-object pair marker, which can not only ensure the structural integrity of the extracted triples, but also ensure its semantic accuracy; at the same time, the subject marker and the relationship-object pair marker can extract the subject-relationship-object triples from the automobile parts supply chain information at one time, instead of dividing the entity relationship extraction into two subtasks of entity extraction and relationship classification like the traditional entity relationship extraction model and method. The method of the present invention can better pay attention to the potential connection between relationships and entities, and is more suitable for the entity relationship extraction of automobile parts supply chain information with multiple subjects and multiple overlapping triples, thereby improving the accuracy of entity relationship extraction in the automobile parts supply chain. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] In order to make the purpose, technical solution and advantages of the invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which:
[0089] Figure 1 This is the network architecture diagram of the relation extraction (AER-HGNN) model.
[0090] Figure 2 This is an example of triples contained in actual automobile parts supply chain information.
[0091] Figure 3 This is the operating process of the iterative update mechanism of heterogeneous graph neural networks.
[0092] Figure 4 The steps of the subject feature fusion mechanism.
[0093] Figure 5 Data statistics for two public datasets: NYT and WebNLG.
[0094] Figure 6 Ablation experiment results under different information complexity.
[0095] Figure 7 The performance comparison of each heterogeneous layer model under different complexity information.
[0096] Figure 8 A simple knowledge graph constructed using triples extracted by the AER-HGNN model. DETAILED DESCRIPTION
[0097] 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. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but only represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.
[0098] The following is a further detailed description through specific implementation methods:
[0099] Example:
[0100] The applicant found that in the task of extracting information entity relationships in the automotive parts supply chain, the relationships between entities are often determined by contextual information rather than the target entity itself. If relationship information is pre-integrated into the entity relationship extraction task, it can effectively reduce the extraction of entities that are not related to semantics, reduce the generation of redundant triples, and improve extraction efficiency. In addition, existing models divide entity extraction tasks and relationship extraction tasks into two tasks, and the final model evaluation only evaluates the performance of the model entity extraction, rather than focusing on the entire triple. It is unrealistic to apply these models to the actual entity relationship extraction of the automotive parts supply chain.
[0101] In view of the above findings, this embodiment discloses a method for extracting entity relationships in an automobile parts supply chain based on a heterogeneous graph neural network.
[0102] like Figure 1 As shown in the figure, the entity relationship extraction method of automobile parts supply chain based on heterogeneous graph neural network includes:
[0103] S1: Obtain the automotive parts supply chain information to be processed and the predefined relationship types;
[0104] S2: Perform word information embedding and high-dimensional word vector embedding on the automobile parts supply chain information and relationship types respectively to obtain the initial representation of word nodes and relationship nodes (on the graph);
[0105] S3: Input the initial representation of word nodes and relation nodes into the trained relation extraction (AER-HGNN) model and output subject-relation-object (entity relation) triples;
[0106] The processing steps when training a relation extraction model are as follows:
[0107] S301: Iteratively fuse word nodes and relationship nodes through a multi-layer heterogeneous graph neural network, update the representation of the word nodes, and use the word node representation output by the last layer of the heterogeneous graph neural network as the updated word node representation (for subsequent entity relationship extraction);
[0108] S302: Marking the starting position and the ending position of the subject in the updated word node representation by a subject marker, and finding a number of subjects;
[0109] S303: (at each training) randomly select a subject, and fuse the features of the current subject with the updated word node representation by using the subject feature fusion module to obtain a word node representation of the fused subject features;
[0110] S304: Marking the position of the relationship in the word node representation fused with the subject feature and the starting position and ending position of the object by a relationship-object pair marker, and finding the relationship-object pair corresponding to the subject;
[0111] S305: combining the subject and the corresponding relation-object pair to generate a subject-relation-object triple;
[0112] S306: Repeat S303 to S305 until all subjects are selected, and all subject-relation-object triples are extracted;
[0113] S307: Calculate a loss function based on the extracted subject-relation-object triples and the (pre-labeled) real subject-relation-object triples, and reversely optimize the parameters of the relation extraction model;
[0114] S308: Repeat steps S301 to S307 to iteratively train the relationship extraction model until the model converges or reaches a preset number of iterations;
[0115] S4: All the output subject-relationship-object triples are used as entity relationship extraction results of the automotive parts supply chain information to be processed.
[0116] The present invention can embed word information and high-dimensional word vectors into automobile parts supply chain information and relationship types, and can unify the modeling of entities and relationships between entities in automobile parts supply chain information as nodes in the graph, which not only retains the richness of the original information, but also provides a data basis for subsequent relationship extraction. Secondly, the present invention iteratively fuses word nodes and relationship nodes to update the representation of word nodes through a multi-layer heterogeneous graph neural network, which can capture the deep association in the information and perform well in processing complex supply chain information containing multiple overlapping triples (i.e., multiple entities share the same or similar relationship); at the same time, through continuous iteration, the representation of each node is fused with the representation of its neighboring nodes, and the features of each node are gradually refined, so that key information can be located more quickly, thereby improving the efficiency of entity relationship extraction in automobile parts supply chain; and the features of the subject are fused with the updated word node representation through the subject feature fusion module, which enhances the representation ability of the node, so that the model can better pay attention to the relationship between the subject-relationship-object triples in the information, and can understand the meaning of the automobile parts supply chain information at a deeper level and make more accurate judgments, thereby improving the performance of model entity relationship extraction. Then, the present invention marks the positions of the subject, relationship and object through the subject marker and the relationship-object pair marker, which can not only ensure the structural integrity of the extracted triples, but also ensure its semantic accuracy; at the same time, the subject marker and the relationship-object pair marker can extract the subject-relationship-object triples from the automobile parts supply chain information at one time, instead of dividing the entity relationship extraction into two subtasks of entity extraction and relationship classification like the traditional entity relationship extraction model and method. The method of the present invention can better pay attention to the potential connection between relationships and entities, and is more suitable for the entity relationship extraction of automobile parts supply chain information with multiple subjects and multiple overlapping triples, thereby improving the accuracy of entity relationship extraction in the automobile parts supply chain.
[0117] Combination Figure 2 As shown in the figure, there are nine triples in this section of automobile parts supply chain information. One entity belongs to multiple triples at the same time, and some entities are subjects in one triple, but objects in another triple, presenting a complex link structure. Existing entity relationship extraction methods cannot well identify the entities in automobile parts supply chain information and the complex relationships between entities.
[0118] In order to better introduce the technical solution of the present invention, this embodiment is described through the following parts.
[0119] 1. Word Information Embedding and Word Vector Embedding
[0120] In this embodiment, the processing steps of word information embedding and word vector embedding are as follows:
[0121] S201: performing word segmentation processing on the automobile parts supply chain information by using the WordPiece method to obtain a unique hot vector representation of sub-words of the automobile parts supply chain information;
[0122] S202: inputting the unique hot vector representation of the automobile parts supply chain information into the pre-trained BERT model to embed word information, thereby obtaining hidden features of the automobile parts supply chain information;
[0123] S203: Use the hidden features of the last layer of the BERT model as the initial representation of the word node;
[0124] The formula is:
[0125]
[0126] Where: represents the initial representation of the i-th word node; w i represents the i-th word in the original automobile parts supply chain information; n represents the number of words in a piece of automobile parts supply chain information;
[0127] S204: embedding the relationship type into a high-dimensional word vector through the relationship type embedding layer to obtain a relationship node representation;
[0128] The formula is:
[0129]
[0130] Where: r i 0 represents the initial representation of the jth relationship node; r j represents the predefined j-th relationship type; E represents the relationship type embedding layer, which is responsible for embedding each relationship type into a high-dimensional vector; m = |R| represents the number of predefined relationship types; W and b are trainable parameters.
[0131] The present invention uses a pre-trained BERT model to embed words in the automotive parts supply chain information, predefines the relationship type according to the relationship existing in the existing automotive parts supply chain information, and embeds the relationship type into a high-dimensional word vector. The hidden features output by the last layer of BERT are used as the initial representation of the word node, and the high-dimensional relationship type word vector is used as the initial representation of the relationship node. The node representation in this format can be used as a good input for the model, thereby contributing to the training effect of the model and the accuracy of extraction.
[0132] 2. Multi-layer Heterogeneous Graph Neural Network
[0133] In this embodiment, combined with Figure 3 As shown, the processing steps of the multi-layer heterogeneous graph neural network are as follows:
[0134] S3011: Use the initial representation of word nodes and relationship nodes as input to the multi-layer heterogeneous graph neural network;
[0135] S3012: updating the representations of word nodes and relationship nodes through iterative fusion of a multi-layer heterogeneous graph neural network; after obtaining a new word node representation, the relationship node is updated through the new word node, and at this time, all word nodes serve as neighbors of a relationship node, and a new relationship node representation is obtained through iterative fusion;
[0136] The formula is:
[0137]
[0138] Where: Represents the word node representation of the output of the l+1th layer heterogeneous graph neural network; Represents the relational node representation of the output of the heterogeneous graph neural network at the l+1th layer; HGNN represents the heterogeneous graph neural network; Represents the word node h in the l-th layer heterogeneous graph neural network i The set of all neighbor relationship nodes; Represents the relationship node r in the lth layer of heterogeneous graph neural network j The set of all neighbor word nodes; The word node representation that represents the output of the l-th layer heterogeneous graph neural network is also the input of the l+1-th layer heterogeneous graph neural network.
[0139] Specifically, the processing steps of each layer of heterogeneous graph neural network are as follows:
[0140] 1) Convert the initial representations of word nodes and relationship nodes into word node vectors and relationship node vectors through a linear layer;
[0141] The formula is:
[0142] α i =W h h i +b i ;
[0143] β j =W r r j +b r ;
[0144] Where: α i , β iRepresents word node vectors and relationship node vectors; W h , b h , W r , b r is a trainable parameter;
[0145] 2) Concatenate the word node vector and the relationship node vector and calculate the similarity, and then calculate the attention weight between the word node and the relationship node based on the similarity;
[0146] γ ij =Linear(W a [α i :β j ]);
[0147]
[0148] Where: Represents word node h i and relationship node r j The attention weight between ij Represents the word node vector α i and the relationship node vector β i The similarity between them; [:] indicates vector concatenation; Liner indicates linear layer; f indicates softmax; W a Represents trainable parameters;
[0149] 3) Based on the attention weight between word nodes and relationship nodes Combine the gating mechanism to update the representation of word nodes; in order to ensure that the dimensions of each node remain unchanged and maintain nonlinear capabilities, the gating mechanism is used instead of the activation function;
[0150] The formula is:
[0151]
[0152] Where: Represents the word node representation after passing through the heterogeneous graph neural network;
[0153] 4) Represent the word nodes after the heterogeneous graph neural network Add the word node to the input as the word node representation output by the heterogeneous graph neural network;
[0154] The formula is:
[0155]
[0156] 3. Subject Marker
[0157] In this embodiment, the processing steps of the subject marker are as follows:
[0158] S3021: Map each word node in the updated word node representation through linear mapping to obtain a space K with a two-dimensional output, where the two dimensions of each word node in the space K respectively represent the probability of being the starting position and the ending position of the topic;
[0159] The formula is:
[0160] K = (σ(Linear(Dropout(X)))) 2 ;
[0161] Where: X∈R n×d represents the updated word node representation; Dropout is used to prevent overfitting; σ represents the sigmod activation function; Liner represents the linear layer;
[0162] S3022: Simplify the subject labeling task into a binary classification task, that is, determine whether each word node is the starting position and the ending position of the subject: if the probability of the starting position and the ending position of the word node subject is greater than the set threshold, its dimension is set to 1, otherwise it is set to 0, thereby obtaining the starting position index and the ending position index of the subject (the dimension of 1 is used as the index of the starting position and the ending position);
[0163] S3023: Find the actual subject S through the starting position index and the ending position index of the subject.
[0164] 4. Subject Feature Fusion Module
[0165] In this embodiment, the processing steps of the subject feature fusion module are as follows:
[0166] S3031: Calculate subject features based on all word nodes between the start position and the end position of the subject;
[0167] Combination Figure 4 As shown, the main features are calculated by the following formula:
[0168]
[0169] Where: s f Indicates the main features of the current training; h x and h y They represent the updated x-th and y-th word node representations of the current training subject respectively; b and e represent the starting position and ending position of the current training subject respectively; a x represents the attention weight of the x-th word node in the body, x,y∈(b,e); is a trainable parameter.
[0170] S3032: fusing the subject feature with each word node in the updated word node representation through a gating mechanism to generate a subject feature fusion representation of the word node;
[0171] The formula is:
[0172]
[0173]
[0174] Where: represents the main feature fusion representation of the i-th word node; h i represents the i-th word node in the updated word node representation; gate represents the gating mechanism; s f represents the main feature; σ represents the sigmoid activation function; W g , b g Represents the linear layer parameters of the gating mechanism; cue_len represents the effective length of the information;
[0175] S3033: adding the main feature fusion representation of the word node to the updated word node representation to obtain the word node representation fused with the main feature;
[0176] The formula is:
[0177]
[0178] Where: The i-th word node representation representing the fusion subject feature; represents the main feature fusion representation of the i-th word node; h i Represents the updated representation of the i-th word node.
[0179] 5. Relation-Object Pair Marker
[0180] In this embodiment, the processing steps of the relation-object pair marker are as follows:
[0181] S3041: mapping each word node dimension in the word node representation of the fused subject feature from the d dimension to a (2×m×d) dimension through a linear layer, where m represents the number of predefined relationship types; the value of the first dimension 2 represents the probability that each word node is the starting position and the ending position of the object, and the value of the second dimension m represents the probability that each word node is the position where the relationship is located;
[0182] The formula is:
[0183] (r,o)=(σ(Linear(Dropout(X′)))) 4 ;
[0184] Where: (r, o) represents the object start position, end position index and relationship category index in the relation-object pair; X′∈R n×d Represents the word node representation of the fused subject features; σ represents the sigmoid activation function; Liner represents the linear layer;
[0185] S3042: Simplify the relationship and object labeling task into a classification task, that is, determine whether each word node is the starting position and ending position of the object, and whether it is one of the m relationship types: if the probability of the position of the word node relationship is greater than the set threshold, its dimension is set to 1, otherwise it is 0; if the probability of the starting position and ending position of the word node object is greater than the set threshold, its dimension is set to 1, otherwise it is 0; the position with dimension 1 is used as the index of the relationship category or the index of the starting position and ending position of the object.
[0186] S3043: Obtain a relationship-object pair (R, O) through the relationship category index and the object start position and end position indexes.
[0187] Finally, a subject-relationship-object triple is represented as (S, R, O), where S represents the subject, R represents the relationship, and O represents the object.
[0188] 6. Loss Function
[0189] In this embodiment, the loss function when training the relationship extraction model is as follows:
[0190]
[0191] Where: U is the set of all relations in the training set; I represents a piece of labeled automotive parts supply chain information, T represents the triples contained in the information, S∈T represents the subject in the triples; T|S represents the set of all triples with S as the subject; (R,O)∈T|S represents the relation-object pair with S as the subject; U / T∈S represents all relations other than those contained in the triple set; Represents an empty relation-object pair, used to indicate that there is no corresponding relation and object; represents the subject prediction probability, Represents the predicted probability of a relation-object pair.
[0192] When training a relation extraction model, the present invention can maximize the joint probability of entity relation extraction of all sentences in the training set by optimizing this loss function, thereby improving the performance of entity relation extraction of the model.
[0193] VII. Experimental Description
[0194] In order to better illustrate the advantages of the technical solution of the present invention, this embodiment discloses the following experiment.
[0195] This experiment used the actual automobile parts supply chain information of the project partner Dongfeng Motor Co., Ltd. to test the automobile parts supply chain information entity relationship extraction (AER-HGNN) based on heterogeneous graph neural network proposed in this invention.
[0196] 1. Dataset
[0197] Combination Figure 5 As shown in Figure 2, existing entity relationship extraction models are tested on these public datasets. From the statistical results, the information structure of these public datasets is too simple and the number of triples is small, which is very different from the actual automotive parts supply chain information.
[0198] We evaluated our model on Dongfeng Auto Parts Supply Chain information. The information includes information on the design, manufacturing, and operation and maintenance stages of the auto parts supply chain, covering many nodes in the auto parts supply chain, such as manufacturers, sellers, logistics, and after-sales. We defined 23 types of relationships based on this information. Since the information on the auto parts supply chain is all overlapping triples, and some information contains many triples, we divide the information into four categories according to the number of triples: simple, general, relatively complex, and complex. Simple information refers to information containing less than or equal to 10 overlapping triples, general information refers to information containing 10-20 triples, relatively complex refers to information containing 20-30 triples, and complex information refers to information containing more than 30 triples. The statistics of auto parts data are shown in Tables 1 and 2.
[0199] Table 1 Dataset statistics. The information on each node is divided into training set, validation set and test set.
[0200]
[0201]
[0202] Table 2 Statistics of the number of four types of information
[0203]
[0204] Previous tasks have been to separate entity extraction and relationship classification tasks, that is, as long as the predicted subject and object are correct, the prediction is considered correct, while ignoring the relationship classification. The model we proposed can extract the subject-relationship-object triple at one time without having to classify the relationship separately. Therefore, only when every element in the subject-relationship-object triple is correct, we can judge that the prediction is correct. We use Precision, Recall and F1 scores to evaluate the performance of the model. The calculation method of the three evaluation indicators is as follows:
[0205]
[0206] Among them, TP is the number of samples correctly predicted by the model as positive, FP is the number of samples incorrectly predicted by the model as positive, and FN is the number of samples incorrectly predicted by the model as negative (i.e., positive samples missed by the model).
[0207] 2. Training details and parameter settings
[0208] For the entity relationship extraction of the automotive parts supply chain, we built our model on the pre-trained BERT model and used its default configuration for word embedding. We used stochastic gradient descent (SGD) to train and optimize the model. The batch size of the training was 32, the maximum length of the automotive parts supply chain information (i.e., sentences) was 128, and the learning rate was set to 0.000001. The word embedding dimension was set to 768, and the number of layers of the heterogeneous graph neural network was set to 2. We set a validation after one epoch of training, and we manually stopped training when there was no improvement on the validation set for 10 consecutive epochs. The rest of the hyperparameters were determined based on the validation set.
[0209] Since the automobile parts supply chain information has the characteristics of multiple subjects, in order to avoid the interference problems that may arise when multiple subjects are trained at the same time, only a single subject is considered at a time during the training process to prevent the model from learning wrong features and improve the effect of model training.
[0210] 3. Experimental results
[0211] 1) Model test results
[0212] For the task of extracting entity relationships from automotive parts supply chain information, we evaluated our proposed AER-HGNN on four types of information: simple, general, relatively complex, and complex.
[0213] Table 3 shows the application of our method on Dongfeng Automobile Parts Supply Chain data and the results obtained for information entity relationship extraction of different complexity.
[0214] Table 3. Test results of the model on information of different complexity levels
[0215]
[0216] From the experimental results, we can see that our model shows excellent performance for simpler automotive parts supply chain information. However, as the number of triplets in the information increases, the performance of the model gradually decreases. When the number of triplets exceeds 30, the recall rate of the model is significantly affected. In contrast, when the number of triplets is less than 30, the AER-HGNN model can still maintain good performance, especially when the number of triplets is less than 20. According to the data in Table 2, the number of overlapping triplets in most automotive parts supply chain information is less than 20. Therefore, our method can maintain high precision and recall when dealing with entity relationship extraction tasks of such information, verifying the effectiveness of our proposed method in the current task of entity relationship extraction of automotive parts supply chain information.
[0217] From the experimental results, we can see that our model shows excellent performance for simpler automotive parts supply chain information. However, as the number of triplets in the information increases, the performance of the model gradually decreases. When the number of triplets exceeds 30, the recall rate of the model is significantly affected. In contrast, when the number of triplets is less than 30, the AER-HGNN model can still maintain good performance, especially when the number of triplets is less than 20. According to the data in Table 2, the number of overlapping triplets in most automotive parts supply chain information is less than 20. Therefore, our method can maintain high precision and recall when dealing with entity relationship extraction tasks of such information, verifying the effectiveness of our proposed method in the current task of entity relationship extraction of automotive parts supply chain information.
[0218] 2) Ablation experiment
[0219] In order to verify the effectiveness of the proposed heterogeneous graph neural network that integrates entity relations and the main feature fusion, we also tested two variants of AER-HGNN: AER-HGNN(NG) and AER-HGNN(NS). Among them, AER-HGNN(NG) does not use heterogeneous graph neural network to iteratively fuse node representations, while AER-HGNN(NS) does not use main feature fusion. To ensure a fair comparison, when verifying AER-HGNN(NG), we use the hidden features processed by the last layer of BERT as word node input; when verifying AER-HGNN(NS), we directly use the updated nodes for relation-object pair extraction. In addition, we also tested these two variants on four automotive parts supply chain information of different complexity. Figure 6The performance of AER-HGNN, AER-HGNN(NG) and AER-HGNN(NS) under four different complexity information is shown, and Table 4 shows the performance comparison of these three models under several mixed complexity information.
[0220] Table 4 Performance of AER-HGNN, AER-HGNN(NG) and AER-HGNN(NS) under four different complexity information
[0221]
[0222] From the above results, it can be seen that when the model does not use heterogeneous graph neural network for node update, its performance decreases significantly, indicating that heterogeneous graph neural network can comprehensively improve the performance of the model. On the other hand, when the subject feature fusion is missing, the prediction accuracy of the model decreases, but the recall rate increases when processing complex information. This shows that subject feature fusion can not only improve the prediction accuracy of the model, but also balance the precision and recall rate to a certain extent. In summary, the combination of heterogeneous graph neural network and subject feature fusion significantly enhances the performance of the model in the task of entity relationship extraction of automotive parts supply chain information.
[0223] 3) Performance comparison of different heterogeneous graph neural network layers
[0224] In order to determine the optimal number of layers of heterogeneous graph neural network in the task of extracting entity relationships from automobile parts supply chain information, we set the number of network layers to l = {1, 2, 3, 4, 5, ...} and analyze the trend of model performance changing with the number of layers. Figure 7 As shown in the figure, when the number of layers of the heterogeneous graph neural network is 2, 3 or 4, the model performs well in all evaluation indicators. As the number of network layers increases, the recall rate of the model when processing complex types of information is significantly improved. However, the precision rate has dropped significantly. In addition, as the number of network layers increases, the training time also increases significantly. Considering the balance between training time cost and model performance, we finally chose l = 2 as the optimal number of layers for the AER-HGNN heterogeneous graph neural network.
[0225] 4) Knowledge graph construction
[0226] We extracted a part of the auto parts supply chain information triples from the AER-HGNN model and built a knowledge graph using SmartKG. Figure 8 The visualization results of the map are shown. Figure 8The knowledge graph in the figure shows the triples corresponding to manufacturers and suppliers. The graph in the center is built based on these triples. The question-and-answer function in the lower right corner allows users to enter queries such as "Laizhou Yinheng Machinery Co., Ltd." and the system will return the attribute information of the node and its adjacent relationship nodes. This result shows that the auto parts supply chain triples extracted by our designed model can effectively support the actual knowledge graph construction.
[0227] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit the technical solution. Those skilled in the art should understand that those modifications or equivalent substitutions of the technical solution of the present invention that do not depart from the purpose and scope of the technical solution should be included in the scope of the claims of the present invention.
Claims
1. An entity relationship extraction method for automobile parts supply chain based on heterogeneous graph neural network, characterized by: include: S1: Obtain the automotive parts supply chain information to be processed and the predefined relationship types; S2: Perform word information embedding and word vector embedding on the automobile parts supply chain information and relationship types respectively to obtain the initial representation of word nodes and relationship nodes; S3: Input the initial representations of word nodes and relation nodes into the trained relation extraction model, and output several subject-relation-object triplets; The processing steps when training a relation extraction model are as follows: S301: iteratively fuse word nodes and relationship nodes through a multi-layer heterogeneous graph neural network, update the representation of the word node, and use the word node representation output by the last layer of the heterogeneous graph neural network as the updated word node representation; S302: Marking the starting position and the ending position of the subject in the updated word node representation by a subject marker, and finding a number of subjects; S303: randomly selecting a subject, fusing the features of the current subject with the updated word node representation through a subject feature fusion module, and obtaining a word node representation of the fused subject features; S304: Marking the position of the relationship in the word node representation fused with the subject feature and the starting position and ending position of the object by a relationship-object pair marker, and finding the relationship-object pair corresponding to the subject; S305: combining the subject and the corresponding relation-object pair to generate a subject-relation-object triple; S306: Repeat S303 to S305 until all subjects are selected, and all subject-relation-object triples are extracted; S307: Calculate a loss function based on the extracted subject-relation-object triples and the (pre-labeled) real subject-relation-object triples, and reversely optimize the parameters of the relation extraction model; S308: Repeat steps S301 to S307 to iteratively train the relationship extraction model until the model converges or reaches a preset number of iterations; S4: All the output subject-relationship-object triples are used as entity relationship extraction results of the automotive parts supply chain information to be processed.
2. The entity relationship extraction method for automobile parts supply chain based on heterogeneous graph neural network according to claim 1 is characterized by: In step S2, the processing steps of word information embedding and word vector embedding are as follows: S201: Perform word segmentation on the automobile parts supply chain information to obtain corresponding one-hot vector representation; S202: inputting the unique hot vector representation of the automobile parts supply chain information into the pre-trained BERT model to embed word information, thereby obtaining hidden features of the automobile parts supply chain information; S203: Use the hidden features of the last layer of the BERT model as the initial representation of the word node; The formula is: Where: represents the initial representation of the i-th word node; w i Represents the i-th word in the original automobile parts supply chain information; n represents the number of words in a piece of automotive parts supply chain information; S204: embedding the relationship type into a high-dimensional word vector through the relationship type embedding layer to obtain a relationship node representation; The formula is: Where: represents the initial representation of the jth relationship node; r j represents the predefined j-th relation type; E represents the relation type embedding layer; m represents the number of predefined relation types; W and b are trainable parameters.
3. The entity relationship extraction method for automobile parts supply chain based on heterogeneous graph neural network according to claim 1 is characterized by: In step S301, the processing steps of the multi-layer heterogeneous graph neural network are as follows: S3011: Use the initial representation of word nodes and relationship nodes as input to the multi-layer heterogeneous graph neural network; S3012: Update the representation of word nodes and relationship nodes through iterative fusion of multi-layer heterogeneous graph neural networks; The formula is: Where: Represents the word node representation of the output of the l+1th layer heterogeneous graph neural network; Represents the relational node representation of the output of the heterogeneous graph neural network at the l+1th layer; HGNN represents the heterogeneous graph neural network; Represents the word node h in the l-th layer heterogeneous graph neural network i The set of all neighbor relationship nodes; Represents the relationship node r in the lth layer of heterogeneous graph neural network j The set of all neighbor word nodes; Represents the word node representation output by the l-th layer heterogeneous graph neural network.
4. The entity relationship extraction method for automobile parts supply chain based on heterogeneous graph neural network as claimed in claim 3 is characterized by: In step S3012, the processing steps of each layer of heterogeneous graph neural network are as follows: 1) Convert the initial representations of word nodes and relationship nodes into word node vectors and relationship node vectors through a linear layer; The formula is: a i =W h h i +b i ; b j =W r r j +b r ; Where: α i , β i Represents word node vectors and relationship node vectors; W h , b h , W r , b r is a trainable parameter; 2) Concatenate the word node vector and the relationship node vector and calculate the similarity, and then calculate the attention weight between the word node and the relationship node based on the similarity; c ij =Linear(W a [a i :b j ]); Where: Represents word node h i and relationship node r j The attention weight between r ij Represents the word node vector α i and the relationship node vector β i The similarity between them; [:] indicates vector concatenation; Liner indicates linear layer; f indicates softmax; W a Represents trainable parameters; 3) Based on the attention weight between word nodes and relationship nodes Combined with the gating mechanism, the representation of word nodes is updated; The formula is: Where: Represents the word node representation after passing through the heterogeneous graph neural network; 4) Represent the word nodes after the heterogeneous graph neural network Add the word node to the input as the word node representation output by the heterogeneous graph neural network; The formula is:
5. The entity relationship extraction method for automobile parts supply chain based on heterogeneous graph neural network according to claim 1 is characterized in that: In step S302, the processing steps of the subject marker are as follows: S3021: Map each word node in the updated word node representation through linear mapping to obtain a space K with a two-dimensional output, where the two dimensions of each word node in the space K respectively represent the probability of being the starting position and the ending position of the topic; The formula is: K=(σ(Linear(Dropout(X)))) 2 ; Where: X∈R n×d represents the updated word node representation; Dropout is used to prevent overfitting; σ represents the sigmod activation function; Liner represents the linear layer; S3022: Determine whether each word node is the starting position and ending position of the subject: if the probability of the starting position and ending position of the word node subject is greater than the set threshold, its dimension is set to 1, otherwise it is set to 0, thereby obtaining the starting position index and the ending position index of the subject; S3023: Find the actual subject S through the starting position index and the ending position index of the subject.
6. The entity relationship extraction method for automobile parts supply chain based on heterogeneous graph neural network according to claim 1 is characterized by: In step S303, the processing steps of the subject feature fusion module are as follows: S3031: Calculate subject features based on all word nodes between the start position and the end position of the subject; S3032: fusing the subject feature with each word node in the updated word node representation through a gating mechanism to generate a subject feature fusion representation of the word node; The formula is: Where: Represents the main feature fusion representation of the i-th word node; h i represents the i-th word node in the updated word node representation; gate represents the gating mechanism; s f represents the main feature; σ represents the sigmoid activation function; W g , b g Represents the linear layer parameters of the gating mechanism; cue_len represents the effective length of the information; S3033: adding the main feature fusion representation of the word node to the updated word node representation to obtain the word node representation fused with the main feature; The formula is: Where: The i-th word node representation representing the fusion subject feature; Represents the main feature fusion representation of the i-th word node; h i Represents the updated representation of the i-th word node.
7. The entity relationship extraction method for automobile parts supply chain based on heterogeneous graph neural network according to claim 6 is characterized by: In step S3031, the subject feature is calculated by the following formula: Where: s f Indicates the main features of the current training; h x and h y They represent the updated x-th and y-th word node representations of the current training subject respectively; b and e represent the starting position and ending position of the current training subject respectively; a x represents the attention weight of the x-th word node in the body, x,y∈(b,e); is a trainable parameter.
8. The entity relationship extraction method for automobile parts supply chain based on heterogeneous graph neural network as claimed in claim 1 is characterized by: In step S304, the relationship-object pair marker is processed as follows: S3041: mapping each word node dimension in the word node representation of the fused subject feature from the d dimension to a (2×m×d) dimension through a linear layer, where m represents the number of predefined relationship types; the value of the first dimension 2 represents the probability that each word node is the starting position and the ending position of the object, and the value of the second dimension m represents the probability that each word node is the position where the relationship is located; The formula is: (r,o)=(σ(Linear(Dropout(X′)))) 4 ; Where: (r, o) represents the object start position, end position index and relationship category index in the relation-object pair; X′∈R n ×d Represents the word node representation of the fused subject features; σ represents the sigmoid activation function; Liner represents the linear layer; S3042: Determine whether each word node is the starting position and the ending position of the object, and whether it is one of the m types of relationships: if the probability of the position of the word node relationship is greater than the set threshold, its dimension is set to 1, otherwise it is 0; if the probability of the starting position and the ending position of the word node object is greater than the set threshold, its dimension is set to 1, otherwise it is 0; S3043: Obtain a relationship-object pair (R, O) through the relationship category index and the object start position and end position indexes.
9. The entity relationship extraction method for automobile parts supply chain based on heterogeneous graph neural network according to claim 1 is characterized by: A subject-relation-object triple is represented as (S, R, O), where S represents the subject, R represents the relationship, and O represents the object.
10. The entity relationship extraction method for automobile parts supply chain based on heterogeneous graph neural network according to claim 1, characterized in that: In step S3, the loss function when training the relationship extraction model is as follows: Where: U is the set of all relations in the training set; I represents a piece of labeled automotive parts supply chain information, T represents the triples contained in the information, S∈T represents the subject in the triples; T|S represents the set of all triples with S as the subject; (R,O)∈T|S represents the relation-object pair with S as the subject; U / T∈S represents all relations other than those contained in the triple set; Represents an empty relation-object pair, used to indicate that there is no corresponding relation and object; represents the subject prediction probability, Represents the predicted probability of a relation-object pair.
Citation Information
Patent Citations
Relation extraction method based on graph neural network
CN113297838A
Relationship extraction method based on graph neural network multi-hop reasoning
CN115391562A
Named entity extraction method and device based on graph neural network and storage medium
CN115879470A
Prediction method and system based on heterogeneous graph neural network model
WO2021179838A1
Multimodal document information extraction method based on graph neural network, device and medium
WO2023138023A1
Cited By
Purchase efficiency optimization management method and system based on artificial intelligence
CN119991180A
Artificial Intelligence-Based Procurement Efficiency Optimization Management Method and System
CN119991180B
Knowledge base establishment method and system of service platform
CN120671793A