Business object publishing method, entity publishing method and device
Through the use of the knowledge map of the knowledge map of the business object in the server, the relevant information of the corresponding business objects in the second server is automatically obtained, and the problem of low release efficiency caused by artificial collection information has been solved, and efficient business objects are released.
Patent Information
- Application Number
- CN201910804091.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-28
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2039-08-28
AI Technical Summary
When publishing new business objects on the server, it is necessary to manually collect relevant information, resulting in inefficient release.
By receiving the release request of the target business object, based on the alignment business objects in the knowledge map of at least two business objects, determine the corresponding second business object of the target business object on the second server, and obtain its relevant information to achieve business objects to achieve business objects Automatic release.
No need to collect information about the target business objects, directly obtain relevant information from the second server, which improves the efficiency of business objects.
Smart Images

Figure CN112445916B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of knowledge graph technology, and in particular to a business object publishing method, an entity publishing method and a device. Background Art
[0002] In order to display more business objects to users, it is often necessary to publish new business objects on the server.
[0003] At present, when publishing a new business object on the server, it is often necessary to manually collect relevant information related to the business object first, and then publish the business object based on the collected relevant information. However, manual collection is costly and time-consuming, which leads to low efficiency in publishing business objects. Summary of the invention
[0004] The embodiment of the present application provides a business object publishing method, so as to improve the efficiency of business object publishing.
[0005] Correspondingly, the embodiments of the present application also provide a device, an electronic device and a storage medium to ensure the implementation and application of the above method.
[0006] In order to solve the above problem, the embodiment of the present application discloses a business object publishing method, which is applied to a first server, and the method includes:
[0007] receiving a publish request for a target business object;
[0008] In response to the publishing request, determining a second business object corresponding to the target business object in a second server based on aligned business objects in at least two business object knowledge graphs;
[0009] Obtaining relevant information of the corresponding second business object in the second server;
[0010] The target business object is published according to the relevant information.
[0011] In order to solve the above problem, an embodiment of the present application discloses an entity publishing method, which is applied to a first server, wherein the method comprises: receiving a publishing request for a target entity;
[0012] In response to the publishing request, determining a second entity corresponding to the target entity in the second server based on the aligned entities in at least two knowledge graphs;
[0013] Obtaining relevant information of the second entity corresponding to the second server;
[0014] The target entity is published according to the relevant information.
[0015] In order to solve the above problem, the embodiment of the present application discloses a business object publishing device, which is applied to a first server, and the device includes:
[0016] A first receiving module, used to receive a publishing request for a target business object;
[0017] A first determination module, configured to determine, in response to the publishing request, a second business object corresponding to the target business object in the second server based on aligned business objects in at least two business object knowledge graphs;
[0018] A first acquisition module, used to acquire relevant information of the second business object corresponding to the second server;
[0019] The first publishing module is used to publish the target business object according to the relevant information.
[0020] In order to solve the above problem, the embodiment of the present application discloses an entity publishing device, which is applied to a first server, and the device includes:
[0021] A third receiving module is used to receive a publishing request for a target entity;
[0022] A fourth determination module, configured to determine, in response to the publishing request, a second entity corresponding to the target entity in the second server based on the aligned entities in at least two knowledge graphs;
[0023] A second acquisition module, used to acquire relevant information of the second entity corresponding to the second server;
[0024] The second publishing module is used to publish the target entity according to the relevant information.
[0025] An embodiment of the present application also discloses an electronic device, including: a processor; and a memory, on which executable code is stored. When the executable code is executed, the processor executes the business object publishing method as described in one or more of the embodiments of the present application.
[0026] The embodiments of the present application also disclose one or more machine-readable media on which executable codes are stored. When the executable codes are executed, the processor executes the business object publishing method as described in one or more of the embodiments of the present application.
[0027] An embodiment of the present application also discloses an electronic device, including: a processor; and a memory, on which executable code is stored. When the executable code is executed, the processor executes the entity publishing method as described in one or more of the embodiments of the present application.
[0028] The embodiments of the present application also disclose one or more machine-readable media on which executable codes are stored. When the executable codes are executed, the processor executes the entity publishing method as described in one or more of the embodiments of the present application.
[0029] Compared with the prior art, the embodiments of the present application have the following advantages:
[0030] In an embodiment of the present application, a publishing request for a target business object is received; in response to the publishing request, a second business object corresponding to the target business object in a second server is determined based on aligned business objects in at least two business object knowledge graphs; relevant information of the corresponding second business object in the second server is obtained; and the target business object is published according to the relevant information. In the present application, there is no need to generate manually collected relevant information of the target business object, and the relevant information corresponding to the second business object can be directly obtained from the second server to achieve publishing of the target business object, thereby improving publishing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1A This is a schematic diagram of a scenario for publishing a business object of this application;
[0032] Figure 1B This is a schematic diagram of another scenario of business object publishing in this application;
[0033] Figure 2 It is a flow chart of the steps of a business object publishing method of the present application;
[0034] Figure 3 It is a flow chart of steps of a method for entity publishing of the present application;
[0035] Figure 4 It is an application schematic diagram of a training data generation method of the present application;
[0036] Figure 5 is an application schematic diagram of another training data generation method of the present application;
[0037] Figure 6 is a flowchart of the steps of a training data generation method of the present application;
[0038] Figure 7 is a flowchart of the steps of another training data generation method of the present application;
[0039] Figure 8 is a flowchart of the steps of a second entity alignment model generation method of the present application;
[0040] Fig. 9 It is a partial schematic diagram of a knowledge graph of the present application;
[0041] Fig.10 This is a schematic diagram of a scenario of searching based on aligned entities in the present application;
[0042] Fig.11 It is a flowchart of the steps of a method for updating relevant information of an entity of the present application;
[0043] Fig.12 It is a schematic diagram of a scenario of updating relevant information of an entity of this application;
[0044] Fig.13 This is a schematic diagram of a scenario in which the relevant information of another entity of this application is updated
[0045] Fig.14 It is a schematic diagram of a scenario for building a website in this application;
[0046] Fig.15 It is a scenario diagram of a physical operation synchronization method of the present application;
[0047] Fig.16 It is a schematic diagram of a target business object knowledge graph of this application;
[0048] Fig.17 It is a schematic diagram of a target business object knowledge graph of this application;
[0049] Fig.18 It is a structural block diagram of a business object publishing device of the present application;
[0050] Fig.19 It is a structural block diagram of a physical publishing device of the present application;
[0051] Fig. 20 It is a schematic diagram of the structure of the device provided in this application. DETAILED DESCRIPTION
[0052] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0053] In order to enable those skilled in the art to better understand the present application, the concepts involved in the present application are explained below:
[0054] Knowledge Graph: A knowledge graph is a network of semantic knowledge bases formed by entities linked by relationships. A knowledge graph describes concepts in the physical world and their relationships in a symbolic form. In a knowledge graph, entities and relationships are stored in the form of triples: entity-relationship-entity.
[0055] Entities refer to concepts in the physical world, such as people, places, drugs, companies, etc. The relationships between entities represent the connections between different entities.
[0056] Aligned entities refer to entities in two knowledge graphs that point to the same concept in the physical world.
[0057] Entity alignment refers to the operation of extracting aligned entities in two knowledge graphs.
[0058] Reference Figure 1A , showing a schematic diagram of a scenario for publishing a business object of the present application. In this scenario, the server AS510 is the second server, and the server BS520 is the first server. The server BS520 can execute step 5.1 to receive a publishing request for business object B, wherein the business object B is the target business object to be published. Since the knowledge graph A of the server AS510 includes detailed information of the business object B, the alignment device S530 can align the knowledge graph A in the server AS510 and the knowledge graph B in the server BS520 based on steps 5.2 and 5.3, and then return the aligned business objects between the knowledge graph A and the knowledge graph B to the server BS520 based on step 5.4. Accordingly, the server BS520 can respond to the publishing request and, based on step 5.5, obtain the relevant information corresponding to the first business object aligned with the business object B from the server AS510 according to these aligned business objects, and publish the business object B. In this way, based on the aligned business objects, detailed information of the business object B can be directly obtained from the server AS510, so that the business object B can be published, thereby improving the efficiency of publishing new business objects in the server.
[0059] Reference Figure 1B , shows another scenario diagram of business object publishing of the present application. In this scenario, the platform can be composed of at least one server. Platform 1S710 may include an alignment business object with knowledge graph B in platform 2, an alignment business object with knowledge graph C in platform 2, and an alignment business object with knowledge graph D in platform 3. These alignment business objects may be based on Figure 1A The alignment device in pre-acquired.
[0060] Further, platform 1S710 may perform step 7.1 to receive a publishing request for business object B, wherein business object B is the target business object to be published. Then, platform 1S710 may obtain detailed information of business objects aligned with business object B in platform 2S720, obtain detailed information of business objects aligned with business object B in platform 3S730, and obtain detailed information of business objects aligned with business object B in platform 4S740 based on steps 7.2, 7.3, and 7.4. Finally, platform 1S710 may publish business object B based on the detailed information obtained from platform 2S720, platform 3S730, and platform 4S740 in step 7.5.
[0061] Since the detailed information of the business object B aligned in different platforms may be different, obtaining the detailed information of the business objects aligned in multiple platforms for publication can make the relevant information of the newly published business object B more abundant and complete, thereby improving the publishing effect of the business object. It should be noted that since the detailed information obtained from platform 2S720, platform 3S730 and platform 4S740 may contain duplicate information, therefore, in the embodiment of the present application, platform 1S710 can also perform deduplication processing on the detailed information obtained from platform 2S720, platform 3S730 and platform 4S740 before publishing business object B, thereby avoiding duplicate information in the relevant information of business object B after publication.
[0062] Reference Figure 2 , shows a flowchart of the steps of a business object publishing method of the present application. The method can be applied to the first server, and the method can specifically include the following steps:
[0063] Step 101: Receive a publishing request for a target business object.
[0064] In the embodiment of the present application, the first server and the second server may be websites, and the target business object may be a newly released business object in the first server. Taking the first server as a shopping website as an example, the target business object may be the newly released commodity data in the shopping website. The publishing request may be sent by the user to the first server.
[0065] Step 102, in response to the publishing request, based on the aligned business objects in at least two business object knowledge graphs, determine the second business object corresponding to the target business object in the second server.
[0066] In an embodiment of the present application, the first server may be one or more, so that when there are multiple first servers, it is possible to quickly publish to multiple servers at the same time. The second server may also be multiple, so that the first server can obtain relevant information of the target business object from multiple second servers, thereby making the relevant information more complete. Accordingly, the business object knowledge graph may be constructed based on data in at least one first server and data in the second server, and the business object knowledge graph may exist in the respective corresponding servers respectively. The business object knowledge graph may include multiple business objects and the relationship between business objects, and a business object represents an entity in the knowledge graph. The aligned business objects in these business object knowledge graphs may represent entities representing the same concept in the first server and the second server. Accordingly, for the target business object, the second business object corresponding to the target business object can be found from these aligned business objects, and then the second business object corresponding to the target business object in the second server is determined.
[0067] Step 103: Obtain relevant information of the second business object corresponding to the second server.
[0068] In the embodiment of the present application, the first server can directly read the relevant information of the second business object from the second server, wherein the relevant information can at least include the name, identification, attributes and the commodity category to which the commodity belongs.
[0069] Step 104: publish the target business object according to the relevant information.
[0070] In the embodiment of the present application, the relevant information corresponding to the second business object can be added to the first server as the relevant information of the target business object, thereby realizing adding relevant information to the target business object. In this way, there is no need to manually collect relevant information of the target business object, and the relevant information corresponding to the second business object can be directly obtained from the second server to realize publishing the target business object, thereby improving the publishing efficiency.
[0071] In summary, the present application provides a method for publishing a business object, including: receiving a publishing request for a target business object; in response to the publishing request, determining a second business object corresponding to the target business object in a second server based on aligned business objects in at least two business object knowledge graphs; obtaining relevant information of the corresponding second business object in the second server; and publishing the target business object based on the relevant information. In the present application, there is no need to generate manually collected relevant information of the target business object, and the relevant information corresponding to the second business object can be directly obtained from the second server to achieve publishing of the target business object, thereby improving publishing efficiency.
[0072] Reference Figure 3 , shows a flow chart of the steps of an entity publishing method of the present application. The method can be applied to the first server, and the method can specifically include the following steps:
[0073] Step 201, receiving a publishing request for a target entity.
[0074] In the embodiment of the present application, the target entity may represent a business object or other objects, such as a user object.
[0075] Step 202, in response to the publishing request, determine a second entity corresponding to the target entity in the second server based on the aligned entities in at least two knowledge graphs.
[0076] Specifically, the implementation method of this step can refer to the aforementioned steps, and the embodiments of the present application will not be described in detail here.
[0077] Step 203: Obtain relevant information of the second entity corresponding to the second server.
[0078] Specifically, the implementation method of this step can refer to the aforementioned steps, and the embodiments of the present application will not be described in detail here.
[0079] Step 204: publish the target entity according to the relevant information.
[0080] Specifically, the implementation method of this step can refer to the aforementioned steps, and the embodiments of the present application will not be described in detail here.
[0081] In summary, the present application provides an entity publishing method, including: receiving a publishing request for a target entity; in response to the publishing request, determining a second entity corresponding to the target entity in a second server based on at least two aligned entities in an entity knowledge graph; obtaining relevant information of the corresponding second entity in the second server; and publishing the target entity according to the relevant information. In the present application, there is no need to generate manually collected relevant information of the target entity, and the relevant information corresponding to the second entity can be directly obtained from the second server to achieve the publishing of the target entity, thereby improving the publishing efficiency.
[0082] Optionally, in a specific implementation of the embodiment of the present application, when obtaining aligned entities in at least two knowledge graphs, an entity alignment model can be bidirectionally iterated to train the at least two knowledge graphs according to a preset vector generation model; the at least two knowledge graphs are identified according to the preset entity alignment model to obtain aligned entities in at least two knowledge graphs. The bidirectional iterative training is used to expand the benchmark set in the process of training the vector generation model; the benchmark set can include some aligned entities of at least two knowledge graphs.
[0083] Specifically, the entity alignment model may be a first entity alignment model or a second entity alignment model. When training the first entity alignment model, training data may be obtained first. Then, a preset machine learning model is trained according to the training data to obtain the first entity alignment model.
[0084] Reference Figure 4 A schematic diagram of an application of a training data generation method according to an embodiment of the present application is shown.
[0085] In an embodiment of the present application, the training data generating device S110, the model training device S120 and the first aligned entity extracting device S130 may be a server, a computer or other electronic devices with relatively strong computing power. The training data generating device S110, the model training device S120 and the first aligned entity extracting device S130 may be the same device or may be independent different devices. The target knowledge graph may be pre-generated based on a data source and stored in the training data generating device S110. The target knowledge graph may be generated according to other devices or may be generated according to the training data generating device S110. The target knowledge graphs S11 and S12 may be used as data sources for the training vector generation model S14 and the expanded benchmark set S13.
[0086] The vector generation model S14 may be pre-built. Specifically, the vector generation model S14 may be built based on a translation model or a graph neural network model, wherein the translation model may be a TransE model, a TransR model, etc., and the graph neural network model may be a graph convolutional neural network (GCN), a graph attention network (GAT), a relational graph attention network (RGAT), etc. The number of layers included in the vector generation model S14, the number of neurons contained in each layer, the role of each layer, and the parameters contained in each layer may all be set based on actual training requirements.
[0087] The reference set S13 may include at least one reference entity pair, which may be partially aligned entities pre-determined from the target knowledge graphs S11 and S12, that is, the entities in these reference entity pairs all belong to the target knowledge graphs S11 or S12. For example, assuming that the two target knowledge graphs A and B are G1 and G2, G1 = (E1, R1, T1), G2 = (E2, R2, T2), and the reference set S13 is P, P = {(e i1 , e i2)}, where E1 and T1 represent the entity set in G1, R1 represents the relationship set in G1, E2 and T2 represent the entity set in G2, and R2 represents the relationship set in G2. Then, e i1 It is an entity belonging to E1 / T1. i2 It is an entity belonging to E2 / T2.
[0088] In an embodiment of the present application, the entity vector S15 of the entity in the two target knowledge graphs will be determined first according to the vector generation model S14, wherein the two target knowledge graphs can be any two knowledge graphs of at least two knowledge graphs. Then, the loss value S16 of the vector generation model S14 can be determined based on the entity vector S15 of the entity in the target knowledge graph and the entity vector S15 of the entity in the benchmark set S13, and the parameters in the vector generation model S14 can be adjusted based on the loss value S16 to optimize the vector generation model S14. Then, based on the updated entity vector, the entities in the two target knowledge graphs S11 and S12 whose distances meet the first preset condition can be expanded to the benchmark set S13. Finally, the vector generation model S14 can continue to be trained, and when the training is completed, the benchmark set S13 can be determined as training data. In this way, in the process of continuously training the vector generation model S14, the benchmark set S13 can be continuously expanded, thereby obtaining a large amount of training data. Furthermore, after obtaining the expanded benchmark set S13, the benchmark set S13 can be used as training data to train the first entity alignment model S17. In this way, the first entity alignment model S17 can be trained without manually selecting a sufficient amount of training data, thereby saving the cost of training the model. Accordingly, after obtaining the first entity alignment model S17, the entities in the knowledge graph can be input into the first entity alignment model S17, and then, the aligned entities S18 in the knowledge graph can be extracted according to the first entity alignment model S17.
[0089] When training the second entity alignment model, refer to Figure 5, showing an application schematic diagram of another training data generation method of an embodiment of the present application. In the embodiment of the present application, when the stopping condition is reached and the training is stopped, the vector generation model S14 can also be determined as the second entity alignment model S19, and the entity vector S20 of the entity in the knowledge graph is determined according to the second entity alignment model S19. Based on the entity vectors S20 of these entities, entities whose distances meet the second preset condition are extracted from the knowledge graph to obtain aligned entities S21. Among them, the knowledge graph is a knowledge graph that needs to be entity aligned, and the knowledge graph can be a target knowledge graph. Since the second entity alignment model S19 is obtained by iterative training and continuous optimization based on the entity pairs with higher accuracy in the benchmark set S13, the entity vector generated by the second entity alignment model S19 can accurately represent the entity. In this way, the aligned entity S21 in the knowledge graph can be accurately extracted based on the entity vector S20 of the entity in the knowledge graph.
[0090] Specifically, in an embodiment of the present application, the above-mentioned training data generating device can execute the following training data generating method.
[0091] Reference Figure 6 , shows a flowchart of the steps of a training data generation method of the present application. Specifically, the following steps may be included:
[0092] Step 301, determine the entity vectors of entities in two target knowledge graphs based on the vector generation model.
[0093] In an embodiment of the present application, the entity vector of each entity in the target knowledge graph can be determined during determination, and the entity vector can be used to characterize the entity. By determining the entity vector for the entity in the target knowledge graph, it can be convenient to process the entity based on the entity vector in the subsequent steps. Since the entities in the benchmark set belong to the target knowledge graph, by determining the entity vectors of the entities in the two target knowledge graphs, the entity vectors of the entities in the target knowledge graph and the entity vectors of the entities in the benchmark set can be obtained at the same time.
[0094] Step 302, determining the loss value of the vector generation model based on the entity vectors of the entities in the two target knowledge graphs and the entity vectors of the entities in a benchmark set; the benchmark set includes partially aligned entities in the two target knowledge graphs.
[0095] In an embodiment of the present application, the loss value can indicate the degree to which the entity vector generated by the vector generation model for the entity can accurately represent the entity. The larger the loss value, the smaller the degree to which the entity vector generated by the vector generation model for the entity can accurately represent the entity. The smaller the loss value, the larger the degree to which the entity vector generated by the vector generation model for the entity can accurately represent the entity.
[0096] Step 303: Adjust the parameters of the vector generation model based on the loss value, and update the entity vector of each entity based on the adjusted vector generation model.
[0097] In an embodiment of the present application, the parameters may be adjusted when the loss value is greater than a preset threshold value, and the preset threshold value may be set according to actual application scenarios and actual needs. If the loss value is greater than the preset threshold value, it may be considered that the entity vector generated by the vector generation model for the entity is not yet able to accurately represent the entity. Therefore, the parameters of the entity alignment model may be adjusted to further optimize the vector generation model and improve the accuracy of the entity vector generated by the vector generation model. Since the accuracy of the entity vector generated by the vector generation model is improved, the entity vector of each entity may be updated based on the adjusted vector generation model so that the entity vector of each entity represents the accuracy of the entity.
[0098] Furthermore, when adjusting the parameters, the parameters can be adjusted by back propagation according to the loss value. Specifically, the loss function used to calculate the loss value can be firstly subjected to a gradient operation, the gradient value of the loss function can be calculated, the error degree can be obtained, and then the product of the gradient value and the preset step length can be calculated, and finally the difference between the parameter and the product can be calculated to obtain the adjusted parameter. Of course, adjustments can also be made in other ways, for example, the parameters can be updated directly according to the preset step length, which is not limited in the embodiments of the present application.
[0099] Step 304: Based on the updated entity vector of the entity, entities in the two target knowledge graphs whose distances from each other satisfy a first preset condition are expanded to the benchmark set.
[0100] In the embodiment of the present application, since the entity vector after the entity is updated can more accurately represent the entity itself, in the embodiment of the present application, the entity for expanding the benchmark set can be selected from the target knowledge graph based on the updated entity vector. In this way, the probability that the selected entity is an aligned entity can be increased to a certain extent.
[0101] Furthermore, when expanding the benchmark set, the benchmark set can be expanded through a two-way selection method based on entities in the target knowledge graph whose distances meet the first preset condition. Among them, the first preset condition can be set according to the actual application scenario and actual needs. For example, the first preset condition can be that the distance ranking is higher than the preset ranking threshold, and the distance ranking refers to the distance of the entity in the target knowledge graph, and the ranking of the distance between the entity and all entities in another target knowledge graph. Assuming that the preset ranking threshold is 3, the distance between entity a in the target knowledge graph G1 and entity A in another target knowledge graph G2 ranks second among the distances to all entities in G2, and the distance between entity a and entity A ranks first among the distances to all entities in G2, while the distance between entity A and entity a ranks third among the distances to all entities in G1, and the distance between entity B and entity a ranks second among the distances to all entities in G1. Then, entity a and entity B can be determined as entities in the two target knowledge graphs whose distances from each other meet the first preset condition, and entity a and entity B are added to the benchmark set as a benchmark entity pair to expand the benchmark set. In this way, through two-way selection, that is, selecting entities whose distances relative to each other meet the first preset condition, the confidence of the selected entity pairs can be improved to a certain extent, thereby ensuring the accuracy of the benchmark set expanded based on these entity pairs.
[0102] Step 305: Continue training the vector generation model, and when the training is completed, determine the benchmark set as training data.
[0103] In the embodiment of the present application, after adjusting the parameters and updating the entity vector of the entity, the loss value can be recalculated based on the updated entity vector of each entity and the updated benchmark set in this round of training, and corresponding processing can be performed based on the loss value, thereby continuing to train the vector generation model. In this way, the ability of the vector generation model can be further improved and the benchmark set can be further expanded by continuing training. Finally, when the training is completed, the benchmark set can be determined as training data.
[0104] In summary, the present application provides a training data generation method, including: determining the entity vectors of entities in two target knowledge graphs according to a vector generation model; determining the loss value of the vector generation model based on the entity vectors of the entities in the two target knowledge graphs and the entity vectors of the entities in the benchmark set, the benchmark set including some aligned entities in the two target knowledge graphs; adjusting the parameters of the entity alignment model based on the loss value, and updating the entity vector of each entity based on the adjusted vector generation model; based on the updated entity vectors of the entities, the entities in the two target knowledge graphs whose distances meet the preset conditions are expanded to the benchmark set; continue to train the vector generation model, and when the training is completed, determine the benchmark set as training data. In the present application, only part of the aligned entities need to be acquired in advance to form the benchmark set, and the benchmark set can be automatically expanded by continuously training the vector generation model, thereby obtaining a large amount of training data. Since only part of the aligned entities need to be acquired in advance to form the benchmark set, the labor cost and time cost required to obtain training data can be reduced to a certain extent, thereby improving the acquisition efficiency.
[0105] Reference Figure 7 , shows a flowchart of another method for generating training data in the present application. Specifically, the following steps may be included:
[0106] Step 401: for the entities in the two target knowledge graphs, determine the first vector of the entity.
[0107] In this step, for each entity, a feature vector can be randomly generated, and then the feature vector is used as the first vector of the entity. The dimension of the randomly generated feature vector and the value range of the elements in each dimension can be pre-set. When generating the feature vector, a feature vector can be generated based on the set dimension and value range according to the random vector generation algorithm. In this way, it is only necessary to pre-define the dimension and value range to generate the first vector for each entity, with low implementation cost and high generation efficiency. For example, the target knowledge graphs G1 and G2 can be used as inputs of the random vector generation algorithm respectively, and accordingly, the output of the algorithm is the first vectors of all entities in the two target knowledge graphs.
[0108] Alternatively, a semantic vector of the entity can be generated based on the semantics of the entity as the first vector of the entity. The semantic vector can represent the semantics contained in the entity. Specifically, a semantic vector representing the semantics of the entity can be generated based on the semantics represented by the entity according to a preset semantic recognition model, and then the semantic vector can be used as the first vector. Since the semantic vector is generated based on the semantics of the entity itself, it can more accurately represent the entity, thereby making the first vector more representative.
[0109] Alternatively, the adjacency matrix of the entity may be obtained and used as the first vector of the entity. The adjacency matrix refers to a two-dimensional array in the graph structure where the entity is located, and the two-dimensional arrays are arrays storing node information and arrays storing edge information.
[0110] Optionally, when the first vector is generated for the first time, in a specific implementation of the embodiment of the present application, determining the first vector of the entity may include:
[0111] Sub-step 4011, extracting entity feature vectors of N neighbor entities of the entity.
[0112] Sub-step 4012, calculating the entity vector of the entity based on the first vector of the entity, the entity feature vectors of the N neighboring entities and the weight parameters in the vector generation model.
[0113] Wherein, N is an integer not less than 1, and the specific value of N can be set according to actual needs. The neighbor entity represents an entity adjacent to the entity. When extracting the entity feature vector of the neighbor entity, the corresponding values of the neighbor entity under multiple information dimensions can be obtained based on the edge information connected to the neighbor entity, the attribute information of the neighbor entity, etc., and then the entity feature vector of the neighbor entity is obtained. Furthermore, in the case of generating the first vector again, the first vector can be the second vector of the previous round.
[0114] Step 402: Input the first vector of the entity into the vector generation model to generate the second vector of the entity, thereby obtaining the entity vector.
[0115] Since each entity in the graph composed of entities and relationships is connected by relationships, it can be considered that the correlation between adjacent entities will be stronger. Accordingly, by combining the information of the entity and its neighboring entities to generate the entity vector of the entity, the entity vector can better represent the entity.
[0116] Furthermore, based on the first vector of the entity, the entity feature vectors of the N neighboring entities and the weight parameters in the vector generation model, the specific calculation method of the entity vector of the entity can be expressed by the following formula:
[0117]
[0118] Among them, h' it represents the entity vector of the i-th entity in the t-th target knowledge graph, N it represents the entity feature vector of the neighbor entity of the ith entity in the tth target knowledge graph, w represents the weight parameter, and h it Represents the first vector of the i-th entity in the t-th target knowledge graph.
[0119] Step 403, determining the loss value of the vector generation model based on the entity vectors of the entities in the two target knowledge graphs and the entity vectors of the entities in a benchmark set; the benchmark set includes partially aligned entities in the two target knowledge graphs.
[0120] Optionally, in a specific implementation of the embodiment of the present application, the reference set includes at least one reference entity pair, and step 403 may specifically include:
[0121] Sub-step 4031, constructing two negative sample entity pairs for the reference entity pair based on the entities in the reference entity pair and the entities in the two target knowledge graphs.
[0122] In this step, the two entities included in the reference entity pair may be the first reference entity pair and the second reference entity pair, respectively, the negative entity pair may be constructed based on the reference entity pair, and each negative entity pair may include one entity in the reference entity pair. Specifically, for each reference entity pair, a first negative entity pair may be constructed based on the first reference entity and the first negative entity in the reference entity pair, wherein the first negative entity is selected from the target knowledge graph to which the second reference entity belongs. Also, a second negative entity pair may be constructed based on the second reference entity and the second negative entity in the reference entity pair, wherein the second negative entity may be selected from the target knowledge graph to which the first reference entity belongs.
[0123] Among them, the first negative sample entity and the second negative sample entity are both randomly selected entities. In this way, by randomly selecting the first negative sample entity and the second negative sample, the randomness of the constructed negative sample entity pair can be increased. Of course, the first negative sample entity can also be selected from the target knowledge graph to which the second reference entity belongs, and the second negative sample entity can be selected from the target knowledge graph to which the first reference entity belongs, in a fixed interval manner. This embodiment of the present application is not limited to this.
[0124] For example, assume that the reference entity pair is (e i1 , e i2 ), e i1 represents the i-th entity in G1, e i2 Represents the i-th entity in G2, in (e i1 , e i2 ) When constructing a negative sample entity pair, you can select an entity e from G2 j2 As the first negative sample entity, according to e i1 With e j2 Constitute a negative sample entity pair (e i1 , e j2), select an entity e from G1 j1 As the second negative sample entity, according to e i2 With e j1 Constitute a negative sample entity pair (e i2 , e j1 ), and then obtain the reference entity pair (e i1 , e i2 ) are two negative entity pairs.
[0125] Sub-step 4032, based on the entity vectors of the entities in the reference entity pair and the entity vectors of the entities in the negative sample entity pair, respectively calculate the entity distance of the reference entity pair and the entity distance of the negative sample entity pair.
[0126] In this step, the entity distance can be used to represent the similarity between entities. The entity distance can be the Manhattan distance, Euclidean distance, etc. between entities in an entity pair.
[0127] Sub-step 4033, calculating the loss value based on the entity distance in the reference entity pair and the entity distance of the negative sample entity pair.
[0128] Since the reference entity pair is the aligned entity in the target knowledge graph, the entity distance between the entities in the reference entity pair should be the shortest, while the entities in the negative sample entity pair are one entity belonging to the reference entity pair and the other entity not aligned with the entity belonging to the reference entity pair. Therefore, the entity distance between the entities in the negative sample entity pair should be farther than the entity distance between the entities in the reference entity pair. Therefore, in this step, the loss value can be calculated by combining the entity distance of the positive sample entity pair, that is, the entity distance in the reference entity pair, and the entity distance of the negative sample entity pair.
[0129] Specifically, the entity distances in the reference entity pair and the entity distances in the negative sample entity pair can be substituted into the ternary loss function, and the loss value can be calculated by the ternary loss function, wherein the ternary loss function can be expressed by the following formula:
[0130]
[0131] Among them, dis(*) represents the entity distance, λ is the preset hyperparameter, and P represents the benchmark set.
[0132] In the embodiment of the present application, the distance between the positive sample entity pair and the distance between the negative sample entity pair are used as elements for calculating the loss value. At the same time, the parameters of the vector generation model are adjusted by the loss value, so that the entity vector generated by the final adjusted vector generation model for the entity can more accurately characterize the entity. In this way, when calculating based on the entity vector generated by the vector generation model, it can be ensured that the distance between the entity and the aligned entity is minimized, and the distance between the entity and other non-aligned entities is larger, thereby making it more likely that the entity pairs selected based on the distance of the entity vectors for expanding the benchmark set in the subsequent steps are aligned entities.
[0133] Step 404: adjust the parameters of the vector generation model based on the loss value, and update the entity vector of the entity based on the adjusted vector generation model.
[0134] In this step, the current entity vector of each entity can be input into the adjusted vector generation model. The adjusted vector generation model can regenerate the entity vector for the entity based on the entity vector of the entity, the entity feature vectors of the neighboring entities of the entity and the weight parameters in the adjusted vector generation model, thereby updating the entity vector.
[0135] Step 405: Based on the updated entity vector of the entity, the entities in the two target knowledge graphs whose distances from each other satisfy a first preset condition are expanded to the benchmark set.
[0136] Optionally, in a specific implementation of the embodiment of the present application, the first preset condition is the shortest distance, and the two target knowledge graphs are respectively the first target knowledge graph and the second target knowledge graph; the first target knowledge graph is composed of the first entity, and the second target knowledge graph is composed of the second entity. In the step, the first entity in the target knowledge graph that does not belong to the benchmark set can be used as the target entity, and the following steps are performed respectively:
[0137] Sub-step 4051, based on the entity vector of the target entity and the entity vector of the second entity in the second target knowledge graph, determine the second entity closest to the target entity to obtain an alternative entity of the target entity.
[0138] In this step, the entity distance between the target entity and each second entity can be calculated based on the entity vector of the target entity and the entity vector of each second entity to obtain multiple entity distances, and then the minimum entity distance among the multiple entity distances is determined, and the second entity corresponding to the minimum entity distance is used as an alternative entity.
[0139] Sub-step 4052, based on the entity vector of the candidate entity and the entity vector of the first entity in the first target knowledge graph, determine whether the first entity closest to the candidate entity is the target entity.
[0140] In this step, the entity distance between the candidate entity and each first entity can be calculated based on the entity vector of the candidate entity and the entity vector of each first entity to obtain multiple entity distances, and then the minimum entity distance among the multiple entity distances is determined. Then, it is determined whether the first entity corresponding to the minimum entity distance is the target entity.
[0141] Sub-step 4053: If yes, then the target entity and the candidate entity are taken as a reference entity pair and added to the reference set.
[0142] In this step, if the first entity corresponding to the minimum entity distance is the target entity, the target entity and the candidate entity can be considered as the entities closest to each other. Therefore, the target entity and the candidate entity can be added to the benchmark set as a benchmark entity pair.
[0143] In the embodiment of the present application, the method of selecting the entities with the closest distance to each other as the reference entity pair and adding the reference set does not require presetting the distance threshold, so the operation of manually debugging the threshold can be omitted, simplifying the operation steps. At the same time, by bidirectionally selecting the entities with the closest distance as the reference entity pair, the accuracy of the selected reference entity pair can be ensured.
[0144] Step 406: Continue training the vector generation model, and when the training is completed, determine the benchmark set as training data.
[0145] In this step, the condition for the end of training may be that the loss value meets the convergence condition, or that there are no entities in the two target knowledge graphs that do not belong to the benchmark set whose distances satisfy the first preset condition. Accordingly, the training may be ended when the loss value meets the convergence condition, or when there are no entities in the two target knowledge graphs that do not belong to the benchmark set whose distances satisfy the first preset condition. Accordingly, the benchmark set may be used as training data. The convergence condition may be that the loss value is less than a preset threshold, or that the loss value no longer changes.
[0146] In summary, the present application provides a training data generation method, including: for entities in two target knowledge graphs, generating a first vector for the entity; inputting the first vector of the entity into a vector generation model, generating the entity vector of the entity according to the vector generation model; determining the loss value of the vector generation model based on the entity vectors of the entities in the two target knowledge graphs and the entity vectors of the entities in the benchmark set, the benchmark set including some aligned entities in the two target knowledge graphs; adjusting the parameters of the entity alignment model based on the loss value, and updating the entity vector of each entity based on the adjusted vector generation model; based on the updated entity vectors of the entities, expanding the entities in the two target knowledge graphs whose distances meet preset conditions to the benchmark set; continuing to train the vector generation model, and when the training is completed, determining the benchmark set as training data; training according to the training data to generate an entity alignment model. In the present application, only part of the aligned entities need to be obtained in advance to form the benchmark set, and the benchmark set can be automatically expanded by continuously training the vector generation model, thereby obtaining a large amount of training data. Since only some aligned entities need to be acquired in advance to form a benchmark set, the labor cost and time cost required for acquiring training data can be reduced to a certain extent, thereby improving acquisition efficiency.
[0147] Furthermore, after obtaining the training data, a preset machine learning model may be trained according to the training data to obtain a first entity alignment model.
[0148] In this step, since the training data can be obtained by continuously expanding the benchmark set according to the training data generation method in the aforementioned embodiment, there is no need to manually select a sufficient amount of training data, thereby saving the cost of obtaining training data. Specifically, during training, the predicted alignment entity of the first entity alignment model can be obtained, and then the loss value of the first entity alignment model can be determined based on the predicted alignment entity and the actual alignment entity in the training data. Then, the parameters of the first entity alignment model are adjusted based on the loss value, and the adjusted first entity alignment model is continued to be trained. Finally, when the loss value meets the convergence condition, the first entity alignment model is determined as the entity alignment model. Among them, the first entity alignment model can be built based on a graph neural network model.
[0149] It should be noted that in another optional embodiment of the present application, a link prediction model can also be trained based on the training data to perform entity link prediction.
[0150] To sum up, in the entity alignment model generation method provided by the present application, there is no need to manually select a sufficient amount of training data. It is only necessary to pre-acquire some alignment entities to form a benchmark set, and the training data can be obtained by continuous expansion. Therefore, the cost required to obtain training data can be reduced to a certain extent, thereby reducing the cost of generating the model.
[0151] Furthermore, in an optional embodiment of the present application, when the at least two knowledge graphs are identified according to a preset entity alignment model to obtain aligned entities in the at least two knowledge graphs, the at least two knowledge graphs can be input into the first entity alignment model; and the aligned entities in the knowledge graphs are determined according to the first entity alignment model.
[0152] In an embodiment of the present application, any two knowledge graphs can be input into the first entity alignment model at a time. The first entity alignment model can be generated based on the above method. The first entity alignment model can perform entity alignment on the input entities, thereby obtaining aligned entities in the two knowledge graphs.
[0153] To sum up, in an entity alignment method provided by the present application, the first entity alignment model used only needs to pre-acquire some alignment entities to constitute a benchmark set during training, and the training data can be obtained by continuous expansion. Therefore, the cost of generating the model can be reduced to a certain extent, thereby reducing the cost of using the first entity alignment model.
[0154] Reference Figure 8 , shows a flowchart of the steps of a second entity alignment model generation method of the present application. Specifically, the following steps may be included:
[0155] Step 501, determine the entity vectors of two target knowledge graph entities based on the vector generation model.
[0156] In an embodiment of the present application, a vector generation model can be used to generate a vector that can represent an entity. The vector generation model can be pre-built, and the vector generation model can be the same as the vector generation model in the aforementioned steps.
[0157] Specifically, according to the vector generation model, the method of determining the entity vectors of the entities in the two target knowledge graphs can refer to the aforementioned steps.
[0158] Step 502, determining the loss value of the vector generation model based on the entity vectors of the entities in the two target knowledge graphs and the entity vectors of the entities in a benchmark set; the benchmark set includes partially aligned entities in the two target knowledge graphs.
[0159] Specifically, the specific implementation of this step may refer to the aforementioned step 203.
[0160] Step 503: Adjust the parameters of the vector generation model based on the loss value, and update the entity vector of the entity based on the adjusted vector generation model.
[0161] Specifically, the specific implementation of this step may refer to the aforementioned step 204.
[0162] Step 504, based on the updated entity vector of the entity, the entities in the two target knowledge graphs whose distances from each other satisfy the first preset condition are expanded to the benchmark set.
[0163] Specifically, the specific implementation of this step may refer to the aforementioned step 205.
[0164] Step 505: Continue to train the vector generation model, and when the training is completed, determine the vector generation model as the second entity alignment model.
[0165] In this step, the method of continuing to train the vector generation model can refer to the method of continuing to train the vector generation model in the previous step. By continuing to train the vector generation model, the accuracy of the entity vector generated by the vector generation model for the entity to represent the entity can be continuously improved.
[0166] Furthermore, in an embodiment of the present application, the vector generation model can be determined as the second entity representation model when the loss value meets the convergence condition, or when there are no entities in the two target knowledge graphs that do not belong to the benchmark set and the distances between them satisfy the first preset condition.
[0167] In summary, the present application provides a method for generating a second entity representation model, including: determining the entity vectors of entities in two target knowledge graphs according to a vector generation model; determining the loss value of the vector generation model based on the entity vectors of the entities in the two target knowledge graphs and the entity vectors of the entities in the benchmark set; the benchmark set includes some aligned entities in the two target knowledge graphs; adjusting the parameters of the vector generation model based on the loss value, and updating the entity vectors of the entities based on the adjusted vector generation model; based on the updated entity vectors of the entities, expanding the entities in the two target knowledge graphs whose distances meet the first preset condition to the benchmark set; continuing to train the vector generation model, and when the training is completed, determining the vector generation model as the second entity alignment model. In the present application, only part of the aligned entities need to be pre-acquired to form the benchmark set. In the process of continuously training the vector representation model, the benchmark set can be automatically expanded. In this way, only part of the aligned entities need to be pre-acquired to form the benchmark set to realize the training of the second entity representation model, which can reduce the cost required for training the second entity representation model to a certain extent.
[0168] Accordingly, in an optional embodiment of the present application, the at least two knowledge graphs may be identified according to a preset entity alignment model to obtain aligned entities in the at least two knowledge graphs through the following steps 601 to 603:
[0169] Step 601: For any two knowledge graphs of at least two knowledge graphs, input the first vectors of entities in the two knowledge graphs into an entity representation model.
[0170] In an embodiment of the present application, the knowledge graph may be a knowledge graph that needs to be entity aligned. The first vector may be used to represent the entity. The first vector may be randomly generated, or generated based on the semantics of the entity, or generated based on the adjacency matrix of the entity. The specific generation process may refer to the process of generating the first vector in the aforementioned step.
[0171] Step 602: Generate a second vector of the entity according to the second entity alignment model.
[0172] In an embodiment of the present application, the second entity alignment model is generated based on the aforementioned second entity alignment model generation method. The second entity alignment model can generate a second vector for each entity based on the first vector of the input entity. Since the second entity alignment model is obtained by iterative training and continuous optimization based on the entity pairs with higher accuracy in the benchmark set, the second vector generated by the second entity alignment model can accurately characterize the entity.
[0173] Step 603: Based on the second vector of the entity, entities whose distances from each other satisfy a second preset condition are extracted from the two knowledge graphs to obtain aligned entities in the two knowledge graphs.
[0174] In an embodiment of the present application, the second preset condition may be set according to actual application scenarios and actual needs. For example, the second preset condition may be that the distance ranking is higher than a preset ranking threshold, and the distance ranking refers to the distance of the entity in the target knowledge graph, and the ranking of the distance between the entity and all entities in another target knowledge graph. In this way, through two-way selection, that is, selecting entities whose distances relative to each other meet the second preset condition, the confidence of the selected entity pairs can be improved to a certain extent, thereby ensuring the accuracy of the selected aligned entities. It should be noted that in another optional embodiment of the present application, a distance threshold may also be set, and based on the second vector of the entity, entities whose distances meet the preset distance threshold are extracted as aligned entities. Of course, the second preset condition may also be that the distance is less than a preset value.
[0175] In summary, in an entity alignment method provided by the present application, the second entity alignment model used can be trained with only a small number of alignment entities, thereby reducing the cost of using the second entity alignment model. At the same time, since the second entity alignment model is iteratively trained and continuously optimized based on entity pairs with higher accuracy in a benchmark set, the second vector generated by the second entity alignment model can accurately characterize the entity, thereby ensuring the accuracy of the aligned entity extracted based on the second vector.
[0176] Optionally, in a specific implementation of the embodiment of the present application, step 602 may specifically include:
[0177] Sub-step 6021, extracting entity feature vectors of M neighbor entities of the entity.
[0178] Specifically, the specific implementation of this step can refer to the aforementioned sub-step 2021.
[0179] Sub-step 6022, calculating the second vector of the entity based on the first vector of the entity, the entity feature vectors of the M neighbor entities and the pre-trained weight parameters in the second entity alignment model.
[0180] Specifically, the specific implementation of this step can refer to the above steps.
[0181] Reference Fig. 9 , showing a partial schematic diagram of a knowledge graph of the present application. For the entity "Desert Boots", in the embodiment of the present application, the second vector of the entity "Desert Boots" can be generated based on the first vector of the entity "Desert Boots", the feature vectors of the neighbor entities "Suzhou", "brown", "leather" and "300 grams" of the entity "Desert Boots" according to the second entity alignment model. For the entity "Desert Boot", the second entity alignment model can be used to generate the second vector of the entity "Desert Boot" based on the first vector of the entity "Desert Boot" and the feature vectors of the neighbor entities "Chinese", "38", "leather" and "300grams" of the entity "Desert Boot". The entity "Desert Boots" and the entity "Desert Boot" indicate the same thing in the physical world. Therefore, the entity distance between the second vector of the entity "Desert Boots" and the second vector of the entity "Desert Boot" will be the shortest distance to each other. Accordingly, the entity "Desert Boots" and the entity "Desert Boot" can be used as alignment entities.
[0182] Further, in the embodiment of the present application, after the aligned entities are extracted from the knowledge graph, search optimization can be performed based on these aligned entities. Fig.10, showing a schematic diagram of a scenario of searching based on alignment entities in an embodiment of the present application. In an embodiment of the present application, the server AS210, the server BS220 and the alignment device S230 may be a server, a computer or other electronic devices with relatively strong computing power. The figure takes the device as a server as an example for illustration. In actual applications, the server AS210, the server BS220 and the alignment device S230 may be the same device or different devices. The terminal device S240 may be any terminal device S240 managed by the server BS220, and the user may use the terminal device S240 to search.
[0183] The alignment device S230 may be deployed with an entity alignment model generated based on the method in the aforementioned embodiment, so that the alignment device S230 can identify the alignment entities between the knowledge graphs according to the entity alignment model. The entity alignment model may be generated by the alignment device S230 itself based on the aforementioned method, or may be generated by other devices.
[0184] Specifically, in this scenario, the alignment device S230 can execute: step 2.1 to obtain knowledge graph A and knowledge graph B; step 2.2 to perform entity alignment on knowledge graph A and knowledge graph B; step 2.3 to return the aligned entity pairs, wherein these entity pairs include: entity pairs of entity M-entity N; accordingly, the user can execute step 2.4 to trigger the terminal device S240 to search for entity M, and the terminal device S240 can execute step 2.5 to initiate a search request for entity M. Assuming that entity M and entity N are aligned entity pairs, entity M is an entity in knowledge graph B, and entity N is an entity in knowledge graph A, then the server BS220 can execute step 2.6 to obtain the information of entity N from knowledge graph A according to the entity pair "entity M-entity N", and obtain the information of entity M from the server BS220. Then, the server BS220 can execute step 2.7 to return the information of both entity M and entity N to the terminal device S240. Accordingly, the terminal device S240 can execute step 2.8 to display information of both entity M and entity N. In this way, by combining the aligned entities extracted by the alignment device S230, the information of the entity searched by the user and the entity aligned with the entity searched by the user can be displayed to the user, thereby improving the richness of the search results. It should be noted that in actual applications, the connection relationship between entities can also be predicted based on the aligned entity pairs, and then the predicted connection relationship can be returned to the server AS210 and the server BS220. Accordingly, the server AS210 and the server BS220 can improve or expand their respective stored knowledge graphs based on the connection relationship.
[0185] Reference Fig.11, shows a flowchart of the steps of a method for updating relevant information of an entity of the present application. The method can be applied to the first server, and the method can specifically include the following steps:
[0186] Step 701, when it is determined that the relevant information of the target entity in the first server is updated, determine the second entity corresponding to the target entity in the second server based on the aligned entities in at least two knowledge graphs.
[0187] In an embodiment of the present application, the target entity and the target entity in the entity publishing method embodiment may be the same entity or different entities. The first server and the second server may be websites, and the entity in the server may represent an object in the website. For example, when the website is a shopping website, the entity in the server may be a commodity in the website. Furthermore, the second server may be one or more, so that when there are multiple second servers, it is possible to update multiple servers at the same time. Accordingly, the knowledge graph may be constructed based on the data in the first server and the data in at least one second server, and the knowledge graph may exist in each corresponding server. The aligned entities in these knowledge graphs are extracted based on the entity alignment method in the aforementioned embodiment. In this way, the aligned entities in these knowledge graphs may represent entities representing the same concept in the first server and the second server. Accordingly, for the target entity, the second entity corresponding to the first entity may be found from these aligned entities, and then the second entity corresponding to the target entity in the second server may be determined.
[0188] Step 702: Update the relevant information of the second entity based on the updated relevant information of the target entity.
[0189] In the embodiment of the present application, the update of the relevant information of the target entity may be to add relevant information to the target entity, to delete relevant information of the target entity, or to update the content of the relevant information of the target entity. Assuming that the relevant information "price 199" is added to the target entity, then correspondingly, the relevant information "price 199" may also be added to the second entity.
[0190] Since the second entity and the target entity represent the same concept, the relevant information of the second entity can be updated accordingly based on the updated relevant information of the target entity, thereby realizing rapid updating of the relevant information of the same entity in different servers. For example, assuming that the entity is a product on a shopping website, the method in the embodiment of the present application can realize rapid updating of the relevant information of the same product on other shopping websites.
[0191] Reference Fig.12, showing a schematic diagram of a scenario of updating relevant information of an entity in an embodiment of the present application. In an embodiment of the present application, the server AS310, the server BS320, the server CS340 and the alignment device S330 can be a server, a computer or other electronic devices with relatively strong computing power. The figure takes the device as a server as an example for illustration. In actual applications, the server AS310, the server BS320, the server CS340 and the alignment device S330 can be the same device or different devices. Among them, the server AS310 is the first server, and the server BS320 and the server CS340 are the second server.
[0192] The alignment device S330 may be deployed with an entity alignment model generated based on the method in the aforementioned embodiment, so that the alignment device S330 can identify the alignment entities between the knowledge graphs according to the entity alignment model. The entity alignment model may be generated by the alignment device S330 itself based on the aforementioned method, or may be generated by other devices.
[0193] Specifically, in this scenario, the server AS310 can execute step 3.1 to update entity A, wherein entity A is the target entity, and the specific operation of updating entity A can be to update the relevant information of entity A. The alignment device S330 can execute: step 3.2 to obtain knowledge graph A, obtain knowledge graph B, and obtain knowledge graph C; step 3.3 to perform entity alignment on knowledge graph A, knowledge graph B, knowledge graph A, and knowledge graph C; step 3.4 to return the aligned entities between knowledge graphs A and B, and the aligned entities between knowledge graphs A and C; accordingly, the server AS310 can execute: step 3.5 to synchronize the information of entity A to the server BS320 based on the aligned entities of knowledge graphs A and B for publication; and step 3.6 to synchronize the information of entity A to the server CS340 based on the aligned entities of knowledge graphs A and C for publication. In this way, combined with the method of updating relevant information by aligning entities, only one update of the relevant information is required on the server, and the relevant information of the corresponding entities on other servers can be automatically synchronized and updated, thereby improving the updating efficiency of relevant information.
[0194] Optionally, in a specific implementation of the embodiment of the present application, before step 702, the following may also be included:
[0195] Step 703: convert the updated relevant information of the target entity into relevant information conforming to a second target language; the second target language is a language used by the second server.
[0196] In this step, different servers may be oriented to different users, and therefore, different servers may use different languages. For example, a server providing services to Spanish users may use Spanish, and a server providing services to British users may use English. Therefore, before synchronously updating the relevant information of the second entity of the second server, the updated relevant information of the target entity may be converted into relevant information in the language adopted by the second server, so that it can be ensured that after the relevant information of the second entity of the second server is updated, the users of the second server can understand the relevant information normally. Of course, the updated relevant information of the target entity may also be sent to the second server, which will convert and update it.
[0197] Specifically, during the conversion, manual translation or machine translation can be used. It should be noted that when language conversion is performed through machine translation, affected by the accuracy of machine translation, some professional terms in professional fields may not be accurately translated. Therefore, in the embodiment of the present application, professional terms in different professional fields can be collected, and then based on these terms, the words corresponding to the professional terms in the machine translation results are corrected, thereby improving the accuracy of language conversion.
[0198] Reference Fig.13 , shows a schematic diagram of another scenario of updating relevant information of an entity in an embodiment of the present application. In this scenario, before synchronizing the information of entity A to the server BS320 and the server CS340, the information of entity A is converted. In this way, by combining the update of relevant information with the aligned entities and converting the language of the information before the update, the relevant information of the corresponding entity on other servers can be automatically and synchronously updated, improving the updating efficiency of the relevant information while ensuring that the updated information can be normally understood by the user.
[0199] In summary, the present application provides a method for updating relevant information of an entity, including: when determining that the relevant information of a target entity in a first server is updated, based on at least two aligned entities in a knowledge graph, determining the second entity corresponding to the target entity in a second server; based on the updated relevant information of the target entity, updating the relevant information of the second entity. In the present application, based on the aligned entities extracted from the knowledge graph, the second entity corresponding to the target entity in other second servers can be conveniently determined, and then based on the update of the relevant information of the target entity, the relevant information of the second entities in multiple other second servers can be synchronously updated, thereby achieving rapid release.
[0200] Furthermore, the present application also provides a website data construction method. The method can be applied to the first server, and the method can specifically include the following steps:
[0201] Step 801, receiving a construction request for constructing website data.
[0202] Step 802, in response to the construction request, based on the aligned entities in at least two knowledge graphs, determine the second entity corresponding to the first entity to be constructed in the first server in the second server.
[0203] In the embodiment of the present application, the first entity to be constructed may be an entity that needs to be added to the first server, but the relevant information is insufficient and the data has not been constructed. Specifically, the method of determining the second entity corresponding to the first entity in the second server may refer to the above steps.
[0204] Step 803: Obtain relevant information corresponding to the second entity from the second server as data of the first entity to construct the website data.
[0205] Specifically, the relevant information corresponding to the second entity can be added to the first server as the relevant information of the first entity, thereby realizing the construction of the data of the first entity. In this way, the relevant information corresponding to the second entity can be directly obtained from the second server without generating the relevant information of the first entity, thereby realizing the construction of the data of the first entity, thereby improving the construction efficiency.
[0206] Taking the construction of a website as an example, based on the method of the embodiment of the present application, it is possible to quickly build a website. Fig.14 , showing a schematic diagram of a scenario for building a website of the present application. In this scenario, the server BS420 can be the first server, the server AS410 can be the second server, and the website to be built can be implemented based on the server BS420. Since the entity in the server BS420 has only simple information, and the knowledge graph in the server AS410 includes detailed information, the alignment device S430 can align the knowledge graph A in the server AS410 and the knowledge graph B in the server BS420 based on steps 4.2 and 4.3, and then return the aligned entities between the knowledge graph A and the knowledge graph B to the server BS420 based on step 4.4. Correspondingly, the server BS420 can obtain the detailed information corresponding to the second entity aligned with the entity to be built from the server AS410 based on these aligned entities based on step 4.5, and build the website based on this information. In this way, there is no need to generate information for each entity to be built in the website, and the construction can be achieved directly based on the detailed information already available for the entity in the server A. Therefore, the efficiency of building a website can be improved.
[0207] Optionally, in a specific implementation of the embodiment of the present application, when the relevant information of the second entity is used to publish the target entity, or when the relevant information of the second entity is used to construct the website data, the relevant information of the corresponding second entity can be first converted into relevant information that conforms to the second target language; the second target language is the language used by the first server. The specific conversion method can refer to the above steps.
[0208] In summary, in a server-side data construction method provided by the present application, there is no need to collect relevant information of the first entity, and the relevant information corresponding to the second entity can be directly obtained from the second server to realize the construction of the data of the first entity, thereby improving the construction efficiency.
[0209] Furthermore, an embodiment of the present application provides an entity operation synchronization method. The method can be applied to a first server, and the method can specifically include the following steps:
[0210] Step 901: After the first user entity in the first server performs a target operation, a second user entity corresponding to the first user entity in the second server is determined based on at least two aligned entities in the knowledge graphs.
[0211] In the embodiment of the present application, the user entity may correspond to an account in the server, and the target operation may be an operation performed by the account. For example, the target operation may be that the account sends a message to another account in the server, or that the account sends a system notification in the server. Specifically, the method for determining the second user entity corresponding to the first user entity in the second server may refer to the above steps.
[0212] Step 902: Control the second user entity to execute the target operation in the second server.
[0213] In this step, the second server can be one or more. Furthermore, since the second user entity and the first user entity are aligned entities, the second user entity can be controlled to also perform the target operation in the second server. In this way, there is no need to control the second user entity to perform the target operation by notifying the second server. After the first user entity performs the target operation, the first server can synchronize the target operation in the second server, thereby improving the efficiency of the operation execution. For example, assuming that the first user entity publishes a system notification X in the first server, the first server can control the second user entity corresponding to the first user entity in the second server to also publish a system notification X.
[0214] Reference Fig.15, shows a scenario diagram of an entity operation synchronization method of the present application. In this scenario, the server AS610 is a first server, and the server BS620 and the server CS640 are second servers. The user entity A1 in the server AS610 can be the first user entity.
[0215] Further, the alignment device S630 can first align the knowledge graph A in the server AS610 and the knowledge graph B in the server BS620 based on step 6.2 and step 6.3, and align the knowledge graph A in the server AS610 and the knowledge graph C in the server CS640, and then return the alignment entities between the knowledge graphs A and B, and the alignment entities between the knowledge graphs A and C to the server AS610 based on step 6.4. Accordingly, the server AS610 can synchronize the target operation of the user entity A1 to the user entity A2 aligned with the user entity A1 in the server BS620 and to the user entity A3 aligned with the user entity A1 in the server CS640 based on these alignment entities based on steps 6.6 and 6.7. In this way, based on the alignment entities, the user entity only needs to perform the target operation on one server to synchronize the target operation to multiple other servers, thereby improving the efficiency of operation execution.
[0216] To sum up, in an entity operation synchronization method provided by the present application, there is no need to control the second user entity to perform the target operation by notifying the second server. After the first user entity performs the target operation, the first server can synchronize the target operation in the second server, thereby improving the efficiency of the operation execution.
[0217] Optionally, when publishing the target business object based on the aligned business objects in at least two business object knowledge graphs, when obtaining the aligned business objects in at least two business object knowledge graphs, the business object alignment model can be bidirectionally iteratively trained on the at least two business object knowledge graphs according to a preset vector generation model; the at least two business object knowledge graphs are identified according to the preset business object alignment model to obtain the aligned business objects in the at least two business object knowledge graphs. The bidirectional iterative training is used to expand the benchmark set in the process of training the vector generation model; the benchmark set includes partially aligned business objects of at least two business object knowledge graphs.
[0218] Specifically, the business object alignment model may be a first business object alignment model or a second business object alignment model. When training the second business object alignment model, a flow chart of a second business object alignment model generation method of the present application may be used. Specifically, the following steps may be included:
[0219] Step 1001, determine the business object vectors of the business objects in the two target business object knowledge graphs based on the business object vector generation model.
[0220] In an embodiment of the present application, the target business object knowledge graph may be a knowledge graph generated from the relevant information of the business object in the business object website. The relevant information may at least include the name, logo, attributes and business object category of the business object. For example, taking the business object as a long skirt in the website as an example, the name of the business object may be the name of the long skirt, the logo may be the logo of the long skirt, the attributes may be the color, style, fabric, size, etc. of the long skirt. The business object category may be the category to which the long skirt belongs: clothing.
[0221] Step 1002, based on the business object vectors of the business objects in the two target business object knowledge graphs and the vectors of the business objects in the business object benchmark set, determine the loss value of the business object vector generation model; the business object benchmark set includes partially aligned business objects in the two target business object knowledge graphs.
[0222] Specifically, the specific implementation of this step can refer to the above steps.
[0223] Step 1003: Adjust the parameters of the business object vector generation model based on the loss value, and update the vector of the business object based on the adjusted business object vector generation model.
[0224] Specifically, the specific implementation of this step can refer to the above steps.
[0225] Step 1004, based on the updated vector of the business object, the business objects in the two target business object knowledge graphs whose distances meet the first preset condition are expanded into the business object benchmark set.
[0226] Specifically, the specific implementation of this step can refer to the above steps.
[0227] Step 105: Continue to train the business object vector generation model, and when the training is completed, determine the vector generation model as the second business object alignment model.
[0228] Specifically, the specific implementation of this step can refer to the above steps. In the embodiment of the present application, the second business object alignment model is generated according to the target business object knowledge graph, so that when the business object is aligned with the knowledge graph of the business object field according to the second business object alignment model, the aligned business objects in the knowledge graph of the business object field can be extracted more accurately.
[0229] In summary, the present application provides a method for generating a second business object alignment model, in which only part of the aligned business objects need to be pre-acquired to form a business object benchmark set. In the process of continuously training the first vector representation model, the business object benchmark set can be automatically expanded. In this way, only part of the aligned business objects need to be pre-acquired to form a business object benchmark set to realize the training of the second business object alignment model, which can reduce the cost required for training the second business object alignment model to a certain extent. At the same time, the targeted use of the target business object knowledge graph to generate the second business object alignment model can make it possible to more accurately extract the aligned business objects in the knowledge graph of the business object field when using the second business object alignment model to align the business objects on the knowledge graph of the business object field.
[0230] Furthermore, the embodiment of the present application provides a method for aligning business objects, which may specifically include the following steps:
[0231] Step 1101: for any two business object knowledge graphs of at least two business object knowledge graphs, input the first vectors of the business objects in the two business object knowledge graphs into a second business object alignment model.
[0232] The business object knowledge graph may be a business object knowledge graph that needs to be aligned with the business object, and the business object knowledge graph may be a knowledge graph generated based on the relevant data of the business object in the business object field. The specific generation method may refer to the aforementioned steps. Furthermore, the first vector may be used to represent the business object. The first vector may be randomly generated, or generated based on the semantics of the business object, or generated based on the adjacency matrix. The specific generation process may refer to the aforementioned steps.
[0233] Step 1102: Generate a second vector of the business object according to the second business object alignment model.
[0234] In this step, the second business object alignment model is generated based on the aforementioned second business object alignment model generation method.
[0235] Step 1103: Based on the second vector of the business object, business objects whose distances satisfy a second preset condition are extracted from the two business object knowledge graphs to obtain aligned business objects in the two business object knowledge graphs.
[0236] In this step, since the second business object alignment model is generated based on the target business object knowledge graph, the business object knowledge graph and the target business object knowledge graph used in training are both constructed based on the data source of the business object field. Therefore, the second vector generated by the second business object alignment model can accurately represent the business object, thereby ensuring the accuracy of the aligned business object extracted based on the second vector of the business object.
[0237] To summarize, in a business object alignment method provided by the present application, the second business object alignment model used can be trained with only a small number of aligned business objects. Therefore, the cost of using the second business object alignment model can be reduced. At the same time, since the second business object alignment model is generated using the target business object knowledge graph, the business object knowledge graph and the target business object knowledge graph used in training are both constructed based on the data source of the business object field. Therefore, the second vector generated by the second business object alignment model can accurately represent the business object, thereby ensuring the accuracy of the aligned business object extracted based on the second vector.
[0238] Reference Fig.16 , showing a schematic diagram of a target business object knowledge graph of an embodiment of the present application, referring to Fig.17 , showing a schematic diagram of another target business object knowledge graph of an embodiment of the present application. The two business object knowledge graphs may include multiple nodes and edges respectively, wherein each node represents a business object, and each edge represents the relationship between business objects. Among them, the business object "Apple XR" and the business object "Iphone XR" point to the same thing in the physical world. Through the aforementioned steps in the embodiment of the present application, the business object "Apple XR" and the business object "IphoneXR" can be extracted as alignment business objects.
[0239] Furthermore, when training the first business object alignment model, training data may be obtained first. Then, the preset machine learning model is trained according to the training data to obtain the first business object alignment model. Specifically, the embodiment of the present application provides a flowchart of the steps of the training data generation method. Specifically, the following steps may be included:
[0240] Step 1201, according to the business object vector generation module, determine the vectors of the business objects in the two target business object knowledge graphs.
[0241] Step 1202, based on the vectors of business objects in the two target business object knowledge graphs and the vectors of business objects in a business object benchmark set, determine the loss value of the business object vector generation model; the business object benchmark set includes partially aligned business objects in the two target business object knowledge graphs.
[0242] Step 1203: Adjust the parameters of the business object vector generation model based on the loss value, and update the vector of the business object based on the adjusted business object vector generation model.
[0243] Step 1204, based on the updated vector of the business object, the business objects in the two target business object knowledge graphs whose distances from each other meet the first preset condition are expanded to the business object benchmark set.
[0244] Step 1205: Continue to train the business object vector generation model, and when the training is completed, determine the business object benchmark set as training data.
[0245] Specifically, the implementation method of each step in the embodiment of the present application can refer to the corresponding steps in the aforementioned embodiments.
[0246] In summary, in a training data generation method provided by the present application, only part of the aligned business objects need to be acquired in advance to form a business object benchmark set, and then the business object benchmark set can be automatically expanded by continuously training the business object vector generation module, thereby obtaining a large amount of training data. Since only part of the aligned business objects need to be acquired in advance to form a business object benchmark set, the cost required to acquire training data can be reduced to a certain extent, the acquisition efficiency can be improved, and the cost of generating the first business object alignment model can be reduced.
[0247] Accordingly, in an optional embodiment of the present application, the at least two business object knowledge graphs may be identified according to a preset business object alignment model to obtain aligned business objects in at least two business object knowledge graphs through the following steps 1301 to 1302:
[0248] Step 1301: input the at least two business object knowledge graphs into a first business object alignment model.
[0249] Step 1302: Determine the aligned business objects in the business object knowledge graph according to the first business object alignment model.
[0250] Specifically, the implementation method of each step in the embodiment of the present application can refer to the corresponding steps in the aforementioned embodiments.
[0251] To summarize, in the embodiments of the present application, when determining the aligned business objects in the business object knowledge graph, the business object alignment model used only needs to pre-acquire some aligned business objects to constitute a business object benchmark set during training, and the training data can be obtained through continuous expansion. Therefore, the cost of generating the model can be reduced to a certain extent, thereby reducing the cost of using the business object alignment model.
[0252] Furthermore, the embodiment of the present application provides a method for updating relevant information of a business object. Specifically, the method may include the following steps:
[0253] Step 1401, when it is determined that the relevant information of the target business object in the first server is updated, determine the second business object corresponding to the target business object in the second server based on the aligned business objects in at least two business object knowledge graphs.
[0254] Step 1402: Update the relevant information of the second business object based on the updated relevant information of the target business object.
[0255] Specifically, the implementation of each step in the embodiment of the present application can refer to the corresponding steps in the aforementioned embodiment. Before updating the relevant information of the second business object based on the updated relevant information of the target business object, the relevant information of the target business object can also be converted into relevant information that conforms to the first target language, wherein the first target language is the language used by the first server.
[0256] In a method for updating relevant information of a business object provided in an embodiment of the present application, the target business object and the target business object in the embodiment of the business object publishing method can be the same business object or different business objects. Based on the aligned business objects extracted from the business object knowledge graph, the second business object corresponding to the target business object in other second service terminals can be easily determined, and then based on the update of the relevant information of the target business object, the relevant information of the second business objects in multiple other second service terminals can be synchronously updated, thereby achieving rapid update.
[0257] Furthermore, the present application embodiment provides a website data construction method, which may specifically include the following steps:
[0258] Step 1501, receiving a construction request for constructing website data.
[0259] Step 1502, in response to the construction request, based on the aligned business objects in at least two business object knowledge graphs, determine the second business object corresponding to the first business object to be constructed in the first server in the second server.
[0260] Step 1503: Acquire relevant information corresponding to the second business object from the second server as data of the first business object to construct the website data.
[0261] Specifically, the implementation method of each step in the embodiment of the present application can refer to the corresponding steps in the aforementioned embodiments.
[0262] In a website data construction method provided by the embodiment of the present application, there is no need to collect relevant information of the first business object, and the relevant information corresponding to the second business object can be directly obtained from the second server to realize the construction of the data of the first business object, thereby improving the construction efficiency.
[0263] Optionally, in a specific implementation of the embodiment of the present application, when the target business object is published using the relevant information of the second business object, or when the website data is constructed using the relevant information of the second business object, the relevant information of the corresponding second business object can be first converted into relevant information conforming to the first target language; wherein the first target language is the language used by the first server. The specific conversion method can refer to the above steps.
[0264] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0265] On the basis of the above embodiments, the embodiments of the present application further provide a device, an electronic device and a storage medium to ensure the implementation and application of the above methods.
[0266] Reference Fig.18 , shows a structural block diagram of a business object publishing device according to an embodiment of the present application, the device is applied to a first server, and the device method includes:
[0267] The first receiving module 1601 is used to receive a publishing request for a target business object;
[0268] A first determination module 1602 is used to determine, in response to the publishing request, a second business object corresponding to the target business object in the second server based on the aligned business objects in the at least two business object knowledge graphs;
[0269] A first acquisition module 1603 is used to acquire relevant information of a corresponding second business object in the second server;
[0270] The first publishing module 1604 is used to publish the target business object according to the relevant information.
[0271] In summary, the business object publishing device provided by the present application can receive a publishing request for a target business object; in response to the publishing request, determine the second business object corresponding to the target business object in the second server based on the aligned business objects in at least two business object knowledge graphs; obtain the relevant information of the corresponding second business object in the second server; and publish the target business object according to the relevant information. In the present application, there is no need to generate manually collected relevant information of the target business object, and the relevant information corresponding to the second business object can be directly obtained from the second server to achieve the publishing of the target business object, thereby improving the publishing efficiency.
[0272] Optionally, in a specific embodiment of the present application, the device further includes:
[0273] The first conversion module is used to convert the relevant information of the corresponding second business object into relevant information conforming to a first target language; the first target language is a language used by the first server.
[0274] Optionally, in a specific embodiment of the present application, the device further includes:
[0275] A second determination module is used to determine, when determining that the relevant information of the target business object in the first server is updated, a second business object corresponding to the target business object in the second server based on the aligned business objects in at least two business object knowledge graphs;
[0276] The first updating module is used to update the relevant information of the second business object based on the updated relevant information of the target business object.
[0277] Optionally, in a specific embodiment of the present application, the device further includes:
[0278] A second receiving module is used to receive a construction request for constructing website data;
[0279] A third determination module is used to determine, in response to the construction request, a second business object corresponding to the first business object to be constructed in the first server in the second server based on the aligned business objects in the at least two business object knowledge graphs;
[0280] The first construction module is used to obtain relevant information corresponding to the second business object from the second server as data of the first business object to construct the website data.
[0281] Optionally, in a specific embodiment of the present application, the device further includes:
[0282] A first training module is used to perform bidirectional iterative training of a business object alignment model on at least two business object knowledge graphs according to a preset vector generation model; wherein the bidirectional iterative training is used to expand a benchmark set during the training of the vector generation model; the benchmark set includes partially aligned business objects of the at least two business object knowledge graphs;
[0283] The first identification module is used to identify the at least two business object knowledge graphs according to a preset business object alignment model to obtain aligned business objects in the at least two business object knowledge graphs.
[0284] Optionally, in a specific implementation of the present application, the first training module is specifically used to:
[0285] Determine the vectors of the business objects in the two target business object knowledge graphs according to the business object vector generation model;
[0286] Determining a loss value of the business object vector generation model based on vectors of business objects in the two target business object knowledge graphs and vectors of business objects in a business object benchmark set; the business object benchmark set includes partially aligned business objects in the two target business object knowledge graphs;
[0287] Adjusting parameters of the business object vector generation model based on the loss value, and updating the vector of the business object based on the adjusted business object vector generation model;
[0288] Based on the updated vector of the business object, business objects whose distances between the two target business object knowledge graphs satisfy a first preset condition are expanded to the business object benchmark set;
[0289] Continue to train the business object vector generation model, and when the training is completed, determine the business object benchmark set as training data;
[0290] The preset machine learning model is trained according to the training data to obtain a first business object alignment model.
[0291] Optionally, in a specific implementation of the present application, the first identification module is specifically used to:
[0292] Inputting the at least two business object knowledge graphs into a first business object alignment model;
[0293] According to the first business object alignment model, the aligned business objects in the business object knowledge graph are determined.
[0294] Optionally, in a specific implementation of the present application, the first training module is specifically used to:
[0295] Determine the vectors of the business objects in the two target business object knowledge graphs according to the business object vector generation model;
[0296] Determining a loss value of the business object vector generation model based on vectors of business objects in the two target business object knowledge graphs and vectors of business objects in a business object benchmark set; the business object benchmark set includes partially aligned entities in the two target business object knowledge graphs;
[0297] Adjusting parameters of the business object vector generation model based on the loss value, and updating the vector of the business object based on the adjusted business object vector generation model;
[0298] Based on the updated vector of the business object, business objects whose distances between the two target business object knowledge graphs satisfy a first preset condition are expanded to the business object benchmark set;
[0299] Continue to train the business object vector generation model, and when the training is completed, determine the vector generation model as the second business object alignment model.
[0300] Optionally, in a specific implementation of the present application, the first identification module is specifically used to:
[0301] For any two knowledge graphs of at least two business object knowledge graphs, inputting first vectors of business objects in the two business object knowledge graphs into a second business object alignment model;
[0302] generating a second vector of the business object according to the second business object alignment model;
[0303] Based on the second vector of the business object, business objects whose distances from each other satisfy a second preset condition are extracted from the two business object knowledge graphs to obtain aligned business objects in the two business object knowledge graphs.
[0304] Reference Fig.19 , shows a structural block diagram of an entity publishing device in an embodiment of the present application, the device is applied to a first server, and the device includes:
[0305] The third receiving module 1701 is used to receive a publishing request for a target entity;
[0306] A fourth determination module 1702 is used to determine, in response to the publishing request, a second entity corresponding to the target entity in the second server based on the aligned entities in at least two knowledge graphs;
[0307] The second acquisition module 1703 is used to acquire relevant information of the second entity corresponding to the second server;
[0308] The second publishing module 1704 is used to publish the target entity according to the relevant information.
[0309] In summary, the entity publishing device provided by the present application can receive a publishing request for a target entity; in response to the publishing request, determine the second entity corresponding to the target entity in the second server based on the aligned entities in at least two entity knowledge graphs; obtain the relevant information of the corresponding second entity in the second server; and publish the target entity according to the relevant information. In the present application, there is no need to generate artificially collected relevant information of the target entity, and the relevant information corresponding to the second entity can be directly obtained from the second server to achieve the publishing of the target entity, thereby improving the publishing efficiency.
[0310] Optionally, in a specific embodiment of the present application, the device further includes:
[0311] A fifth determination module, configured to determine, when determining that the relevant information of the target entity in the first server is updated, a second entity corresponding to the target entity in the second server based on the aligned entities in at least two knowledge graphs;
[0312] The second updating module is configured to update the relevant information of the second entity based on the updated relevant information of the target entity.
[0313] Optionally, in a specific embodiment of the present application, the device further includes:
[0314] A fourth receiving module, used for receiving a construction request for constructing website data;
[0315] A sixth determination module, configured to determine, in response to the construction request, a second entity corresponding to the first entity to be constructed in the first server in the second server based on the aligned entities in at least two knowledge graphs;
[0316] The second construction module is used to obtain relevant information corresponding to the second entity from the second server as data of the first entity to construct the website data.
[0317] Optionally, in a specific embodiment of the present application, the device further includes:
[0318] The second conversion module is used to convert the relevant information of the corresponding second entity into relevant information conforming to a second target language; the second target language is a language used by the first server.
[0319] Optionally, in a specific implementation of the present application, the entity includes a user entity, and the device further includes:
[0320] a seventh determination module, configured to determine, after the first user entity in the first server performs a target operation, a second user entity corresponding to the first user entity in the second server based on at least two aligned entities in the knowledge graphs;
[0321] A control module is used to control the second user entity to perform the target operation in the second server.
[0322] Optionally, in a specific embodiment of the present application, the device further includes:
[0323] A second training module is used to perform bidirectional iterative training of an entity alignment model on at least two knowledge graphs according to a preset vector generation model; wherein the bidirectional iterative training is used to expand a benchmark set during the training of the vector generation model; the benchmark set includes partially aligned entities of the at least two knowledge graphs;
[0324] The second recognition module is used to recognize the at least two knowledge graphs according to a preset entity alignment model to obtain aligned entities in the at least two knowledge graphs.
[0325] Optionally, in a specific implementation of the present application, the second training module is specifically used to:
[0326] Determine the entity vectors of entities in the two target knowledge graphs based on the vector generation model;
[0327] Determining a loss value of the vector generation model based on entity vectors of entities in the two target knowledge graphs and entity vectors of entities in a benchmark set; the benchmark set includes partially aligned entities in the two target knowledge graphs;
[0328] Adjusting parameters of the vector generation model based on the loss value, and updating the entity vector of the entity based on the adjusted vector generation model;
[0329] Based on the updated entity vector of the entity, entities in the two target knowledge graphs whose distances satisfy a first preset condition are expanded to the benchmark set;
[0330] Continue training the vector generation model, and when the training is completed, determine the benchmark set as training data;
[0331] The preset machine learning model is trained according to the training data to obtain a first entity alignment model.
[0332] Optionally, in a specific implementation of the present application, the second training module is further specifically used for:
[0333] For the entities in the two target knowledge graphs, determining a first vector of the entity;
[0334] The first vector of the entity is input into the vector generation model to generate the second vector of the entity, thereby obtaining the entity vector.
[0335] Optionally, in a specific implementation of the present application, when the first vector is generated for the first time, determining the first vector of the entity includes: randomly generating a feature vector for the entity as the first vector of the entity; or obtaining an adjacency matrix of the entity as the first vector of the entity; or generating a semantic vector of the entity based on the semantics of the entity as the first vector of the entity;
[0336] When the first vector is generated again, the first vector is the second vector of the previous round.
[0337] Optionally, in a specific implementation of the present application, the second training module is further specifically used for:
[0338] Extracting entity feature vectors of N neighbor entities of the entity;
[0339] The second vector of the entity is calculated based on the first vector of the entity, entity feature vectors of the N neighboring entities, and weight parameters in the vector generation model.
[0340] Optionally, in a specific implementation of the present application, the benchmark set includes at least one benchmark entity pair;
[0341] The second training module is further specifically used for:
[0342] Constructing two negative sample entity pairs for the reference entity pair according to the entities in the reference entity pair and the entities in the two target knowledge graphs;
[0343] Based on the entity vectors of the entities in the reference entity pair and the entity vectors of the entities in the negative sample entity pair, respectively calculating the entity distance of the reference entity pair and the entity distance of the negative sample entity pair;
[0344] The loss value is calculated based on the entity distance in the reference entity pair and the entity distance of the negative sample entity pair.
[0345] Optionally, in a specific implementation of the present application, the reference entity pair includes a first reference entity and a second reference entity; the first reference entity and the second reference entity belong to different target knowledge graphs respectively;
[0346] The second training module is further specifically used for:
[0347] Constructing a first negative entity pair according to a first reference entity and a first negative entity in the reference entity pair; the first negative entity is selected from a target knowledge graph to which the second reference entity belongs;
[0348] A second negative entity pair is constructed based on a second reference entity and a second negative entity in the reference entity pair; the second negative entity is selected from a target knowledge graph to which the first reference entity belongs.
[0349] Optionally, in a specific implementation of the present application, the first negative sample entity and the second negative sample entity are randomly selected entities.
[0350] Optionally, in a specific implementation of the present application, the first preset condition is the shortest distance; the two target knowledge graphs are respectively the first target knowledge graph and the second target knowledge graph; the first target knowledge graph is composed of the first entity, and the second target knowledge graph is composed of the second entity;
[0351] The second training module is further specifically used for:
[0352] The first entity in the first target knowledge graph that does not belong to the benchmark set is taken as the target entity, and the following operations are performed respectively:
[0353] Based on the entity vector of the target entity and the entity vector of the second entity in the second target knowledge graph, determine the second entity closest to the target entity to obtain a candidate entity for the target entity;
[0354] Based on the entity vector of the candidate entity and the entity vector of the first entity in the first target knowledge graph, determining whether the first entity closest to the candidate entity is the target entity;
[0355] If so, the target entity and the candidate entity are taken as a reference entity pair and added to the reference set.
[0356] Optionally, in a specific implementation of the present application, the second identification module is specifically used to:
[0357] Inputting the at least two knowledge graphs into the first entity alignment model;
[0358] According to the first entity alignment model, an alignment entity in the knowledge graph is determined.
[0359] Optionally, in a specific implementation of the present application, the second training module is further specifically used for:
[0360] Determine the entity vectors of entities in the two target knowledge graphs based on the vector generation model;
[0361] Determining a loss value of the vector generation model based on entity vectors of entities in the two target knowledge graphs and entity vectors of entities in a benchmark set; the benchmark set includes partially aligned entities in the two target knowledge graphs;
[0362] Adjusting parameters of the vector generation model based on the loss value, and updating the entity vector of the entity based on the adjusted vector generation model;
[0363] Based on the updated entity vector of the entity, entities in the two target knowledge graphs whose distances satisfy a first preset condition are expanded to the benchmark set;
[0364] Continue to train the vector generation model, and when the training is completed, determine the vector generation model as the second entity alignment model.
[0365] Optionally, in a specific implementation of the present application, the second identification module is specifically used to:
[0366] For any two knowledge graphs of at least two knowledge graphs, inputting first vectors of entities in the two knowledge graphs into a second entity alignment model;
[0367] generating a second vector of the entity according to the second entity alignment model;
[0368] Based on the second vector of the entity, entities whose distances from each other satisfy a second preset condition are extracted from the two knowledge graphs to obtain aligned entities in the two knowledge graphs.
[0369] Optionally, in a specific implementation of the present application, the second training module is further specifically used to: extract entity feature vectors of M neighbor entities of the entity;
[0370] A second vector of the entity is calculated based on the first vector of the entity, entity feature vectors of the M neighboring entities, and pre-trained weight parameters in the two-entity alignment model.
[0371] Optionally, in a specific implementation of the present application, the second preset condition is that the distance is less than a preset value.
[0372] Optionally, in a specific embodiment of the present application, the conditions for the end of the training include: the loss value meets the convergence condition, or there are no entities in the two target knowledge graphs that do not belong to the benchmark set and the distance between them meets the first preset condition.
[0373] The embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a device, the device can execute instructions (instructions) of each method step in the embodiment of the present application.
[0374] Embodiments of the present application provide one or more machine-readable media on which instructions are stored. When executed by one or more processors, the electronic device executes one or more of the methods described in the above embodiments.
[0375] The embodiments of the present disclosure may be implemented as an apparatus configured as desired using any appropriate hardware, firmware, software, or any combination thereof, and the apparatus may include electronic devices such as a server (cluster), a mobile device, and a terminal device. Fig. 20 An exemplary apparatus 1800 that can be used to implement various embodiments described in this application is schematically illustrated.
[0376] For one embodiment, Fig. 20 An exemplary apparatus 1800 is shown having one or more processors 1802, a control module (chip set) 1804 coupled to at least one of the (one or more) processors 1802, a memory 1806 coupled to the control module 1804, a non-volatile memory (NVM) / storage device 1808 coupled to the control module 1804, one or more input / transmission devices 1811 coupled to the control module 1804, and a network interface 1812 coupled to the control module 1806.
[0377] The processor 1802 may include one or more single-core or multi-core processors, and the processor 1802 may include any combination of general-purpose processors or special-purpose processors (such as graphics processors, application processors, baseband processors, etc.). In some embodiments, the device 1800 can be used as a server (cluster), mobile device, terminal device, etc. in the embodiments of the present application.
[0378] In some embodiments, the device 1800 may include one or more computer-readable media (e.g., memory 1806 or NVM / storage device 1808) having instructions 1804 and one or more processors 1802 configured to execute the instructions 1804 in combination with the one or more computer-readable media to implement the module to perform the actions described in the present disclosure.
[0379] For one embodiment, the control module 1804 may include any suitable interface controller to provide any suitable interface to at least one of the processor(s) 1802 and / or any suitable device or component in communication with the control module 1804 .
[0380] The control module 1804 may include a memory controller module to provide an interface to the memory 1806. The memory controller module may be a hardware module, a software module, and / or a firmware module.
[0381] The memory 1806 may be used, for example, to load and store data and / or instructions 1804 for the device 1800. For one embodiment, the memory 1806 may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the memory 1806 may include a double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).
[0382] For one embodiment, the control module 1804 may include one or more input / transmit controllers to provide an interface to the NVM / storage device 1808 and the input / transmit device(s) 1800 .
[0383] For example, NVM / storage 1808 may be used to store data and / or instructions 1804. NVM / storage 1808 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).
[0384] NVM / storage device 1808 may include storage resources that are physically part of the device on which apparatus 1800 is installed, or it may be accessible to the device without being part of the device. For example, NVM / storage device 1808 may be accessed via (one or more) input / transmission devices 1800 over a network.
[0385] (One or more) input / transmission devices 1800 may provide an interface for the apparatus 1800 to communicate with any other appropriate device, and the input / transmission device 1800 may include a communication component, an audio component, a sensor component, etc. The network interface 1802 may provide an interface for the apparatus 1800 to communicate through one or more networks, and the apparatus 1800 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, for example, accessing a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, etc., or a combination thereof for wireless communication.
[0386] For one embodiment, at least one of the processor(s) 1802 may be packaged together with the logic of one or more controllers (e.g., a memory controller module) of the control module 1804. For one embodiment, at least one of the processor(s) 1802 may be packaged together with the logic of one or more controllers of the control module 1804 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 1802 may be integrated on the same die with the logic of one or more controllers of the control module 1204. For one embodiment, at least one of the processor(s) 1202 may be integrated on the same die with the logic of one or more controllers of the control module 1804 to form a system-on-chip (SoC).
[0387] In various embodiments, the device 1800 may be, but is not limited to, a terminal device such as a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the device 1800 may have more or fewer components and / or different architectures. For example, in some embodiments, the device 1800 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.
[0388] An embodiment of the present application provides an electronic device, comprising: one or more processors; and, having executable codes stored thereon, wherein when the executable codes are executed, the processors execute the aforementioned method.
[0389] The embodiments of the present application provide one or more machine-readable media on which executable codes are stored. When the executable codes are executed, the processor executes the aforementioned method.
[0390] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0391] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0392] The present application embodiment is described with reference to the flowchart and / or block diagram of the method, terminal device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the process and / or box in the flowchart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device produce a device for realizing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.
[0393] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0394] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce computer-implemented processing, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0395] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0396] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0397] The above is a detailed introduction to a business object publishing method and device, an entity publishing method and device, an electronic device and a storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A business object publishing method, applied to a first server, characterized in that: The method comprises: receiving a publish request for a target business object; In response to the publishing request, determining a second business object corresponding to the target business object in a second server based on aligned business objects in at least two business object knowledge graphs; Obtaining relevant information of a corresponding second business object in the second server; the relevant information is detailed information of the second business object; The target business object is published according to the relevant information; the target business object includes the relevant information of the second business object; The publishing the target business object according to the relevant information includes: The relevant information of the second business object is used as the relevant information of the target business object, and the target business object is published.
2. The method according to claim 1, characterized in that The method further comprises: The relevant information of the corresponding second business object is converted into relevant information conforming to a first target language; the first target language is a language used by the first server.
3. The method according to claim 1, characterized in that The method further comprises: In the case of determining that the relevant information of the target business object in the first server is updated, determining a second business object corresponding to the target business object in the second server based on the aligned business objects in the at least two business object knowledge graphs; Based on the updated relevant information of the target business object, the relevant information of the second business object is updated.
4. The method according to claim 1, characterized in that: The method further comprises: receiving a build request for building website data; In response to the construction request, determining a second business object corresponding to the first business object to be constructed in the first server in the second server based on the aligned business objects in the at least two business object knowledge graphs; The relevant information corresponding to the second business object is obtained from the second server as the data of the first business object to construct the website data.
5. The method according to claim 1, characterized in that The method further comprises: A business object alignment model is bidirectionally iterated on at least two business object knowledge graphs according to a preset vector generation model; wherein the bidirectional iterative training is used to expand a benchmark set during the training of the vector generation model; the benchmark set includes partially aligned business objects of the at least two business object knowledge graphs; The at least two business object knowledge graphs are identified according to a preset business object alignment model to obtain aligned business objects in the at least two business object knowledge graphs.
6. The method according to claim 5, characterized in that The step of performing bidirectional iterative training on at least two business object knowledge graphs according to a preset vector generation model for a business object alignment model includes: Determine the vectors of the business objects in the two target business object knowledge graphs according to the business object vector generation model; Determining a loss value of the business object vector generation model based on vectors of business objects in the two target business object knowledge graphs and vectors of business objects in a business object benchmark set; the business object benchmark set includes partially aligned business objects in the two target business object knowledge graphs; Adjusting parameters of the business object vector generation model based on the loss value, and updating the vector of the business object based on the adjusted business object vector generation model; Based on the updated vector of the business object, business objects whose distances between the two target business object knowledge graphs satisfy a first preset condition are expanded to the business object benchmark set; Continue to train the business object vector generation model, and when the training is completed, determine the business object benchmark set as training data; The preset machine learning model is trained according to the training data to obtain a first business object alignment model.
7. The method according to claim 6, characterized in that The identifying the at least two business object knowledge graphs according to a preset business object alignment model to obtain aligned business objects in the at least two business object knowledge graphs includes: Inputting the at least two business object knowledge graphs into a first business object alignment model; According to the first business object alignment model, the aligned business objects in the business object knowledge graph are determined.
8. The method according to claim 5, characterized in that The step of performing bidirectional iterative training on at least two business object knowledge graphs according to a preset vector generation model for a business object alignment model includes: Determine the vectors of the business objects in the two target business object knowledge graphs according to the business object vector generation model; Determining a loss value of the business object vector generation model based on vectors of business objects in the two target business object knowledge graphs and vectors of business objects in a business object benchmark set; the business object benchmark set includes partially aligned entities in the two target business object knowledge graphs; Adjusting parameters of the business object vector generation model based on the loss value, and updating the vector of the business object based on the adjusted business object vector generation model; Based on the updated vector of the business object, business objects whose distances between the two target business object knowledge graphs satisfy a first preset condition are expanded to the business object benchmark set; Continue to train the business object vector generation model, and when the training is completed, determine the vector generation model as the second business object alignment model.
9. The method according to claim 8, characterized in that The identifying the at least two business object knowledge graphs according to a preset business object alignment model to obtain aligned business objects in the at least two business object knowledge graphs includes: For any two knowledge graphs of at least two business object knowledge graphs, inputting first vectors of business objects in the two business object knowledge graphs into a second business object alignment model; generating a second vector of the business object according to the second business object alignment model; Based on the second vector of the business object, business objects whose distances from each other satisfy a second preset condition are extracted from the two business object knowledge graphs to obtain aligned business objects in the two business object knowledge graphs.
10. An entity publishing method, applied to a first server, characterized in that: The method comprises: receiving a publish request for a target entity; In response to the publishing request, determining a second entity corresponding to the target entity in the second server based on the aligned entities in at least two knowledge graphs; Obtain relevant information of the second entity corresponding to the second server; the relevant information is detailed information of the second entity; Publishing the target entity according to the relevant information; the target entity includes the relevant information of the second entity; The publishing the target entity according to the relevant information includes: The relevant information of the second entity is used as the relevant information of the target entity, and the target entity is published.
11. The method according to claim 10, characterized in that The method further comprises: In the case of determining that the relevant information of the target entity in the first server is updated, determining a second entity corresponding to the target entity in the second server based on the aligned entities in at least two knowledge graphs; Based on the updated relevant information of the target entity, the relevant information of the second entity is updated.
12. The method according to claim 10, characterized in that The method further comprises: receiving a build request for building website data; In response to the construction request, determining a second entity corresponding to a first entity to be constructed in the first server in the second server based on aligned entities in at least two knowledge graphs; The relevant information corresponding to the second entity is obtained from the second server as the data of the first entity to construct the website data.
13. The method according to claim 10, characterized in that The method further comprises: The relevant information of the corresponding second entity is converted into relevant information conforming to a second target language; the second target language is a language used by the first server.
14. The method according to claim 10, characterized in that The entity comprises a user entity, and the method further comprises: After the first user entity in the first server performs the target operation, determining a second user entity corresponding to the first user entity in the second server based on at least two aligned entities in the knowledge graphs; Control the second user entity to perform the target operation in the second server.
15. The method according to claim 10, characterized in that The method further comprises: Performing bidirectional iterative training of entity alignment models on at least two knowledge graphs according to a preset vector generation model; wherein the bidirectional iterative training is used to expand a benchmark set during the training of the vector generation model; the benchmark set includes partially aligned entities of the at least two knowledge graphs; The at least two knowledge graphs are identified according to a preset entity alignment model to obtain aligned entities in the at least two knowledge graphs.
16. The method according to claim 15, characterized in that The method of performing bidirectional iterative training of the entity alignment model on at least two knowledge graphs according to the preset vector generation model includes: Determine the entity vectors of entities in the two target knowledge graphs based on the vector generation model; Determining a loss value of the vector generation model based on entity vectors of entities in the two target knowledge graphs and entity vectors of entities in a benchmark set; the benchmark set includes partially aligned entities in the two target knowledge graphs; Adjusting parameters of the vector generation model based on the loss value, and updating the entity vector of the entity based on the adjusted vector generation model; Based on the updated entity vector of the entity, entities in the two target knowledge graphs whose distances satisfy a first preset condition are expanded to the benchmark set; Continue training the vector generation model, and when the training is completed, determine the benchmark set as training data; The preset machine learning model is trained according to the training data to obtain a first entity alignment model.
17. The method according to claim 16, characterized in that Determining entity vectors of entities in two target knowledge graphs according to the vector generation model includes: For the entities in the two target knowledge graphs, determining a first vector of the entity; The first vector of the entity is input into the vector generation model to generate the second vector of the entity, thereby obtaining the entity vector.
18. The method according to claim 17, characterized in that In the case where the first vector is generated for the first time, the determining the first vector of the entity includes: randomly generating a feature vector for the entity as the first vector of the entity; or obtaining an adjacency matrix of the entity as the first vector of the entity; or generating a semantic vector of the entity based on the semantics of the entity as the first vector of the entity; When the first vector is generated again, the first vector is the second vector of the previous round.
19. The method according to claim 17, characterized in that The step of inputting the first vector of the entity into the vector generation model to generate a second vector of the entity comprises: Extracting entity feature vectors of N neighbor entities of the entity; The second vector of the entity is calculated based on the first vector of the entity, entity feature vectors of the N neighboring entities, and weight parameters in the vector generation model.
20. The method according to claim 16, characterized in that The reference set includes at least one reference entity pair; The determining the loss value of the vector generation model based on the entity vectors of the entities in the two target knowledge graphs and the entity vectors of the entities in the benchmark set includes: Constructing two negative sample entity pairs for the reference entity pair according to the entities in the reference entity pair and the entities in the two target knowledge graphs; Based on the entity vectors of the entities in the reference entity pair and the entity vectors of the entities in the negative sample entity pair, respectively calculating the entity distance of the reference entity pair and the entity distance of the negative sample entity pair; The loss value is calculated based on the entity distance in the reference entity pair and the entity distance of the negative sample entity pair.
21. The method according to claim 20, characterized in that The reference entity pair includes a first reference entity and a second reference entity; the first reference entity and the second reference entity belong to different target knowledge graphs respectively; The constructing two negative sample entity pairs for the reference entity pair according to the entity in the reference entity pair and the entities in the two target knowledge graphs includes: Constructing a first negative entity pair according to a first reference entity and a first negative entity in the reference entity pair; the first negative entity is selected from a target knowledge graph to which the second reference entity belongs; A second negative entity pair is constructed based on a second reference entity and a second negative entity in the reference entity pair; the second negative entity is selected from a target knowledge graph to which the first reference entity belongs.
22. The method according to claim 21, characterized in that The first negative sample entity and the second negative sample entity are randomly selected entities.
23. The method according to claim 16, characterized in that The first preset condition is the shortest distance; the two target knowledge graphs are respectively the first target knowledge graph and the second target knowledge graph; the first target knowledge graph is composed of the first entity, and the second target knowledge graph is composed of the second entity; The step of expanding entities in the two target knowledge graphs whose distances from each other satisfy a first preset condition based on the updated entity vector of the entity to the benchmark set includes: The first entity in the first target knowledge graph that does not belong to the benchmark set is taken as the target entity, and the following operations are performed respectively: Based on the entity vector of the target entity and the entity vector of the second entity in the second target knowledge graph, determine the second entity closest to the target entity to obtain a candidate entity for the target entity; Based on the entity vector of the candidate entity and the entity vector of the first entity in the first target knowledge graph, determining whether the first entity closest to the candidate entity is the target entity; If so, the target entity and the candidate entity are taken as a reference entity pair and added to the reference set.
24. The method according to claim 16, characterized in that The identifying the at least two knowledge graphs according to a preset entity alignment model to obtain aligned entities in the at least two knowledge graphs includes: Inputting the at least two knowledge graphs into the first entity alignment model; According to the first entity alignment model, an alignment entity in the knowledge graph is determined.
25. The method according to claim 15, characterized in that The method of performing bidirectional iterative training of the entity alignment model on at least two knowledge graphs according to the preset vector generation model includes: Determine the entity vectors of entities in the two target knowledge graphs based on the vector generation model; Determining a loss value of the vector generation model based on entity vectors of entities in the two target knowledge graphs and entity vectors of entities in a benchmark set; the benchmark set includes partially aligned entities in the two target knowledge graphs; Adjusting parameters of the vector generation model based on the loss value, and updating the entity vector of the entity based on the adjusted vector generation model; Based on the updated entity vector of the entity, entities in the two target knowledge graphs whose distances satisfy a first preset condition are expanded to the benchmark set; Continue to train the vector generation model, and when the training is completed, determine the vector generation model as the second entity alignment model.
26. The method according to claim 25, characterized in that The identifying the at least two knowledge graphs according to a preset entity alignment model to obtain aligned entities in the at least two knowledge graphs includes: For any two knowledge graphs of at least two knowledge graphs, inputting first vectors of entities in the two knowledge graphs into a second entity alignment model; generating a second vector of the entity according to the second entity alignment model; Based on the second vector of the entity, entities whose distances from each other satisfy a second preset condition are extracted from the two knowledge graphs to obtain aligned entities in the two knowledge graphs.
27. The method according to claim 26, characterized in that Generating a second vector of the entity according to the second entity alignment model includes: Extracting entity feature vectors of M neighbor entities of the entity; A second vector of the entity is calculated based on the first vector of the entity, entity feature vectors of the M neighboring entities, and pre-trained weight parameters in the two-entity alignment model.
28. The method according to claim 27, characterized in that The second preset condition is that the distance is less than a preset value.
29. The method according to claim 16 or 25, characterized in that The conditions for the end of the training include: the loss value meets the convergence condition, or there are no entities in the two target knowledge graphs that do not belong to the benchmark set and whose distances from each other meet the first preset condition.
30. A business object publishing device, applied to a first server, characterized in that: The device comprises: A first receiving module, used to receive a publishing request for a target business object; A first determination module, configured to determine, in response to the publishing request, a second business object corresponding to the target business object in the second server based on aligned business objects in at least two business object knowledge graphs; A first acquisition module is used to acquire relevant information of a second business object corresponding to the second service end; the relevant information is detailed information of the second business object; A first publishing module, configured to publish the target business object according to the relevant information; the target business object includes the relevant information of the second business object; The first publishing module is specifically configured to use the relevant information of the second business object as the relevant information of the target business object and publish the target business object.
31. An entity publishing device, applied to a first server, characterized in that: The device comprises: A third receiving module is used to receive a publishing request for a target entity; A fourth determination module, configured to determine, in response to the publishing request, a second entity corresponding to the target entity in the second server based on the aligned entities in at least two knowledge graphs; A second acquisition module is used to acquire relevant information of a second entity corresponding to the second server; the relevant information is detailed information of the second entity; A second publishing module, configured to publish the target entity according to the relevant information; the target entity includes the relevant information of the second entity; The second publishing module is specifically configured to use the relevant information of the second entity as the relevant information of the target entity and publish it to the target entity.
32. An electronic device, characterized in that: include: processor; and a memory having executable codes stored thereon, which, when executed, cause the processor to perform the method as claimed in one or more of claims 1-9.
33. One or more machine-readable media having executable codes stored thereon, which, when executed, cause a processor to perform the method of one or more of claims 1-9.
34. An electronic device, characterized in that: include: processor; and a memory having executable code stored thereon, which, when executed, causes the processor to perform the method as claimed in one or more of claims 10-29.
35. One or more machine-readable media having executable code stored thereon, which, when executed, causes a processor to perform the method of one or more of claims 10-29.
Citation Information
Patent Citations
Iterative entity alignment model
CN107480191A
Generation methods, generation devices and generation system of service object attribute identifiers
CN108121737A