An industry knowledge graph-oriented enterprise upstream and downstream relationship prediction method
By combining graph attention networks and knowledge completion models with enterprise characteristics, the problem of incomplete entity relationships in industry knowledge graphs is solved, enabling efficient prediction of upstream and downstream relationships of enterprises and improving the accuracy and commercial value of industry knowledge graphs.
Patent Information
- Application Number
- CN202211318411.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2042-10-26
AI Technical Summary
Existing methods suffer from incomplete entity relationships and computational complexity with large-scale data when constructing industry knowledge graphs. Furthermore, they cannot effectively utilize unstructured text information, leading to inaccurate predictions of upstream and downstream relationships among enterprises.
We employ a graph attention network, a ConvE sub-model, and a knowledge completion TransR sub-model, combining enterprise category features and technical features. We extract entity features through clustering and training word vectors, and use graph topology and pre-trained information to predict upstream and downstream relationships of enterprises.
It improves the accuracy and efficiency of predicting upstream and downstream relationships among enterprises, enabling better completion of industry knowledge graphs and promoting mutual benefit and win-win cooperation among enterprises and the digitalization of industries.
Smart Images

Figure CN115618017B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of machine learning, and particularly relates to an enterprise upstream and downstream relationship prediction method for an industrial knowledge graph. BACKGROUND
[0002] A knowledge graph is a structured semantic network knowledge base composed of entities, relationships and attributes. Under the Resource Description Framework (RDF), knowledge can be expressed in the form of a fact triple (head, relation, tail), for example, (Tianjin XX Automobile Co., Ltd., produces, pure electric city bus). The head and tail represent the head entity and the tail entity, respectively, and the relation represents the relationship between the head entity and the tail entity.
[0003] Existing methods often use manual or semi-automatic methods to construct a knowledge graph, but the lack of a large number of implicit relationships between entities results in the problem of incompleteness in almost all knowledge graphs, and thus the research of knowledge completion is proposed. The representation of a knowledge graph can be divided into two types in terms of content: entity-relation-entity triples and entity-attribute-attribute value triples. Therefore, a triple is a basic unit of knowledge graph representation, and the knowledge graph completion problem can be converted into the evaluation of the authenticity and credibility of triples.
[0004] An industrial knowledge graph is an important application of a knowledge graph in the industrial field, and has relatively high requirements for the accuracy and completeness of knowledge, but still has the problem of incompleteness. Taking a new energy vehicle industrial knowledge graph as an example, predicting the upstream and downstream relationships between enterprises and then completing the industrial knowledge graph is conducive to the construction of an industrial supply chain cooperation system and the mutual benefit and win-win between enterprises.
[0005] Existing knowledge completion methods can be divided into two categories: traditional methods and knowledge representation learning methods.
[0006] Traditional knowledge completion methods based on a probabilistic graph can combine network structure and node attribute information. A representative method is a Bayesian probabilistic graph model, which is a directed cyclic graph suitable for expressing and analyzing uncertain knowledge and effective reasoning. Graph computing-based method models such as PRA (path ranking algorithm) use random walking to obtain specific paths of a knowledge graph, and then use the obtained path features to train a model. However, these methods have two problems: first, poor scalability and large memory usage, and for a set of entity pairs, these methods need to enumerate paths to determine whether all possible relationships exist between the entity pairs. Second, they face the problem of high complexity of large-scale data computation.
[0007] Knowledge representation learning can encode entities and relationships with high-quality embedding, well capture the semantic information implied by entities and relationships, achieve efficient computation, and greatly improve the knowledge completion effect. However, most of the existing methods lack the embedding of effective information of the graph topology structure of the knowledge graph and the fusion of pre-training information, and cannot efficiently utilize the semantic information of the triples in the existing knowledge graph.
[0008] In addition, there are a large amount of unstructured text in the industrial knowledge graph, such as attribute text description information of enterprises and text description of patents. The existing model cannot directly use the attribute information of the unstructured entity to strengthen the representation of the enterprise entity in the triple.
[0009] Therefore, there is an urgent need to design an enterprise entity relationship prediction method for industrial knowledge graph that can overcome the above problems. SUMMARY
[0010] To solve the above problems, an enterprise entity relationship prediction method for industrial knowledge graph is provided, and the present application adopts the following technical solutions:
[0011] The present application provides an enterprise upstream and downstream relationship prediction method for industrial knowledge graph, which is used for predicting the upstream and downstream relationship of enterprises in the industrial knowledge graph, and is characterized by the following steps: step S1, constructing an entity relationship prediction model, which includes a graph attention network, a ConvE submodel and a knowledge completion TransR submodel; step S2, inputting the knowledge graph triple data of the to-be-tested industry into the entity relationship prediction model, and extracting the corresponding enterprise category features and enterprise technology features as entity features by clustering and training word vectors; step S3, the entity relationship prediction model encodes the entity relationship information of the entity features based on the graph attention network, thereby obtaining the corresponding entity representation; step S4, the entity relationship prediction model obtains the entity vector representation and the corresponding relationship vector representation of the entity features based on the knowledge completion model TransR; step S5, the ConvE submodel embeds the entity vector representation and the relationship vector representation by using two-dimensional convolution, and outputs the confidence size of the triple data, thereby predicting the upstream and downstream relationship between enterprises in the to-be-tested industry.
[0012] The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph can also have the following technical features: the enterprise category feature is obtained by subject clustering on the enterprise attribute description information data in the knowledge graph of the to-be-tested industry; the subject clustering is specifically: first, the enterprise attribute description information data is preprocessed, and various useless characters are removed by using a regular expression; then, the attribute description information data of each enterprise is regarded as an article, and the attribute description information data of all enterprises is regarded as a document set; each enterprise is classified based on an effective unsupervised method LDA subject clustering model, so that each enterprise is given a clustering label.
[0013] The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph can also have the following technical features: the enterprise technology feature is obtained by extracting technical keywords from the patent text information data of the enterprises in the knowledge graph of the to-be-tested industry, and the specific process includes: first, the patent text information data is preprocessed, the context information in the preprocessed text data is used to predict a target word vector, so that vector representations of all words are obtained; then, based on the pre-labeled sample vector, the keywords with a higher similarity frequency between each patent text information and the sample vector are found out based on the cosine similarity, and are used as the enterprise technology feature to strengthen the entity representation of the enterprise.
[0014] The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph can also have the following technical features: the entity relationship prediction model is an encoder-decoder architecture, a graph attention network is used as the encoder to better embed the graph topological structure information of the knowledge graph, a two-dimensional convolution ConvE submodel is used as the decoder to decode the semantic information of the triples in the knowledge graph in multiple spatial dimensions, and a knowledge completion model TransR is used to provide the decoder with information about the translational properties between entities.
[0015] The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph can also have the following technical features: the graph attention network has two graph attention layers, the first attention layer is used to capture information about the one-hop neighbors of the center node, and the second attention layer is used to capture information about the two-hop neighbors of the center node, and outputs the entity representation in an average manner based on multi-head attention, wherein each layer takes an entity embedding matrix and a relation embedding matrix as input, the entity embedding matrix is represented as where the i-th row is the embedding vector of the entity e i , N e represents the number of entities, and D is the dimension of each entity embedding vector, and the relation embedding matrix is represented as , wherein N rThe number of representative relations, P is the dimension of each relation embedding vector, and the entity embedding matrix output by each layer is The relation embedding matrix
[0016] The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph provided by the application can also have the following technical features: the specific process of step S3 is as follows: in order to obtain the new embedding representation of the entity e i , the entity relation prediction model learns all the relation and entity triple data associated with the entity e i , for a specific triple t i =(e kij ,r i ,e k ) associated with the entity e j , the new vector representation of the specific triple t kij is obtained by concatenating the entity and relation vectors.
[0017] Wherein, the vectors and represent the embeddings of entities e i , e j and relation r k , and W1 represents a linear transformation matrix. The entity relation prediction model learns the importance of each triple t ijk represented by c kij , then multiplies it with the weight matrix W2, and finally uses the LeakyRelu function to obtain the absolute attention value b kij of the triple t ijk =LeakyReLU(W2c ijk ). In order to obtain the relative attention value, the softmax is applied to b ijk , and the relative attention value a ijk =softmax(b ijk ) is obtained. Based on the idea of GAT multi-head attention mechanism, the model uses multi-head attention mechanism to stabilize the training process, and the entity representation is calculated as follows:
[0018]
[0019] In the formula, M represents M attention heads, m represents the mth attention head, represents the set of all neighbor nodes of entity node i.
[0020] The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph provided by the application can also have the following technical features: the knowledge graph triple data of the industry to be predicted is sent to a TransR sub-model to obtain entity vector representation and relationship vector representation in data i , a coefficient matrix W E is used to perform linear transformation on the entity vector matrix H i , and then a splicing operation is performed on the entity output H e of the encoder to obtain the final entity vector representation H'' which is given to the decoder
[0021] H'' = W E H i ||H e ,
[0022] Similarly, the relationship matrix vector R i is processed to obtain the relationship vector representation R'' which is given to the decoder
[0023] R'' = [W R R i ||R e ].
[0024] In the formula, W R is a coefficient matrix, and R e represents the relationship output of the encoder.
[0025] The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph provided by the application can also have the following technical features: the confidence of the triple is obtained by the following process: the ConvE sub-model obtains the similarity ψ s (e o , e r ) of the head entity e s and the tail entity e o under the relationship r, and then the similarity is put into a sigmod activation function to obtain the triple data similarity probability P as the confidence, and the greater the P is, the more similar the head entity e s and the tail entity e o are under the relationship r.
[0026] The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph provided by the application can also have the following technical features: in step S5, a threshold setting method is used, when the confidence of the prediction of the upstream and downstream relationship between two enterprises is greater than the threshold, it is determined that the two enterprises have the upstream and downstream relationship, otherwise, it is determined that the two enterprises do not have the upstream and downstream relationship.
[0027] The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph can also have the following technical features: the threshold setting method is as follows: the minimum value of the threshold is obtained according to the Hit@50 index, then the threshold is continuously increased, and F1 is selected as the evaluation index of the enterprise upstream and downstream relationship prediction, and the final threshold is determined by optimizing the F1 index.
[0028] Inventive action and effect
[0029] The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph according to the present application first fully utilizes the text description information of the entity, extracts the enterprise entity features by clustering and training the word vectors, and thus enhances the entity representation. Secondly, the graph attention network is used as the encoder to better capture the neighbor node information around the entity node, so as to obtain the high-quality embedding of the entity and the information of the graph topology. Then, the TransR sub-model is used to provide the translation property information between the entities for the decoder, so as to accelerate the model training speed and improve the accuracy of the entity relationship prediction result. Compared with the prior art, the entity relationship prediction method in the knowledge graph adopted by the present application is flexible and is not limited to a certain knowledge graph. Moreover, the graph topology structure information and the pre-training information are fused, which can play a good role and effectively improve the accuracy of the upstream and downstream relationship prediction between the enterprises in the industrial knowledge graph.
[0030] Therefore, the enterprise upstream and downstream relationship prediction method for the industrial knowledge graph can complete the industrial knowledge graph based on the prediction result, is beneficial to the construction of the industrial supply chain cooperation system, realizes the mutual benefit and win-win between enterprises, and promotes the digital industrialization and industrial digitization, and realizes high commercial value. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 is a flowchart of the enterprise upstream and downstream relationship prediction method for the industrial knowledge graph in the embodiment of the present application;
[0032] Figure 2 is a structural schematic diagram of the entity relationship prediction model in the embodiment of the present application;
[0033] Figure 3 is a result schematic diagram of the enterprise clustering label in the embodiment of the present application;
[0034] Figure 4 is a word vector distribution diagram of the enterprise patent text information data in the embodiment of the present application;
[0035] Figure 5 is a result schematic diagram of the influence of the selection of the confidence threshold on the accuracy, recall rate and F1 in the embodiment of the present application. DETAILED DESCRIPTION
[0036] In order to make the technical means, creative features, purposes and effects of the present application easy to understand, the following will be a specific description of the present application of an industrial knowledge graph-oriented enterprise upstream and downstream relationship prediction method combined with examples and drawings.
[0037] <Embodiment>
[0038] Figure 1 is a flowchart of the industrial knowledge graph-oriented enterprise upstream and downstream relationship prediction method in the embodiment of the present application.
[0039] As Figure 1 shown, the present embodiment provides a specific process for predicting the upstream and downstream relationship of enterprises for industrial knowledge graph as follows:
[0040] Step S1, construct an entity relationship prediction model, which includes a graph attention network, a ConvE submodel and a knowledge completion TransR submodel.
[0041] Figure 2 is a structural diagram of the entity relationship prediction model in the embodiment of the present application.
[0042] As Figure 2 shown, the present embodiment constructs an entity relationship prediction model based on an encoder-decoder architecture, which uses a graph attention network as an encoder to better embed the graph topology structure information of the knowledge graph; uses a two-dimensional convolution ConvE submodel as a decoder to decode the semantic information of the triples in the knowledge graph in multiple spatial dimensions; and uses a knowledge completion model TransR to provide the decoder with information about the translational properties between entities.
[0043] Step S2, input the knowledge graph triple data of the to-be-tested industry into the entity relationship prediction model, and extract the corresponding enterprise category features and enterprise technology features as entity features by clustering and training word vectors.
[0044] The present embodiment takes the new energy automobile industry knowledge graph as an example.
[0045] Among them, the extraction process of the enterprise category features is as follows:
[0046] Firstly, data preprocessing including cleaning and processing is performed on the enterprise attribute description information data, so as to obtain the processed data. Specifically:
[0047] In the enterprise attribute description information data, for the data missing problem, the number of companies with missing information is very small, which has little effect on the entire data set, so the data information is directly discarded. For the format inconsistency problem, after careful observation and comparison, Chinese word segmentation is performed using a word segmentation tool, and a commonly used stop word dictionary is established. The string with square brackets is removed by regular expression, and then the string is divided according to the comma and semicolon characters. Each word is extracted, and finally the regular expression is used to remove various useless character symbols to remove the interference of invalid words. For the mixed English and Chinese naming problem, since the data is basically Chinese, the English description is directly ignored.
[0048] Then all the words of the attribute description information of all enterprises are converted into a word frequency matrix W with a size of NxD, where N represents the number of enterprises, D represents the number of all words, and the number of topics n topic is set.
[0049] Finally, the word frequency matrix W is used to train the LDA topic clustering model. The attribute description information of each enterprise is regarded as an article, and the attribute description information of all enterprises is regarded as a whole document set. The attribute description information of the enterprise is clustered, and the industrial link information is implicitly added to the enterprise, so that each enterprise is given a clustering label. The final enterprise clustering label result is as shown in Figure 3 .
[0050] In this embodiment, since there are five industrial links, the number of topics is selected from [5, 6, 7, 8, 9, 10]. Through a small amount of label data verification, the best clustering number is finally determined to be 5.
[0051] The technical features of the enterprise are obtained by extracting technical keywords from the patent text information data of the enterprise. The specific process is as follows:
[0052] First, the patent text information data is preprocessed, and the target word vector is predicted according to the context information in the preprocessed text data, so as to obtain the vector representation of all words. For patent text description of unstructured text data, the processing flow includes removing useless characters, Chinese word segmentation and stop word processing. The processing process is as follows: the patent text information data after word segmentation and stop word processing is put into the bag-of-words model in word2vec, the target word vector is predicted according to the context, and finally the vector representation of all words is obtained. In this embodiment, since the number of words in the patent text description is large, the dimension of the model output word vector is set to 256.
[0053] Then, based on the pre-labeled sample vector, the keywords with high similarity frequency with the sample vector in each patent text information are found out according to the cosine similarity, which are used as the technical features of the enterprise to strengthen the entity representation of the enterprise.
[0054] In this embodiment, a batch of production-related technical terms were selected and annotated from a large amount of patent text data. It was found that these technical terms are strongly dependent on nearby context words and do not rely excessively on distant words. Therefore, the maximum sliding window of the word2vec model was set to 3, and the model randomly selected values between [1,3]. In the model, the sliding window size w represents the distance between the central word and its context, i.e., the input data during model training includes the w words before and w words after the central word. The number of negative samples was set to 5, meaning that in the reverse update of model training, only a small portion of the weights for a training sample is updated, including the weight coefficient matrix of positive samples and 5 negative samples.
[0055] After model training, vector representations of all words are obtained. Since the output word vectors are too large to be easily displayed, PCA (Principal Component Analysis) dimensionality reduction is used to map the word vectors to a two-dimensional space, and a subset of words is extracted for visualization, such as... Figure 4 As shown, the effect of the model in discovering similarity relationships between words is presented intuitively.
[0056] Step S3: The entity relationship prediction model encodes entity relationship information of entity features based on graph attention network to obtain the corresponding entity representation.
[0057] The graph attention network in this embodiment employs two graph attention layers (R-GAT). The first attention layer captures information about the central node's one-hop neighbors, and the second attention layer captures information about the central node's two-hop neighbors. Based on multi-head attention, it outputs entity representations using an averaging approach. Each layer takes an entity embedding matrix and a relation embedding matrix as input. The entity embedding matrix is represented as follows: Where N e The number of entities is represented by D, where D is the dimension of the embedding vector for each entity, and the relation embedding matrix is represented as follows: Where N r The number of relations is represented by P, where P is the dimension of the embedding vector for each relation, and the corresponding entity embedding matrix for each layer is... Relational Embedding Matrix
[0058] The specific process of step S3 is as follows:
[0059] To obtain entity e i The new embedding representation, firstly, the entity relationship prediction model learns with entity e i All related relation and entity triples, for entity e i The associated specific triplet t kij =(e i ,r k ,ej ), and the specific triple t kij is obtained by taking the form of a serial entity and relationship vector
[0060]
[0061] wherein the vector and respectively represent the embedding of the entity e i , e j and the relationship r k , and W1 represents a linear transformation matrix.
[0062] Then, the entity relationship prediction model is multiplied by c ijk and the weight matrix W2, and a LeakyRelu function is used to obtain the absolute attention value b kij of the triple t ijk = LeakyReLU(W2c ijk ). In order to obtain the relative attention value, the softmax is applied to b ijk , and the relative attention value a ijk = softmax(b ijk ) is obtained. Based on the idea of GAT multi-head attention mechanism, the model uses a multi-head attention mechanism to stabilize the training process, and the entity representation is calculated as follows:
[0063]
[0064] In the formula, M represents M attention heads, m represents the mth attention head, and represents the set of all neighbor nodes of the entity node i.
[0065] Step S4, the entity relationship prediction model obtains the entity vector representation and the relationship vector representation of the entity feature based on the knowledge completion TransR sub-model.
[0066] The classic Trans series knowledge completion TransR sub-model is used to provide the decoder with the information of the translation property between entities: the knowledge graph triple data of the to-be-predicted industry is sent to the TransR sub-model to obtain the vector representation of the entities and the relationship in the data, wherein the output entity vector matrix is denoted as H i , wherein the ith row of the matrix is the vector representation of the ith entity The coefficient matrix W E is used to linearly transform the entity vector matrix H i , and then the entity output H e of the encoder is spliced to obtain the final entity vector representation H" which is given to the decoder:
[0067] H" = WE H i ||H e .
[0068] Similarly, the relation matrix vector R i has a similar operation, so as to obtain the relation vector representation:
[0069] R'' = [W R R i ||R e ]
[0070] In the formula, W R is the coefficient matrix, and R e represents the relation output of the encoder.
[0071] Step S5, the ConvE sub-model adopts two-dimensional convolution to embed entity vector representation and relation vector representation to predict missing links in the knowledge graph, corresponding to the confidence size of the output triple data, sets a threshold value θ, when the probability of predicting two companies under the upstream and downstream relationship is greater than the threshold value θ, it is determined that the two companies have upstream and downstream relationship, otherwise it is determined that there is no upstream and downstream relationship, so as to predict the upstream and downstream relationship between the companies in the to-be-tested industry.
[0072] In this embodiment, the ConvE sub-model obtains the similarity of the head entity e s and the tail entity e o under the relation r: Then the similarity is put into the sigmod activation function to obtain the triple similarity probability P, that is, the confidence, if P is greater, it proves that the head entity e s and the tail entity e o are more similar under the relation r.
[0073] Finally, the loss function of the model is defined as follows, and the cross-entropy function is minimized:
[0074]
[0075] In the formula, p = σ (ψ r (e s ,e o )) represents the probability of the head and tail entities e s ,e o under the relation r. N is the number of entities, t is the label vector, and the elements in the vector t are 1, indicating that there is a relationship, otherwise 0.
[0076] The model parameters used in predicting the upstream and downstream relationships of the enterprise in this embodiment are as follows: in the training stage, the encoder adopts two layers of R-GAT to train the embedding of entities and relationships, the number of heads of the multi-head attention mechanism is set to 2 for both layers of R-GAT, and dropout = 0.3 is applied to the input of each layer of GAT. In the decoder, the dropout of the input layer is 0.2, the dropout of the feature map layer is 0.3, the dropout of the hidden layer is 0.3, and the convolution kernel size is 3x3. The optimizer used in the training is Adam, and the loss function uses the cross-entropy function.
[0077] In this embodiment, the minimum value of the threshold θ is first obtained according to the Hit@50 indicator, then θ is continuously increased, F1 is selected as the evaluation indicator of the prediction of the upstream and downstream relationships of the enterprise, and the final threshold θ is determined by optimizing the F1 indicator. The positive example triplets are in the test set, and for each positive example triplet, an effective negative example triplet is generated by randomly replacing the tail entity in the triplet to calculate the F1 value. The sigmod function is used to calculate the probability value P of the final triplet, and then the F1 value is calculated. To illustrate the process and effectiveness of selecting the confidence threshold θ of the triplet, in the prediction of the upstream and downstream relationships of the enterprise, θ ∈ [0.6, 1] is selected, Figure 5 The change curves of the model Precision, Recall and F1 value are shown. Finally, θ = 0.82 is selected to make the F1 reach the highest value.
[0078] To verify the performance of the entity relationship prediction model of this embodiment, the new energy automobile industry knowledge graph is taken as an example to test the prediction of the upstream and downstream relationships of the enterprise and the existing mainstream model, and the test results are shown in Table 1 below.
[0079] Table 1: Prediction results of the upstream and downstream relationships of the enterprise
[0080]
[0081] Table 1 above proves the effectiveness of the GAT encoder module of the model, which can learn high-order information from the local neighborhood of the center vertex. It is 0.07 higher than the KB-GAT model which is also based on the graph attention network, and the reason is that KB-GAT uses ConvKB as the decoder, in which up to 14.2% of the final scores of the triplets are similar or even consistent, finally resulting in a small degree of differentiation between many correct triplets and incorrect triplets. The model of this embodiment adds the pre-training information of TransR and adopts ConvE as the decoder, which can well distinguish between positive examples and negative examples, so it can achieve good prediction effect.
[0082] In order to verify the universality of the method, the data set of the relationship prediction task in knowledge completion is selected: the FB15K-237 and WN18RR data sets, wherein the FB15K-237 data set is extracted from the FB15K, and the WN18RR data set is from the WN18. Nearly 20w triple data are extracted from the Chinese encyclopedia knowledge graph as the training set, containing 111377 entities, 6667 relationships, 500 triplets of the "Baidu category" relationship are selected as the verification set, and 500 triplets are selected as the test set. On the three data sets, the model of the method and the mainstream model are compared. The model and the four baseline models except KB-GAT are compared on multiple data sets, and the best results can be obtained in terms of Mean Rank and Hit@3, Hit@10, as shown in Table 2.
[0083] Table 2 Comparison test on Chinese encyclopedia knowledge graph, FB15K-237 and WN18RR data sets
[0084]
[0085] Effects of the embodiments
[0086] According to the enterprise upstream and downstream relationship prediction method for the industrial knowledge graph provided in the embodiment, first, in order to make full use of the text description information of the entity, the entity feature is extracted by clustering and training the word vector, so as to enhance the entity representation. Secondly, the graph attention network is used as the encoder to better capture the neighbor node information around the entity node, so as to obtain the high-quality embedding of the entity and the information of the graph topology structure. Then, the TransR sub-model is used to provide the translation property information between entities for the decoder, so as to accelerate the model training speed and improve the accuracy of the entity relationship prediction result.
[0087] Compared with the prior art, the entity relationship prediction method in the knowledge graph adopted in the embodiment is flexible and is not limited to a certain knowledge graph. Moreover, the graph topology structure information and the pre-training information are fused, which can play a good role and effectively improve the accuracy of the upstream and downstream relationship prediction between enterprises in the industrial knowledge graph.
[0088] To sum up, the enterprise upstream and downstream relationship prediction method for the industrial knowledge graph can complete the industrial knowledge graph based on the prediction result, is conducive to the construction of the industrial supply chain cooperation system, realizes the mutual benefit and win-win between enterprises, and promotes the digital industrialization and industrial digitization, and realizes high commercial value.
[0089] The above embodiments are only used for illustrating the specific implementation mode of the present application, and the present application is not limited to the description range of the above embodiments.
Claims
1. An industry knowledge graph-oriented enterprise upstream and downstream relationship prediction method for predicting the upstream and downstream relationships of enterprises in an industry knowledge graph, characterized in that, The method comprises the following steps: Step S1, constructing an entity relationship prediction model, the model comprising a graph attention network, a ConvE sub-model and a knowledge completion TransR sub-model, the entity relationship prediction model being an encoder-decoder architecture, the graph attention network being used as an encoder to better embed the graph topological structure information of the knowledge graph, the two-dimensional convolution ConvE sub-model being used as a decoder to decode the semantic information of the triples in the knowledge graph in multiple spatial dimensions, and the knowledge completion TransR sub-model being used to provide the decoder with information about the translational properties between entities; Step S2, inputting the knowledge graph triple data of the industry to be tested into the entity relationship prediction model, and extracting corresponding enterprise category features and enterprise technology features as entity features by clustering and training word vectors, The enterprise category features are obtained by subject clustering of the enterprise attribute description information data in the knowledge graph of the industry to be tested, and the subject clustering specifically comprises the following steps: firstly, preprocessing the enterprise attribute description information data, and removing various useless characters by using a regular expression; then regarding the attribute description information data of each enterprise as an article, regarding the attribute description information data of all enterprises as a document set, and performing category clustering on each enterprise based on an effective unsupervised method LDA subject clustering model, so as to assign a clustering label to each enterprise, The enterprise technology features are obtained by extracting technical keywords from the patent text information data of the enterprises in the knowledge graph of the industry to be tested, and the specific process comprises the following steps: firstly, preprocessing the patent text information data, and predicting target word vectors according to the context information in the preprocessed text data, so as to obtain vector representations of all words; then based on pre-labeled sample vectors, finding out keywords in each patent text information that have a higher similarity frequency with the sample vectors according to the cosine similarity, as the enterprise technology features, for strengthening the entity representation of the enterprises; Step S3, the entity relationship prediction model encodes the entity relationship information of the entity features based on the graph attention network, so as to obtain corresponding entity representations; Step S4, the entity relationship prediction model obtains entity vector representations and corresponding relationship vector representations of the entity features based on the knowledge completion TransR sub-model; Step S5, the ConvE sub-model embeds the entity vector representations and the relationship vector representations by using two-dimensional convolution, and outputs the confidence size of the triple data correspondingly, so as to predict the upstream and downstream relationships between the enterprises in the industry to be tested.
2. The enterprise upstream and downstream relationship prediction method for the industry knowledge graph according to claim 1, characterized in that: wherein The graph attention network has two graph attention layers, the first attention layer being used to capture information about one-hop neighbors of a center node, and the second attention layer being used to capture information about two-hop neighbors of the center node, and outputting entity representations in an average manner based on multi-head attention, where each layer takes as input an entity embedding matrix and a relation embedding matrix, the entity embedding matrix is denoted as where the i-th row is the embedding vector of entity e i , N e represents the number of entities, and D is the dimension of each entity embedding vector, the relation embedding matrix is denoted as , where N r represents the number of relations, and P is the dimension of each relation embedding vector, the entity embedding matrix corresponding to each layer is denoted as the relation embedding matrix 3. The enterprise upstream and downstream relationship prediction method for the industry knowledge graph according to claim 2, characterized in that: wherein The specific process of the step S3 is as follows: To obtain a new embedding representation of an entity e i , an entity relation prediction model learns all the triples data of relations and entities associated with the entity e i , for a particular triple t i = (e kij , r i , e k ) associated with the entity e j , a new vector representation of the particular triple t kij is obtained in a way of concatenating entity and relation vectors where the vectors and represent the embeddings of entities e i , e j and relation r k , respectively, and W1 represents a linear transformation matrix, The entity relation prediction model learns c ijk Each triple t kij The importance of each triple t kij is then multiplied by the weight matrix W2, and finally a LeakyRelu function is used to obtain the absolute attention value b ijk = LeakyReLU(W2c ijk ) To obtain the relative attention value, softmax is applied to b ijk , to obtain the relative attention value α ijk = softmax(b ijk ), based on the idea of GAT multi-head attention mechanism, the model uses multi-head attention mechanism to stabilize the training process, and the entity representation is calculated: In the formula, M represents M attention heads, m represents the mth attention head, represents the set of all neighbor nodes of entity node i.
4. The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph according to claim 3, characterized in that: wherein The specific process of the step S4 is: sending the knowledge graph triple data of the industry to be predicted to the TransR sub-model to obtain entity vector representation and relationship vector representation from data model training, wherein the output entity vector matrix is denoted as H i , the coefficient matrix W E is used to perform linear transformation on the entity vector matrix H i , and then a splicing operation is performed on the entity output H e of the encoder to obtain the final entity vector representation H" which is given to the decoder: H" = W E H i ||H e , Likewise for the relation matrix vector R i By the above operation, the relation vector representation R" is obtained and given to the decoder: R" = [W R R i ||R e ].
5. The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph according to claim 1, characterized in that: wherein The confidence of the triple is obtained by: the ConvE sub-model obtains the head entity e s and the tail entity e o The similarity ψ under the relationship r r (e s ,e o ), and then the similarity is put into the sigmod activation function to obtain the similarity probability P of the triple data as the confidence, and the greater P is, the more similar the head entity e s and the tail entity e o under the relationship r are.
6. The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph according to claim 1, characterized in that: wherein, In the step S5, a threshold setting method is adopted, when the confidence degree of the prediction of the two enterprises in the upstream and downstream relationship is greater than the threshold, it is determined that the two enterprises have the upstream and downstream relationship, otherwise it is determined that the two enterprises do not have the upstream and downstream relationship.
7. The enterprise upstream and downstream relationship prediction method for the industrial knowledge graph according to claim 6, characterized in that: wherein, The threshold setting method is as follows: the minimum value of the threshold is obtained according to the Hit@50 index, then the threshold is continuously increased, the F1 is selected as the evaluation index of the enterprise upstream and downstream relationship prediction, and the final threshold is determined by optimizing the F1 index.
Citation Information
Patent Citations
Knowledge graph relationship prediction method and device based on attention mechanism
CN113535984A
Risk prediction method and device, equipment and storage medium
CN113822494A