Data attribute completion method and apparatus, device, and medium
By identifying target nodes in graph data and jointly training a policy function and an entity recognition model, the policy function is optimized to construct feature paths. This solves the problem of accuracy in data attribute supplementation during entity parsing and improves the accuracy and robustness of entity recognition.
Patent Information
- Application Number
- PCT/CN2024/124092
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-09
- Filing Date
- 2024-10-11
- Publication Date
- 2026-02-12
AI Technical Summary
In the process of entity parsing, existing technologies suffer from reduced accuracy due to data redundancy, noise interference, and inconsistency from external data sources. Therefore, how to supplement data attributes to improve the accuracy of entity parsing has become an urgent problem to be solved.
By identifying target nodes from graph data, using an initial policy function to supplement the path, constructing a target feature path, and training it in conjunction with an entity recognition model, the policy function is optimized to obtain the final feature path, thus achieving attribute supplementation.
It improves the convergence speed of the policy function and the accuracy of attribute supplementation, thereby enhancing the accuracy of the entity recognition model and its robustness to changes in data distribution.
Smart Images

Figure CN2024124092_12022026_PF_FP_ABST
Abstract
Description
Data attribute supplement method, device, equipment and medium
[0001] The present application is based on the Chinese invention application with the application number 202411093545.1 and the name of "Data attribute supplement method, device, equipment and medium" filed on August 9, 2024, and claims priority thereto. TECHNICAL FIELD
[0002] The present application is applicable to the field of big data technology, and particularly relates to a data attribute supplement method, device, equipment and medium. BACKGROUND
[0003] Entity resolution refers to a process of identifying all references corresponding to the same entity in the real world given one or more reference sets describing the real world, for example, given a data set, entity resolution is a process of identifying all data in the data set pointing to the same real entity. In the process of entity resolution on the data set, if the existing attributes and attribute values and other data information in the data set are insufficient to uniquely identify or distinguish different entities in the process of entity resolution, it is necessary to supplement and enrich the data in the data set according to the data in the external data source. If all data in the external data source is used to enrich the data set, it may affect the accuracy of entity resolution due to data redundancy, noise interference and data inconsistency, etc. For example, irrelevant, incorrect, outdated or null information in the external data source may have a negative impact on the results of entity resolution. Therefore, how to supplement the data attributes to improve the accuracy of entity resolution becomes a problem to be solved.
[0004] SUMMARY
[0005] In view of this, the embodiments of the present application provide a data attribute supplement method, device, equipment and medium to solve the problem of how to supplement the data attributes to improve the accuracy of entity resolution.
[0006] In a first aspect, the embodiments of the present application provide a data attribute supplement method, which comprises:
[0007] determining a target node matched with an entity corresponding to target tuple data from graph data;
[0008] using an initial strategy function to supplement a feature path of the target node in the graph data to obtain a target feature path;
[0009] determining a feature value corresponding to the target feature path from the graph data as attribute supplement data of the target tuple data;
[0010] According to the attribute supplement data, an entity recognition model is trained to obtain a trained entity recognition model, and a performance recognition result of the trained entity recognition model is obtained.
[0011] According to the performance recognition result, the initial strategy function is optimized to obtain a target strategy function, the feature path of the target node is supplemented using the target strategy function to obtain a final feature path, and a feature value corresponding to the final feature path is determined as attribute supplement data of the target tuple data.
[0012] In a second aspect, an embodiment of the present application provides a data attribute supplement device, which comprises:
[0013] A heterogeneous entity analysis module is configured to determine a target node matched with an entity corresponding to target tuple data from graph data.
[0014] A construction module is configured to supplement a feature path of the target node in the graph data using an initial strategy function to obtain a target feature path.
[0015] A determination module is configured to determine a feature value corresponding to the target feature path from the graph data as attribute supplement data of the target tuple data.
[0016] An evaluation module is configured to train an entity recognition model according to the attribute supplement data to obtain a trained entity recognition model, and obtain a performance recognition result of the trained entity recognition model.
[0017] An optimization module is configured to optimize the initial strategy function according to the performance recognition result to obtain a target strategy function, supplement the feature path of the target node using the target strategy function to obtain a final feature path, and determine a feature value corresponding to the final feature path as attribute supplement data of the target tuple data.
[0018] In a third aspect, an embodiment of the present application provides a computer device, which comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the data attribute supplement method of the first aspect when executing the computer program.
[0019] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the data attribute supplement method of the first aspect.
[0020] Compared with the prior art, the application has the beneficial effects that: the application determines the target node matched with the target tuple data from the graph data, uses the initial strategy function to perform path supplement on the feature path of the target node in the graph data to obtain a target feature path, determines the feature value corresponding to the target feature path as attribute supplement data of the target tuple data, trains the entity recognition model according to the attribute supplement data to obtain a trained entity recognition model, obtains a performance recognition result of the trained entity recognition model, optimizes the initial strategy function according to the performance recognition result to obtain a target strategy function, performs path supplement according to the target strategy function to obtain a final feature path, and determines the feature value corresponding to the final feature path as attribute supplement result of the target tuple data. Through joint training of the strategy function and the entity recognition model, the strategy function and the entity recognition model interact and influence each other in the training process, the strategy function is optimized based on the performance recognition result of the entity recognition model, the strategy function can learn effective strategies more quickly, the convergence speed of the strategy function and the accuracy of attribute supplement are improved, the target tuple data after attribute supplement based on the feature path constructed by the strategy function is trained to improve the accuracy of entity analysis of the entity recognition model, and the robustness of the entity recognition model to data distribution changes is also improved in the joint training process. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the application. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0022] Fig. 1 is a schematic diagram of an application environment of a data attribute supplement method provided by an embodiment of the application;
[0023] Fig. 2 is a flowchart of a data attribute supplement method provided by an embodiment of the application;
[0024] Fig. 3 is a schematic diagram of graph data provided by an embodiment of the application;
[0025] Fig. 4 is a schematic diagram of target tuple data provided by an embodiment of the application;
[0026] Fig. 5 is a flowchart of a data attribute supplement method provided by an embodiment of the application;
[0027] Fig. 6 is a flowchart of a data attribute supplement method provided by an embodiment of the application;
[0028] FIG. 7 is a flow diagram of a data attribute supplementing method according to an embodiment of the present application;
[0029] FIG. 8 is a flow diagram of a data attribute supplementing method according to an embodiment of the present application;
[0030] FIG. 9 is a flow diagram of a data attribute supplementing method according to an embodiment of the present application;
[0031] FIG. 10 is a flow diagram of a data attribute supplementing method according to an embodiment of the present application;
[0032] FIG. 11 is a structural diagram of a data attribute supplementing apparatus according to an embodiment of the present application;
[0033] FIG. 12 is a structural diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0034] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0035] In order to illustrate the technical solutions of the present application, the following will be described by specific embodiments.
[0036] A data attribute supplementing method provided by an embodiment of the present application can be applied in an application environment as shown in FIG. 1. In the application environment, a server and a client communicate with each other. The server provides a data attribute supplementing service, and the client triggers a data attribute supplementing task to the server. The client includes, but is not limited to, a palmtop computer, a desktop computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cloud computer device, a personal digital assistant (PDA), and the like. The computer device corresponding to the server can be implemented by an independent server or a server cluster composed of multiple servers.
[0037] Referring to FIG. 2, a flow diagram of a data attribute supplementing method according to an embodiment of the present application is shown. The data attribute supplementing method is applied to the server in FIG. 1. The server is connected to the client to obtain graph data and target tuple data sent by the client. As shown in FIG. 2, the data attribute supplementing method can include the following steps:
[0038] Step S201, determining a target node matched with a target entity corresponding to the target tuple data from the graph data.
[0039] In the embodiments of the present application, the graph data can refer to a knowledge graph of a graph structure composed of nodes, edges, features of the nodes, and relationship types of the edges. The nodes can represent entities or feature values of the entities in the knowledge graph. The edges can represent relationships between the nodes and relationships between the nodes and the features. The features of the nodes can refer to data associated with the nodes (entities) and used to represent characteristics or states of the nodes. The feature values of the nodes are specific numerical values of the corresponding node features. The target tuple data can refer to a row of data in a data set in a table structure. Each target tuple data is composed of attributes and corresponding attribute values. The attributes can refer to variables or fields describing characteristics of the target tuple data. The attribute values can refer to specific numerical values of the corresponding attributes. The target node can refer to a node in the graph data representing the same real entity as the target tuple data.
[0040] For example, as shown in FIG. 3, a schematic diagram of graph data provided by the second embodiment of the present application is shown. The graph data is a knowledge graph composed of nodes, edges, features of the nodes, and relationship types of the edges. The knowledge graph includes two nodes, v1 and v2. For example, for the node v1, six features are included, namely, name, gender, age, spouse, occupation, and telephone, and the corresponding feature values are “A1, male, 38, v2, writer, 190****6666” in sequence.
[0041] For example, as shown in FIG. 4, a schematic diagram of target tuple data provided by the second embodiment of the present application is shown. The target tuple data is a row of data in a data table, including four attributes, namely, name, gender, age, and occupation, and the corresponding attribute values are “A1, male, 38, writer” in sequence.
[0042] Specifically, the target tuple data and the graph data can be analyzed according to the heterogeneous entity analysis algorithm, and a target node representing the same real entity as the target tuple data can be determined from the graph data.
[0043] Step S202, using an initial strategy function, a feature path of the target node in the graph data is supplemented to obtain a target feature path.
[0044] Step S203, determining attribute supplement data of the target tuple data from a feature value corresponding to the target feature path in the graph data.
[0045] In the embodiments of the present application, the feature path can refer to a path composed of a node, a feature of the node, and a corresponding feature value in the graph data. For example, as shown in FIG. 3, for the node v2, a feature path of the node v2 can refer to a feature path composed of the node v2, the feature "name" of the node, and the corresponding feature value "A2", which can be denoted as p = (v2, v8). The policy function can be represented as a probability density function, and the input is the current state, and the output is the probability distribution of taking each action. For example, in the application scenario of an autonomous vehicle, the policy function can select an action such as acceleration, deceleration, or maintaining the current speed with a certain probability according to the current vehicle speed and road conditions. The policy function can be denoted as p e, where e is a set of parameters that defines the probability distribution of selecting a feature path. The initial policy function can refer to the policy function after parameter initialization. The target feature path can refer to a feature path obtained by supplementing the feature path of the target node in the graph data using the initial policy function. The attribute supplement data can refer to the features and corresponding feature values in the target feature path.
[0046] Specifically, according to the attributes and attribute values of the target tuple data, the initial policy function is used to supplement the feature path of the target node in the graph data to obtain the target feature path, and the features and corresponding feature values in the target feature path are determined as the attribute supplement data of the target tuple data.
[0047] In step S204, the entity recognition model is trained according to the attribute supplement data to obtain a trained entity recognition model, and a performance recognition result of the trained entity recognition model is obtained.
[0048] In the embodiments of the present application, the entity recognition model can refer to a machine learning model for entity analysis, and the performance recognition result can refer to a result of index evaluation of the trained entity recognition model. For example, the gender recognition result can be the F1 score, recall rate, and accuracy of the model.
[0049] Specifically, for any target tuple data in the data set, the attribute supplement data is used to supplement the attributes and attribute values of the target tuple data. After the attribute supplement of all target tuple data in the data set is completed, an attribute-supplemented data set is obtained. The attribute-supplemented data set is used as a training set to train the entity recognition model to obtain a trained entity recognition model. The trained entity recognition model is evaluated using a validation set to obtain performance recognition results such as the F1 score and recall rate of the trained entity recognition model.
[0050] In step S205, the initial strategy function is optimized according to the performance recognition result to obtain a target strategy function, the feature path of the target node is supplemented using the target strategy function to obtain a final feature path, and a feature value corresponding to the final feature path is determined as an attribute supplement result of the target tuple data.
[0051] In the embodiment of the application, the target strategy function can refer to a strategy function after optimization of the initial strategy function, the final feature path can refer to a feature path after path supplement of the feature path of the target node using the target strategy function, and the attribute supplement result can refer to a feature and a feature value in the final feature path.
[0052] Specifically, the initial strategy function and the entity recognition model are jointly trained, the initial strategy function is used to construct the target feature path, the entity recognition model is used to train the target tuple data enriched in feature and feature value using the target feature path, the initial strategy function is optimized according to the performance recognition result of the trained entity recognition model until a termination condition of the joint training is reached to obtain the target strategy function, the feature path of the target node is supplemented using the target strategy function to obtain the final feature path, the feature and the feature value of the final feature path are determined as the attribute supplement result of the target tuple data, and the target tuple data is supplemented in attribute according to the attribute supplement result.
[0053] In the embodiment of the application, the strategy function and the entity recognition model are jointly trained, so that the strategy function and the entity recognition model interact and influence each other in the training process, the strategy function is optimized based on the performance recognition result of the entity recognition model, the strategy function can learn effective strategies more quickly, the convergence speed of the strategy function and the accuracy of attribute supplement are improved, the target tuple data supplemented in attribute based on the feature path constructed by the strategy function is used to train the entity recognition model, the accuracy of entity analysis of the entity recognition model is improved, and meanwhile, the robustness of the entity recognition model to data distribution changes is also improved in the joint training process.
[0054] Referring to FIG. 5, a flowchart of a data attribute supplement method provided in Embodiment Three of the application is shown. As shown in FIG. 5, the step S201 of determining the target node matched with the entity corresponding to the target tuple data from the graph data can include the following steps:
[0055] In step S501, the feature value of each node in the graph data is determined, and the attribute value of the target tuple data is determined.
[0056] Step S502, all attribute values in the target tuple data form an attribute value set, for any node in the graph data, determine the first subgraph data corresponding to the node, and all feature values of the nodes in the first subgraph data form a feature value set.
[0057] Step S503, calculate the intersection of the feature value set and the attribute value set, and calculate the union of the feature value set and the attribute value set, and the ratio of the intersection and the union as the first similarity value of the node and the target tuple data, and according to the first similarity value of all nodes in the graph data and the preset threshold, determine the candidate nodes matched with the target tuple data entity.
[0058] Step S504, according to the feature vector of the candidate node and the attribute vector of the target tuple data, the candidate node is screened to obtain the target node.
[0059] In the embodiment of the application, the attribute value set can refer to the set of attribute values of all attributes in the target tuple data, the first subgraph data can refer to the graph data of any node, including the node and all neighbors of the node, the feature value set can refer to the set of feature values of all nodes in the first subgraph data, the first similarity value can refer to a score value representing the syntactic similarity between the node in the graph data and the target tuple data, and the preset threshold can refer to a value that the first similarity value corresponding to the node needs to satisfy when the node is determined as a candidate node.
[0060] Specifically, the first similarity value of each node in the graph data and the target tuple data can be calculated according to the Jaccard similarity coefficient. First, determine the attribute values corresponding to all attributes in the target tuple data to form an attribute value set, denoted as Set(t), for any node in the graph data, determine the first subgraph data corresponding to the node, determine the feature values of all nodes in the first subgraph data, and form a feature value set, denoted as Set(v), the first similarity value is denoted as Jacc(t,v), then, according to the Jaccard similarity coefficient, the first similarity value of the node and the target tuple data can be calculated, which can be expressed as Finally, according to the preset threshold and the first similarity value, the first similarity value of all nodes in the graph data is screened, and the nodes with the first similarity value higher than the preset threshold are determined as candidate nodes, and the candidate nodes are screened according to the feature vector of the candidate node and the attribute vector of the target tuple data to obtain the target node.
[0061] The embodiment of the application calculates a first similarity value of an attribute value set corresponding to the target tuple data and a feature value set corresponding to any node in the graph data according to the Jaccard similarity coefficient, obtains a candidate node according to the first similarity value, filters the candidate node to obtain a candidate node with high graph data syntax similarity, and filters the candidate node to obtain the target node, thereby improving the accuracy of the target node obtained by filtering.
[0062] Referring to FIG. 6, a flowchart of a data attribute supplementing method provided by the fourth embodiment of the application is shown. As shown in FIG. 6, the step of filtering the candidate node to obtain the target node according to the feature vector of the candidate node and the attribute vector of the target tuple data in step S304 can include the following steps:
[0063] In step S601, all attribute values in the target tuple data are vectorized to obtain an attribute vector, and for any candidate node, second subgraph data corresponding to the candidate node is determined, and the feature values of all nodes in the second subgraph data are vectorized to obtain a feature vector.
[0064] In step S602, a second similarity value of the feature vector and the attribute vector is calculated, and the second similarity values of all candidate nodes are sorted to obtain the target node.
[0065] In the embodiment of the application, the attribute vector can be a vector form of all attribute values in the target tuple data, the second subgraph data can be graph data of any candidate node including the candidate node and all neighbors of the candidate node, the feature vector can be a vector form of feature values of all nodes in the second subgraph data, and the second similarity value can be a score value representing the semantic similarity between the candidate node in the graph data and the target tuple data.
[0066] Specifically, the second similarity value of any candidate node and the target tuple data can be calculated according to the cosine similarity. First, all attribute values corresponding to attributes in the target tuple data are vectorized to obtain an attribute vector, denoted as e t For any candidate node, second subgraph data corresponding to the candidate node is determined, and the feature values of all nodes in the second subgraph data are vectorized to obtain a feature vector, denoted as e w The second similarity value is denoted as sem(t, v), then the second similarity value of the feature vector and the attribute vector is calculated according to the cosine similarity, which can be represented as sem(t, v)=maxcos(e w ,e t Finally, the second similarity values of all candidate nodes are sorted, and the candidate node with the maximum second similarity value is determined as the target node.
[0067] The embodiment of the application improves the accuracy of the target node obtained by screening on the basis of the syntactic similarity, improves the speed and flexibility of the target node obtained by screening, and improves the accuracy of the target node obtained by screening on the basis of the syntactic similarity.
[0068] Referring to FIG. 7, it is a flowchart of a data attribute supplement method provided by the fifth embodiment of the application. As shown in FIG. 7, the step S202 of supplementing the feature path of the target node in the graph data using the initial policy function to obtain the target feature path can include the following steps:
[0069] In step S701, the attribute and the attribute value of the target tuple data are determined, and the initial feature path starting from the target node is determined according to the attribute and the attribute value.
[0070] In step S702, the initial feature path is input into the initial policy function to obtain the action probability distribution in the state of the initial feature path.
[0071] In step S703, the feature path of the target node in the graph data is supplemented according to the action probability distribution to obtain an updated feature path.
[0072] In step S704, the updated feature path is used as the initial feature path, and the step of inputting the initial feature path into the initial policy function is returned until the number of feature values corresponding to the updated feature path meets the preset first value, and the target feature path is obtained.
[0073] In the embodiment of the application, the initial feature path can be a path determined in the graph data and starting from the target node, which is composed of the attribute and the attribute value of the target tuple data. The action probability distribution can be a probability distribution of taking each action output by the initial policy function in the current state of inputting the initial feature path, for example, the action probability distribution can include the probability of adding a new feature path, the probability of backtracking the feature path, and the probability of maintaining the current feature path. The updated feature path can be a feature path obtained by supplementing the feature path of the target node in the graph data according to the action probability distribution, and the preset first value can be a value that the number of feature values of the updated feature path should meet when the target feature path is determined.
[0074] Specifically, according to the attribute and attribute value of the target tuple data, an initial feature path starting from the target node is determined, the initial feature path is input into the initial strategy function, and the probability of adding a new feature path, the probability of backing up a feature path and the probability of keeping the current feature path in the current state of the initial feature path are output, the action with the maximum probability is determined, and the action corresponding to the maximum probability is executed to obtain an updated feature path. The initial feature path is updated to the updated feature path, and the step of inputting the initial feature path into the initial strategy function is returned until the number of feature values in the updated feature path meets the preset first value. Then, it is determined that the updated feature path meeting the first value is the target feature path.
[0075] For example, for the target tuple data shown in FIG. 4, if the target node corresponding to the target tuple data in FIG. 3 is v1, according to the attribute and attribute value of the target tuple data, there are four initial feature paths starting from the target node v1 in FIG. 2, which are ρ1=(v1, v6), ρ2=(v1, v4), ρ3=(v1, v7) and ρ4=(v1, v3). If the action probability distribution output by the initial strategy function is that the probability of adding a new feature path is 0.5, the probability of backing up a feature path is 0.3, and the probability of keeping the current feature path is 0.2, the action with the maximum probability is determined to be adding a new feature path, and the action of adding a new feature path is executed. In the initial feature path, the edge ρ5=(v1, v2) is randomly added, and the updated feature path is ρ1=(v1, v6), ρ2=(v1, v4), ρ3=(v1, v7), ρ4=(v1, v3) and ρ5=(v1, v2). The updated feature path includes five features of name, gender, age, occupation and spouse, and the corresponding five feature values are “A1, male, 38, writer, v2” in turn. If the preset first value is 5, it is determined that the number of feature values in the updated feature path meets the preset first value, and the updated feature path is determined to be the target feature path.
[0076] In the process of constructing the target feature path based on the corresponding target node and attribute value, the time complexity of the algorithm is only related to the complexity of the graph data and the number of attributes that need to be supplemented for the target tuple data. It is proved that the data attribute supplement problem is polynomial time solvable. On a data set including large-scale target tuple data, the algorithm can also complete the construction of the target feature path within a reasonable time, thereby improving the construction efficiency of the target feature path.
[0077] Referring to FIG. 8, a flowchart of a data attribute supplement method according to an embodiment of the present application is shown. As shown in FIG. 8, the step S801 of optimizing the initial strategy function according to the performance identification result to obtain an updated strategy function can include the following steps:
[0078] In step S801, the initial strategy function is optimized according to the performance identification result to obtain an updated strategy function.
[0079] In step S802, the updated strategy function is used as the initial strategy function, and the steps of using the initial strategy function are returned to be executed until the updated strategy function meets the preset termination condition to obtain a target strategy function.
[0080] In an embodiment of the present application, the preset termination condition can be a preset termination condition for joint training of the strategy function and the entity recognition model, for example, the performance indicators (such as accuracy, loss value, etc.) of the entity recognition model reaching the training target, reaching the maximum number of training times, and resource exhaustion, etc.
[0081] Specifically, the parameters of the initial strategy function are updated according to the performance identification result to obtain an updated strategy function. The updated strategy function is used as the initial strategy function, and the steps of joint training of the strategy function and the entity recognition model in steps S202 to S204 are returned to be executed until the joint training meets the preset termination condition, and the strategy function and the entity recognition model converge to an optimal state to obtain a target strategy function.
[0082] In an embodiment of the present application, the strategy function and the entity recognition model are jointly trained, so that the strategy function and the entity recognition model interact and influence each other during the training process. The strategy function is optimized based on the performance identification result of the entity recognition model, so that the strategy function can learn effective strategies more quickly, and the convergence speed of the strategy function and the accuracy of attribute supplement are improved. The target tuple data obtained by attribute supplement based on the feature path constructed by the strategy function is used to train the entity recognition model, which improves the accuracy of entity analysis of the entity recognition model. At the same time, the robustness of the entity recognition model to data distribution changes is also improved during the joint training.
[0083] Referring to FIG. 9, a flowchart of a data attribute supplement method according to an embodiment of the present application is shown. As shown in FIG. 9, the step S801 of optimizing the initial strategy function according to the performance identification result to obtain an updated strategy function can include the following steps:
[0084] In step S901, if the performance identification result is greater than a preset second value, a positive reward is given to the initial strategy function.
[0085] At step S902, the initial policy function is optimized according to the positive reward and the reinforcement learning algorithm to obtain an updated policy function.
[0086] In the embodiments of the present application, the positive reward can refer to positive feedback given to the initial policy function, the preset second value can refer to a value that the performance recognition result needs to satisfy when the positive reward is given in advance, and the reinforcement learning algorithm can refer to a Proximal Policy Optimization (PPO) algorithm.
[0087] Specifically, after the attribute and attribute value of the target tuple data in the target feature path constructed according to the initial policy function are supplemented to obtain the attribute-supplemented data set, if the performance recognition result (such as F1 score, recall rate and accuracy, etc.) of the entity recognition model after the entity recognition model is trained with the attribute-supplemented data set as the training set is greater than the preset second value, it indicates that the data set supplemented by the initial policy function improves the recognition performance of the entity recognition model, then the initial policy function is given a positive reward through the reward function, and the initial policy function is optimized based on the feedback positive reward through the reinforcement learning algorithm to obtain an updated policy function.
[0088] Optionally, after the target feature path is constructed by the initial policy function, the diversity and integrity of the feature values in the target feature path are evaluated, and the diversity evaluation, integrity evaluation and model performance recognition result are comprehensively considered to determine whether to give the initial policy function a positive reward or a negative reward.
[0089] The diversity evaluation can refer to the difference evaluation of the feature values in the target feature path and the attribute values in the target tuple data, and the correlation between the feature values and the attribute values can be measured by a Mutual Information (MI) method to obtain a diversity evaluation result, and the feature values with low mutual information can be selected to supplement the attributes of the target tuple data.
[0090] The integrity evaluation can refer to the evaluation of how many effective feature values the target feature path can provide for the target tuple data, that is, the evaluation of reducing the number of null values, and the integrity of the target feature path can be evaluated by counting the proportion of non-null values that the target feature path can return in the graph data to obtain an integrity evaluation result, and the target feature path with a high non-null value return rate can be preferentially selected to supplement the attributes of the target tuple data.
[0091] In the embodiment of the present application, if the performance of the entity recognition model in the joint training process is greater than the preset second value, a positive reward is given to the initial strategy function, which explicitly tells the initial strategy function which behaviors are beneficial to achieving the goal, thereby guiding the initial strategy function to take more of these behaviors in the subsequent joint training process, so that the initial strategy function can learn an effective strategy more quickly, improving the convergence speed of the entire learning process. Through the reinforcement learning algorithm, the initial strategy function is updated based on the positive reward, and the variance of the strategy function update is reduced by clipping the reward, thereby improving the stability and efficiency of the training process.
[0092] Referring to FIG. 10, a flowchart of a data attribute supplementing method provided by an eighth embodiment of the present application is shown. As shown in FIG. 10, the step of optimizing the initial strategy function according to the performance recognition result in step S801 to obtain an updated strategy function can include the following steps:
[0093] In step S1001, if the performance recognition result is less than the preset second value, a negative reward is given to the initial strategy function.
[0094] In step S1002, the initial strategy function is optimized according to the negative reward and the reinforcement learning algorithm to obtain an updated strategy function.
[0095] In the embodiment of the present application, the negative reward can refer to negative feedback given to the initial function.
[0096] Specifically, after supplementing the attributes and attribute values of the target tuple data in the data set according to the target feature path constructed based on the initial strategy function, and obtaining the attribute-supplemented data set, if the performance recognition result (such as F1 score, recall rate, and accuracy) of the entity recognition model after training the entity recognition model with the attribute-supplemented data set as the training set is less than the preset second value, it indicates that the data set supplemented by the initial strategy function causes the recognition performance of the entity recognition model to decrease. Then, a negative reward is given to the initial strategy function through the reward function, and the initial strategy function is optimized based on the feedback negative reward through the reinforcement learning algorithm to obtain an updated strategy function.
[0097] Optionally, after the initial strategy function constructs the target feature path, the diversity and integrity of the feature values in the target feature path are evaluated, and the diversity evaluation, integrity evaluation, and model performance recognition result are considered comprehensively to determine whether to give the initial strategy function a positive reward or a negative reward. Specifically, reference can be made to the contents in steps S901 to S902.
[0098] In the embodiment of the present application, if the performance of the entity recognition model in the joint training process is less than the preset second value, a negative reward is given to the initial strategy function, which explicitly tells the initial strategy function which behaviors are not conducive to achieving the goal, thereby avoiding the initial strategy function from repeatedly taking these behaviors in the subsequent joint training process, prompting the initial strategy function to explore other possible action plans to find a better action strategy, so that the initial strategy function balances between exploring new strategies and utilizing known effective strategies, prevents the initial strategy function from falling into a local optimal solution, and updates the initial strategy function based on the negative reward through the reinforcement learning algorithm, reduces the variance of strategy function updates through reward clipping, thereby improving the stability and efficiency of the training process.
[0099] Corresponding to the data attribute supplement method of the above embodiment, Figure 11 shows the structure block diagram of the data attribute supplement device provided by the ninth embodiment of the present application. The above data attribute supplement device is applied to the server in Figure 1, and the server is connected with the client to obtain the graph data and the target tuple data sent by the client. For the sake of convenience, only the part related to the present application embodiment is shown.
[0100] Referring to Figure 11, the data attribute supplement device comprises:
[0101] The heterogeneous entity analysis module 1101 is configured to determine a target node matched with the entity corresponding to the target tuple data from the graph data.
[0102] The construction module 1102 is configured to use the initial strategy function to supplement the feature path of the target node in the graph data to obtain a target feature path.
[0103] The determination module 1103 is configured to determine the feature value corresponding to the target feature path from the graph data as the attribute supplement data of the target tuple data.
[0104] The evaluation module 1104 is configured to train the entity recognition model according to the attribute supplement data to obtain a trained entity recognition model, and obtain the performance recognition result of the trained entity recognition model.
[0105] The optimization module 1105 is configured to optimize the initial strategy function according to the performance recognition result to obtain a target strategy function, use the target strategy function to supplement the feature path of the target node to obtain a final feature path, and determine the feature value corresponding to the final feature path as the attribute supplement result of the target tuple data.
[0106] Optionally, the heterogeneous entity analysis module 1101 comprises:
[0107] The first determining unit is configured to determine eigenvalues of each node in the graph data, and determine attribute values of the target tuple data;
[0108] The first forming unit is configured to form attribute value sets by using all attribute values in the target tuple data, determine, for any node in the graph data, first sub-graph data corresponding to the node, form eigenvalue sets by using eigenvalues of all nodes in the first sub-graph data, and calculate an intersection of the eigenvalue sets and the attribute value sets and a union of the eigenvalue sets and the attribute value sets.
[0109] The first calculating unit is configured to calculate a ratio of the intersection to the union as a first similarity value between the node and the target tuple data, and determine candidate nodes matched with the target tuple data entity according to the first similarity values of all nodes in the graph data and a preset threshold.
[0110] The second determining unit is configured to filter the candidate nodes according to the eigen vectors of the candidate nodes and attribute vectors of the target tuple data, and obtain the target node.
[0111] Optionally, the second determining unit includes:
[0112] The vectorization sub-unit is configured to vectorize all attribute values in the target tuple data to obtain attribute vectors, determine, for any candidate node, second sub-graph data corresponding to the candidate node, and vectorize eigenvalues of all nodes in the second sub-graph data to obtain eigen vectors.
[0113] The third determining sub-unit is configured to calculate a second similarity value between the eigen vectors and the attribute vectors, sort the second similarity values corresponding to all candidate nodes, and obtain the target node.
[0114] Optionally, the construction module 1102 includes:
[0115] The fourth determining unit is configured to determine attributes and attribute values of the target tuple data, and determine an initial feature path starting from the target node according to the attributes and the attribute values.
[0116] The probability output unit is configured to input the initial feature path into the initial policy function to obtain an action probability distribution in a state of the initial feature path.
[0117] The path supplement unit is configured to perform path supplement on a feature path of the target node in the graph data according to the action probability distribution, and obtain an updated feature path.
[0118] The first loop unit is configured to return to execute the step of inputting the initial feature path into the initial strategy function with the updated feature path as the initial feature path until a quantity of feature values corresponding to the updated feature path meets a preset first value, and obtain the target feature path.
[0119] Optionally, the optimization module 1105 comprises:
[0120] The first updating unit is configured to optimize the initial strategy function according to the performance identification result, and obtain an updated strategy function.
[0121] The second loop unit is configured to return to execute the step of using the initial strategy function with the updated strategy function as the initial strategy function until the updated strategy function meets a preset termination condition, and obtain the target strategy function.
[0122] Optionally, the first updating unit comprises:
[0123] The positive reward sub-unit is configured to give a positive reward to the initial strategy function if the performance identification result is greater than a preset second value.
[0124] The second updating sub-unit is configured to optimize the initial strategy function according to the positive reward and a reinforcement learning algorithm, and obtain the updated strategy function.
[0125] Optionally, the first updating unit comprises:
[0126] The negative reward sub-unit is configured to give a negative reward to the initial strategy function if the performance identification result is less than the preset second value.
[0127] The third updating sub-unit is configured to optimize the initial strategy function according to the negative reward and the reinforcement learning algorithm, and obtain the updated strategy function.
[0128] In an embodiment, a computer device can be provided, which can be a server. An internal structure diagram of the computer device can be as shown in FIG. 12. The computer device comprises a processor, a memory, a network interface and a database connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a readable storage medium and a database. The internal memory provides an environment for running the operating system and the readable storage medium in the non-volatile storage medium. The database of the computer device is configured to store user original data. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The readable storage medium is executed by the processor to implement a data attribute supplement method.
[0129] In an embodiment, a computer device is provided, comprising a memory, a processor, and a readable storage medium stored on the memory and executable on the processor, the processor implements the steps of the data attribute supplement method in the above-mentioned embodiments, such as steps S201-S205 shown in FIG. 2, or steps shown in FIGS. 5-10, which are not repeated here. Alternatively, the processor implements the functions of the modules / units in the embodiment of the user data processing apparatus, such as the functions of the heterogeneous entity analysis module 1101, the construction module 1102, the determination module 1103, the evaluation module 1104, and the optimization module 1105 shown in FIG. 11, which are not repeated here.
[0130] In an embodiment, one or more readable storage media having computer readable instructions stored thereon are provided, the computer readable instructions, when executed by one or more processors, cause the one or more processors to implement the steps of the data attribute supplement method in the above-mentioned embodiments, such as steps S201-S205 shown in FIG. 2, or steps shown in FIGS. 5-10, which are not repeated here. Alternatively, the processor implements the functions of the modules / units in the embodiment of the user data processing apparatus, such as the functions of the heterogeneous entity analysis module 1101, the construction module 1102, the determination module 1103, the evaluation module 1104, and the optimization module 1105 shown in FIG. 11, which are not repeated here. The readable storage medium in the embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
[0131] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing relevant hardware through a readable storage medium, and the readable storage medium can be stored in a non-volatile computer readable storage medium. When executed, the readable storage medium can include the processes of the above-mentioned embodiments of each method. Any reference to memory, storage, database or other medium used in each embodiment provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0132] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.
[0133] The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A data attribute supplementing method, wherein, The data attribute supplementing method comprises: determining a target node matched with an entity corresponding to target tuple data from graph data; using an initial strategy function, performing path supplement on a feature path of the target node in the graph data to obtain a target feature path; determining a feature value corresponding to the target feature path from the graph data as attribute supplement data of the target tuple data; training an entity recognition model according to the attribute supplement data to obtain a trained entity recognition model, and obtaining a performance recognition result of the trained entity recognition model; according to the performance recognition result, optimizing the initial strategy function to obtain a target strategy function, using the target strategy function to perform path supplement on the feature path of the target node to obtain a final feature path, and determining a feature value corresponding to the final feature path as attribute supplement result of the target tuple data.
2. The data attribute supplementation method of claim 1, wherein, The method comprises: determining a feature value of each node in the graph data, and determining an attribute value of the target tuple data; forming all attribute values in the target tuple data into an attribute value set, determining a first sub-graph data corresponding to any node in the graph data, and forming feature values of all nodes in the first sub-graph data into a feature value set; calculating an intersection of the feature value set and the attribute value set, and calculating a union set of the feature value set and the attribute value set, taking a ratio of the intersection set and the union set as a first similarity value of the node and the target tuple data, and determining a candidate node matched with the entity of the target tuple data according to the first similarity value of all nodes in the graph data and a preset threshold value; screening the candidate node according to a feature vector of the candidate node and an attribute vector of the target tuple data to obtain the target node.
3. The data attribute completion method of claim 2, wherein, The method comprises: vectorizing all attribute values in the target tuple data to obtain an attribute vector, determining a second sub-graph data corresponding to any candidate node, and vectorizing feature values of all nodes in the second sub-graph data to obtain a feature vector; calculating a second similarity value of the feature vector and the attribute vector, and sorting second similarity values of all candidate nodes to obtain the target node.
4. The data attribute completion method of claim 1, wherein, The method comprises: determining an attribute and an attribute value of the target tuple data, and determining an initial feature path starting from the target node according to the attribute and the attribute value; inputting the initial feature path into the initial strategy function to obtain an action probability distribution in a state of the initial feature path; performing path supplement on the feature path of the target node in the graph data according to the action probability distribution to obtain an updated feature path; Taking the updated feature path as the initial feature path, returning to execute the step of inputting the initial feature path into the initial strategy function until the number of feature values corresponding to the updated feature path meets a preset first value, and obtaining the target feature path.
5. The data attribute supplementation method of claim 1, wherein, The optimization of the initial strategy function according to the performance identification result comprises: optimizing the initial strategy function according to the performance identification result to obtain an updated strategy function; taking the updated strategy function as the initial strategy function, returning to execute the step of using the initial strategy function until the updated strategy function meets a preset termination condition, and obtaining the target strategy function.
6. The data attribute supplementation method of claim 5, wherein, The optimization of the initial strategy function according to the performance identification result comprises: if the performance identification result is greater than a preset second value, giving a positive reward to the initial strategy function; optimizing the initial strategy function according to the positive reward and a reinforcement learning algorithm to obtain the updated strategy function.
7. The data attribute completion method of claim 5, wherein, The optimization of the initial strategy function according to the performance identification result comprises: if the performance identification result is less than a preset second value, giving a negative reward to the initial strategy function; optimizing the initial strategy function according to the negative reward and a reinforcement learning algorithm to obtain the updated strategy function.
8. A data attribute supplementing apparatus, wherein, The data attribute supplementing device comprises: a heterogeneous entity analysis module configured to determine a target node matched with an entity corresponding to target tuple data from graph data; a construction module configured to supplement a feature path of the target node in the graph data using an initial strategy function to obtain a target feature path; a determination module configured to determine feature values corresponding to the target feature path as attribute supplement data of the target tuple data from the graph data; an evaluation module configured to train an entity recognition model according to the attribute supplement data to obtain a trained entity recognition model and acquire a performance identification result of the trained entity recognition model; an optimization module configured to optimize the initial strategy function according to the performance identification result to obtain a target strategy function, supplement a feature path of the target node using the target strategy function to obtain a final feature path, and determine feature values corresponding to the final feature path as attribute supplement results of the target tuple data.
9. A computer device comprising a memory, a processor, and a readable storage medium stored in the memory and executable on the processor, wherein, The processor implements the following steps when executing the readable storage medium: determining a target node matched with an entity corresponding to target tuple data from graph data; supplementing a feature path of the target node in the graph data using an initial strategy function to obtain a target feature path; determining feature values corresponding to the target feature path as attribute supplement data of the target tuple data from the graph data; training an entity recognition model according to the attribute supplement data to obtain a trained entity recognition model and acquiring a performance identification result of the trained entity recognition model; optimizing the initial strategy function according to the performance identification result to obtain an updated strategy function; According to the performance identification result, the initial strategy function is optimized to obtain a target strategy function, the feature path of the target node in the graph data is supplemented using the target strategy function, and a final feature path is obtained, and a feature value corresponding to the final feature path is determined as an attribute supplement result of the target tuple data.
10. The computer device of claim 9, wherein, The target node matched with the target tuple data corresponding entity is determined from the graph data, including: Determine the feature value of each node in the graph data, and determine the attribute value of the target tuple data; All attribute values in the target tuple data are formed into an attribute value set, and for any node in the graph data, a first sub-graph data corresponding to the node is determined, and the feature values of all nodes in the first sub-graph data are formed into a feature value set; The intersection of the feature value set and the attribute value set is calculated, and the union of the feature value set and the attribute value set is calculated, and the ratio of the intersection to the union is taken as the first similarity value of the node and the target tuple data; According to the first similarity value of all nodes in the graph data and the preset threshold, a candidate node matched with the target tuple data entity is determined; According to the feature vector of the candidate node and the attribute vector of the target tuple data, the candidate node is screened to obtain the target node.
11. The computer device of claim 10, wherein, The feature vector of the candidate node and the attribute vector of the target tuple data are used to screen the candidate node to obtain the target node, including: All attribute values in the target tuple data are vectorized to obtain an attribute vector, and for any candidate node, a second sub-graph data corresponding to the candidate node is determined, and the feature values of all nodes in the second sub-graph data are vectorized to obtain a feature vector; The second similarity value of the feature vector and the attribute vector is calculated, and the second similarity values of all candidate nodes are sorted to obtain the target node.
12. The computer device of claim 9, wherein, The initial strategy function is used to supplement the feature path of the target node in the graph data to obtain a target feature path, including: Determine the attribute and attribute value of the target tuple data, and determine an initial feature path starting from the target node according to the attribute and the attribute value; The initial feature path is input into the initial strategy function to obtain an action probability distribution in the initial feature path state; According to the action probability distribution, the feature path of the target node in the graph data is supplemented to obtain an updated feature path; The updated feature path is taken as the initial feature path, and the step of inputting the initial feature path into the initial strategy function is returned to be executed until the number of feature values corresponding to the updated feature path satisfies a preset first value, and the target feature path is obtained.
13. The computer device of claim 9, wherein, According to the performance identification result, the initial strategy function is optimized to obtain a target strategy function, including: According to the performance identification result, the initial strategy function is optimized to obtain an updated strategy function; Taking the updated strategy function as the initial strategy function, returning to execute the step of using the initial strategy function until the updated strategy function meets a preset termination condition, and obtaining the target strategy function.
14. The computer device of claim 13, wherein, The optimizing the initial strategy function according to the performance identification result to obtain an updated strategy function comprises: If the performance identification result is greater than a preset second value, a positive reward is given to the initial strategy function; According to the positive reward and a reinforcement learning algorithm, the initial strategy function is optimized to obtain the updated strategy function.
15. The computer device of claim 13, wherein, The optimizing the initial strategy function according to the performance identification result to obtain an updated strategy function comprises: If the performance identification result is less than a preset second value, a negative reward is given to the initial strategy function; According to the negative reward and a reinforcement learning algorithm, the initial strategy function is optimized to obtain the updated strategy function.
16. One or more readable storage media having stored thereon computer- readable instructions, the computer-readable storage media having stored thereon computer- readable instructions, wherein, The computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the following steps: Determine a target node matched with an entity corresponding to target tuple data from graph data; Using an initial strategy function, supplement a feature path of the target node in the graph data to obtain a target feature path; Determine a feature value corresponding to the target feature path from the graph data as attribute supplement data of the target tuple data; According to the attribute supplement data, train an entity recognition model to obtain a trained entity recognition model, and obtain a performance identification result of the trained entity recognition model; According to the performance identification result, optimize the initial strategy function to obtain a target strategy function, use the target strategy function to supplement the feature path of the target node to obtain a final feature path, and determine a feature value corresponding to the final feature path as an attribute supplement result of the target tuple data.
17. The readable storage medium of claim 16, wherein, The determining a target node matched with an entity corresponding to target tuple data from graph data comprises: Determine a feature value of each node in the graph data, and determine an attribute value of the target tuple data; Form an attribute value set by all attribute values in the target tuple data, determine a first sub-graph data corresponding to any node in the graph data, form a feature value set by all feature values in the first sub-graph data, calculate an intersection of the feature value set and the attribute value set, and calculate a union set of the feature value set and the attribute value set, take a ratio of the intersection set and the union set as a first similarity value of the node and the target tuple data, and determine a candidate node matched with the entity of the target tuple data according to the first similarity value of all nodes in the graph data and a preset threshold value; According to the feature vector of the candidate node and the attribute vector of the target tuple data, the candidate node is screened to obtain the target node. The screening the candidate node according to the feature vector of the candidate node and the attribute vector of the target tuple data to obtain the target node comprises:
18. The readable storage medium of claim 17, wherein, Vectorize all attribute values in the target tuple data to obtain an attribute vector, determine, for any candidate node, second subgraph data corresponding to the candidate node, vectorize feature values of all nodes in the second subgraph data to obtain a feature vector, and calculate a second similarity value between the feature vector and the attribute vector. Sort second similarity values corresponding to all candidate nodes to obtain the target node.
19. The readable storage medium of claim 16, wherein, The step of supplementing a feature path of the target node in the graph data using an initial policy function includes: Determine attributes and attribute values of the target tuple data, and determine an initial feature path starting from the target node according to the attributes and the attribute values. Input the initial feature path into the initial policy function to obtain an action probability distribution in a state of the initial feature path. Supplement the feature path of the target node in the graph data according to the action probability distribution to obtain an updated feature path. Take the updated feature path as the initial feature path, and return to the step of inputting the initial feature path into the initial policy function until a number of feature values corresponding to the updated feature path meets a preset first value, and obtain the target feature path.
20. The readable storage medium of claim 16, wherein, The step of optimizing the initial policy function according to the performance identification result to obtain a target policy function includes: Optimize the initial policy function according to the performance identification result to obtain an updated policy function. Take the updated policy function as the initial policy function, and return to the step of using the initial policy function until the updated policy function meets a preset termination condition, and obtain the target policy function.
Citation Information
Patent Citations
Character relationship recognition model training method and device, equipment and medium
CN110674637A
Knowledge graph reasoning method and device and storage medium
CN112084344A
Knowledge graph reasoning completion method and system based on reinforcement learning
CN112434171A
Method and system for entity extraction and disambiguation
US20170098013A1