Method and apparatus for relationship prediction
By acquiring object attribute information and knowledge graph path vectors from SMEs, and fusing them with a pre-defined attention mechanism and a multilayer perceptron, the accuracy and interpretability issues of supply chain relationship prediction for SMEs are solved, achieving efficient business decision support.
Patent Information
- Application Number
- CN202211123061.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-15
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2042-09-15
AI Technical Summary
In scenarios with sparse data, SMEs often lack accurate and interpretable predictions of supply chain relationships, which impacts their business decisions.
By acquiring object attribute information and initial vectors of knowledge graph paths, a pre-defined attention mechanism is used to fuse them, and a multilayer perceptron is combined to predict relationships, outputting path information with high contribution.
It improves the accuracy of supply chain relationship forecasting for SMEs, provides interpretable decision-making basis, and enhances user experience.
Smart Images

Figure CN115510238B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present specification relate to the technical field of computer, in particular to a relationship prediction method. BACKGROUND
[0002] Small and medium-sized enterprises exist widely in various industries, and in recent years, they have become increasingly important to the development of economy and society. However, small and medium-sized enterprises often face difficulties in financing, limited information acquisition ability, and narrow sales channels; in order to solve these problems, supply chain technology is generally introduced to cope with them. However, compared with the rich and easily accessible data of large enterprises, the information about themselves that can be obtained by small and medium-sized enterprises is very limited, which is a typical data sparse scenario, which brings great challenges to the use of supply chain technology to solve the above problems. Especially in the supply chain prediction task of small and medium-sized enterprises, in the data sparse scenario, the accuracy of the supply chain relationship prediction result of small and medium-sized enterprises will be greatly affected. SUMMARY
[0003] Therefore, the embodiments of the present specification provide a relationship prediction method. One or more embodiments of the present specification also relate to a relationship prediction device, a relationship prediction model, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects in the prior art.
[0004] According to a first aspect of the embodiments of the present specification, a relationship prediction method is provided, comprising:
[0005] Obtaining object attribute information of a first object and a second object, and obtaining an initial object vector of the object attribute information;
[0006] Determining a target path corresponding to the first object and the second object according to an object knowledge graph respectively, and obtaining an initial path vector of the target path;
[0007] Processing the initial object vector and the initial path vector to obtain a target object vector and a target path vector;
[0008] Fusing the target object vector and the target path vector through a preset attention mechanism to obtain a fusion vector, and predicting a relationship between the first object and the second object according to the fusion vector.
[0009] According to a second aspect of the embodiments of the present specification, a relationship prediction device is provided, comprising:
[0010] An object vector obtaining module configured to obtain object attribute information of a first object and a second object, and obtain an initial object vector of the object attribute information;
[0011] a path vector obtaining module configured to determine target paths corresponding to the first object and the second object respectively according to an object knowledge graph, and obtain an initial path vector of the target paths;
[0012] a vector processing module configured to process the initial object vector and the initial path vector to obtain a target object vector and a target path vector;
[0013] a relation prediction module configured to fuse the target object vector and the target path vector through a preset attention mechanism to obtain a fusion vector, and predict a relation between the first object and the second object according to the fusion vector.
[0014] According to a third aspect of the embodiments of the present specification, there is provided a relation prediction method comprising an object vector obtaining network layer, a path vector obtaining network layer, a vector processing network layer, and a relation prediction network layer, wherein,
[0015] the object vector obtaining network layer is configured to determine object attribute information of a first object and a second object, and obtain an initial object vector of the object attribute information;
[0016] the path vector obtaining network layer is configured to determine path information of target paths corresponding to the first object and the second object respectively according to an object knowledge graph, and obtain an initial path vector of the path information;
[0017] the vector processing network layer is configured to process the initial object vector and the initial path vector to obtain a target object vector and a target path vector;
[0018] the relation prediction network layer is configured to fuse the target object vector and the target path vector through a preset attention mechanism to obtain a fusion vector, and predict a relation between the first object and the second object according to the fusion vector.
[0019] According to a fourth aspect of the embodiments of the present specification, there is provided a computing device comprising:
[0020] a memory and a processor;
[0021] the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions, which implement the steps of the above relation prediction method when executed by the processor.
[0022] According to a fifth aspect of the embodiments of the present specification, there is provided a computer readable storage medium storing computer executable instructions, which implement the steps of the above relation prediction method when executed by a processor.
[0023] According to a sixth aspect of the embodiments of the present specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the relationship prediction method.
[0024] One embodiment of the present specification implements a relationship prediction method and device, wherein the method comprises obtaining object attribute information of a first object and a second object, and obtaining an initial object vector of the object attribute information; determining a target path corresponding to the first object and the second object according to an object knowledge graph respectively, and obtaining an initial path vector of the target path; processing the initial object vector and the initial path vector to obtain a target object vector and a target path vector; fusing the target object vector and the target path vector through a preset attention mechanism to obtain a fusion vector, and predicting a relationship between the first object and the second object according to the fusion vector. Specifically, the object attribute information (such as enterprise basic information) and the target path corresponding to the object (such as a small and medium-sized enterprise) determined according to the object knowledge graph (such as an enterprise knowledge graph) are fused by using the preset attention mechanism, which realizes full mining of the implicit information in the association relationship between the enterprise basic information and the target path, and solves the influence of the accuracy of the supply chain prediction result of the enterprise in the data sparse scene. BRIEF DESCRIPTION OF DRAWINGS
[0025] Figure 1 is a processing schematic diagram of a specific application scenario of a relationship prediction method provided by one embodiment of the present specification;
[0026] Figure 2 is a flowchart of a relationship prediction method provided by one embodiment of the present specification;
[0027] Figure 3 is a processing process flowchart of a relationship prediction method provided by one embodiment of the present specification;
[0028] Figure 4 is a structure schematic diagram of a relationship prediction device provided by one embodiment of the present specification;
[0029] Figure 5 is a structure block diagram of a computing device provided by one embodiment of the present specification. DETAILED DESCRIPTION
[0030] In the following description, many specific details are set forth in order to provide a thorough understanding of the present specification. However, the present specification can be practiced in many different ways beyond the specific embodiments described herein, and it is understood that similar implementations can be made without departing from the spirit of the present specification, so the present specification is not limited to the specific implementations disclosed below.
[0031] The terminology used in this disclosure, one or more embodiments of the present specification, is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present specification. As used in this disclosure and the appended claims herein, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "and / or," as used in the context of this disclosure, refers to and encompasses any one of multiple potential combinations of the associated listed items.
[0032] It will be understood that, although the terms first, second, etc. can be employed in this disclosure, one or more embodiments of the present specification, to describe various information, these information should not be limited to these terms. These terms are only used to differentiate one piece of information from another piece of information of the same type. For example, a first can also be referred to as a second, and similarly, a second can also be referred to as a first, without departing from the scope of one or more embodiments of the present specification. Depending on the context, the word "if' as used herein can be interpreted to mean "when" or "in response to determining".
[0033] First, the noun terms related to one or more embodiments of the present specification are explained.
[0034] Knowledge graph: refers to a graph data structure that connects various types of financial field entities (such as enterprises, legal representatives, industries, etc.) through various types of relationships (such as business relationships, transaction relationships, etc.) to objectively depict the factual behaviors of business, transactions, and fund flows between enterprises and important personnel, wherein the attribute characteristics of a large-scale specific entity are on the order of billions.
[0035] Supply chain: refers to the entire link of the flow of goods, data, and funds related to products or services from raw material procurement to product delivery to the final destination.
[0036] Data sparsity: refers to the problem that in small and medium-sized enterprises, the basic information for processing the association between enterprises is difficult to obtain or the available data is limited.
[0037] Interpretable prediction: relative to the "black box" decision mechanism of deep learning models, the interpretability of a specific prediction model can provide a decision basis that can be understood by humans while predicting.
[0038] Path connectivity mode: refers to the association between entities implied in the path connecting two different entities in the knowledge graph.
[0039] Representation learning: also known as feature learning, is a method of using machine learning methods to obtain a vectorized expression of the object to be represented, so as to more easily extract useful information from the original object to be represented when constructing a classifier or performing other prediction tasks.
[0040] Supply chain relationship: in the embodiments of the present specification, it specifically refers to the upstream and downstream dependence relationship of two enterprises in the supply chain system.
[0041] One-hot encoding: one-hot encoding, also known as one-bit effective encoding, mainly uses N-bit state registers to encode N states, each state has its own independent register bit, and only one bit is effective at any time.
[0042] Doc2Vec: an unsupervised learning algorithm, which is used to learn and generate fixed-dimensional vectors to represent different documents or sentences.
[0043] MLP: multi-layer perceptron, a neural network model used to implement relationship prediction modeling.
[0044] Small and medium-sized enterprises have important social and economic significance. However, according to the background art, small and medium-sized enterprises often face difficulties in financing, limited information acquisition ability, narrow sales channels and other difficulties; in order to solve these problems, introducing supply chain technology is an effective solution. At the same time, a fact that has to be considered is that compared with the rich and easily accessible data of large enterprises, the information that can be obtained about small and medium-sized enterprises is very limited, which is a typical "data sparse" scenario. This brings great challenges to the use of supply chain technology to solve their difficulties; in order to solve such challenges, knowledge graphs containing rich facts and connection relationships have been widely used in various scenarios in recent years, such as the recommendation field, the risk control field, the advertising field, the medical field, the transportation field and other typical "data sparse" scenarios. However, most knowledge graph-based methods usually directly follow the modeling method of classical graph neural networks, which is effective to some extent, but is not satisfactory in terms of interpretability. And the relationship prediction method provided in the embodiments of the present specification, when applied to solve the "small and medium-sized enterprise supply chain prediction" task, since the prediction results of the model will be an important basis for the actual business decision of the enterprise operator, the demand for "interpretability" of the decision results is more urgent. Of course, the relationship prediction method provided in the embodiments of the present specification can not only be applied to the "small and medium-sized enterprise supply chain prediction" task, but also be applicable to the scenarios in which it can realize object relationship prediction, such as user relationship prediction with financial relationship, in order to facilitate understanding, the relationship prediction method is applied to solve the "small and medium-sized enterprise supply chain prediction" task in the embodiments of the present specification.
[0045] Real enterprise supply chain relationship is usually clustered in the form of "upstream-middle-downstream", and connected through network to form. In this organization, enterprises from different industries can be connected through complex business relationship path, and the upstream enterprise operator can "find the needle in the haystack" in the supply chain network to find the "potential partners" they are interested in. Obviously, this way of analyzing the connection path in the enterprise supply chain to infer the potential cooperation possibility is in line with people's understanding and cognition, and accordingly, it can be considered as explainable. Therefore, exploring the knowledge graph path can be regarded as an effective method to solve the two challenges of "data sparsity" and "explainability" at the same time. However, in reality, a knowledge graph describing the relationship between enterprises in the supply chain is often of a huge scale (such as the knowledge graph reaching the scale of hundreds of billions). Then in such a large-scale knowledge graph, the path relationship between enterprises will be complex, large and full of noise. Through the simple way of exploring the knowledge graph path, the prediction modeling of the supply chain relationship between enterprises will inevitably face these difficulties.
[0046] Based on this, in the present specification, a relationship prediction method is provided. One or more embodiments of the present specification also relate to a relationship prediction device, a relationship prediction model, a computing device, a computer-readable storage medium and a computer program, which are described in detail in the following embodiments.
[0047] Referring to Figure 1 , Figure 1 A processing schematic diagram of a specific application scenario of a relationship prediction method according to an embodiment of the present specification is shown.
[0048] Figure 1 The user 102, the client 104 and the server 106 are included in the embodiment.
[0049] In a specific implementation, the client 104 provides a user interaction interface for the user 102, and the user 102 inputs enterprise a and enterprise b in the user interaction interface and clicks the "start prediction" control; the client 104 generates a supply chain prediction request for enterprise a and enterprise b in response to the triggering instruction of the user 102 on the "start prediction" control on the user interaction interface, and sends the supply chain prediction request to the server 106, so as to realize the prediction of whether there is a supply chain relationship between enterprise a and enterprise b in the server 106, that is, the prediction of whether there is an upstream and downstream relationship between enterprise a and enterprise b.
[0050] After the server 106 receives the supply chain prediction request sent by the client 104, the enterprise basic information of enterprise a and enterprise b, such as enterprise name, enterprise type, enterprise employee number, industry to which the enterprise belongs, geographical location, etc., and the enterprise knowledge graph containing enterprise a and enterprise b are obtained.
[0051] Then the enterprise basic information of enterprise a and enterprise b, the enterprise knowledge graph containing enterprise a and enterprise b are input into the deployed relationship prediction model, and the knowledge graph path vectorization representation learning network layer, the enterprise basic information vectorization representation learning network layer, the connectivity representation learning network layer and the hierarchical correlation path sampling network layer of the deployed relationship prediction model are used to predict whether there is a supply chain relationship between enterprise a and enterprise b, to obtain the supply chain relationship prediction result of enterprise a and enterprise b, a number of knowledge graph paths with high contribution to the prediction result, and the weight of each knowledge graph path participating in the final decision, i.e. contribution.
[0052] The knowledge graph path vectorization representation learning network layer determines the knowledge graph path corresponding to enterprise a and the knowledge graph path corresponding to enterprise b from the enterprise knowledge graph containing enterprise a and enterprise b, and then performs representation learning on the knowledge graph path corresponding to enterprise a and the knowledge graph path corresponding to enterprise b through a knowledge graph path vectorization representation learning technology (such as Path2Vec) to obtain the vectorized representation of the knowledge graph path corresponding to enterprise a and the vectorized representation of the knowledge graph path corresponding to enterprise b; the enterprise basic information vectorization representation learning network layer performs representation learning on the enterprise basic information of enterprise a and enterprise b to obtain the vectorized representation of the enterprise basic information of enterprise a and the vectorized representation of the enterprise basic information of enterprise b; the connectivity representation learning network layer processes the feature vectors corresponding to the vectorized representations output by the knowledge graph path vectorization representation learning network layer and the enterprise basic information vectorization representation learning network layer by splicing them, and inputs them into the connectivity representation learning network layer to obtain a more refined representation vector; then the more refined representation vector is input into the hierarchical correlation relationship path sampling network layer, and in the network layer, a "query-key" form of attention mechanism is introduced, taking the more refined representation vector learned from the enterprise basic information as the "query" and the more refined representation vector of each knowledge graph path as the "key" to perform similarity measurement, so as to calculate the vector similarity between them to determine the weight of each knowledge graph path to the final prediction "contribution degree". Further, the weights are used as fusion weighting coefficients to fuse the more refined representation vector of the enterprise basic information and the more refined representation vector of the knowledge graph path, and a multi-layer perception (MLP) is used to predict the supply chain relationship between enterprise a and enterprise b. At the same time, the prediction result is output, as well as several knowledge graph paths with high contribution to the prediction result and the contribution degree of each knowledge graph path to the final decision.
[0053] The server 106 returns the supply chain relationship prediction result of enterprise a and enterprise b, the several knowledge graph paths with high contribution to the prediction result, and the weight of each knowledge graph path to the final decision to the client 104, and the client 104 displays them to the user 102 through the user interaction interface; the user 102 can then implement business based on the information displayed in the user interaction interface, such as fund lending or product selling.
[0054] The relationship prediction method provided by the embodiments of the present specification inputs the enterprise basic information of enterprise a and enterprise b and the enterprise knowledge graph containing enterprise a and enterprise b into the deployed relationship prediction model, and learns through the knowledge graph path vectorization representation learning network layer, the enterprise basic information vectorization representation learning network layer, the connectivity representation learning network layer and the hierarchical association relationship path sampling network layer in the relationship prediction model, to fully mine the implicit information between the enterprise basic information features and the connectivity mode features of different paths of enterprises in the knowledge graph, improve the accuracy of the supply chain relationship prediction result of enterprise a and enterprise b; at the same time, the knowledge graph paths with high contribution degree and the respective contribution weights (i.e. contribution degree) of these paths in the final decision are also output as the basis for subsequent user business analysis and decision making, realizing explainable prediction and improving user experience.
[0055] Referring to Figure 2 , Figure 2 A flowchart of a relationship prediction method according to an embodiment of the present specification is shown, which specifically includes the following steps.
[0056] Step 202: Obtain object attribute information of a first object and a second object, and obtain an initial object vector of the object attribute information.
[0057] Specifically, the specific application scenarios of the relationship prediction method provided by the embodiments of the present specification are different, and the first object and the second object are also different; for example, the relationship prediction method is applied to the enterprise supply chain relationship prediction scenario, and the first object and the second object can be understood as two different enterprises, for example, the first object is a fund providing enterprise (bank), and the second object is a fund demanding enterprise (various types of merchants, etc.); while if the relationship prediction method is applied to the user relationship prediction scenario, the first object and the second object can be understood as two different users, such as the first object is user a and the second object is user b. For ease of understanding, the following embodiments will be described in detail with the first object and the second object understood as two different enterprises as an example in the case of the relationship prediction method applied to the enterprise supply chain relationship prediction scenario.
[0058] In the case of the first object and the second object being two different enterprises, the object attribute information of the first object and the second object can be understood as the enterprise basic information of the first enterprise and the second enterprise, such as enterprise name, enterprise size, enterprise type, etc.
[0059] Since the relationship prediction model is a machine learning model, and the data processed in the machine learning model is a theoretically infinite-dimensional vector represented in geometric form, after obtaining the object attribute information of the first object and the second object, in order to realize subsequent rapid and accurate relationship prediction of the first object and the second object by the relationship prediction model, it is necessary to convert the object attribute information of the first object and the second object into the initial object vector corresponding to the object attribute information. The specific implementation is as follows:
[0060] The initial object vector of the object attribute information includes:
[0061] The object attribute information is encoded, and vector representation learning of the encoded object attribute information is performed by a deep neural network to obtain the initial object vector of the object attribute information.
[0062] The relationship prediction model can be understood as the relationship prediction model of the above-mentioned embodiments, and can be understood as the relationship prediction method provided by the embodiments of the present specification being implemented based on the relationship prediction model. The deep neural network (Deep Neural Networks, DNN) can be understood as a vector conversion network for vectorizing the object attribute information in the relationship prediction model.
[0063] Taking the object attribute information as enterprise basic information as an example, the object attribute information is encoded, and vector representation learning of the encoded object attribute information is performed by a deep neural network to obtain the initial object vector of the object attribute information. It can be understood that the enterprise basic information is one-hot encoded, and the encoded enterprise basic information is vector representation learning by using a deep neural network to obtain the vectorization representation corresponding to the enterprise basic information, i.e. the initial object vector.
[0064] In practical applications, the object attribute information of the first object and the second object can be understood as the object attribute information of the first object and the object attribute information of the second object. Then, obtaining the initial object vector of the object attribute information can be understood as obtaining the initial object vector of the object attribute information of the first object and the object attribute information of the second object. The specific implementation is as follows:
[0065] The initial object vector of the object attribute information includes:
[0066] The first object attribute information of the first object and the second object attribute information of the second object are obtained.
[0067] The first object attribute information and the second object attribute information are encoded, and vector representation learning is performed on the encoded first object attribute information and second object attribute information through a deep neural network to obtain an initial object vector of the first object attribute information and the second object attribute information.
[0068] The specific implementation of encoding the first object attribute information and the second object attribute information and performing vector representation learning on the encoded first object attribute information and second object attribute information through a deep neural network to obtain an initial object vector of the first object attribute information and the second object attribute information can be found in the specific implementation of encoding the object attribute information and performing vector representation learning on the encoded object attribute information through a deep neural network to obtain an initial object vector of the object attribute information in the above embodiments, which will not be repeated here.
[0069] Taking an enterprise as an example, first enterprise attribute information of a first enterprise and second enterprise attribute information of a second enterprise are obtained; the first enterprise attribute information and the second enterprise attribute information are encoded, and vector representation learning is performed on the encoded first enterprise attribute information and second enterprise attribute information through a deep neural network to obtain an initial object vector of the first enterprise attribute information and the second enterprise attribute information, that is, the initial object vector can be understood as a splicing vector of the vector obtained by performing vector representation learning on the first enterprise attribute information and the vector obtained by performing vector representation learning on the second enterprise attribute information.
[0070] Step 204: determining a target path corresponding to the first object and the second object according to an object knowledge graph, and obtaining an initial path vector of the target path.
[0071] The object knowledge graph can be understood as a knowledge graph containing the first object and the second object. In the case that the first object and the second object are two different enterprises, the object knowledge graph can be understood as an enterprise knowledge graph, that is, an enterprise knowledge graph constructed by taking an enterprise as a node and an association relationship between enterprises as an edge.
[0072] In the case that the first object and the second object are two different enterprises and the object knowledge graph is an enterprise knowledge graph, the target path corresponding to the first object and the second object can be understood as a target path corresponding to the first enterprise and the second enterprise, for example, the target path corresponding to the first object is a plurality of paths associated with the first enterprise, and the target path corresponding to the second object is a plurality of paths associated with the second enterprise.
[0073] Similarly, as can be seen from the above, in order to accurately predict the relationship between the first object and the second object subsequently, it is also necessary to convert the target path corresponding to the first object and the second object into an initial path vector corresponding to the target path. The specific implementation is as described below.
[0074] The initial path vector of the target path is obtained, including:
[0075] The target path is processed into natural language text, and vector representation learning is performed on the natural language text through a word vector processing model to obtain the initial path vector of the target path.
[0076] Taking the object knowledge graph as an enterprise knowledge graph as an example, the target path is processed into natural language text, and vector representation learning is performed on the natural language text through a word vector processing model to obtain the initial path vector of the path information. It can be understood that the target path in the enterprise knowledge graph such as "enterprise-relation-enterprise...-enterprise" is approximately regarded as a sentence (i.e. natural language text) in natural language, and the enterprise, relation, etc. is regarded as a word in the sentence. Then, the knowledge graph path in the form of the approximate natural language sentence is subjected to vector representation learning through a word vector processing model (such as a document vector processing model) to obtain a vectorized representation corresponding to the target path, i.e. an initial path vector. The word vector processing model includes but is not limited to a Doc2Vec model.
[0077] In actual application, the target path corresponding to the first object and the second object can be understood as the target path corresponding to the first object and the target path corresponding to the second object. Then, obtaining the initial path vector of the target path can be understood as obtaining the initial path vector of the target path corresponding to the first object and the target path corresponding to the second object. The specific implementation is as described below.
[0078] The target path corresponding to the first object and the second object is determined according to the object knowledge graph, and the initial path vector of the target path is obtained, including:
[0079] The first target path corresponding to the first object and the second target path corresponding to the second object are determined according to the object knowledge graph;
[0080] The first target path and the second target path are processed into natural language text, and vector representation learning is performed on the natural language text through a word vector processing model to obtain the initial path vector of the first target path and the second target path.
[0081] The first target path and the second target path are processed as natural language texts, and vector representation learning is performed on the natural language texts through a word vector processing model to obtain an initial path vector of the first target path and the second target path. For details of the specific implementation, refer to the above embodiment of processing the target path as a natural language text and performing vector representation learning on the natural language text through a word vector processing model to obtain an initial path vector of the target path, which will not be repeated here.
[0082] Taking an object knowledge graph as an enterprise knowledge graph, first, a first target path corresponding to a first enterprise and a second target path corresponding to a second enterprise are determined according to the enterprise knowledge graph; then the first target path and the second target path are processed as natural language texts, and vector representation learning is respectively performed on the natural language texts through a word vector processing model to obtain an initial path vector corresponding to the first target path and the second target path, that is, the initial path vector can be understood as a splicing vector of a vector obtained by performing vector representation learning on the first target path and a vector obtained by performing vector representation learning on the second target path.
[0083] In the embodiment of the present specification, the object attribute information of the first object, the object attribute information of the second object, the first target path corresponding to the first object, and the second target path corresponding to the second object are obtained, and then the supply chain relationship between enterprises can be accurately predicted according to the complete enterprise basic information and different target paths corresponding to the enterprises. At the same time, in order to improve the processing efficiency of the computer and reduce the prediction time of the relationship prediction method, the initial object vectors of the first object attribute information and the second object attribute information can be obtained through one-hot encoding and a deep neural network, and the initial path vectors of the first target path and the second target path can be obtained through natural language text processing of the target path and a word vector processing model. Subsequently, the computer can accurately and quickly predict the relationship between the first object and the second object according to the relationship prediction method through the initial object vectors and the initial path vectors.
[0084] Step 206: processing the initial object vector and the initial path vector to obtain a target object vector and a target path vector.
[0085] In actual application, because the initial object vector and the initial path vector are learned in different ways and from different sources, they are not in the same semantic space and cannot be directly measured when used later. Therefore, in the embodiment of the present specification, the initial object vector and the initial path vector can be processed through a multi-head attention network so that they are distributed in the same semantic space for subsequent vector fusion. The specific implementation is as follows:
[0086] The processing of the initial object vector and the initial path vector obtains a target object vector and a target path vector, and includes:
[0087] The initial object vector and the initial path vector are spliced, and the spliced vector is input into a multi-head attention network for processing to obtain a target vector corresponding to the spliced vector,
[0088] The target vector includes a target object vector corresponding to the initial object vector and a target path vector corresponding to the initial path vector.
[0089] Specifically, the initial object vector and the initial path vector are spliced, and the spliced vector is input into a multi-head attention network for processing to obtain a target vector corresponding to the spliced vector, which includes a target object vector corresponding to the initial object vector and a target path vector corresponding to the initial path vector.
[0090] In the embodiments of the present specification, by inputting the spliced initial object vector and the initial path vector into the multi-head attention network for processing, the initial object vector and the initial path vector can be corrected and reshaped by fully utilizing the similarity relationship between the vectors, so that each refined vector can contain a large amount of information (such as necessary similarity interaction information between each vector and other vectors), solving the problem of data sparseness. Moreover, the initial path vector of the path information is learned by the Doc2Vec model, and the initial object vector of the object attribute information is input into the DNN model after one-hot encoding and learned, which are essentially different in learning method and source, although they are distributed in the same d-dimensional space, but not in the same semantic space, and cannot be directly similarity measured subsequently. Therefore, after being processed by the multi-head attention network, they can be projected into the same d-dimensional space by the multi-head attention mechanism of the multi-head attention network, so that each vector can contain more information and they can be distributed in the same semantic space, facilitating the similarity measurement between vectors subsequently, to ensure the accuracy of subsequent vector-based relationship prediction.
[0091] In order to further improve the accuracy of the multi-head attention mechanism network in vector processing, a constraint method in vector processing can be introduced into the multi-head attention mechanism network to avoid the multiple heads of the multi-head attention mechanism learning similar information in the vector processing process, resulting in insufficient distinguishability. The specific implementation is as follows:
[0092] The processing of the initial object vector and the initial path vector obtains a target object vector and a target path vector, and includes:
[0093] The concatenated vector is input into a multi-head attention network adopting a preset constraint method, and the concatenated vector corresponding target vector is obtained by processing the concatenated vector through a multi-head attention mechanism in the multi-head attention network.
[0094] The preset constraint method includes but is not limited to a Hilbert independent criterion constraint.
[0095] In a specific implementation, the multi-head attention network has multiple heads, and in the process of vector processing, the multiple heads are more likely to learn very similar information, which leads to insufficient distinction and finally loses its value. In the embodiments of the present specification, the concatenated vector is input into a multi-head attention network adopting a preset constraint method, and the concatenated vector corresponding target vector is obtained by processing the concatenated vector through a multi-head attention mechanism in the multi-head attention network under the constraint of the preset constraint method. The different heads in the multi-head attention network can be constrained to learn as much different information as possible, so as to more accurately obtain the concatenated vector corresponding target vector and improve the overall performance of the multi-head attention network in vector processing.
[0096] Step 208: fusing the target object vector and the target path vector through a preset attention mechanism to obtain a fused vector, and predicting the relationship between the first object and the second object according to the fused vector.
[0097] The preset attention mechanism can be understood as a key-value pair attention mechanism (i.e., query-key attention). When the relationship prediction method of the embodiments of the present specification is applied to an enterprise supply chain prediction scenario, the first object is a first enterprise, and the second object is a second enterprise different from the first enterprise. Then, the relationship between the first object and the second object is predicted according to the fused vector, which includes:
[0098] The relationship between the first enterprise and the second enterprise is predicted according to the fused vector.
[0099] That is, the relationship between the first object and the second object can be understood as whether the first object and the second object are in a supply chain relationship, i.e., whether they are in an upstream-downstream relationship.
[0100] Specifically, in order to fully tap the information implied in the association between the characteristics of enterprise basic information (i.e., target object vector) and the connectivity mode characteristics of different target paths (i.e., target path vector), the key-value pair attention mechanism is introduced in the embodiments of the present specification, i.e., the query-key form of attention mechanism, taking the target object vector learned from the enterprise basic information as the "query" and the target path vector of each knowledge graph path (target path) as the "key" for similarity measurement, so as to calculate the vector similarity between them to determine the weight of each knowledge graph path for the final prediction contribution, and finally take these weights as the fusion weighting coefficients to fuse the characteristics of enterprise basic information and the connectivity mode characteristics of different target paths to obtain a fusion vector. The specific implementation manner is described as follows:
[0101] The fusion vector is obtained by fusing the target object vector and the target path vector through the preset attention mechanism, and the fusion vector comprises:
[0102] The similarity between the target object vector and the target path vector is calculated through the key-value pair attention mechanism, taking the target object vector as the query vector and the target path vector as the key vector.
[0103] The target object vector and the target path vector are fused according to the similarity to obtain a fusion vector.
[0104] Specifically, the similarity between the query vector and each key vector is calculated through the key-value pair attention mechanism, taking the target object vector as the query vector and the target path vector as the key vector. Finally, the target object vector and the target path vector are fused according to the similarity to obtain a fusion vector.
[0105] After obtaining the fusion vector, the relationship between the first object and the second object can be quickly and accurately predicted according to the fusion vector. The specific implementation manner is described as follows:
[0106] The relationship between the first object and the second object is predicted according to the fusion vector, and the relationship between the first object and the second object comprises:
[0107] The fusion vector is input into a classification model, and the relationship between the first object and the second object is predicted through the classification model.
[0108] The classification model can be pre-set as a multilayer perceptron (MLP).
[0109] Specifically, after the characteristics of enterprise basic information and the connectivity mode characteristics of different target paths are fused to obtain a fusion vector by taking the weight of each knowledge graph path for the final prediction contribution as the fusion weighting coefficient, the supply chain relationship between the first object and the second object can be predicted through the multilayer perceptron to obtain an accurate prediction result.
[0110] The relationship prediction method provided by the embodiment of the present specification fuses the object attribute information (such as enterprise basic information) and the path information of the target path corresponding to the object determined according to the object knowledge graph by using a preset attention mechanism, realizes the full mining of the implicit information in the association relationship between the enterprise basic information and the path information, and solves the influence of the accuracy of the supply chain prediction result of the enterprise in the data sparse scene.
[0111] In addition, in order to realize the explainable prediction, the classification model will also perform filtering on the target paths to be displayed according to the weight of each target path in the object knowledge graph when outputting the relationship between the first object and the second object, and the filtered target paths to be displayed can be displayed to the user for subsequent business decision-making. The specific implementation manner is as follows:
[0112] After predicting the relationship between the first object and the second object according to the fusion vector, the method further includes:
[0113] determining the weight of the target path according to the similarity, and determining a target path to be displayed from the target path according to the weight of the target path.
[0114] Specifically, the similarity between the target object vector and each target path is taken as the weight of each target path, and all target paths are sorted according to the weight of each target path, and then a preset number of target paths are selected from the sorted target paths as the target paths to be displayed; wherein the preset number can be set according to actual needs, and the embodiment of the present specification does not make any limitation thereon, for example, the preset number can be 2 or 3, etc.
[0115] After obtaining the target paths to be displayed, in order to further realize the explainable problem, the relationship between the first object and the second object, the target paths to be displayed and the weight of the target paths to be displayed can be displayed, so that the user can subsequently adjust and decide the business according to the display information. The specific implementation manner is as follows:
[0116] After determining the target path to be displayed from the target path, the method further includes:
[0117] displaying the relationship between the first object and the second object, the target path to be displayed and the weight corresponding to the target path to be displayed.
[0118] In a specific implementation, the relationship between the first object and the second object, the target path to be displayed, and the weight corresponding to the target path to be displayed can be displayed to the user through the user terminal, so that the user can make a business decision according to the display information. For example, the user can know the contribution degree of the target path to be displayed to the final decision (i.e., the relationship prediction result) through the weight corresponding to the target path to be displayed, and can know the association relationship between enterprises in the target path to be displayed through analysis of the target path to be displayed, facilitating subsequent confirmation of whether to lend or supply products to some enterprises.
[0119] The relationship prediction method provided in the embodiments of the present specification fully mines the implicit information of the association relationship between the enterprise basic information features and the connectivity mode features of different target paths by introducing the query-key form attention mechanism, and the method can explicitly output important knowledge graph paths and the contribution weight (i.e., the weight) of each knowledge graph path in the final decision, for people to analyze the basis for decision-making, thereby realizing interpretability and improving user experience.
[0120] The following describes the relationship prediction method in combination with the accompanying Figure 3 The relationship prediction method provided in the embodiments of the present specification is further described by taking the application of the relationship prediction method in the enterprise supply chain prediction scenario as an example. Among them, Figure 3 FIG. 1 shows a processing process flowchart of a relationship prediction method provided in an embodiment of the present specification, specifically including the following steps.
[0121] Step 302: Obtain enterprise basic information 1 of enterprise a and enterprise basic information 2 of enterprise b, and perform one-hot encoding on the enterprise basic information 1 and the enterprise basic information 2, and perform vector representation learning on the enterprise basic information 1 and the enterprise basic information 2 through a deep neural network to obtain an initial enterprise vector.
[0122] Step 304: Obtain target path 1 of enterprise a and target path 2 of enterprise b according to an enterprise knowledge graph, and perform vector representation learning on the target path 1 and the target path 2 through a knowledge graph path vectorization representation learning technology to obtain an initial path vector.
[0123] Step 306: Concatenate the initial enterprise vector and the initial path vector, and input the concatenated vector into a multi-head attention network constrained by a Hubert independence criterion.
[0124] Step 308: Perform vector processing on the concatenated vector in the multi-head attention network constrained by the Hubert independence criterion to obtain a target enterprise vector and a target path vector.
[0125] Step 310: Input the target enterprise vector and the target path vector into the query-key form of attention mechanism. Use the representation vector (target path vector) learned from the enterprise basic information as the "query" and the representation vector (target path vector) of each knowledge graph path as the "key" to measure similarity. Then, calculate the vector similarity between them as the weight of each path's "contribution" to the final prediction. Use these weights as fusion weighting coefficients to fuse the enterprise basic information representation vector and the knowledge graph path representation vector to obtain the fused vector.
[0126] Step 312: Input the fused vector into the multilayer perceptron and use the multilayer perceptron to predict the supply chain relationship between enterprise a and enterprise b.
[0127] In addition, while outputting the prediction results of the supply chain relationship between enterprise A and enterprise B, the multilayer perceptron can also output important knowledge graph paths and the weight of each knowledge graph path in the final decision, so that people can analyze the basis of the decision and thus achieve "interpretable" prediction.
[0128] When the relationship prediction method provided in this specification is applied to enterprise supply chain forecasting, it effectively integrates the knowledge graph path-level knowledge representation with the enterprise's inherent information representation by proposing a multi-head attention representation learning module constrained by the Hilbert independence criterion, based on the vectorized representation learning of the target paths and basic enterprise information in the enterprise knowledge graph. This fully leverages the maximum efficiency of multi-head representation learning. Furthermore, by introducing a query-key attention mechanism, it effectively mines the implicit information in the correlation between the characteristics of basic enterprise information and the connectivity patterns of different target paths. Building on this, the embodiments in this specification can also, while providing the relationship prediction results, explicitly output the important knowledge graph paths used in the model's decision-making process and the contribution weight of each knowledge graph path to the final decision result, thereby achieving "interpretable" prediction of supply chain relationships for SMEs.
[0129] Corresponding to the above method embodiments, this specification also provides embodiments of a relationship prediction device. Figure 4 A schematic diagram of a relation prediction device according to one embodiment of this specification is shown. Figure 4 As shown, the device includes:
[0130] The object vector acquisition module 402 is configured to acquire object attribute information of a first object and a second object, and acquire an initial object vector of the object attribute information;
[0131] The path vector obtaining module 404 is configured to determine target paths corresponding to the first object and the second object respectively according to an object knowledge graph, and obtain initial path vectors of the target paths.
[0132] The vector processing module 406 is configured to process the initial object vector and the initial path vector to obtain a target object vector and a target path vector.
[0133] The relationship prediction module 408 is configured to fuse the target object vector and the target path vector through a preset attention mechanism to obtain a fusion vector, and predict a relationship between the first object and the second object according to the fusion vector.
[0134] Optionally, the vector processing module 406 is further configured to:
[0135] splice the initial object vector and the initial path vector, and input the spliced vector into a multi-head attention network for processing to obtain a target vector corresponding to the spliced vector,
[0136] wherein the target vector includes a target object vector corresponding to the initial object vector and a target path vector corresponding to the initial path vector.
[0137] Optionally, the vector processing module 406 is further configured to:
[0138] input the spliced vector into a multi-head attention network using a preset constraint method, and process the spliced vector through a multi-head attention mechanism in the multi-head attention network to obtain a target vector corresponding to the spliced vector.
[0139] Optionally, the relationship prediction module 408 is further configured to:
[0140] perform similarity calculation by taking the target object vector as a query vector and the target path vector as a key vector through a key-value pair attention mechanism.
[0141] fuse the target object vector and the target path vector according to the similarity to obtain a fusion vector.
[0142] Optionally, the relationship prediction module 408 is further configured to:
[0143] input the fusion vector into a classification model, and predict the relationship between the first object and the second object through the classification model.
[0144] Optionally, the object vector obtaining module 402 is further configured to:
[0145] obtain first object attribute information of a first object and second object attribute information of a second object;
[0146] encode the first object attribute information and the second object attribute information, and perform vector representation learning on the encoded first object attribute information and second object attribute information through a deep neural network to obtain initial object vectors of the first object attribute information and the second object attribute information.
[0147] Optionally, the path vector obtaining module 404 is further configured to:
[0148] determine a first target path corresponding to the first object and a second target path corresponding to the second object according to an object knowledge graph;
[0149] process the first target path and the second target path into natural language texts, and perform vector representation learning on the natural language texts through a word vector processing model to obtain initial path vectors of the first target path and the second target path.
[0150] Optionally, the apparatus further comprises:
[0151] a path obtaining module configured to:
[0152] determine a weight of the target path according to the similarity, and determine a target path to be displayed from the target path according to the weight of the target path.
[0153] Optionally, the apparatus further comprises:
[0154] an information display module configured to:
[0155] display the relationship between the first object and the second object, the target path to be displayed, and the weight corresponding to the target path to be displayed.
[0156] Optionally, the first object is a first enterprise, and the second object is a second enterprise different from the first enterprise;
[0157] Correspondingly, the relationship prediction module 408 is further configured to:
[0158] predict whether the first enterprise and the second enterprise have a supply chain relationship according to the fusion vector.
[0159] The relationship prediction device provided by the embodiment of the present specification fuses object attribute information (such as enterprise basic information) and a target path corresponding to an object (such as a small and medium-sized enterprise) determined according to an object knowledge graph (such as an enterprise knowledge graph) by using a preset attention mechanism, fully mines the implicit information in the association relationship between the enterprise basic information and the target path, and solves the influence of the accuracy of the supply chain prediction result of the enterprise in the data sparse scene.
[0160] The above is a schematic scheme of the relationship prediction device of the embodiment. It should be noted that the technical scheme of the relationship prediction device belongs to the same concept as the technical scheme of the relationship prediction method described above, and the details of the technical scheme of the relationship prediction device that are not described in detail can be referred to the description of the technical scheme of the relationship prediction method.
[0161] Another embodiment of the present specification also provides a relationship prediction model, comprising an object vector acquisition network layer, a path vector acquisition network layer, a vector processing network layer, and a relationship prediction network layer, wherein,
[0162] The object vector acquisition network layer is configured to determine object attribute information of a first object and a second object, and acquire initial object vectors of the object attribute information;
[0163] The path vector acquisition network layer is configured to determine path information of target paths corresponding to the first object and the second object according to an object knowledge graph, and acquire initial path vectors of the path information;
[0164] The vector processing network layer is configured to process the initial object vectors and the initial path vectors to obtain target object vectors and target path vectors;
[0165] The relationship prediction network layer is configured to fuse the target object vectors and the target path vectors by using a preset attention mechanism to obtain a fusion vector, and predict a relationship between the first object and the second object according to the fusion vector.
[0166] The relationship prediction model can be understood as the relationship prediction model in the above embodiment, that is, the relationship prediction method provided by the above embodiment can be implemented based on the relationship prediction model; and the object vector acquisition network layer in the relationship prediction model can be understood as the enterprise basic information vectorization representation learning network layer in the above embodiment, the path vector acquisition network layer can be understood as the knowledge graph path vectorization representation learning network layer in the above embodiment, the vector processing network layer can be understood as the connectivity representation learning network layer in the above embodiment, and the relationship prediction network layer can be understood as the hierarchical association relationship path sampling network layer in the above embodiment.
[0167] In particular implementation, the relationship prediction model can realize the technical scheme of the relationship prediction method as described above, and achieve the same technical effects as the relationship prediction method as described above.
[0168] The above is a schematic scheme of the relationship prediction model of the present embodiment. It should be noted that the technical scheme of the relationship prediction model and the technical scheme of the relationship prediction method as described above belong to the same concept, and the details of the technical scheme of the relationship prediction model that are not described in detail can be referred to the description of the technical scheme of the relationship prediction method as described above.
[0169] Figure 5 A structural block diagram of a computing device 500 according to one embodiment of the present specification is shown. The components of the computing device 500 include, but are not limited to, a memory 510 and a processor 520. The processor 520 is connected to the memory 510 through a bus 530, and a database 550 is used to save data.
[0170] The computing device 500 also includes an access device 540, which enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 can include one or more of any type of network interface (e.g., network interface card (NIC)) such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like, wired or wireless.
[0171] In one embodiment of the present specification, the above-mentioned components of the computing device 500 and other components not shown in the Figure 5 may be connected to each other, for example, through a bus. It should be understood that Figure 5 The structural block diagram of the computing device shown is only for the purpose of example, and is not a limitation on the scope of the present specification. Those skilled in the art can add or replace other components as needed.
[0172] The computing device 500 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a PC. The computing device 500 can also be a mobile or stationary server.
[0173] The processor 520 is configured to execute the following computer-executable instructions, which implement the steps of the relationship prediction method described above.
[0174] The above is a schematic scheme of the computing device of the embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the relationship prediction method described above belong to the same concept, and the details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the relationship prediction method.
[0175] An embodiment of the present specification also provides a computer-readable storage medium storing computer-executable instructions, which implement the steps of the relationship prediction method described above when executed by a processor.
[0176] The above is a schematic scheme of the computer-readable storage medium of the embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the relationship prediction method described above belong to the same concept, and the details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the relationship prediction method.
[0177] An embodiment of the present specification also provides a computer program, which causes a computer to perform the steps of the relationship prediction method described above when the computer program is executed in the computer.
[0178] The above is a schematic scheme of the computer program of the embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the relationship prediction method described above belong to the same concept, and the details of the technical scheme of the computer program that are not described in detail can be referred to the description of the technical scheme of the relationship prediction method.
[0179] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than the order described in the embodiments and still achieve the desired result. In addition, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous or possible.
[0180] The computer readable medium can include any entity or apparatus capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium can include appropriate additions or subtractions according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
[0181] It should be noted that for the foregoing method embodiments, the descriptions are each simply a combination of a series of acts for the sake of brevity, but those skilled in the art should know that the present application is not limited by the order of the acts described, because some steps can be performed in other orders or at the same time in accordance with the present application. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the acts and modules involved are not necessarily essential to the present application.
[0182] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0183] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The alternative embodiments do not describe all the details and limit the present application to the specific embodiments described. Obviously, according to the content of the present application, many modifications and changes can be made. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can well understand and use the present application. The present application is limited only by the claims and their full scope and equivalents.
Claims
1. A relationship prediction method, comprising: obtaining object attribute information of a first object and a second object, and obtaining an initial object vector of the object attribute information, wherein the first object is a first enterprise, and the second object is a second enterprise different from the first enterprise; determining a target path corresponding to the first object and the second object respectively according to an object knowledge graph, and obtaining an initial path vector of the target path; processing the initial object vector and the initial path vector to obtain a target object vector and a target path vector; performing similarity calculation by taking the target object vector as a query vector and the target path vector as a key vector through a preset key-value pair attention mechanism, fusing the target object vector and the target path vector according to the similarity to obtain a fusion vector, and predicting a relationship between the first object and the second object according to the fusion vector, wherein the relationship between the first object and the second object is whether the first enterprise and the second enterprise have a supply chain relationship according to the fusion vector.
2. The relationship prediction method of claim 1, wherein the processing of the initial object vector and the initial path vector to obtain a target object vector and a target path vector comprises: splicing the initial object vector and the initial path vector, and inputting the spliced vector into a multi-head attention network for processing to obtain a target vector corresponding to the spliced vector, wherein the target vector includes a target object vector corresponding to the initial object vector and a target path vector corresponding to the initial path vector.
3. The relationship prediction method of claim 2, wherein the inputting of the spliced vector into a multi-head attention network for processing to obtain a target vector corresponding to the spliced vector comprises: inputting the spliced vector into a multi-head attention network using a preset constraint method, and processing the spliced vector through a multi-head attention mechanism in the multi-head attention network to obtain a target vector corresponding to the spliced vector.
4. The relationship prediction method of claim 1, wherein the predicting of the relationship between the first object and the second object according to the fusion vector comprises: inputting the fusion vector into a classification model, and predicting the relationship between the first object and the second object through the classification model.
5. The relationship prediction method of any one of claims 1-4, wherein the obtaining of the object attribute information of the first object and the second object, and the obtaining of the initial object vector of the object attribute information comprises: obtaining first object attribute information of the first object and second object attribute information of the second object; encoding the first object attribute information and the second object attribute information, and performing vector representation learning on the encoded first object attribute information and second object attribute information through a deep neural network to obtain the initial object vector of the first object attribute information and the second object attribute information. 6.The relationship prediction method of any one of claims 1-4, wherein the determining the target path corresponding to the first object and the second object according to the object knowledge graph and obtaining the initial path vector of the target path comprises: determining the first target path corresponding to the first object and the second target path corresponding to the second object according to the object knowledge graph; processing the first target path and the second target path into natural language text, and performing vector representation learning on the natural language text through a word vector processing model to obtain the initial path vector of the first target path and the second target path. 7.The relationship prediction method of claim 1, wherein after the predicting the relationship between the first object and the second object according to the fusion vector, the method further comprises: determining the weight of the target path according to the similarity, and determining a target path to be displayed from the target path according to the weight of the target path. 8.The relationship prediction method of claim 7, wherein after the determining the target path to be displayed from the target path, the method further comprises: displaying the relationship between the first object and the second object, the target path to be displayed, and the weight corresponding to the target path to be displayed. 9.A relationship prediction device, comprising: an object vector obtaining module configured to obtain object attribute information of a first object and a second object, and obtain an initial object vector of the object attribute information, wherein the first object is a first enterprise, and the second object is a second enterprise different from the first enterprise; a path vector obtaining module configured to determine target paths corresponding to the first object and the second object according to an object knowledge graph, and obtain initial path vectors of the target paths; a vector processing module configured to process the initial object vector and the initial path vector to obtain a target object vector and a target path vector; and a relationship prediction module configured to perform similarity calculation by taking the target object vector as a query vector and the target path vector as a key vector through a preset key-value pair attention mechanism, fuse the target object vector and the target path vector according to the similarity to obtain a fusion vector, and predict a relationship between the first object and the second object according to the fusion vector, wherein the predicting the relationship between the first object and the second object according to the fusion vector is predicting whether the first enterprise and the second enterprise have a supply chain relationship according to the fusion vector. 10.A relationship prediction model, comprising an object vector obtaining network layer, a path vector obtaining network layer, a vector processing network layer, and a relationship prediction network layer, wherein the object vector obtaining network layer is configured to determine object attribute information of a first object and a second object, and obtain an initial object vector of the object attribute information, wherein the first object is a first enterprise, and the second object is a second enterprise different from the first enterprise; the path vector obtaining network layer is configured to determine target paths corresponding to the first object and the second object according to an object knowledge graph, and obtain initial path vectors of the target paths; the vector processing network layer is configured to process the initial object vector and the initial path vector to obtain a target object vector and a target path vector; and the relationship prediction network layer is configured to perform similarity calculation by taking the target object vector as a query vector and the target path vector as a key vector through a preset key-value pair attention mechanism, fuse the target object vector and the target path vector according to the similarity to obtain a fusion vector, and predict a relationship between the first object and the second object according to the fusion vector. The path vector obtaining network layer is configured to determine path information of target paths corresponding to the first object and the second object respectively according to an object knowledge graph, and obtain initial path vectors of the path information. The vector processing network layer is configured to process the initial object vector and the initial path vector to obtain a target object vector and a target path vector. The relationship prediction network layer is configured to perform similarity calculation by taking the target object vector as a query vector and the target path vector as a key vector through a preset key-value pair attention mechanism, to fuse the target object vector and the target path vector according to the similarity to obtain a fusion vector, and to predict a relationship between the first object and the second object according to the fusion vector, wherein the relationship between the first object and the second object is whether the first enterprise and the second enterprise have a supply chain relationship according to the fusion vector. 11.A computing device, comprising: a memory and a processor; the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions, and the computer executable instructions, when executed by the processor, implement the steps of the relationship prediction method in any one of claims 1 to 8. 12.A computer readable storage medium storing computer executable instructions, and the computer executable instructions, when executed by a processor, implement the steps of the relationship prediction method in any one of claims 1 to 8.
Citation Information
Patent Citations
Transaction two-party relationship information identification method and device
CN112215604A