A data processing method and related device
By adding node information types based on the node information of the graph node, the problem of low accuracy of the graph alignment task in the prior art is solved, the accuracy of node matching is improved, and the model is more suitable for graph alignment.
Patent Information
- Application Number
- CN202110181822.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-08
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2041-02-08
AI Technical Summary
In the prior art, the training-derived model has low accuracy and it is difficult to efficiently implement the graph alignment task.
Based on the node information of the graph node, the node information type is further added as the basis for judging whether the graph node matches, enrich the dimensions of the input data, and thus improve the accuracy of node matching.
By adding node information type as the matching basis, the accuracy of the node matching model is improved, making the model more suitable for graph alignment tasks.
Smart Images

Figure CN113568984B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method and related devices. Background Art
[0002] Knowledge graphs are a popular way to record information nowadays. An effective knowledge graph can store node information corresponding to multiple objects through multiple graph nodes, and store the associations between these node information through the connection relationships between graph nodes. Since there are many kinds of knowledge graphs, and different knowledge graphs may have graph nodes storing node information corresponding to the same object, therefore, aligning these graph nodes corresponding to the same object through graph alignment helps to improve the information richness of the knowledge graph.
[0003] In the related art, the graph alignment task is usually performed through a trained model. However, the trained model in the related art has low accuracy and it is difficult to efficiently implement the graph alignment task. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides a data processing method, in which the processing device can further add the node information type corresponding to the graph node as the basis for judging whether the graph node matches, based on the node information possessed by the graph node, thereby enriching the richness of input data during model training and matching application, thereby improving the accuracy of node matching, and making the trained node matching model more suitable for performing graph alignment tasks.
[0005] The embodiments of the present application disclose the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a data processing method, the method comprising:
[0007] Obtain a set of sample graph node pairs, wherein the sample graph node pairs are annotated with corresponding matching results, wherein the matching results are used to reflect whether multiple sample graph nodes included in the sample graph node pairs correspond to the same object, and the sample graph nodes have corresponding node information types;
[0008] Determine the sample input data corresponding to the sample graph node pair according to the node information and node information type corresponding to the sample graph node included in the sample graph node pair;
[0009] The sample input data corresponding to the sample graph node pairs are used as training samples, and the matching results corresponding to the sample graph node pairs are used as training labels to train the node matching model;
[0010] Get the graph node pairs to be identified;
[0011] Determine the input data corresponding to the graph node pair to be identified according to the node information and node information type corresponding to the graph nodes included in the graph node pair to be identified;
[0012] According to the input data and the trained node matching model, the matching results corresponding to the to-be-identified graph node pairs are determined.
[0013] In a second aspect, an embodiment of the present application provides a data processing device, the device comprising a first acquisition unit, a first determination unit, a training unit, a second acquisition unit, a second determination unit, and a third determination unit:
[0014] The first acquisition unit is used to acquire a set of sample graph node pairs, wherein the sample graph node pairs are annotated with corresponding matching results, wherein the matching results are used to reflect whether a plurality of sample graph nodes included in the sample graph node pairs correspond to the same object, and the sample graph nodes have corresponding node information types;
[0015] The first determining unit is used to determine the sample input data corresponding to the sample graph node pair according to the node information and node information type corresponding to the sample graph node included in the sample graph node pair;
[0016] The training unit is used to train the node matching model by using the sample input data corresponding to the sample graph node pair as training samples and the matching results corresponding to the sample graph node pair as training labels;
[0017] The second acquisition unit is used to acquire the graph node pairs to be identified;
[0018] The second determining unit is used to determine the input data corresponding to the graph node pair to be identified according to the node information and node information type corresponding to the graph nodes included in the graph node pair to be identified;
[0019] The third determination unit is used to determine the matching results corresponding to the to-be-identified graph node pairs based on the input data and the trained node matching model.
[0020] In a third aspect, an embodiment of the present application provides a computer device, the device comprising a processor and a memory:
[0021] The memory is used to store program code and transmit the program code to the processor;
[0022] The processor is used to execute the data processing method described in the first aspect according to the instructions in the program code.
[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the data processing method described in the first aspect.
[0024] It can be seen from the above technical solution that when training the model, firstly, a set of sample graph node pairs can be obtained, in which the sample graph node pairs in the set are annotated with corresponding matching results, and the matching results are used to reflect whether the multiple sample graph nodes included in the sample graph node pair correspond to the same object, wherein each sample graph node has a corresponding node information type. In order to be able to train the node matching model based on information of more dimensions, the sample input data corresponding to the sample graph node pair can be determined based on the node information and node information type corresponding to the sample graph nodes included in the sample graph node pair, and then the sample input data can be used as a training sample, and the matching results corresponding to the sample graph node pair can be used as training labels for training to obtain a node matching model, which can be used to determine the matching results of the graph nodes included in the graph node pair based on the input data of the graph node pair. During the application process, the graph node pair to be identified can be obtained, and then the input data corresponding to the graph node pair to be identified can be determined based on the node information and node information type corresponding to the graph node included in the graph node pair to be identified, and then the matching result corresponding to the graph node to be identified can be determined based on the input data and the node matching model. Since the node information type of the graph node is integrated into the node matching process, the node matching model can analyze whether the graph nodes match from more dimensions, which improves the accuracy of node matching to a certain extent, making the node matching model more suitable for graph alignment. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 A schematic diagram of a data processing method in an actual application scenario provided by an embodiment of the present application;
[0027] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;
[0028] Figure 3 A schematic diagram of a data processing method in an actual application scenario provided by an embodiment of the present application;
[0029] Figure 4 A structural block diagram of a data processing device provided in an embodiment of the present application;
[0030] Figure 5 A structural diagram of a computer device provided in an embodiment of the present application;
[0031] Figure 6 A structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0033] Graph alignment is a common method for organizing and analyzing knowledge graphs. Through graph alignment, graph nodes corresponding to the same object can be determined from multiple knowledge graphs, so that more comprehensive graph nodes can be organized for the object and the information in the knowledge graph can be enriched. In related technologies, when determining graph nodes corresponding to the same object, they are determined only by the node information in the graph nodes. The data richness is low, and it is difficult to train a node matching model with high accuracy.
[0034] In order to solve the above technical problems, the present application provides a data processing method, in which the processing device can further add the node information type corresponding to the graph node as the basis for judging whether the graph node matches, based on the node information possessed by the graph node, thereby enriching the richness of input data during model training and matching application, thereby improving the accuracy of node matching, and making the trained node matching model more suitable for performing graph alignment tasks.
[0035] It is understandable that the method can be applied to a processing device, which is a processing device with a data processing function, for example, a terminal device or a server with a data processing function. The method is independently executed by a terminal device or a server, and can also be applied to a network scenario in which a terminal device and a server communicate, and the terminal device and the server cooperate to operate. Among them, the terminal device can be a mobile phone, a desktop computer, a personal digital assistant (PDA for short), a tablet computer and other devices. The server can be understood as an application server or a Web server. In actual deployment, the server can be an independent physical server or a server cluster or distributed system composed of multiple physical servers. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here.
[0036] In order to facilitate understanding of the technical solution provided by the present application, a data processing method provided by an embodiment of the present application will be introduced below in combination with an actual application scenario.
[0037] See also Figure 1 , Figure 1 A schematic diagram of a data processing method in an actual application scenario provided in an embodiment of the present application. In the actual application scenario, the processing device is a server 101 with a data processing function.
[0038] In order to perform graph alignment, the server 101 can first train a model that can be used for graph node matching. First, the server 101 can obtain a sample graph node pair set, which includes multiple sample graph node pairs annotated with corresponding matching results. The matching results can be used to reflect whether the multiple sample graph nodes included in the sample graph node pair correspond to the same object. In this actual application scenario, a sample graph node pair includes two sample graph nodes, such as Figure 1 As shown, the sample graph node pair may include sample graph node 1 and sample graph node 2.
[0039] In order to improve the matching accuracy of the trained node matching model, the server 101 can obtain multi-dimensional information for the sample graph node, so as to accurately analyze the object corresponding to the sample graph node. In this actual application scenario, the sample graph node can be determined to have a corresponding node information type, such as Figure 1 As shown, sample graph node 1 has corresponding node information type 1, sample graph node 2 has corresponding node information type 2, etc. Server 101 can determine the sample input data corresponding to the sample graph node according to the node information type and node information corresponding to sample graph node 1 and sample graph node 2, and then use the sample input data as a training sample and the matching result 1 corresponding to the sample graph node as a training label to train the node matching model.
[0040] Through the training process, the server 101 can obtain a trained node matching model, which has a certain ability to determine whether the graph nodes match, that is, whether they correspond to the same object. Subsequently, the server 101 can obtain a pair of graph nodes to be identified, which includes graph node 3 and graph node 4. The server 101 can determine the input data corresponding to the graph node pair to be identified based on the node information and node information type corresponding to the graph node 3 and the graph node 4, and then input the input data into the trained node matching model to determine the matching result 2 corresponding to the graph node pair to be identified.
[0041] Because during the training and application process, server 101 further combines the node information type corresponding to the graph node on the basis of the node information corresponding to the graph node, it is able to analyze the objects corresponding to the graph nodes from more dimensions, thereby enabling the trained node matching model to output matching results with higher accuracy, thereby further improving the completion of the graph alignment task based on the use of existing sample data.
[0042] Next, a data processing method provided in an embodiment of the present application will be introduced in conjunction with the accompanying drawings.
[0043] See also Figure 2 , Figure 2 A flowchart of a data processing method provided in an embodiment of the present application, the method comprising:
[0044] S201: Obtain a sample graph node pair set.
[0045] Graph alignment refers to the process of integrating graph nodes corresponding to the same object in different knowledge graphs. Therefore, in order to perform graph alignment, the processing device first needs to find a method that can more efficiently determine whether the objects corresponding to the graph nodes are consistent. Since this process involves analyzing the data information in the graph nodes, and the model is a more efficient and convenient way to process data, the processing device can first determine a model that can match graph nodes.
[0046] In order to train the model, the processing device can first obtain a combination of sample graph node pairs, where the sample graph node pair set includes multiple sample graph node pairs, and a sample graph node pair includes multiple sample graph nodes, usually 2 sample graph nodes, and in some special cases, 3 or more sample graph nodes. During the training process, in order to enable the model to learn how to correctly identify whether multiple graph nodes correspond to the same object, the sample graph node pair is annotated with a corresponding matching result, which is used to reflect whether the multiple sample graph nodes included in the sample graph node pair correspond to the same object.
[0047] For example, the sample graph node pair may be marked with "0" or "1", where 0 indicates that the multiple sample graph nodes in the sample graph node pair do not correspond to the same object, and 1 indicates that the multiple sample graph nodes in the sample graph node pair correspond to the same object.
[0048] Among them, in the architecture of the knowledge graph, each graph node has corresponding node information, and the node information is information related to the object corresponding to the graph node. Therefore, by analyzing the node information of multiple graph nodes, it can be determined to a certain extent whether multiple graph nodes correspond to the same object. However, since graph nodes can correspond to a large number of objects, the information content included in the node information is also relatively messy. If the model is judged on the object corresponding to the graph node only based on the node information, the training difficulty will be too high, and it will be difficult for the model to learn more accurate model parameters from the messy information; at the same time, training based only on node information will result in a relatively single dimension of training data, making it difficult to improve the accuracy of node matching.
[0049] Based on this, in order to improve the accuracy of the model function without affecting the difficulty of model training as much as possible, the processing device can find a type of information that makes it easier for the model to learn based on the node information. It can be understood that although the graph nodes can correspond to a large number of objects, in real life, the number of types to which the objects belong is far less than the number of objects. For example, household appliances can include many types, such as hair dryers, refrigerators, washing machines, etc., but these objects belong to the same category of "household appliances". At the same time, although the node information is relatively messy, it is less difficult to determine the corresponding object by using the node information to determine the category to which the corresponding object of the graph node belongs, and the judgment accuracy is also higher, such as through some common keywords. It can be seen that the node information type is a type of information that is easy for the model to learn, and the node information type refers to the type of object referred to by the node information corresponding to the graph node.
[0050] Based on this, in an embodiment of the present application, the processing device can further integrate the node information type for model training based on the node information. In the acquired sample graph node pair set, the sample graph node can have a corresponding node information type, which can be manually annotated or annotated by the model.
[0051] S202: Determine sample input data corresponding to the sample graph node pair according to the node information and node information type corresponding to the sample graph nodes included in the sample graph node pair.
[0052] In order to enable the model to learn how to determine whether the graph nodes match through node information and node information type, for each sample graph node pair in the sample graph node pair set, the processing device can determine the sample input data corresponding to the sample graph node pair based on the node information and node information type corresponding to the sample graph node included in the sample graph node pair. There are multiple ways for the processing device to determine the input data based on the above information, for example, the input data can be determined in a vector manner, which will be described in detail in the technical content described below.
[0053] S203: Use the sample input data corresponding to the sample graph node pairs as training samples, and the matching results corresponding to the sample graph node pairs as training labels to train the node matching model.
[0054] Among them, the node matching model is a model used to determine whether the graph nodes in the graph node pair match based on the input data, that is, whether they correspond to the same object. It can be seen from the above content that after obtaining the input data in the above manner, the input data can reflect the node information of the graph node and the node information type and other multi-dimensional information. Therefore, in order to enable the node matching model to perform node matching analysis based on the above multi-dimensional information, for each sample graph node pair in the sample graph node pair set, the processing device can use the sample input data corresponding to the sample graph node pair as a training sample, and the matching result corresponding to the sample graph node pair as a training label to train the node matching model.
[0055] During the training process, since the node information type is easier for the model to learn as a learnable feature, and compared with the object, the node information type is a more accurate feature that the model can determine, therefore, through the node information type, the processing device can guide the node matching model to learn the node information, thereby further improving the learning accuracy while minimizing the impact on the learning difficulty.
[0056] For example, during the training process, based on the input matching result labels, the node matching model can not only learn the association between different sample graph nodes in terms of node information, but also learn the association between node information types. Therefore, when the node matching model is applied to node matching, it can match from two dimensions, node information and node information type, thereby improving the accuracy of node matching.
[0057] S204: Obtain graph node pairs to be identified.
[0058] After obtaining the trained node matching model, the processing device can apply the node matching model to the actual node matching process. First, the processing device can obtain a graph node pair to be identified, in which the graph nodes in the graph node pair to be identified do not yet have a clear matching result. It can be understood that in order to make the node matching result more accurate, the number of graph nodes included in a single graph node pair to be identified can be the same as the number of sample graph node pairs included in a single sample graph node pair. Among them, the graph nodes included in each graph node pair to be identified can be arbitrarily selected by the processing device from different knowledge graphs.
[0059] S205: Determine the input data corresponding to the graph node pair to be identified based on the node information and node information type corresponding to the graph nodes included in the graph node pair to be identified.
[0060] Similarly, in order to enable the trained node matching model to perform node matching based on the node information and node information type of the graph nodes, the processing device can determine the input data corresponding to the graph node pair to be identified based on the node information and node information type corresponding to the graph nodes included in the graph node pair to be identified. In order to improve the accuracy of node matching, the method of determining the input data can be the same as the method of determining the sample input data, so that the model can perform node matching based on the same data format and reduce the interference caused by different data formats.
[0061] S206: Determine the matching results corresponding to the graph node pairs to be identified based on the input data and the trained node matching model.
[0062] It can be seen from the above technical solution that when training the model, firstly, a set of sample graph node pairs can be obtained, in which the sample graph node pairs in the set are annotated with corresponding matching results, and the matching results are used to reflect whether the multiple sample graph nodes included in the sample graph node pair correspond to the same object, wherein each sample graph node has a corresponding node information type. In order to be able to train the node matching model based on information of more dimensions, the sample input data corresponding to the sample graph node pair can be determined based on the node information and node information type corresponding to the sample graph nodes included in the sample graph node pair, and then the sample input data can be used as a training sample, and the matching results corresponding to the sample graph node pair can be used as training labels for training to obtain a node matching model, which can be used to determine the matching results of the graph nodes included in the graph node pair based on the input data of the graph node pair. During the application process, the graph node pair to be identified can be obtained, and then the input data corresponding to the graph node pair to be identified can be determined based on the node information and node information type corresponding to the graph node included in the graph node pair to be identified, and then the matching result corresponding to the graph node to be identified can be determined based on the input data and the node matching model. Since the node information type of the graph node is integrated into the node matching process, the node matching model can analyze whether the graph nodes match from more dimensions, which improves the accuracy of node matching to a certain extent, making the node matching model more suitable for graph alignment.
[0063] It is understandable that when training a model, the more sample data is input, the better the model training effect is. Through the above technical content, the processing device has obtained a node matching model that can more accurately identify the matching results of graph node pairs. Therefore, in order to further improve the training quality of the model, the processing device can obtain more training samples through the trained node matching model to further train the node matching model.
[0064] Among them, since the trained node matching model may also have certain errors, not all matching results determined by the node matching model have high confidence, that is, not all matching results are relatively reliable. In a possible implementation, in order to further improve the accuracy of model training, the processing device can select the matching results with high confidence determined by the trained node matching model to further train the node matching model.
[0065] For example, in an embodiment of the present application, the matching result may include a matching confidence, which is used for the accuracy of the matching result. The higher the matching confidence, the higher the accuracy of the matching result determined by the node matching model. The processing device can set a preset threshold, and then obtain the target to-be-identified graph node pair whose confidence is greater than the preset threshold, that is, the node matching model has a higher accuracy rate when determining the matching result of the target to-be-identified graph node pair. Thus, the target to-be-identified graph node pair and its corresponding matching result can form a set of high-quality training data.
[0066] The processing device can determine the target graph node pair to be identified as a sample graph node pair, and repeatedly execute the step of determining the sample input data corresponding to the sample graph node pair based on the node information and node information type corresponding to the sample graph nodes included in the sample graph node pair. Then, the node matching model trained in the above process can be further trained through the target graph node pair to be identified, thereby improving the matching accuracy of the model.
[0067] As mentioned above, when performing node matching, the processing device can perform multi-dimensional matching based on the node information type corresponding to the graph node. In addition, the node information type can also be used to further verify the matching results. It can be understood that in objective laws, although the same object may be divided into multiple types, in most cases, there may be multiple types that cannot coexist for the same object. For example, although the object "Samoyed" can be classified into the node information type of "dog" and the node information type of "animal", it is impossible to classify the object into the node information type of "inorganic matter".
[0068] Based on this, after the processing device determines the target graph node pair to be identified, in order to further improve the accuracy of the matching result, the matching result can be further verified based on the node information types of multiple graph nodes included in the target graph node pair to be identified. In one possible implementation, if the matching result corresponding to the target graph node pair to be identified is that the included graph nodes correspond to the same object, the processing device can determine the target node information type corresponding to the graph nodes included in the target graph node pair to be identified, and determine whether there are conflicting node information types in the target node information type. Conflicting node information types refer to node information types that cannot correspond to the same object, such as the above-mentioned node information types "animal" and "inorganic matter".
[0069] If it is determined that the target information type does not include conflicting node information types, it means that from the perspective of node information types, the probability that multiple graph nodes in the target to-be-identified graph node pair correspond to the same object is high. At this time, the processing device can determine the target to-be-identified graph node pair as a sample graph node pair, and repeatedly perform the step of determining the sample input data corresponding to the sample graph node pair based on the node information and node information type corresponding to the sample graph node included in the sample graph node pair.
[0070] As mentioned above, there may be multiple methods for determining sample input data based on node information and node information type. In one possible implementation, in order to more accurately reflect the node information and node information type, the processing device may express the node information and node information type in the form of a vector.
[0071] When performing model training, the processing device can determine a first node information vector based on the node information corresponding to the sample graph node, and the first node information vector is used to reflect the node information corresponding to the sample graph node from a vector level; determine a first information type vector based on the node information type corresponding to the sample graph node, and the first information type vector is used to reflect the node information type corresponding to the sample graph node from a vector level. The processing device can generate a first node feature vector corresponding to the sample graph node by splicing the first node information vector and the first information type vector, so that the node information type corresponding to the sample graph node can be integrated into the feature vector. The processing device can determine the first node feature vector corresponding to the sample graph node included in the sample graph node pair as the sample input data corresponding to the sample graph node pair.
[0072] Similarly, when determining the matching results corresponding to the graph node pair to be identified through the model, the processing device can also determine the input data corresponding to the graph node pair to be identified in the form of a vector. In one possible implementation, the processing device can determine a second node information vector based on the node information corresponding to the graph node, and the second node information vector is used to reflect the node information of the graph node from a vector level; determine a second information type vector based on the node information type corresponding to the graph node, and the second information type vector is used to reflect the node information type of the graph node from a vector level. The processing device can generate a second node feature vector corresponding to the graph node by splicing the second node information vector and the second information type vector.
[0073] When determining the input data corresponding to the graph node pair to be identified, the processing device may determine the second node feature vector corresponding to the graph node included in the graph node pair to be identified as the input data corresponding to the graph node pair to be identified. When performing node matching, the trained node matching model can analyze the node information and node information type of the graph node through the second node feature vector corresponding to each graph node, so as to judge the degree of matching between multiple graph nodes included in a graph node pair to be identified in terms of node information and node information type.
[0074] It is understandable that when determining the node information type corresponding to the graph node and the sample graph node in the above process, the specific determination method may also include multiple methods. In one possible implementation, in order to improve the accuracy of the node information type, the processing device may determine the node information type through an information classification model, and the information classification model may be used to determine the corresponding node information type based on the node information.
[0075] The information classification model can be trained in the following manner: the processing device can obtain sample node information, and the sample node information is labeled with the corresponding node information type. The processing device can use the sample node information as a training sample and the corresponding node information type as a training label to train the information classification model. Since the number of node information types is much smaller than the number of node information, and determining the node information type is a relatively simple learning task for the model, the processing device can easily train the information classification model and ensure the model accuracy of the model as much as possible.
[0076] It can be understood that since the node matching model is based on the node information and node information type of the graph node, in order to further improve the model accuracy of the node matching model, the processing device can also improve the accuracy of determining the node information type during the training process.
[0077] In one possible implementation, when training the node matching model, the processing device can determine the initial matching result output by the node matching model based on the sample input data corresponding to the sample graph node pair and the node matching model, and then determine the difference parameter based on the initial matching result and the matching result corresponding to the sample graph node pair.
[0078] When training the model, the processing device can not only make the model parameters in the node matching model more accurate, but also further improve the model parameters in the information classification model, so that the node information type determined by the information classification model is more accurate. Based on this, the processing device can train the node matching model and the information classification model according to the difference parameter to obtain the trained node matching model and the trained information classification model. When training the node matching model, the processing device can adjust the parameters of the node matching model so that the initial matching result of the node matching model gradually approaches the matching result corresponding to the sample graph node pair. In the parameter adjustment process, the node matching model can learn the knowledge related to node matching at the level of node information and node information type. At the same time, when training the information classification model, the processing device can also adjust the model parameters in the information classification model so that the initial matching result output based on the node information type determined by the information classification model can be closer to the matching result, so that when the trained information classification model determines the node information type, the determined node information type can more effectively help the node matching model to analyze whether the graph node corresponds to the same object, further improving the accuracy of the node matching model.
[0079] In order to facilitate understanding of the technical solution provided by the embodiment of the present application, a data processing method provided by the embodiment of the present application will be introduced below in combination with an actual application scenario.
[0080] See also Figure 3 , Figure 3 A schematic diagram of a data processing method in an actual application scenario provided in an embodiment of the present application. In this actual application scenario, the processing device is a server capable of performing model training and data processing.
[0081] After obtaining the sample graph node pair, the server can input the sample graph node pair into the node matching model and the information classification model. The information classification model can determine the corresponding node information type based on the node information of the sample graph node, and then send the node information type to the node matching model for encoding and splicing to generate the first node feature vector corresponding to the sample graph node. The server can train the node matching model based on the first node feature vector to obtain a trained node matching model.
[0082] The server can determine the matching results corresponding to the graph node pairs to be identified through the trained node matching model. First, the server can input the graph node pairs to be identified into the node matching model and the information classification model, and obtain the second node feature vector corresponding to the graph nodes in the graph node pairs to be identified through coding splicing. The trained node matching model can perform node matching based on the second node feature vector to obtain the matching results corresponding to the graph node pairs to be identified. Based on the confidence level, the server can select the graph node pairs to be identified with higher confidence matching results as the target graph node pairs to be identified, and then perform node information type screening based on the target node information type corresponding to the target graph node pairs to be identified, and select the target graph node pairs to be identified that are more reasonable at the node information type level.
[0083] The server can use the target graph node pairs to be identified obtained after two screenings as new sample graph node pairs, and continue to perform a new round of training on the node matching model, thereby further improving the training degree of the node matching model.
[0084] Among them, the server can perform encoding splicing in the following ways:
[0085] A knowledge graph can be defined as G = (E, R, T), where E, R, and T are the entity set, relationship set, and triple combination of the knowledge graph, respectively. Entity refers to the node information in the graph node, and relationship refers to the association relationship between graph nodes. A triple includes two graph nodes with an association relationship and the corresponding association relationship. Among them, a triple can be expressed as (h, r, t), where h represents the head entity, r represents the association relationship, and t represents the tail entity. h, r, and t represent the vectors corresponding to h, r, and t.
[0086] For two different sample knowledge graphs G i =(E i ,R i ,T i ), G j =(E j ,R j ,T j ) and graph node pairs In the graph alignment task, it is necessary to match the graph nodes that have not been matched yet. and is the first node information vector corresponding to the sample graph node,
[0087] The first node information vector is determined in the following manner:
[0088] f E (h,r,t)=||h+rt||2
[0089] This formula can be optimized using the following loss function:
[0090]
[0091] Among them, [X] + =max(0,x), γ1, γ2 are hyperparameters used to control the distance between positive and negative samples, α is a hyperparameter for balancing the ratio of positive and negative samples, and T' is a negative sample generated by randomly replacing the head or tail entity of a triplet.
[0092] In order to enable the model to perform node matching based on both node information and node information type, a first information type vector c can be determined for each sample graph node. For example, the vector c can be determined by a long short-term memory artificial neural network model (Long Short-Term Memory, referred to as LSTM), such as c = f(e), where f is an LSTM. The server can concatenate the first information type vector with the first node information vector to obtain a first node feature vector for each sample graph node. For example, the first node feature vector can be expressed as M = (e, c), where c∈K, and K is a set of information category vectors.
[0093] When performing node matching, the server may determine whether the two first node feature vectors match by the vector similarity, which may be achieved, for example, by the following formula:
[0094] L A =||YM i -M j ||
[0095] Among them, L A It can reflect the difference between the two vectors. If the matching result of the sample graph node pair corresponds to the same node, then the L A It should be infinitely close to 0. The server can adjust the parameter Y to make L A Close to 0, the parameter Y can be used as a model parameter in the node matching model. Therefore, in the process of adjusting the parameter Y, the node matching model can learn effective knowledge related to node matching from the level of node information and node information type.
[0096] It can be understood that the data processing method provided in this application can be applied not only to the scenario of graph alignment, but also to other scenarios that require node matching, such as graph-based question and answer, graph semantic expression, graph search, graph reasoning, graph-based relationship prediction, graph-based event extraction, etc.
[0097] Based on the data processing method provided in the above embodiment, the present application embodiment also provides a data processing device, see Figure 4 , Figure 4 A structural block diagram of a data processing device 400 provided in an embodiment of the present application, the device 400 includes a first acquisition unit 401, a first determination unit 402, a training unit 403, a second acquisition unit 404, a second determination unit 405 and a third determination unit 406:
[0098] A first acquisition unit 401 is used to acquire a set of sample graph node pairs, wherein the sample graph node pairs are annotated with corresponding matching results, wherein the matching results are used to reflect whether multiple sample graph nodes included in the sample graph node pairs correspond to the same object, and the sample graph nodes have corresponding node information types;
[0099] A first determining unit 402, configured to determine sample input data corresponding to the sample graph node pair according to node information and node information type corresponding to the sample graph nodes included in the sample graph node pair;
[0100] A training unit 403 is used to train a node matching model by using the sample input data corresponding to the sample graph node pair as a training sample and the matching results corresponding to the sample graph node pair as a training label;
[0101] The second acquisition unit 404 is used to acquire the graph node pairs to be identified;
[0102] The second determining unit 405 is used to determine the input data corresponding to the graph node pair to be identified according to the node information and node information type corresponding to the graph nodes included in the graph node pair to be identified;
[0103] The third determination unit 406 determines the matching result corresponding to the to-be-identified graph node pair according to the input data and the trained node matching model.
[0104] In a possible implementation, the matching result includes a matching confidence, and the matching confidence is used to identify the correctness of the matching result. The apparatus 400 further includes a third acquisition unit and an execution unit:
[0105] A third acquisition unit is used to acquire a target to-be-identified graph node pair whose matching confidence is greater than a preset threshold;
[0106] An execution unit is used to determine the target graph node pair to be identified as the sample graph node pair, and repeatedly execute the step of determining the sample input data corresponding to the sample graph node pair based on the node information and node information type corresponding to the sample graph nodes included in the sample graph node pair.
[0107] In a possible implementation, the execution unit is specifically used for:
[0108] If the matching result corresponding to the target to-be-identified graph node pair is that the included graph nodes correspond to the same object, determine the target node information type corresponding to the graph nodes included in the target to-be-identified graph node pair;
[0109] If it is determined that the target node information type does not include conflicting node information types, the target graph node pair to be identified is determined as the sample graph node pair, and the step of determining the sample input data corresponding to the sample graph node pair based on the node information and node information type corresponding to the sample graph nodes included in the sample graph node pair is repeated.
[0110] In a possible implementation manner, the first determining unit 402 is specifically configured to:
[0111] Determine a first node information vector according to the node information corresponding to the sample graph node;
[0112] Determine a first information type vector according to the node information type corresponding to the sample graph node;
[0113] Generate a first node feature vector corresponding to the sample graph node by concatenating the first node information vector and the first information type vector;
[0114] The first node feature vector corresponding to the sample graph node included in the sample graph node pair is determined as the sample input data corresponding to the sample graph node pair.
[0115] In a possible implementation manner, the second determining unit 405 is specifically configured to:
[0116] Determine a second node information vector according to the node information corresponding to the graph node;
[0117] Determine a second information type vector according to the node information type corresponding to the graph node;
[0118] Generate a second node feature vector corresponding to the graph node by concatenating the second node information vector and the second information type vector;
[0119] The second node feature vector corresponding to the graph node included in the graph node pair to be identified is determined as the input data corresponding to the graph node pair to be identified.
[0120] In a possible implementation manner, the node information type is determined by an information classification model, and the information classification model is used to determine the corresponding node information type based on the node information.
[0121] In a possible implementation, the training unit 403 is specifically configured to:
[0122] Determine an initial matching result output by the node matching model according to the sample input data corresponding to the sample graph node pair and the node matching model;
[0123] Determining a difference parameter according to the initial matching result and the matching result corresponding to the sample graph node pair;
[0124] The node matching model and the information classification model are trained according to the difference parameters to obtain the trained node matching model and the trained information classification model. The adjusted information classification model can be used to determine the node information type in a subsequent process.
[0125] The present application also provides a computer device, which is described below in conjunction with the accompanying drawings. Figure 5 As shown, the embodiment of the present application provides a device, which may also be a terminal device. The terminal device may be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a point of sales (POS), a vehicle-mounted computer, etc., and the terminal device is a mobile phone as an example:
[0126] Figure 5 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Figure 5 The mobile phone includes: a radio frequency (RF) circuit 810, a memory 820, an input unit 830, a display unit 840, a sensor 850, an audio circuit 860, a wireless fidelity (WiFi) module 870, a processor 880, and a power supply 890. Those skilled in the art will understand that Figure 5 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0127] Combine the following Figure 5 A detailed introduction to the various components of the mobile phone:
[0128] The RF circuit 810 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 880 for processing; in addition, the designed uplink data is sent to the base station. Usually, the RF circuit 810 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, referred to as LNA), a duplexer, etc. In addition, the RF circuit 810 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0129] The memory 820 can be used to store software programs and modules. The processor 880 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 820. The memory 820 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 820 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0130] The input unit 830 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 830 may include a touch panel 831 and other input devices 832. The touch panel 831, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 831 or near the touch panel 831 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 831 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 880, and can receive and execute commands sent by the processor 880. In addition, the touch panel 831 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 831, the input unit 830 may also include other input devices 832. Specifically, the other input devices 832 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.
[0131] The display unit 840 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 840 may include a display panel 841. Optionally, the display panel 841 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), etc. Further, the touch panel 831 may cover the display panel 841. When the touch panel 831 detects a touch operation on or near it, it is transmitted to the processor 880 to determine the type of touch event. Subsequently, the processor 880 provides a corresponding visual output on the display panel 841 according to the type of touch event. Although in Figure 5 In the embodiment, the touch panel 831 and the display panel 841 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 831 and the display panel 841 can be integrated to realize the input and output functions of the mobile phone.
[0132] The mobile phone may also include at least one sensor 850, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 841 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 841 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0133] The audio circuit 860, the speaker 861, and the microphone 862 can provide an audio interface between the user and the mobile phone. The audio circuit 860 can transmit the received audio data to the speaker 861 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 862 converts the collected sound signal into an electrical signal, which is received by the audio circuit 860 and converted into audio data, and then the audio data is output to the processor 880 for processing, and then sent to another mobile phone through the RF circuit 810, or the audio data is output to the memory 820 for further processing.
[0134] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 870. It provides users with wireless broadband Internet access. Figure 5 A WiFi module 870 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.
[0135] The processor 880 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 820, and calling data stored in the memory 820. Optionally, the processor 880 may include one or more processing units; preferably, the processor 880 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 880.
[0136] The mobile phone also includes a power supply 890 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 880 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions.
[0137] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0138] In this embodiment, the processor 880 included in the terminal device also has the following functions:
[0139] Obtain a set of sample graph node pairs, wherein the sample graph node pairs are annotated with corresponding matching results, wherein the matching results are used to reflect whether multiple sample graph nodes included in the sample graph node pairs correspond to the same object, and the sample graph nodes have corresponding node information types;
[0140] Determine the sample input data corresponding to the sample graph node pair according to the node information and node information type corresponding to the sample graph node included in the sample graph node pair;
[0141] The sample input data corresponding to the sample graph node pairs are used as training samples, and the matching results corresponding to the sample graph node pairs are used as training labels to train the node matching model;
[0142] Get the graph node pairs to be identified;
[0143] Determine the input data corresponding to the graph node pair to be identified according to the node information and node information type corresponding to the graph nodes included in the graph node pair to be identified;
[0144] According to the input data and the trained node matching model, the matching results corresponding to the to-be-identified graph node pairs are determined.
[0145] The present application also provides a server. Figure 6 As shown, Figure 6The structural diagram of the server 900 provided in the embodiment of the present application, the server 900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 922 (for example, one or more processors) and a memory 932, and one or more storage media 930 (for example, one or more mass storage devices) storing application programs 942 or data 944. Among them, the memory 932 and the storage medium 930 can be temporary storage or permanent storage. The program stored in the storage medium 930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 922 can be configured to communicate with the storage medium 930 and execute a series of instruction operations in the storage medium 930 on the server 900.
[0146] The server 900 may also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input and output interfaces 958, and / or one or more operating systems 941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0147] The steps performed by the server in the above embodiment can be based on Figure 6 The server structure shown.
[0148] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program, wherein the computer program is used to execute any one of the data processing methods described in the aforementioned embodiments.
[0149] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.
[0150] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0151] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data processing method, characterized in that: The method comprises: Obtain a set of sample graph node pairs, wherein the sample graph node pairs are annotated with corresponding matching results, wherein the matching results are used to reflect whether multiple sample graph nodes included in the sample graph node pairs correspond to the same object, wherein the sample graph nodes have corresponding node information types, wherein the node information type is an electrical appliance, and the object is a hair dryer, a refrigerator, or a washing machine; Determine the sample input data corresponding to the sample graph node pair according to the node information and node information type corresponding to the sample graph node included in the sample graph node pair; The sample input data corresponding to the sample graph node pairs are used as training samples, and the matching results corresponding to the sample graph node pairs are used as training labels to train the node matching model; Get the graph node pairs to be identified; Determine the input data corresponding to the graph node pair to be identified according to the node information and node information type corresponding to the graph nodes included in the graph node pair to be identified; According to the input data and the trained node matching model, the matching results corresponding to the to-be-identified graph node pairs are determined.
2. The method according to claim 1, characterized in that The matching result includes a matching confidence, and the matching confidence is used to identify the correctness of the matching result. The method further includes: Obtain target graph node pairs to be identified whose matching confidence is greater than a preset threshold; Determine the target graph node pair to be identified as the sample graph node pair, and repeat the step of determining the sample input data corresponding to the sample graph node pair based on the node information and node information type corresponding to the sample graph nodes included in the sample graph node pair.
3. The method according to claim 2, characterized in that The step of determining the target to-be-identified graph node pair as the sample graph node pair, and repeatedly performing the step of determining the sample input data corresponding to the sample graph node pair according to the node information and the node information type corresponding to the sample graph nodes included in the sample graph node pair, comprises: If the matching result corresponding to the target to-be-identified graph node pair is that the included graph nodes correspond to the same object, determine the target node information type corresponding to the graph nodes included in the target to-be-identified graph node pair; If it is determined that the target node information type does not include conflicting node information types, the target graph node pair to be identified is determined as the sample graph node pair, and the step of determining the sample input data corresponding to the sample graph node pair based on the node information and node information type corresponding to the sample graph nodes included in the sample graph node pair is repeated.
4. The method according to claim 1, characterized in that: The determining, according to the node information and the node information type corresponding to the sample graph nodes included in the sample graph node pair, the sample input data corresponding to the sample graph node pair comprises: Determine a first node information vector according to the node information corresponding to the sample graph node; Determine a first information type vector according to the node information type corresponding to the sample graph node; Generate a first node feature vector corresponding to the sample graph node by concatenating the first node information vector and the first information type vector; The first node feature vector corresponding to the sample graph node included in the sample graph node pair is determined as the sample input data corresponding to the sample graph node pair.
5. The method according to claim 4, characterized in that The step of determining input data corresponding to the graph node pair to be identified based on the node information and node information type corresponding to the graph nodes included in the graph node pair to be identified includes: Determine a second node information vector according to the node information corresponding to the graph node; Determine a second information type vector according to the node information type corresponding to the graph node; Generate a second node feature vector corresponding to the graph node by concatenating the second node information vector and the second information type vector; The second node feature vector corresponding to the graph node included in the graph node pair to be identified is determined as the input data corresponding to the graph node pair to be identified.
6. The method according to claim 1, characterized in that The node information type is determined by an information classification model, and the information classification model is used to determine the corresponding node information type based on the node information.
7. The method according to claim 6, characterized in that The method of using the sample input data corresponding to the sample graph node pair as training samples and the matching results corresponding to the sample graph node pair as training labels to train the node matching model includes: Determine an initial matching result output by the node matching model according to the sample input data corresponding to the sample graph node pair and the node matching model; Determining a difference parameter according to the initial matching result and the matching result corresponding to the sample graph node pair; The node matching model and the information classification model are trained according to the difference parameters to obtain the trained node matching model and the trained information classification model. The adjusted information classification model can be used to determine the node information type in a subsequent process.
8. A data processing device, characterized in that: The device comprises a first acquisition unit, a first determination unit, a training unit, a second acquisition unit, a second determination unit and a third determination unit: The first acquisition unit is used to acquire a set of sample graph node pairs, wherein the sample graph node pairs are annotated with corresponding matching results, wherein the matching results are used to reflect whether multiple sample graph nodes included in the sample graph node pairs correspond to the same object, wherein the sample graph nodes have corresponding node information types, wherein the node information type is an electrical appliance, and the object is a hair dryer, a refrigerator, or a washing machine; The first determining unit is used to determine the sample input data corresponding to the sample graph node pair according to the node information and node information type corresponding to the sample graph node included in the sample graph node pair; The training unit is used to train the node matching model by using the sample input data corresponding to the sample graph node pair as training samples and the matching results corresponding to the sample graph node pair as training labels; The second acquisition unit is used to acquire the graph node pairs to be identified; The second determining unit is used to determine the input data corresponding to the graph node pair to be identified according to the node information and node information type corresponding to the graph nodes included in the graph node pair to be identified; The third determination unit is used to determine the matching results corresponding to the to-be-identified graph node pairs based on the input data and the trained node matching model.
9. A computer device, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the data processing method according to any one of claims 1 to 7 according to the instructions in the program code.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the data processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Information processing method and device, information retrieval method and device, and server
CN110377745A
Entity alignment method, device and equipment
CN111597276A